Adding fclose for printTopo
authorNikhil Jain <nikhil@illinois.edu>
Thu, 19 Apr 2012 22:26:04 +0000 (17:26 -0500)
committerNikhil Jain <nikhil@illinois.edu>
Thu, 19 Apr 2012 22:26:04 +0000 (17:26 -0500)
src/ck-core/init.C

index bf1bec47f75f743b82f731eb840f4e258a36ec5d..feaf730827f50d721466d2a198b46cdb8f76bf7b 100644 (file)
@@ -1257,8 +1257,12 @@ void _initCharm(int unused_argc, char **argv)
                TopoManager tmgr;
     FILE *fp;
     fp = fopen("topologyInfo.txt", "w");
-    if (fp == NULL) fp = stderr;
+    if (fp == NULL) {
+      CkPrintf("Error opening topology.Info.txt file, writing to stdout\n");
+      fp = stdout;
+    }
                tmgr.printAllocation(fp);
+    fclose(fp);
            }
        }