About the "-th" command

Hello everyone
I’m trying to use the multithreading provided by castor, I used the command “-th 4”, but the software says I need to run it with the CASTOR_OMP environment variable set to 1. I used the command “export CASTOR_OMP=1” to set the environment variable and “make” the castor again, but I still have the above reminder when running. How can I solve this problem? I would be grateful for any answer.

Greetings,

Is it possible that you forgot to re-generate the cmake files before launching make?

In short, use either ccmake or export+cmake to enable CASToR_OMP (see section 3.4 of the guide, if needed), generate the cmake files (“c” abd “g” with ccmake, no idea with cmake) and then run make.

Note: Sometime, cmake re-generate behave weirdly and it is better to restart fresh to create the cmake files.

Bests,
Maxime Toussaint

Hi,

Using the standard makefile for compilation, make sure you cleaned everything (make clean) after you changed this environment variable. The Makefile does not automatically check than an environment variable has been changed, so most probably you get this error because the code has not been recompiled with openMP.

tl;dr: try make clean before recompiling with make -j

Best,
Thibaut

I’m sorry I replied too late because I was sick. I used the standard “make” instead of “cmake”, but thanks for the reply anyway.

Hi,
I’m sorry I replied too late because I was sick. Thanks for your response, I will follow your advice.

Hi,

I made the change as you suggested and when I looked at the environment variables I found that the change did succeed, but when I ran I still had the previous problem and the software prompted me to still be single-threaded.

image

Hi,

It seems that you are using the DEBUG mode (CASTOR_DEBUG).

If you do not know why, then unset this variable and redo the compilation.

By the way, do not set the CASTOR_VERBOSE variable either.

These variables are used for debugging, and the DEBUG variable disable the multi-threading by default.

Best

Simon

Hi,

Thanks for your response, I will follow your advice.

Best

YuanHang

Hi Simon,

II tried setting the variables “DEBUG” and “VERBOSE” to “0” before compiling, and compiling them before setting them to “0,” but once they were set to “0,” they couldn’t compile. Do you know what the problem is?
image

Best

YuanHang

Hi,

Disable also the CASTOR_MPI variable.

In general, think about enabling something only if you need it.

Basically, in your case, only enable CASTOR_OMP and correctly set the variable CASTOR_CONFIG.

Best
Simon