[cig-commits] commit:

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


changeset:   168:5fa09b9ac8f6
user:        JohnMansour <john.mansour at maths.monash.edu.au>
date:        Thu Oct 09 14:53:36 2008 +1100
files:       Swarm/src/SwarmDump.c
description:
SwarmDump modified to remove MPI file operations... replaced with standard c binary file operations


diff -r 9d80e49b2289 -r 5fa09b9ac8f6 Swarm/src/SwarmDump.c
--- a/Swarm/src/SwarmDump.c	Mon Oct 06 16:27:35 2008 +1100
+++ b/Swarm/src/SwarmDump.c	Thu Oct 09 14:53:36 2008 +1100
@@ -236,11 +236,9 @@ void _SwarmDump_Execute( void* swarmDump
 void _SwarmDump_Execute( void* swarmDump, void* data ) {
 	SwarmDump*	      self                = (SwarmDump*)     swarmDump;
 	AbstractContext*  context             = Stg_CheckType( data, AbstractContext );
-	Stream*           stream              = Journal_Register( MPIStream_Type, Swarm_Type );
 	Particle_Index    particleLocalCount;
 	SizeT             particleSize;
 	Name              filename;
-	Name              filenameTemp;
 	Index             swarm_I;
 	Swarm*            swarm;
 	Stream*           info = Journal_Register( Info_Type, self->type );
@@ -284,22 +282,11 @@ void _SwarmDump_Execute( void* swarmDump
 		}
 
 #ifdef WRITE_HDF5
-      Stg_asprintf( &filename, "%s.h5", filename );
+		Stg_asprintf( &filename, "%s.h5", filename );
 		SwarmDump_DumpToHDF5( self, swarm, filename );
 #else
-      Stg_asprintf( &filename, "%s.dat", filename );
-      /* write checkpoint file to a temporary file to avoid nfs issues */
-      Stg_asprintf( &filenameTemp, "%s.temp", filename );
-      Stream_RedirectFile( stream, filenameTemp );
-		MPIStream_WriteAllProcessors( stream, swarm->particles, particleSize, (SizeT) particleLocalCount, swarm->comm );
-		Stream_CloseFile( stream );
-
-		/* remove old checkpoint file, if any exists... then move temp file to appropriate filename */
-		if(swarm->myRank == 0){
-		      remove( filename );
-		      rename( filenameTemp , filename );
-		}
-		Memory_Free( filenameTemp );
+      		Stg_asprintf( &filename, "%s.dat", filename );
+		BinaryStream_WriteAllProcessors( filename, swarm->particles, particleSize, (SizeT) particleLocalCount, swarm->comm );
 #endif
 		Memory_Free( filename );
 				



More information about the CIG-COMMITS mailing list