[cig-commits] r18970 - long/3D/SNAC/trunk/Snac/snac2restart
echoi at geodynamics.org
echoi at geodynamics.org
Fri Sep 23 13:29:52 PDT 2011
Author: echoi
Date: 2011-09-23 13:29:51 -0700 (Fri, 23 Sep 2011)
New Revision: 18970
Modified:
long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c
Log:
Fixed a bug in setting the path to initial coordinate files for restarting.
Modified: long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c
===================================================================
--- long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c 2011-09-23 20:24:19 UTC (rev 18969)
+++ long/3D/SNAC/trunk/Snac/snac2restart/snac2restart.c 2011-09-23 20:29:51 UTC (rev 18970)
@@ -95,8 +95,8 @@
}
}
else {
- fprintf(stderr,"Number and kinds of arguments must be exactly like the following:\n");
- fprintf(stderr,"Usage: %s [timeStep] [path to first outputs] [your \"outputPath\"] [path to write restart files]\n",arglist[0]);
+ fprintf(stderr,"\nNumber and kinds of arguments must be exactly like the following:\n");
+ fprintf(stderr,"Usage**: %s [timeStep] [path to first outputs] [your \"outputPath\"] [path to write restart files]\n\n** Note that all four arguments are required.\n\n",arglist[0]);
exit(0);
}
}
@@ -258,18 +258,15 @@
assert(0);
abort();
}
- if( strcmp( readPath, origPath ) ) {
- sprintf( tmpBuf, "%s/coord.%u", origPath, rank );
- fprintf(stderr,"Reading init coords from %s\n",tmpBuf);
- if( (initCoordIn = fopen( tmpBuf, "r" )) == NULL ) {
- /* failed to open file for reading */
- fprintf(stderr, " ... failed - no such file\n");
- assert(0);
- abort();
- }
+
+ sprintf( tmpBuf, "%s/coord.%u", origPath, rank );
+ fprintf(stderr,"Reading init coords from %s\n",tmpBuf);
+ if( (initCoordIn = fopen( tmpBuf, "r" )) == NULL ) {
+ /* failed to open file for reading */
+ fprintf(stderr, " ... failed - no such file\n");
+ assert(0);
+ abort();
}
- else
- initCoordIn = coordIn;
sprintf( tmpBuf, "%s/velCP.%u", readPath, rank );
fprintf(stderr,"Reading from %s\n",tmpBuf);
@@ -383,7 +380,7 @@
fprintf(stderr, "Failed to open %s for writing\n", tmpBuf);
exit(0);
}
- fseek( initCoordIn, 0, SEEK_SET );
+ fseek( initCoordIn, 0, SEEK_SET );
for( node_gI = 0; node_gI < nodeLocalCount; node_gI++ ) {
float coord[3];
fread( &coord, sizeof(float), 3, initCoordIn );
More information about the CIG-COMMITS
mailing list