renamed GMX_THREADS to GMX_THREAD_MPI
[alexxy/gromacs.git] / src / gmxlib / gmxfio.c
index d80d864d436b5892511e8a77ec3bade74fc53191..4fc20cc416f1c9b7e93cf1fceca45b6777e4507c 100644 (file)
@@ -53,7 +53,7 @@
 #include "gmxfio.h"
 #include "md5.h"
 
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
 #include "thread_mpi.h"
 #endif
 
@@ -68,7 +68,7 @@
 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.        
 
@@ -248,14 +248,14 @@ static void gmx_fio_set_iotype(t_fileio *fio)
    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
 }
@@ -270,7 +270,7 @@ static void gmx_fio_make_dummy(void)
         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
     }
@@ -293,7 +293,7 @@ static void gmx_fio_make_dummy(void)
 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
@@ -325,7 +325,7 @@ static void gmx_fio_insert(t_fileio *fio)
     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
@@ -362,7 +362,7 @@ static t_fileio *gmx_fio_get_first(void)
     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
@@ -399,7 +399,7 @@ static t_fileio *gmx_fio_get_next(t_fileio *fio)
     if (fio->next==open_files)
     {
         ret=NULL;
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
         tMPI_Thread_mutex_unlock(&open_file_mutex);
 #endif
     }
@@ -416,7 +416,7 @@ static t_fileio *gmx_fio_get_next(t_fileio *fio)
 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
 }
@@ -485,7 +485,7 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode)
     }
 
     snew(fio, 1);
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
     tMPI_Lock_init(&(fio->mtx));
 #endif
     bRead = (newmode[0]=='r' && newmode[1]!='+');
@@ -599,7 +599,7 @@ int gmx_fio_close(t_fileio *fio)
 {
     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);
@@ -613,7 +613,7 @@ int gmx_fio_close(t_fileio *fio)
 
     sfree(fio);
 
-#ifdef GMX_THREADS
+#ifdef GMX_THREAD_MPI
     tMPI_Thread_mutex_unlock(&open_file_mutex);
 #endif