[cig-commits] r14291 - long/3D/SNAC/trunk/Snac/libSnac/src
cstark at geodynamics.org
cstark at geodynamics.org
Tue Mar 10 18:27:34 PDT 2009
Author: cstark
Date: 2009-03-10 18:27:33 -0700 (Tue, 10 Mar 2009)
New Revision: 14291
Modified:
long/3D/SNAC/trunk/Snac/libSnac/src/Context.c
long/3D/SNAC/trunk/Snac/libSnac/src/Context.h
Log:
Added Snac context variables for numbers of processors in x,y,z directions.
These numbers are now reported at the beginning of a run to make monitoring and snac2vtk postprocessing easier.
It may be unnecessary/inadvisable to add these variables to the dictionary, but the hope is that these numbers will be output to the input.xml file (maybe?) so allow more automatic postprocessing in the future.
Modified: long/3D/SNAC/trunk/Snac/libSnac/src/Context.c
===================================================================
--- long/3D/SNAC/trunk/Snac/libSnac/src/Context.c 2009-03-10 23:11:49 UTC (rev 14290)
+++ long/3D/SNAC/trunk/Snac/libSnac/src/Context.c 2009-03-11 01:27:33 UTC (rev 14291)
@@ -210,6 +210,11 @@
Dictionary* velocityBCsDict;
char* tmpStr;
+/* Mesh* mesh = self->mesh; */
+/* MeshLayout* layout = (MeshLayout*)self->layout; */
+/* HexaMD* decomp = (HexaMD*)self->decomp; */
+
+
/* Building StGermain Variables of nodal quantities... we must the "complex" constructor for Variable... the
* info needs to be wrapped this generic way... */
Index nodeOffsetCount = 8;
@@ -337,11 +342,33 @@
self->gravity = 0.0f;
self->demf = 0.0f;
+
/* What method are we using to calculate forces? */
/* "Complete" type should be always used unless there is a really good reason to use others. */
self->forceCalcType = Snac_Force_Complete;
Journal_Printf( self->info, "\"forceCalcType\" set by Dictionary to \"complete\"\n" );
+ /*
+ * Record the number of "processors" in each direction in parallelized runs
+ * - This info is routinely required by snac2vtk for postprocessing but has had to be hand-calculated
+ * by the user from the numbers recorded in sim.x and in the original input xml.
+ * Addition of these variables will enforce reporting of the processor geometry and speed postprocessing.
+ */
+ self->numProcX = Dictionary_Entry_Value_AsUnsignedInt(
+ Dictionary_GetDefault( self->dictionary, "numProcX",
+ Dictionary_Entry_Value_FromUnsignedInt( ((HexaMD*)self->mesh->layout->decomp)->partition3DCounts[0] ) ) );
+ self->numProcY = Dictionary_Entry_Value_AsUnsignedInt(
+ Dictionary_GetDefault( self->dictionary, "numProcY",
+ Dictionary_Entry_Value_FromUnsignedInt( ((HexaMD*)self->mesh->layout->decomp)->partition3DCounts[1] ) ) );
+ self->numProcZ = Dictionary_Entry_Value_AsUnsignedInt(
+ Dictionary_GetDefault( self->dictionary, "numProcZ",
+ Dictionary_Entry_Value_FromUnsignedInt( ((HexaMD*)self->mesh->layout->decomp)->partition3DCounts[2] ) ) );
+
+ Journal_Printf( self->info, "\nParallel processing geometry: nX=%d nY=%d nZ=%d\n\n",
+ self->numProcX,self->numProcY,self->numProcZ );
+
+
+
/* Add initial condition managers */
nodeICsDict = Dictionary_Entry_Value_AsDictionary( Dictionary_Get( self->dictionary, "nodeICs" ) );
self->nodeICs = CompositeVC_New( "nodeIC", self->variable_Register, self->condFunc_Register, nodeICsDict, self->mesh );
@@ -833,7 +860,7 @@
Snac_Context* self = (Snac_Context*)_context;
int nseg;
- Journal_Printf( self->snacInfo, "For Material %d:\n",phaseI );
+ Journal_Printf( self->snacInfo, "\nFor Material %d:\n",phaseI );
Journal_Printf( self->snacInfo, "\trheology = %d\n", self->materialProperty[phaseI].rheology );
@@ -1343,7 +1370,7 @@
/* fprintf(stderr, "Dumping ? stress tensor: ts=%d df=%d\n",self->timeStep,self->dumpEvery); */
if( self->timeStep ==0 || (self->timeStep-1) % self->dumpEvery == 0 ) {
Element_LocalIndex element_lI;
- fprintf(stderr, "r=%d, ts=%d/%d: Dumping stress tensor with df=%d\n", self->rank, self->timeStep, self->maxTimeSteps,self->dumpEvery);
+ fprintf(stderr, "r=%d, ts=%d/%d: Dumping stress tensor given dump freq=%d\n", self->rank, self->timeStep, self->maxTimeSteps,self->dumpEvery);
for( element_lI = 0; element_lI < self->mesh->elementLocalCount; element_lI++ ) {
Snac_Element* element = Snac_Element_At( self, element_lI );
Modified: long/3D/SNAC/trunk/Snac/libSnac/src/Context.h
===================================================================
--- long/3D/SNAC/trunk/Snac/libSnac/src/Context.h 2009-03-10 23:11:49 UTC (rev 14290)
+++ long/3D/SNAC/trunk/Snac/libSnac/src/Context.h 2009-03-11 01:27:33 UTC (rev 14291)
@@ -75,6 +75,7 @@
Bool computeThermalStress; \
Index restartStep; \
\
+ \
double topo_kappa; \
double topoGradMax; \
double topoGradCriterion; \
@@ -130,8 +131,13 @@
EntryPoint_Index loopElementsMomentumK;\
EntryPoint_Index updateElementK; \
EntryPoint_Index loopNodesEnergyK; \
- EntryPoint_Index loopElementsEnergyK;
+ EntryPoint_Index loopElementsEnergyK; \
+ /* Should this type by Index? */ \
+ Index numProcX; \
+ Index numProcY; \
+ Index numProcZ;
+
struct _Snac_Context { __Snac_Context };
More information about the CIG-COMMITS
mailing list