when thread migration is not supported, disable TCHARM_Migrate() call by giving a...
authorGengbin Zheng <gzheng@illinois.edu>
Thu, 22 Jan 2009 20:36:29 +0000 (20:36 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Thu, 22 Jan 2009 20:36:29 +0000 (20:36 +0000)
src/libs/ck-libs/tcharm/tcharm.C

index 2b66cbb114cf35191370b9e610326940252dabe9..074033dfd8854c40977b7d40c68bb69606f18e4d 100644 (file)
@@ -770,6 +770,10 @@ CDECL void *TCHARM_Get_global(int globalID)
 CDECL void TCHARM_Migrate(void)
 {
        TCHARMAPI("TCHARM_Migrate");
+       if (CthMigratable() == 0) {
+          CkPrintf("Charm++ warning: thread migration is not supported!\n");
+          return;
+        }
        TCharm::get()->migrate();
 }
 FORTRAN_AS_C(TCHARM_MIGRATE,TCHARM_Migrate,tcharm_migrate,(void),())
@@ -872,8 +876,8 @@ CDECL void TCHARM_Init(int *argc,char ***argv) {
 FDECL void FTN_NAME(TCHARM_INIT,tcharm_init)(void)
 {
        int argc=1;
-       char *argv_sto[2]={"foo",NULL};
-       char **argv=argv_sto;
+       const char *argv_sto[2]={"foo",NULL};
+       char **argv=(char **)argv_sto;
        TCHARM_Init(&argc,&argv);
 }