#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
}