Project

General

Profile

Bug #203

GMX_THREADS never defined when --enable-threads set

Added by Steffen Möller over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Hello,

although --endable-threads was set at configure time, and GMX_THREAD_PTHREADS is define, GMX_THREADS is never defined, though. Consequently, mdrun immediatly bails out when started with -nt, claiming that Gromacs is not prepared for threading. Is this possibly unintentionally a consequence of some irritation cause by the vars GMX_THREAD, GMX_THREADS and GMX_THREAD_PTHREAD all being used in parallel? The OS this was observed for is Solaris 9.

Kind regards

Steffen

bash-2.05$ grep -r GMX_THREAD . | grep -v altivec
./src/kernel/mdrun.c:#ifndef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_sse2/nb_kernel_ia32_sse2.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_sse2/nb_kernel_ia32_sse2.c:nb_kernel_ia32_sse2_test_mutex = GMX_THREAD_MUTEX_INITIALIZER;
./src/gmxlib/nonbonded/nb_kernel_ia32_sse2/nb_kernel_ia32_sse2.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_sse2/nb_kernel_ia32_sse2.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse/nb_kernel_x86_64_sse.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse/nb_kernel_x86_64_sse.c:nb_kernel_x86_64_sse_test_mutex = GMX_THREAD_MUTEX_INITIALIZER;
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse/nb_kernel_x86_64_sse.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse/nb_kernel_x86_64_sse.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nonbonded.c:#if GMX_THREADS
./src/gmxlib/nonbonded/nonbonded.c:#if GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_sse/nb_kernel_ia32_sse.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_sse/nb_kernel_ia32_sse.c:nb_kernel_ia32_sse_test_mutex = GMX_THREAD_MUTEX_INITIALIZER;
./src/gmxlib/nonbonded/nb_kernel_ia32_sse/nb_kernel_ia32_sse.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_sse/nb_kernel_ia32_sse.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel/Makefile.in:GMX_THREAD_TRUE@THREADFLAG = -threads
./src/gmxlib/nonbonded/nb_kernel/Makefile.am:if GMX_THREAD
./src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel_ia32_3dnow.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel_ia32_3dnow.c:nb_kernel_ia32_3dnow_test_mutex = GMX_THREAD_MUTEX_INITIALIZER;
./src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel_ia32_3dnow.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_ia32_3dnow/nb_kernel_ia32_3dnow.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel_x86_64_sse2.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel_x86_64_sse2.c:nb_kernel_x86_64_sse2_test_mutex = GMX_THREAD_MUTEX_INITIALIZER;
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel_x86_64_sse2.c:#ifdef GMX_THREADS
./src/gmxlib/nonbonded/nb_kernel_x86_64_sse2/nb_kernel_x86_64_sse2.c:#ifdef GMX_THREADS
./src/gmxlib/smalloc.c:#ifdef GMX_THREAD_PTHREAD
./src/gmxlib/smalloc.c:#ifdef GMX_THREAD_PTHREAD
./src/contrib/pmetest.c:#ifndef GMX_THREADS
./src/mdlib/ns.c:#ifdef GMX_THREADS
./src/mdlib/ns.c:#ifdef GMX_THREADS
./src/config.h.in:#undef GMX_THREAD_PTHREAD
./src/config.h:#define GMX_THREAD_PTHREAD
./configure.ac:AM_CONDITIONAL([GMX_THREAD],[test "$enable_threads" = "yes"])
./configure.ac: AC_DEFINE([GMX_THREAD_PTHREAD],,[Use pthreads for Gromacs multithreading])
./configure:GMX_THREAD_TRUE
./configure:GMX_THREAD_FALSE
./configure: GMX_THREAD_TRUE=
./configure: GMX_THREAD_FALSE='#'
./configure: GMX_THREAD_TRUE='#'
./configure: GMX_THREAD_FALSE=
./configure:#define GMX_THREAD_PTHREAD
./configure:if test -z "${GMX_THREAD_TRUE}" && test -z "${GMX_THREAD_FALSE}"; then
./configure: { { echo "$as_me:$LINENO: error: conditional \"GMX_THREAD\" was never defined.
./configure:echo "$as_me: error: conditional \"GMX_THREAD\" was never defined.
./configure:GMX_THREAD_TRUE!$GMX_THREAD_TRUE$ac_delim
./configure:GMX_THREAD_FALSE!$GMX_THREAD_FALSE$ac_delim
./include/gmx_thread.h:#ifndef _GMX_THREAD_H_
./include/gmx_thread.h:#define _GMX_THREAD_H_
./include/gmx_thread.h: * GMX_THREAD_ONCE_INITIALIZER.
./include/gmx_thread.h: * of the gmx_thread_once_t, and initialize it to GMX_THREAD_ONCE_INITIALIZER.
./include/gmx_thread.h:#define GMX_THREAD_ONCE_INITIALIZER { -1, 0 }
./include/gmx_thread.h: * but you can do it with the static initialzer GMX_THREAD_ONCE_INIT.
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:| #define GMX_THREAD_PTHREAD
./config.log:GMX_THREAD_FALSE='#'
./config.log:GMX_THREAD_TRUE=''
./config.log:#define GMX_THREAD_PTHREAD
./config.status:s,@GMX_THREAD_TRUE
,|#_!!_#|,g
./config.status:s,GMX_THREAD_FALSE,|#_!!_#|#,g
./config.status:s,^\([ #]*\)[^ ]*\([ ]*GMX_THREAD_PTHREAD\)[ (].*,\1define\2 ,

$ head -7 config.log | tail -4
It was created by GROMACS configure 3.3.3, which was
generated by GNU Autoconf 2.61. Invocation command line was

$ ./configure --enable-threads

History

#1 Updated by Erik Lindahl over 11 years ago

Hi,

We don't use threads in Gromacs (yet), simply because the MPI parallelization is much faster. Technically it's supported in the nonbonded kernels, but for the above reason we haven't threaded the NS yet.

Thus, for now you should use MPI instead :-)

Cheers,

Erik

#2 Updated by Steffen Möller over 11 years ago

Many thanks for your kind and informative reply. It would be nice if you could add a respective statement in your sources or some googleable documentation since I would have then started a couple of hours earlier with compiling bits for MPI shared mem.

Cheers,

Steffen

Also available in: Atom PDF