making +printTopo write to a file
[charm.git] / src / ck-core / init.C
index 41400042445ca91b29ed31f03e2e287cd35e10f3..bf1bec47f75f743b82f731eb840f4e258a36ec5d 100644 (file)
@@ -1255,7 +1255,10 @@ void _initCharm(int unused_argc, char **argv)
        if(CmiMyPe() == 0) {
             if(CmiGetArgFlag(argv, "+printTopo")) {
                TopoManager tmgr;
-               tmgr.printAllocation(stdout);
+    FILE *fp;
+    fp = fopen("topologyInfo.txt", "w");
+    if (fp == NULL) fp = stderr;
+               tmgr.printAllocation(fp);
            }
        }