at isomalloc_sync mode, try to test if there is shared file system (which the sync...
authorGengbin Zheng <gzheng@illinois.edu>
Tue, 3 Mar 2009 07:35:47 +0000 (07:35 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Tue, 3 Mar 2009 07:35:47 +0000 (07:35 +0000)
src/conv-core/isomalloc.c

index 130eb8bed523d8441b524b526bb1273384915299..ab6a2cb4d2ee84a5349a3ad69fa9665e3df85fad 100644 (file)
@@ -2005,14 +2005,22 @@ static void init_ranges(char **argv)
 
             for (i=0; i<CmiNumNodes(); i++) {
               CmiUInt8 ss, ee; 
+              int try_count;
               char fname[128];
               if (i==CmiMyNode()) continue;
               sprintf(fname,".isomalloc.%d", i);
-              while ((fd = open(fname, O_RDONLY)) == -1)
+              try_count = 0;
+              while ((fd = open(fname, O_RDONLY)) == -1 && try_count<10000)
+              {
+                try_count++;
 #ifndef __MINGW_H
-              CMK_CPV_IS_SMP
+                CMK_CPV_IS_SMP
 #endif
-              ;
+                ;
+              }
+              if (fd == -1) {
+                CmiAbort("isomalloc_sync failed, make sure you have a shared file system.");
+              }
               read(fd, &ss, sizeof(CmiUInt8));
               read(fd, &ee, sizeof(CmiUInt8));
               close(fd);