[cig-commits] r6388 - in long/3D/Gale/trunk: . src/Underworld/plugins/Output/VTKOutput

walter at geodynamics.org walter at geodynamics.org
Fri Mar 23 23:22:01 PDT 2007


Author: walter
Date: 2007-03-23 23:22:00 -0700 (Fri, 23 Mar 2007)
New Revision: 6388

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c
Log:
 r1741 at earth:  boo | 2007-03-23 23:20:48 -0700
 Make VTKOutput output pressure and fields in parallel, not just particles



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1739
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1741

Modified: long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c	2007-03-24 01:21:37 UTC (rev 6387)
+++ long/3D/Gale/trunk/src/Underworld/plugins/Output/VTKOutput/VTKOutput.c	2007-03-24 06:22:00 UTC (rev 6388)
@@ -79,13 +79,22 @@
 }
 
 void VTKOutput_particles(IntegrationPointsSwarm*  picswarm, int stepping,
-                         char *outputPath, int timeStep, int dim);
-void VTKOutput_fields(void *context);
+                         char *outputPath, int timeStep, int dim, int myRank);
+void VTKOutput_fields(void *context, int myRank);
 
 void VTKOutput( void* _context ) {
 	UnderworldContext*	context = (UnderworldContext*)_context;
 	Dictionary*             dictionary         = context->dictionary;
 
+        int myRank;
+        MPI_Comm comm;
+
+        comm=CommTopology_GetComm
+          ( Mesh_GetCommTopology(context->picIntegrationPoints->mesh,
+                                 MT_VERTEX));
+                                 
+	MPI_Comm_rank( comm, (int*)&myRank );
+
         /* Only dump if at the right time step. */
         if(context->timeStep % context->dumpEvery != 0)
           return;
@@ -96,12 +105,12 @@
                             Dictionary_GetInt_WithDefault
                             (dictionary,"particleStepping",1),
                             context->outputPath, context->timeStep,
-                            context->dim);
-        VTKOutput_fields(context);
+                            context->dim,myRank);
+        VTKOutput_fields(context,myRank);
 }
 
 void VTKOutput_particles(IntegrationPointsSwarm*  picswarm, int stepping,
-                         char *outputPath, int timeStep, int dim) {
+                         char *outputPath, int timeStep, int dim, int myRank) {
         double *coord;
         int iteration;
 	Particle_Index          num_particles = picswarm->particleLocalCount;
@@ -114,18 +123,12 @@
         Rheology_Register*      rheology_register;
 
         Name filename;
-        int myRank;
-        MPI_Comm comm;
         Stream*           stream;
 
         Rheology_Index      rheology_I; 
         Rheology_Index      rheologyCount;
         YieldRheology*      rheology; 
 
-        comm=CommTopology_GetComm( Mesh_GetCommTopology(picswarm->mesh,
-                                                        MT_VERTEX));
-	MPI_Comm_rank( comm, (int*)&myRank );
-
         stream = Journal_Register( MPIStream_Type, Swarm_Type );
         Stg_asprintf( &filename, "%s/particles.%d.%05d.vtk", outputPath,
                       myRank, timeStep);
@@ -233,7 +236,7 @@
 /* Pressure is stored on cell centers, while everything else is stored
    on cell vertices.  So we have to make two different files, one for
    pressure, and one for everything else. */
-void VTKOutput_fields(void *context) {
+void VTKOutput_fields(void *context, int myRank) {
   
   FiniteElementContext*     self = (FiniteElementContext*) context;
   Index var_I;
@@ -249,10 +252,11 @@
 
   field_stream = Journal_Register( MPIStream_Type, "fields" );
   pressure_stream = Journal_Register( MPIStream_Type, "pressure" );
-  Stg_asprintf( &pressure_filename, "%s/pressure.%05d.vtk", self->outputPath,
+  Stg_asprintf( &pressure_filename, "%s/pressure.%d.%05d.vtk",
+                self->outputPath,myRank,
                 self->timeStep);
-  Stg_asprintf( &field_filename, "%s/fields.%05d.vtk", self->outputPath,
-                    self->timeStep);
+  Stg_asprintf( &field_filename, "%s/fields.%d.%05d.vtk", self->outputPath,
+                myRank, self->timeStep);
 
   Stream_RedirectFile( field_stream, field_filename );
   Stream_RedirectFile( pressure_stream, pressure_filename );



More information about the cig-commits mailing list