shankar1729 / jdftx

JDFTx: software for joint density functional theory
http://jdftx.org
79 stars 49 forks source link

About the restrict of multhread running #307

Closed gvtheen closed 6 months ago

gvtheen commented 7 months ago

Hi, developer, I used the following setting to compile the Jdftx software.

export CC=mpicc CXX=mpicxx cmake -D EnableCUDA=no -D ForceFFTW=yes -D ThreadedBLAS=no -D EnableLibXC=yes -D EnableMKL=yes -D FFTW3_PATH=/public/software/apps/libs-depend/fftw-3.3.10-gnu-openmpi -D MKL_PATH=/public/software/compiler/intel-oneAPI/oneapi/mkl/2022.1.0 -D GSL_PATH=/public/software/apps/libs-depend/gsl-2.7.2-gnu-openmpi -D LIBXC_PATH=/public/software/apps/libs-depend/libxc/5.2.2-gnu-openmpi ../jdftx

I have setted the "ThreadedBLAS=no".

However, when I run the jdftx ( mpirun -np 40 jdftx -i inp -o out ) with the setting ( export OMP_NUM_THREADS=1 ),the running core are still more than 40 cores. How can I restrict the multhreadrunning.

shankar1729 commented 7 months ago

Add -c 1 to the jdftx command line to use one core per process. Without this variable, ajDFTx tries to use all available cores on the nodes it's running on. JDFTx uses pthreads rather than OpenMP, and hence the OMP variable does not affect it.

Best, Shankar

gvtheen commented 7 months ago

Add -c 1 to the jdftx command line to use one core per process. Without this variable, ajDFTx tries to use all available cores on the nodes it's running on. JDFTx uses pthreads rather than OpenMP, and hence the OMP variable does not affect it.

Best, Shankar

Many thanks,Prof. shankar!