########################################################################
option(GMX_DOUBLE "Use double precision (much slower, use only if you really need it)" OFF)
option(GMX_MPI "Build a parallel (message-passing) version of GROMACS" OFF)
-option(GMX_THREADS "Build a parallel (thread-based) version of GROMACS (cannot be combined with MPI yet)" ON)
+option(GMX_THREAD_MPI "Build a thread-MPI-based multithreaded version of GROMACS (not compatible with MPI)" ON)
option(GMX_SOFTWARE_INVSQRT "Use GROMACS software 1/sqrt" ON)
mark_as_advanced(GMX_SOFTWARE_INVSQRT)
option(GMX_POWERPC_INVSQRT "Use PowerPC hardware 1/sqrt" OFF)
if(GMX_MPI)
message(FATAL_ERROR "The OpenMM build is not compatible with MPI!")
endif(GMX_MPI)
- if(GMX_THREADS)
- message(STATUS "Threads are not compatible with OpenMM build, disabled!")
- set(GMX_THREADS OFF CACHE BOOL
- "Threads are not compatible with OpenMM build, disabled!" FORCE)
- endif(GMX_THREADS)
+ if(GMX_THREAD_MPI)
+ message(STATUS "Thread-MPI not compatible with OpenMM, disabled!")
+ set(GMX_THREAD_MPI OFF CACHE BOOL
+ "Thread-MPI not compatible with OpenMM build, disabled!" FORCE)
+ endif(GMX_THREAD_MPI)
if(GMX_OPENMP)
- message(STATUS "OpenMP multithreading is not compatible with OpenMM, disabled")
+ message(STATUS "OpenMP multithreading not compatible with OpenMM, disabled")
set(GMX_OPENMP OFF CACHE BOOL
- "OpenMP multithreading is not compatible with OpenMM, disabled!" FORCE)
+ "OpenMP multithreading not compatible with OpenMM, disabled!" FORCE)
endif()
if(GMX_SOFTWARE_INVSQRT)
set(GMX_SOFTWARE_INVSQRT OFF CACHE STRING
endif()
# mark as advanced the unused variables
mark_as_advanced(FORCE GMX_ACCELERATION GMX_MPI GMX_FFT_LIBRARY
- GMX_QMMM_PROGRAM GMX_THREADS GMX_DOUBLE)
+ GMX_QMMM_PROGRAM GMX_THREAD_MPI GMX_DOUBLE)
else(GMX_OPENMM)
mark_as_advanced(CLEAR GMX_ACCELERATION GMX_MPI GMX_FFT_LIBRARY
- GMX_QMMM_PROGRAM GMX_THREADS GMX_DOUBLE)
+ GMX_QMMM_PROGRAM GMX_THREAD_MPI GMX_DOUBLE)
endif(GMX_OPENMM)
endif(X11_FOUND)
endif(GMX_X11)
-if(GMX_THREADS)
- set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_THREADS")
+if(GMX_THREAD_MPI)
+ set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_THREAD_MPI")
include(ThreadMPI)
set(THREAD_MPI_LIB thread_mpi)
set(GMX_MPI 1)
string(TOUPPER ${GMX_FFT_LIBRARY} ${GMX_FFT_LIBRARY})
if(${GMX_FFT_LIBRARY} STREQUAL "FFTW2")
- message(FATAL_ERROR "FFTW2 can't be used with threads. Try fftw3 or mkl.")
+ message(FATAL_ERROR "FFTW2 can't be used with thread-MPI. Try fftw3 or mkl.")
endif()
-endif(GMX_THREADS)
+endif(GMX_THREAD_MPI)
if(GMX_OPENMM)
set(CUDA_BUILD_EMULATION OFF)
set(GMX_SOFTWARE_INVSQRT OFF CACHE BOOL "Do not use software reciprocal square root on BlueGene" FORCE)
set(GMX_POWERPC_INVSQRT ON CACHE BOOL "Use hardware reciprocal square root on BlueGene" FORCE)
set(GMX_X11 OFF CACHE BOOL "X11 not compatible with BlueGene, disabled!" FORCE)
- set(GMX_THREADS OFF CACHE BOOL "Threads not compatible with BlueGene, disabled!" FORCE)
+ set(GMX_THREAD_MPI OFF CACHE BOOL "Thread-MPI not compatible with BlueGene, disabled!" FORCE)
set(GMX_MPI ON CACHE BOOL "Use MPI on BlueGene" FORCE)
elseif(${GMX_ACCELERATION} STREQUAL "POWER6")
set(GMX_POWER6 1)
endif(${GMX_ACCELERATION} STREQUAL "NONE")
if(GMX_FORTRAN OR GMX_POWER6)
- if (GMX_THREADS)
- message(FATAL_ERROR "FORTRAN/POWER6 is incompatible with threads and only provides a speed-up on certain IBM compilers. Disable FORTRAN (or threads if you really want to use FORTRAN kernels).")
- endif(GMX_THREADS)
+ if (GMX_THREAD_MPI)
+ message(FATAL_ERROR "FORTRAN/POWER6 is incompatible with thread-MPI and only provides a speed-up on certain IBM compilers. Disable FORTRAN (or threads if you really want to use FORTRAN kernels).")
+ endif(GMX_THREAD_MPI)
enable_language(Fortran)
include(FortranCInterface)
discover_fortran_mangling(prefix isupper suffix extra_under_score found)
# Manage the MPI setup, assuming that CMAKE_C_COMPILER is an MPI
# (wrapper) compiler.
if(GMX_MPI)
- if(GMX_THREADS)
- set(GMX_THREADS OFF CACHE BOOL
- "Thread-based parallelization conflicts with MPI." FORCE)
- endif(GMX_THREADS)
+ if(GMX_THREAD_MPI)
+ message(STATUS "MPI is not compatible with thread-MPI. Disabling thread-MPI.")
+ set(GMX_THREAD_MPI OFF CACHE BOOL
+ "Build a thread-MPI-based multithreaded version of GROMACS (not compatible with MPI)" FORCE)
+ endif(GMX_THREAD_MPI)
# Test the CMAKE_C_COMPILER for being an MPI (wrapper) compiler
TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR}
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
int (*compar)(const void *, const void *));
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* Some implementations of qsort are not threadsafe.
* For instance qsort in glibc contains a bug which makes it non-threadsafe:
* http://sources.redhat.com/bugzilla/show_bug.cgi?id=11655
*/
extern gmx_large_int_t deform_init_init_step_tpx;
extern matrix deform_init_box_tpx;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
extern tMPI_Thread_mutex_t deform_init_box_mutex;
/* The minimum number of atoms per thread. With fewer atoms than this,
#ifdef GMX_LIB_MPI
#include <mpi.h>
#else
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "../tmpi.h"
#else
typedef void* MPI_Comm;
#cmakedefine GMX_MPI
/* Use threads for parallelization */
-#cmakedefine GMX_THREADS
+#cmakedefine GMX_THREAD_MPI
/* Use old threading (domain decomp force calc) code */
#cmakedefine GMX_THREAD_SHM_FDECOMP
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
# This would be the standard way to include thread_mpi, but we want libgmx
# to link the functions directly
-#if(GMX_THREADS)
+#if(GMX_THREAD_MPI)
# add_subdirectory(thread_mpi)
-#endif(GMX_THREADS)
+#endif(GMX_THREAD_MPI)
#target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_MPI_LIB})
# Files called xxx_test.c are test drivers with a main() function for module xxx.c,
#include <config.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include <thread_mpi.h>
#endif
fprintf(fp, "Precision: single\n");
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
fprintf(fp, "Parallellization: thread_mpi\n");
#elif defined(GMX_MPI)
fprintf(fp, "Parallellization: MPI\n");
#include "xdrf.h"
#include "macros.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
static char *default_file_name = NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
static tMPI_Thread_mutex_t filenm_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#endif
void set_default_file_name(const char *name)
{
int i;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&filenm_mutex);
#endif
default_file_name = strdup(name);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&filenm_mutex);
#endif
{
const char *buf = NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&filenm_mutex);
#endif
buf = deffile[ftp].defnm;
}
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&filenm_mutex);
#endif
#include "statutil.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
static t_pstack *pstack=NULL;
static gmx_bool bUnbuffered=FALSE;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* this linked list is an intrinsically globally shared object, so we have
to protect it with mutexes */
static tMPI_Thread_mutex_t pstack_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
{
t_pstack *ps;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
ps->fp = fp;
ps->prev = pstack;
pstack = ps;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&pstack_mutex);
#endif
}
#else
t_pstack *ps,*tmp;
int ret=0;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
ret = fclose(fp);
}
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&pstack_mutex);
#endif
return ret;
void frewind(FILE *fp)
{
t_pstack *ps;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
while (ps != NULL) {
if (ps->fp == fp) {
fprintf(stderr,"Cannot rewind compressed file!\n");
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&pstack_mutex);
#endif
return;
ps=ps->prev;
}
rewind(fp);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&pstack_mutex);
#endif
}
gmx_bool is_pipe(FILE *fp)
{
t_pstack *ps;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&pstack_mutex);
#endif
ps=pstack;
while (ps != NULL) {
if (ps->fp == fp) {
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&pstack_mutex);
#endif
return TRUE;
}
ps=ps->prev;
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&pstack_mutex);
#endif
return FALSE;
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
static char *fatal_tmp_file = NULL;
static FILE *log_file = NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
static tMPI_Thread_mutex_t debug_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
static tMPI_Thread_mutex_t where_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
static tMPI_Thread_mutex_t fatal_tmp_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
gmx_bool bDebugMode(void)
{
gmx_bool ret;
-/*#ifdef GMX_THREADS*/
+/*#ifdef GMX_THREAD_MPI*/
#if 0
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
ret=bDebug;
-/*#ifdef GMX_THREADS*/
+/*#ifdef GMX_THREAD_MPI*/
#if 0
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
char *temp;
if ( bFirst ) {
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&where_mutex);
if (bFirst) /* we repeat the check in the locked section because things
might have changed */
if ((temp=getenv("WHERE")) != NULL)
nskip = strtol(temp, NULL, 10);
bFirst = FALSE;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
}
tMPI_Thread_mutex_unlock(&where_mutex);
#endif
static void quit_gmx(const char *msg)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
if (fatal_errno == 0)
perror(msg);
}
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
if (gmx_parallel_env_initialized())
{
int nnodes;
}
exit(fatal_errno);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
}
*/
static void quit_gmx_noquit(const char *msg)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
if (!fatal_errno)
}
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
}
void _set_fatal_tmp_file(const char *fn, const char *file, int line)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&fatal_tmp_mutex);
#endif
if (fatal_tmp_file == NULL)
else
fprintf(stderr,"BUGWARNING: fatal_tmp_file already set at %s:%d",
file,line);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&fatal_tmp_mutex);
#endif
}
void _unset_fatal_tmp_file(const char *fn, const char *file, int line)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&fatal_tmp_mutex);
#endif
if (strcmp(fn,fatal_tmp_file) == 0) {
} else
fprintf(stderr,"BUGWARNING: file %s not set as fatal_tmp_file at %s:%d",
fn,file,line);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&fatal_tmp_mutex);
#endif
}
static void clean_fatal_tmp_file()
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&fatal_tmp_mutex);
#endif
if (fatal_tmp_file) {
sfree(fatal_tmp_file);
fatal_tmp_file = NULL;
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&fatal_tmp_mutex);
#endif
}
va_end(ap);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
fatal_errno = f_errno;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
va_end(ap);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
fatal_errno = f_errno;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
void init_debug (const int dbglevel,const char *dbgfile)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
if (!bDebug) /* another thread hasn't already run this*/
if (dbglevel >= 2)
gmx_debug_at = TRUE;
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
}
int onoff,en_mask,abort_action,i;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
onoff = _DEBUG;
for(i=0; (i<asize(hs)); i++)
signal(hs[i],handle_signals);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
}
void set_gmx_error_handler(void (*func)(const char *msg))
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&debug_mutex);
#endif
gmx_error_handler = func;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&debug_mutex);
#endif
}
#include "gmxfio.h"
#include "md5.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
static t_fileio *open_files = NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* this mutex locks the open_files structure so that no two threads can
modify it.
type of access to the fio's elements. */
void gmx_fio_lock(t_fileio *fio)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Lock_lock(&(fio->mtx));
#endif
}
/* unlock the mutex associated with this fio. */
void gmx_fio_unlock(t_fileio *fio)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Lock_unlock(&(fio->mtx));
#endif
}
open_files->fn=NULL;
open_files->next=open_files;
open_files->prev=open_files;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Lock_init(&(open_files->mtx));
#endif
}
static void gmx_fio_insert(t_fileio *fio)
{
t_fileio *prev;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* first lock the big open_files mutex. */
tMPI_Thread_mutex_lock(&open_file_mutex);
#endif
gmx_fio_unlock(open_files);
gmx_fio_unlock(fio);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* now unlock the big open_files mutex. */
tMPI_Thread_mutex_unlock(&open_file_mutex);
#endif
t_fileio *ret;
/* first lock the big open_files mutex and the dummy's mutex */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* first lock the big open_files mutex. */
tMPI_Thread_mutex_lock(&open_file_mutex);
#endif
if (fio->next==open_files)
{
ret=NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&open_file_mutex);
#endif
}
static void gmx_fio_stop_getting_next(t_fileio *fio)
{
gmx_fio_unlock(fio);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&open_file_mutex);
#endif
}
}
snew(fio, 1);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Lock_init(&(fio->mtx));
#endif
bRead = (newmode[0]=='r' && newmode[1]!='+');
{
int rc = 0;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* first lock the big open_files mutex. */
/* We don't want two processes operating on the list at the same time */
tMPI_Thread_mutex_lock(&open_file_mutex);
sfree(fio);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&open_file_mutex);
#endif
#include "gmxfio.h"
#include "md5.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
#include "gmxfio.h"
#include "md5.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
t_fileio *next, *prev; /* next and previous file pointers in the
linked list */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Lock_t mtx; /* content locking mutex. This is a fast lock
for performance reasons: in some cases every
single byte that gets read/written requires
#include "gmxfio.h"
#include "md5.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
#include "gmxfio.h"
#include "md5.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
static XDR *xdridptr[MAXID];
static char xdrmodes[MAXID];
static unsigned int cnt;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* we need this because of the global variables above for FORTRAN binding.
The I/O operations are going to be slow. */
static tMPI_Thread_mutex_t xdr_fortran_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
static void xdr_fortran_lock(void)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&xdr_fortran_mutex);
#endif
}
static void xdr_fortran_unlock(void)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&xdr_fortran_mutex);
#endif
}
char newtype[5];
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
if (!tMPI_Thread_mutex_trylock( &xdr_fortran_mutex ))
{
tMPI_Thread_mutex_unlock( &xdr_fortran_mutex );
int xdrid;
int rc = 0;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
if (!tMPI_Thread_mutex_trylock( &xdr_fortran_mutex ))
{
tMPI_Thread_mutex_unlock( &xdr_fortran_mutex );
#include "gmxfio.h"
#include "string2.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
of the simulation, once by each thread with the same value. We assume
that writing to an int is atomic.*/
static gmx_bool parallel_env_val;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_t parallel_env_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#endif
gmx_bool gmx_parallel_env_initialized(void)
{
gmx_bool ret;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(¶llel_env_mutex);
#endif
ret=parallel_env_val;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(¶llel_env_mutex);
#endif
return ret;
static void set_parallel_env(gmx_bool val)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(¶llel_env_mutex);
#endif
if (!parallel_env_val)
/* we only allow it to be set, not unset */
parallel_env_val=val;
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(¶llel_env_mutex);
#endif
}
/* Communicate the filename for logfile */
if (cr->nnodes > 1 && !bMasterOnly
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* With thread MPI the non-master log files are opened later
* when the files names are already known on all nodes.
*/
MPI_Comm_create(MPI_COMM_WORLD,ms->mpi_group_masters,
&ms->mpi_comm_masters);
-#if !defined(GMX_THREADS) && !defined(MPI_IN_PLACE_EXISTS)
+#if !defined(GMX_THREAD_MPI) && !defined(MPI_IN_PLACE_EXISTS)
/* initialize the MPI_IN_PLACE replacement buffers */
snew(ms->mpb, 1);
ms->mpb->ibuf=NULL;
cr->duty = (DUTY_PP | DUTY_PME);
/* Communicate arguments if parallel */
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
if (PAR(cr))
comm_args(cr,argc,argv_ptr);
-#endif /* GMX_THREADS */
+#endif /* GMX_THREAD_MPI */
#ifdef GMX_MPI
-#if !defined(GMX_THREADS) && !defined(MPI_IN_PLACE_EXISTS)
+#if !defined(GMX_THREAD_MPI) && !defined(MPI_IN_PLACE_EXISTS)
/* initialize the MPI_IN_PLACE replacement buffers */
snew(cr->mpb, 1);
cr->mpb->ibuf=NULL;
t_commrec *init_par_threads(const t_commrec *cro)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
int initialized;
t_commrec *cr;
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
nc = &cr->nc;
nc->bUse = FALSE;
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
if (getenv("GMX_NO_NODECOMM") == NULL) {
#ifdef GMX_MPI
MPI_Comm_size(cr->mpi_comm_mygroup,&n);
#ifndef GMX_MPI
gmx_call("gmx_abort");
#else
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
fprintf(stderr,"Halting program %s\n",ShortProgram());
thanx(stderr);
exit(1);
#ifndef GMX_MPI
gmx_call("gmx_sumd");
#else
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
if (cr->nc.bUse) {
if (cr->nc.rank_intra == 0)
{
#ifndef GMX_MPI
gmx_call("gmx_sumf");
#else
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
if (cr->nc.bUse) {
/* Use two step summing. */
if (cr->nc.rank_intra == 0)
#ifndef GMX_MPI
gmx_call("gmx_sumi");
#else
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
if (cr->nc.bUse) {
/* Use two step summing */
if (cr->nc.rank_intra == 0)
#ifndef GMX_MPI
gmx_call("gmx_sumli");
#else
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
if (cr->nc.bUse) {
/* Use two step summing */
if (cr->nc.rank_intra == 0)
#ifdef GMX_MPI
void gmx_sumd_comm(int nr,double r[],MPI_Comm mpi_comm)
{
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
MPI_Allreduce(MPI_IN_PLACE,r,nr,MPI_DOUBLE,MPI_SUM,mpi_comm);
#else
/* this function is only used in code that is not performance critical,
#ifdef GMX_MPI
void gmx_sumf_comm(int nr,float r[],MPI_Comm mpi_comm)
{
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
MPI_Allreduce(MPI_IN_PLACE,r,nr,MPI_FLOAT,MPI_SUM,mpi_comm);
#else
/* this function is only used in code that is not performance critical,
#ifndef GMX_MPI
gmx_call("gmx_sumi_sim");
#else
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
MPI_Allreduce(MPI_IN_PLACE,r,nr,MPI_INT,MPI_SUM,ms->mpi_comm_masters);
#else
/* this is thread-unsafe, but it will do for now: */
#ifndef GMX_MPI
gmx_call("gmx_sumli_sim");
#else
-#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREADS)
+#if defined(MPI_IN_PLACE_EXISTS) || defined(GMX_THREAD_MPI)
MPI_Allreduce(MPI_IN_PLACE,r,nr,GMX_MPI_LARGE_INT,MPI_SUM,
ms->mpi_comm_masters);
#else
#include "gmxfio.h"
#include "oenv.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
#define p4(x) ((x)*(x)*(x)*(x))
static real A,A_3,B,B_4,C,c1,c2,c3,c4,c5,c6,One_4pi,FourPi_V,Vol,N0;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
static tMPI_Thread_mutex_t shift_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#endif
void set_shift_consts(FILE *log,real r1,real rc,rvec box,t_forcerec *fr)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* at the very least we shouldn't allow multiple threads to set these
simulataneously */
tMPI_Thread_mutex_lock(&shift_mutex);
}
One_4pi = 1.0/(4.0*M_PI);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&shift_mutex);
#endif
}
/* This file is completely threadsafe - keep it that way! */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi/threads.h"
#endif
if (!bMal)
bytes=-bytes;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&gmx_logfile_mtx);
#endif
what ? what : NN,bytes/1024.0,
file ? fname : NN,line,nelem,size);
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&gmx_logfile_mtx);
#endif
}
#include "mtop_util.h"
#include "gmxfio.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
static const char *program_name=NULL;
static char *cmd_line=NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* For now, some things here are simply not re-entrant, so
we have to actively lock them. */
static tMPI_Thread_mutex_t init_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
const char *ShortProgram(void)
{
const char *pr,*ret;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&init_mutex);
#endif
pr=ret=program_name;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&init_mutex);
#endif
if ((pr=strrchr(ret,DIR_SEPARATOR)) != NULL)
const char *Program(void)
{
const char *ret;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&init_mutex);
#endif
ret=program_name;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&init_mutex);
#endif
return ret;
const char *command_line(void)
{
const char *ret;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&init_mutex);
#endif
ret=cmd_line;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&init_mutex);
#endif
return ret;
void set_program_name(const char *argvzero)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&init_mutex);
#endif
/* When you run a dynamically linked program before installing
}
if (program_name == NULL)
program_name="GROMACS";
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&init_mutex);
#endif
}
int i;
size_t cmdlength;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&init_mutex);
#endif
if (cmd_line==NULL)
strcat(cmd_line," ");
}
}
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&init_mutex);
#endif
/* The some system, e.g. the catamount kernel on cray xt3 do not have nice(2). */
if (nicelevel != 0 && !bExit)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
static gmx_bool nice_set=FALSE; /* only set it once */
tMPI_Thread_mutex_lock(&init_mutex);
if (!nice_set)
{
#endif
i=nice(nicelevel); /* assign ret value to avoid warnings */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
nice_set=TRUE;
}
tMPI_Thread_mutex_unlock(&init_mutex);
#include "statutil.h"
#include "gmx_fatal.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
{ 0, FALSE }
};
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
static tMPI_Thread_mutex_t tc_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#endif
{
gmx_bool ret;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&tc_mutex);
#endif
range_check(tcontrol,0,TNR);
ret=timecontrol[tcontrol].bSet;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&tc_mutex);
#endif
{
real ret;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&tc_mutex);
#endif
range_check(tcontrol,0,TNR);
ret=timecontrol[tcontrol].t;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&tc_mutex);
#endif
return ret;
void setTimeValue(int tcontrol,real value)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&tc_mutex);
#endif
range_check(tcontrol,0,TNR);
timecontrol[tcontrol].t = value;
timecontrol[tcontrol].bSet = TRUE;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&tc_mutex);
#endif
}
#endif
/* This file is completely threadsafe - keep it that way! */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include <thread_mpi.h>
#endif
#endif
/* This file is completely threadsafe - please keep it that way! */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include <thread_mpi.h>
#endif
#include "pbc.h"
#include <string.h>
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
static gmx_bool bOverAllocDD=FALSE;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
static tMPI_Thread_mutex_t over_alloc_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#endif
void set_over_alloc_dd(gmx_bool set)
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&over_alloc_mutex);
/* we just make sure that we don't set this at the same time.
We don't worry too much about reading this rarely-set variable */
#endif
bOverAllocDD = set;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&over_alloc_mutex);
#endif
}
#include <unistd.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
if (DEFORM(*ir))
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&deform_init_box_mutex);
#endif
set_deform_reference_box(upd,
deform_init_init_step_tpx,
deform_init_box_tpx);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&deform_init_box_mutex);
#endif
}
/* Check whether everything is still allright */
if (((int)gmx_get_stop_condition() > handled_stop_condition)
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
&& MASTER(cr)
#endif
)
#include "string2.h"
#include "copyrite.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
/* Check whether everything is still allright */
if (((int)gmx_get_stop_condition() > handled_stop_condition)
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
&& MASTER(cr)
#endif
)
#include "mdrun.h"
#include "xmdrun.h"
#include "checkpoint.h"
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "thread_mpi.h"
#endif
"Use particle decompostion" },
{ "-dd", FALSE, etRVEC,{&realddxyz},
"Domain decomposition grid, 0 is optimize" },
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
{ "-nt", FALSE, etINT, {&nthreads},
"Number of threads to start (0 is guess)" },
#endif
dd_node_order = nenum(ddno_opt);
cr->npmenodes = npme;
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
nthreads=1;
#endif
gmx_fatal(FARGS,"Need at least two replicas for replica exchange (option -multi)");
if (nmultisim > 1) {
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
gmx_bool bParFn = (multidir == NULL);
init_multisystem(cr, nmultisim, multidir, NFILE, fnm, bParFn);
#else
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
gmx_large_int_t deform_init_init_step_tpx;
matrix deform_init_box_tpx;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_t deform_init_box_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
struct mdrunner_arglist
{
FILE *fplog;
read_tpx_state(ftp2fn(efTPX,nfile,fnm),inputrec,state,NULL,mtop);
/* NOW the threads will be started: */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
nthreads_mpi = get_nthreads_mpi(nthreads_requested, inputrec, mtop);
if (nthreads_mpi > 1)
#ifndef GMX_MPI
"but mdrun was compiled without threads or MPI enabled"
#else
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
"but the number of threads (option -nt) is 1"
#else
"but mdrun was not started through mpirun/mpiexec or only one process was requested through mpirun/mpiexec"
* This should be thread safe, since they are only written once
* and with identical values.
*/
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&deform_init_box_mutex);
#endif
deform_init_init_step_tpx = inputrec->init_step;
copy_mat(box,deform_init_box_tpx);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&deform_init_box_mutex);
#endif
}
}
if (((MASTER(cr) || (Flags & MD_SEPPOT)) && (Flags & MD_APPENDFILES))
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* With thread MPI only the master node/thread exists in mdrun.c,
* therefore non-master nodes need to open the "seppot" log file here.
*/
rc=(int)gmx_get_stop_condition();
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* we need to join all threads. The sub-threads join when they
exit this function, but the master thread needs to be told to
wait for that. */
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_FFT_FFTW3
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* none of the fftw3 calls, except execute(), are thread-safe, so
we need to serialize them with this mutex. */
static tMPI_Thread_mutex_t big_fftw_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
#define FFTW_LOCK tMPI_Thread_mutex_lock(&big_fftw_mutex)
#define FFTW_UNLOCK tMPI_Thread_mutex_unlock(&big_fftw_mutex)
-#else /* GMX_THREADS */
+#else /* GMX_THREAD_MPI */
#define FFTW_LOCK
#define FFTW_UNLOCK
-#endif /* GMX_THREADS */
+#endif /* GMX_THREAD_MPI */
#endif /* GMX_FFT_FFTW3 */
static double fft5d_fmax(double a, double b){
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* none of the fftw3 calls, except execute(), are thread-safe, so
we need to serialize them with this mutex. */
static tMPI_Thread_mutex_t big_fftw_mutex=TMPI_THREAD_MUTEX_INITIALIZER;
static gmx_bool gmx_fft_threads_initialized=FALSE;
#define FFTW_LOCK tMPI_Thread_mutex_lock(&big_fftw_mutex)
#define FFTW_UNLOCK tMPI_Thread_mutex_unlock(&big_fftw_mutex)
-#else /* GMX_THREADS */
+#else /* GMX_THREAD_MPI */
#define FFTW_LOCK
#define FFTW_UNLOCK
-#endif /* GMX_THREADS */
+#endif /* GMX_THREAD_MPI */
/* We assume here that aligned memory starts at multiple of 16 bytes and unaligned memory starts at multiple of 8 bytes. The later is guranteed for all malloc implementation.
Consequesences:
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
snew(wc->wcc,ewcNR);
if (getenv("GMX_CYCLE_ALL") != NULL)
{
-/*#ifndef GMX_THREADS*/
+/*#ifndef GMX_THREAD_MPI*/
if (fplog)
{
fprintf(fplog,"\nWill time all the code during the run\n\n");
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
double dt;
char buf[48];
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
if (!PAR(cr))
#endif
{
ir->delta_t/1000*24*60*60/runtime->time_per_step);
}
}
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
if (PAR(cr))
{
fprintf(out,"\n");
#ifdef GMX_LIB_MPI
#include <mpi.h>
#endif
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#include "tmpi.h"
#endif
/* if (DEFORM(*ir))
{
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_lock(&deform_init_box_mutex);
#endif
set_deform_reference_box(upd,
deform_init_init_step_tpx,
deform_init_box_tpx);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
tMPI_Thread_mutex_unlock(&deform_init_box_mutex);
#endif
}*/
/* Check whether everything is still allright */
if (((int)gmx_get_stop_condition() > handled_stop_condition)
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
&& MASTER(cr)
#endif
)
read_tpx_state(ftp2fn(efTPX,nfile,fnm),inputrec,state,NULL,mtop);
/* NOW the threads will be started: */
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
#endif
}
/* END OF CAUTION: cr is now reliable */
dd_node_order = nenum(ddno_opt);
cr->npmenodes = npme;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
/* now determine the number of threads automatically. The threads are
only started at mdrunner_threads, though. */
if (nthreads<1)
gmx_fatal(FARGS,"Need at least two replicas for replica exchange (option -multi)");
if (nmultisim > 1) {
-#ifndef GMX_THREADS
+#ifndef GMX_THREAD_MPI
gmx_bool bParFn = (multidir == NULL);
init_multisystem(cr,nmultisim,multidir,NFILE,fnm,TRUE);
#else