[cig-commits] commit:

Mercurial hg at geodynamics.org
Mon Nov 24 11:59:15 PST 2008


changeset:   112:bfcefb0b783c
user:        BelindaMay
date:        Fri Jun 13 07:05:13 2008 +0000
files:       Swarm/src/SwarmClass.c Swarm/src/SwarmDump.c
description:
Changed the file extension of swarm checkpointing files to .h5 when HDF5 is used


diff -r 5f7045fc57d3 -r bfcefb0b783c Swarm/src/SwarmClass.c
--- a/Swarm/src/SwarmClass.c	Thu Jun 12 00:39:33 2008 +0000
+++ b/Swarm/src/SwarmClass.c	Fri Jun 13 07:05:13 2008 +0000
@@ -1659,6 +1659,16 @@ void Swarm_ReplaceCurrentParticleLayoutW
 
 
 void Swarm_GetCheckpointFilenameForGivenTimestep( Swarm* self, AbstractContext* context, char* swarmSaveFileName ) {
+#ifdef HAVE_HDF5
+	if ( strlen(context->checkPointPrefixString) > 0 ) {
+		sprintf( swarmSaveFileName, "%s/%s.%s.%05d.h5", context->checkpointReadPath,
+			context->checkPointPrefixString, self->name, context->restartTimestep );
+	}
+	else {
+		sprintf( swarmSaveFileName, "%s/%s.%05d.h5", context->checkpointReadPath,
+			self->name, context->restartTimestep );
+	}
+#else
 	if ( strlen(context->checkPointPrefixString) > 0 ) {
 		sprintf( swarmSaveFileName, "%s/%s.%s.%05d.dat", context->checkpointReadPath,
 			context->checkPointPrefixString, self->name, context->restartTimestep );
@@ -1667,6 +1677,7 @@ void Swarm_GetCheckpointFilenameForGiven
 		sprintf( swarmSaveFileName, "%s/%s.%05d.dat", context->checkpointReadPath,
 			self->name, context->restartTimestep );
 	}
+#endif
 }
 
 Bool Swarm_AddCommHandler( Swarm *self, void *commHandler )
diff -r 5f7045fc57d3 -r bfcefb0b783c Swarm/src/SwarmDump.c
--- a/Swarm/src/SwarmDump.c	Thu Jun 12 00:39:33 2008 +0000
+++ b/Swarm/src/SwarmDump.c	Fri Jun 13 07:05:13 2008 +0000
@@ -254,21 +254,21 @@ void _SwarmDump_Execute( void* swarmDump
 
 		if ( self->newFileEachTime ) {
 			if ( strlen(context->checkPointPrefixString) > 0 ) {
-				Stg_asprintf( &filename, "%s/%s.%s.%05d.dat", context->checkpointWritePath,
+				Stg_asprintf( &filename, "%s/%s.%s.%05d", context->checkpointWritePath,
 					context->checkPointPrefixString, swarm->name, context->timeStep );
 			}
 			else {
-				Stg_asprintf( &filename, "%s/%s.%05d.dat", context->checkpointWritePath,
+				Stg_asprintf( &filename, "%s/%s.%05d", context->checkpointWritePath,
 					swarm->name, context->timeStep );
 			}
 		}	
 		else { 
 			if ( strlen(context->checkPointPrefixString) > 0 ) {
-				Stg_asprintf( &filename, "%s/%s.%s.dat", context->checkpointWritePath,
+				Stg_asprintf( &filename, "%s/%s.%s", context->checkpointWritePath,
 					context->checkPointPrefixString, swarm->name );
 			}
 			else {
-				Stg_asprintf( &filename, "%s/%s.dat", context->checkpointWritePath, swarm->name );
+				Stg_asprintf( &filename, "%s/%s", context->checkpointWritePath, swarm->name );
 			}
 		}	
 
@@ -282,8 +282,10 @@ void _SwarmDump_Execute( void* swarmDump
 		}
 
 #ifdef HAVE_HDF5
+      Stg_asprintf( &filename, "%s.h5", filename );
 		SwarmDump_DumpToHDF5( self, swarm, filename );
 #else
+      Stg_asprintf( &filename, "%s.dat", filename );
 		Stream_RedirectFile( stream, filename );
 		MPIStream_WriteAllProcessors( stream, swarm->particles, particleSize, (SizeT) particleLocalCount, swarm->comm );
 		Stream_CloseFile( stream );



More information about the CIG-COMMITS mailing list