Apparent installation problem

Hi everyone,

I’m attempting to build CADET v4.2.0 on a Linux machine (running Ubuntu 20.10). I installed CADET following the directions packaged with the source code (BUILD-LINUX.md), and I didn’t receive any errors (output is given in the attached file). However, when I run cadet-cli with a .h5 file that worked in the previous version of CADET (v4.1.0), I’m receiving ERROR: std::bad_alloc.

For reference, I have installed HDF5 and LAPACK from the Ubuntu repo. I’m using libmkl-dev for LAPACK and BLAS. I did not install SUNDIALS, SuperLU, or UMFPACK since they’re now optional. I have tried building both with and without the -DBLA_VENDOR=Intel10_64lp option.

I’m guessing I made a mistake during installation, but I don’t know how to troubleshoot this. My apologies if I’m missing something that should be obvious. For my future reference, what is the proper way to test if CADET installed correctly?

I sincerely appreciate your help with this!

Thank you,
Chase Herman

install_log.txt (35.8 KB)

Hi Chase,

it looks like CADET was compiled correctly. The log you’ve posted seems clean (just a side note: we recommend using MKL in serial mode, i.e., Intel10_64lp_seq).

In order to debug this problem, it would be great if you could provide the .h5 file that triggers this error.

Best,
Sam

Hi Sam,

Thank you for your help! Attached is the .h5 file, along with the notebook used to generate it.

Thank you,
Chase

test_case.h5 (34.5 KB)

test_case_no_imports.ipynb (13.8 KB)

can confirm the issue.

It seems to run on my Windows box (at least in a debug build). Will try it on my Unix box later.

Results from the Windows run:
test_case.h5 (96.9 KB)

For me, it also runs in DEBUG mode, but not in RELEASE.

OS: Ubuntu 20.04
cmake version: 3.16.3
gcc version: 9.3.0

This hints at a TBB problem: In debug mode, TBB is not used.

Thanks to @j.rao and @j.schmoelder, we figured out the following quick fix:
Set NTHREADS to 0 (or a positive number). Do not use a negative number.

Background: NTHREADS is read as int but converted to unsigned int at some point. Since NTHREADS was set to -1, the conversion wrapped around to a ridiculously high (unsigned) number. Apparently, TBB does not care and tries to allocate memory for its jobs based on the number of threads. This resulted in the observed std::bad_alloc.

There’s a fix underway but for now, please use 0 instead of -1.

1 Like

The fix is provided in commit Fix _nThreads lower bound to 0 (#83) · modsim/CADET@c832f68 · GitHub. Please get the most recent source (https://github.com/modsim/CADET/archive/refs/heads/master.zip) and compile again.

1 Like