[cig-commits] r4806 - in long/3D/Gale/trunk/src/StGermain: . Discretisation/Swarm/src

walter at geodynamics.org walter at geodynamics.org
Wed Oct 11 13:45:30 PDT 2006


Author: walter
Date: 2006-10-11 13:45:30 -0700 (Wed, 11 Oct 2006)
New Revision: 4806

Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ParticleCommHandler.c
Log:
 r2863 at earth:  boo | 2006-10-11 13:42:23 -0700
  r2779 at earth (orig r3767):  JulianGiordani | 2006-08-17 19:52:43 -0700
  
  Modification made by Rob and Jules. It seems that this array only needed to be sorted on the root processor, not the other processors. So we just encased the sort in an if( rank == 0 ).
  
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2862
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3766
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:2863
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3767

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ParticleCommHandler.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ParticleCommHandler.c	2006-10-11 20:45:27 UTC (rev 4805)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/ParticleCommHandler.c	2006-10-11 20:45:30 UTC (rev 4806)
@@ -585,17 +585,17 @@
 
 	procTimes = Memory_Alloc_Array( double, self->swarm->nProc, "procTimes" );
 	MPI_Gather( &myProcTime, 1, MPI_DOUBLE, procTimes, 1, MPI_DOUBLE, 0, self->swarm->comm );
-	for ( proc_I = 0; proc_I < self->swarm->nProc; proc_I++ ) {
-		if ( procTimes[proc_I] > maxProcTime ) {
-			maxProcTime = procTimes[proc_I];
+	if (self->swarm->myRank == 0 ) {
+		for ( proc_I = 0; proc_I < self->swarm->nProc; proc_I++ ) {
+			if ( procTimes[proc_I] > maxProcTime ) {
+				maxProcTime = procTimes[proc_I];
+			}
 		}
-	}
-	MPI_Barrier( self->swarm->comm );
-	if (self->swarm->myRank == 0 ) {
 		// TODO: print some stats on max particles sent/recvd and total sent/recvd
 		Journal_Printf( info, "...Max Communication time by any proc was %.2f (secs)\n", maxProcTime );
 	}
 	Memory_Free( procTimes );
+	MPI_Barrier( self->swarm->comm );
 
 	/* clean up allocated memory, and zero counters, ready for next timestep */
 	Memory_Free( self->particlesArrivingFromNbrShadowCellsTotalCounts );



More information about the cig-commits mailing list