diff options
-rw-r--r-- | src/DumpGH.c | 36 | ||||
-rw-r--r-- | src/DumpVar.c | 54 | ||||
-rw-r--r-- | src/GHExtension.c | 8 | ||||
-rw-r--r-- | src/Output2D.c | 52 | ||||
-rw-r--r-- | src/Output3D.c | 50 | ||||
-rw-r--r-- | src/RecoverGH.c | 14 | ||||
-rw-r--r-- | src/RestoreFile.c | 32 | ||||
-rw-r--r-- | src/Write2D.c | 22 | ||||
-rw-r--r-- | src/Write3D.c | 32 |
9 files changed, 152 insertions, 148 deletions
diff --git a/src/DumpGH.c b/src/DumpGH.c index d2519b9..b0290a1 100644 --- a/src/DumpGH.c +++ b/src/DumpGH.c @@ -102,11 +102,11 @@ void IOFlexIO_TerminationDumpGH (cGH *GH) { /*** FIXME: no cactus_terminate flag anymore ? ***/ #if 0 -#ifdef CACTUSBASE_PUGH +#ifdef CACTUSPUGH_PUGH if (cactus_terminate == TERMINATION_RAISED_BRDCAST) { IOFlexIO_DumpGH (GH, CP_EVOLUTION_DATA); } -#endif /* CACTUSBASE_PUGH */ +#endif /* CACTUSPUGH_PUGH */ #else CCTK_WARN (1, "TerminationDumpGH() not yet implemented !"); #endif @@ -143,13 +143,13 @@ void IOFlexIO_InitialDataDumpGH (cGH *GH) /* BoxinBox does its own: get maxlevel (once!) and do dumpGH for all GH*/ /* when this is called by the highest box */ if (Contains("boxinbox","yes")) { - if (maxlev==0) while (GetGHbyLevel(0,maxlev+1,0)) maxlev++; + if (maxlev==0) while (GHbyLevel(0,maxlev+1,0)) maxlev++; if (maxlev==0) return; if (GH->level==maxlev) for (l=0;l<=maxlev;l++) { printf("Dumping BoxinBox level %d of %d \n",l,maxlev); - IOFlexIO_DumpGH(GetGHbyLevel(0,l,0), CP_INITIAL_DATA); + IOFlexIO_DumpGH(GHbyLevel(0,l,0), CP_INITIAL_DATA); } return; } @@ -166,7 +166,7 @@ void IOFlexIO_IEEEIOStructDump (cGH *GH, IOFile iof) ioGH *ioUtilGH; /* Get the handle for IOUtil extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; i_temp = GH->cctk_iteration; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "GH$iteration", FLEXIO_INT4, @@ -176,7 +176,7 @@ void IOFlexIO_IEEEIOStructDump (cGH *GH, IOFile iof) CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "GH$ioproc_every", FLEXIO_INT4, 1, &i_temp)); - i_temp = CCTK_GetnProcs (GH); + i_temp = CCTK_nProcs (GH); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "GH$nprocs", FLEXIO_INT4, 1, &i_temp)); @@ -236,7 +236,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) CactusStartTimer (&total_time); /* Get the handle for IOUtil xtensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; /* disable downsampling after saving original downsampling params */ old_downsample_x = ioUtilGH->downsample_x; @@ -249,8 +249,8 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) ioUtilGH->out_single = 0; /* sync all groups */ - for (index = 0; index < CCTK_GetNumGroups (); index++) { - char *gname = CCTK_GetGroupName (index); + for (index = 0; index < CCTK_NumGroups (); index++) { + char *gname = CCTK_GroupName (index); CCTK_SyncGroup (GH, gname); free (gname); @@ -258,7 +258,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) /* get the base filename ... */ IOUtil_PrepareFilename (GH, NULL, dumpfname, called_from, - CCTK_GetMyProc (GH) / ioUtilGH->ioproc_every, + CCTK_MyProc (GH) / ioUtilGH->ioproc_every, ioUtilGH->unchunked); /* ... and append the extension */ @@ -266,7 +266,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) sprintf (dumpfname, "%s.chkpt.ieee", dumpfname); /* Now open the file */ - if (CCTK_GetMyProc (GH) == ioUtilGH->ioproc) { + if (CCTK_MyProc (GH) == ioUtilGH->ioproc) { if (IO_verbose) printf ("Creating file %s\n", tmpfname); iof = IEEEopen (tmpfname, "w"); @@ -298,15 +298,15 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) wrotech = 0; /* ... now the variables */ - for (index = 0; index < CCTK_GetNumVars (); index++) { + for (index = 0; index < CCTK_NumVars (); index++) { /* let only variables pass which have storage assigned */ - if (! CCTK_QueryGroupStorage_ByIndex (GH, - CCTK_GetGroupIndexFromVar_ByIndex (index))) + if (! CCTK_QueryGroupStorageI (GH, + CCTK_GroupIndexFromVarI (index))) continue; if (IO_verbose) { - char *varname = CCTK_GetVarName (index); + char *varname = CCTK_VarName (index); printf (" %s", varname); wrotech += strlen (varname) + 1; @@ -317,7 +317,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) } /* get the current timelevel */ - current_timelevel = CCTK_GetNumTimeLevels_ByIndex (index) - 1; + current_timelevel = CCTK_NumTimeLevelsFromVarI (index) - 1; if (current_timelevel > 0) current_timelevel--; @@ -334,14 +334,14 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) printf ("\nTime to write: %lf sec (%lf sec per Grid Func)\n", /*** FIXME: choose right component of basic[] ***/ write_time.total.basic [0], - write_time.total.basic [0] / CCTK_GetNumVars ()); + write_time.total.basic [0] / CCTK_NumVars ()); #ifndef WIN32 /* PW: This should work on WIN32 also, since it is in stdio.h. Someone should check this if/when we go into WIN32 production. */ - if (CCTK_GetMyProc (GH) == ioUtilGH->ioproc) { + if (CCTK_MyProc (GH) == ioUtilGH->ioproc) { if (rename (tmpfname, dumpfname)) { char msg [512]; diff --git a/src/DumpVar.c b/src/DumpVar.c index e91f0e0..1d0f7d1 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -114,9 +114,9 @@ void IOFlexIO_DumpVar (cGH *GH, int index, int timelevel, IOFile iof) int ioflex_type, mpi_type = 0, element_size; /* Get the handle for IOUtil extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; - variable_type = CCTK_GetVarVType (index); + variable_type = CCTK_VarTypeI (index); switch (variable_type) { case CCTK_VARIABLE_REAL: @@ -155,7 +155,7 @@ void IOFlexIO_DumpVar (cGH *GH, int index, int timelevel, IOFile iof) return; } - switch (CCTK_GetVarGType (index)) { + switch (CCTK_GroupTypeFromVarI (index)) { case GROUP_SCALAR: IOFlexIO_DumpScalar (GH, index, timelevel, iof, ioflex_type); break; @@ -172,7 +172,7 @@ void IOFlexIO_DumpVar (cGH *GH, int index, int timelevel, IOFile iof) default: sprintf (msg, "Invalid group type %d in IOFlexIO_DumpVar", - CCTK_GetVarGType (index)); + CCTK_GroupTypeFromVarI (index)); CCTK_WARN (1, msg); return; } @@ -227,14 +227,14 @@ void IOFlexIO_DumpScalar (cGH *GH, int index, int timelevel, IOFile iof, /* Get the handle for IOUtil extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; - if (CCTK_GetMyProc (GH) != ioUtilGH->ioproc) + if (CCTK_MyProc (GH) != ioUtilGH->ioproc) return; /* first dump the data then add the attributes */ CACTUS_IEEEIO_ERROR (IOwrite (iof, ioflex_type, 1, dim, - CCTK_GetVarDataPtr_ByIndex (GH, timelevel, index))); + CCTK_VarDataPtrI (GH, timelevel, index))); IOFlexIO_AddCommonAttributes (GH, index, timelevel, gsz, iof); } @@ -375,11 +375,11 @@ void IOFlexIO_DumpGF (cGH *GH, int index, int timelevel, IOFile iof, #endif /* Get the handles for pugh and IO extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; - myproc = CCTK_GetMyProc (GH); - nprocs = CCTK_GetnProcs (GH); + myproc = CCTK_MyProc (GH); + nprocs = CCTK_nProcs (GH); /* If I'm not vertex centered, bail (for now) */ if (pughGH->stagger != PUGH_VERTEXCTR) { @@ -518,23 +518,23 @@ void IOFlexIO_AddCommonAttributes (cGH *GH, int index, int timelevel, ioGH *ioUtilGH; /* Get the handles for pugh and IO extensions */ - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; - name = CCTK_GetFullName (index); + name = CCTK_FullName (index); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "name", BYTE, strlen (name) + 1, name)); free (name); - gname = CCTK_GetGroupNameFromVar_ByIndex (index); + gname = CCTK_GroupNameFromVarI (index); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "groupname", BYTE, strlen (gname) + 1, gname)); - i_to_IO = CCTK_GetVarGType (index); + i_to_IO = CCTK_GroupTypeFromVarI (index); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "grouptype", FLEXIO_INT4, 1, &i_to_IO)); - i_to_IO = CCTK_GetNumTimeLevels_ByIndex (index); + i_to_IO = CCTK_NumTimeLevelsFromVarI (index); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "ntimelevels", FLEXIO_INT4, 1, &i_to_IO)); @@ -579,7 +579,7 @@ void IOFlexIO_AddCommonAttributes (cGH *GH, int index, int timelevel, CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "global_size", FLEXIO_INT4, 3, gsz)); - i_to_IO = CCTK_GetnProcs (GH); + i_to_IO = CCTK_nProcs (GH); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "nprocs", FLEXIO_INT4, 1, &i_to_IO)); @@ -621,7 +621,7 @@ void IOFlexIO_AddChunkAttributes (cGH *GH, int index, CCTK_INT4 chunk_origin [3] CCTK_INT4 i_to_IO; /* there is nothing to do for a serial run */ - if (CCTK_GetnProcs (GH) == 1) + if (CCTK_nProcs (GH) == 1) return; CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "chunk_origin", FLEXIO_INT4, @@ -631,7 +631,7 @@ void IOFlexIO_AddChunkAttributes (cGH *GH, int index, CCTK_INT4 chunk_origin [3] CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "chunk_dataset", FLEXIO_INT4, 1, &i_to_IO)); - name = CCTK_GetFullName (index); + name = CCTK_FullName (index); CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "name", BYTE, strlen (name)+1, name)); } @@ -699,12 +699,12 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, CCTK_REAL *real_ptr; CCTK_CHAR *char_ptr; CCTK_INT *int_ptr; - void *data = CCTK_GetVarDataPtr_ByIndex (GH, timelevel, index); + void *data = CCTK_VarDataPtrI (GH, timelevel, index); - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; - myproc = CCTK_GetMyProc (GH); + myproc = CCTK_MyProc (GH); if (ioUtilGH->downsample_x == 1 && ioUtilGH->downsample_y == 1 && @@ -796,7 +796,7 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, /* I hate it to repeat the loops for each case label but that way produces much more efficient code */ l = 0; - switch (CCTK_GetVarVType (index)) { + switch (CCTK_VarTypeI (index)) { case CCTK_VARIABLE_CHAR: char_ptr = (CCTK_CHAR *) *outme; for (k = start [2]; k <= end [2]; k += ioUtilGH->downsample_z) @@ -864,7 +864,7 @@ void IOFlexIO_eachProcDump (cGH *GH, int index, int timelevel, void *outme, int chunk_dims [3]; ioGH *ioUtilGH; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; /* So set up the local shape. */ chunk_dims [0] = bnd [3]; @@ -908,7 +908,7 @@ void IOFlexIO_procDump (IOFile iof, cGH *GH, int index, void *outme, int chunk_dims [3], chunk_origin [3]; /* Chunk dim and origin */ ioGH *ioUtilGH; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; chunk_origin [0] = bnd [0]; chunk_origin [1] = bnd [1]; diff --git a/src/GHExtension.c b/src/GHExtension.c index 09efeaa..5e1e27f 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -35,7 +35,7 @@ void *IOFlexIO_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH) int i, numvars; flexioGH *newGH; - numvars = CCTK_GetNumVars (); + numvars = CCTK_NumVars (); newGH = (flexioGH *) malloc (sizeof (flexioGH)); newGH->IO_2Dnum = (int *) malloc (numvars * sizeof (int)); @@ -64,13 +64,13 @@ int IOFlexIO_InitGH (cGH *GH) flexioGH *myGH; /* get the handles for IOUtil and IOFlexIO extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; InitIONum (myGH->IO_2Dnum, output2D); InitIONum (myGH->IO_3Dnum, output3D); - for (i=0; i<CCTK_GetNumVars(); i++) + for (i=0; i<CCTK_NumVars(); i++) myGH->IO_2Dlast [i] = myGH->IO_3Dlast [i] = -1; myGH->reuse_fh = reuse_fh; diff --git a/src/Output2D.c b/src/Output2D.c index 927c114..edca82d 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -31,10 +31,10 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index); @desc Loops over all variables and outputs them if necessary @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetNumVars - CCTK_GetImplementationFromVar - CCTK_GetVarName + @calls CCTK_GHExtensionHandle + CCTK_NumVars + CCTK_ImplementationFromVar + CCTK_VarName IOFlexIO_TimeFor2D IOFlexIO_Output2DVarAs @calledby @@ -57,15 +57,15 @@ int IOFlexIO_Output2DGH (cGH *GH) char *name, *fullname; /* Get the GH extension for IOFlexIO */ - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Loop over all variables */ - for (i = 0; i < CCTK_GetNumVars (); i++) { + for (i = 0; i < CCTK_NumVars (); i++) { if (IOFlexIO_TimeFor2D (GH, i)) { - name = CCTK_GetVarName (i); - fullname = CCTK_GetFullName (i); + name = CCTK_VarName (i); + fullname = CCTK_FullName (i); if (IO_verbose) { printf("IOFlexIO Output2DGH : \n"); @@ -96,8 +96,8 @@ int IOFlexIO_Output2DGH (cGH *GH) unconditional output of a variable using the IO 2D output method @enddesc @calls CCTK_DecomposeName - CCTK_GetVarIndex - CCTK_GetGHExtensionHandle + CCTK_VarIndex + CCTK_GHExtensionHandle IOFlexIO_Write2D @calledby IOFlexIO_Output2DGH @history @@ -129,10 +129,10 @@ int IOFlexIO_Output2DVarAs (cGH *GH, const char *fullname, const char *alias) int index, first; flexioGH *myGH; - index = CCTK_GetVarIndex (fullname); + index = CCTK_VarIndex (fullname); /* get the handle for IOFlexIO extensions */ - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Output with correct file opening behaviour */ first = (myGH->IO_2Dnum [index] == 1); @@ -159,11 +159,11 @@ int IOFlexIO_Output2DVarAs (cGH *GH, const char *fullname, const char *alias) Decides if it is time to output a variable using the IO 2D output method @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetVarGType + @calls CCTK_GHExtensionHandle + CCTK_GroupTypeFromVar CCTK_WARN - CCTK_QueryGroupStorage_ByIndex - CCTK_GetGroupNameFromVar_ByIndex + CCTK_QueryGroupStorageI + CCTK_GroupNameFromVarI @calledby IOFlexIO_Output2DGH @history @@ -189,11 +189,11 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index) flexioGH *myGH; /* Get the GH extension for IOUtil and IOFlexIO */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Check this GF should be output */ - if (! (CCTK_GetVarGType (index) == GROUP_GF && myGH->IO_2Dnum [index] != 0 + if (! (CCTK_GroupTypeFromVarI (index) == GROUP_GF && myGH->IO_2Dnum [index] != 0 && GH->cctk_iteration % ioUtilGH->IO_2Devery == 0)) return (0); @@ -204,9 +204,9 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index) } /* Check GF has storage */ - if (! CCTK_QueryGroupStorage_ByIndex (GH, - CCTK_GetGroupIndexFromVar_ByIndex(index))) { - char *fullname = CCTK_GetFullName (index); + if (! CCTK_QueryGroupStorageI (GH, + CCTK_GroupIndexFromVarI(index))) { + char *fullname = CCTK_FullName (index); char *msg = (char *) malloc (80 + strlen (fullname)); sprintf (msg, "No IOFlexIO 2D output for '%s' (no storage)", fullname); @@ -228,8 +228,8 @@ int IOFlexIO_TimeFor2D (cGH *GH, int index) Triggers the output a variable using the IO 2D output method @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetVarName + @calls CCTK_GHExtensionHandle + CCTK_VarName IOFlexIO_Write2D @calledby @history @@ -256,10 +256,10 @@ int IOFlexIO_TriggerOutput2D (cGH *GH, int index) flexioGH *myGH; char *varname; - varname = CCTK_GetVarName (index); + varname = CCTK_VarName (index); /* get the handle for IOFlexIO extensions */ - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Output with correct file opening behaviour */ first = (myGH->IO_2Dnum [index] == 1); diff --git a/src/Output3D.c b/src/Output3D.c index d1d8cec..ad9b04d 100644 --- a/src/Output3D.c +++ b/src/Output3D.c @@ -31,10 +31,10 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index); @desc Loops over all variables and outputs them if necessary @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetNumVars - CCTK_GetImplementationFromVar - CCTK_GetVarName + @calls CCTK_GHExtensionHandle + CCTK_NumVars + CCTK_ImplementationFromVar + CCTK_VarName IOFlexIO_TimeFor3D IOFlexIO_Output3DVarAs @calledby @@ -59,13 +59,13 @@ int IOFlexIO_Output3DGH (cGH *GH) DECLARE_CCTK_PARAMETERS /* Get the GH extension for IOFlexIO */ - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Loop over all variables */ - for (i = 0; i < CCTK_GetNumVars (); i++) { + for (i = 0; i < CCTK_NumVars (); i++) { if (IOFlexIO_TimeFor3D (GH, i)) { - implementation = CCTK_GetImplementationFromVar (i); - name = CCTK_GetVarName (i); + implementation = CCTK_ImpFromVarI (i); + name = CCTK_VarName (i); fullname = (char *) malloc (strlen (implementation) + strlen (name) + 3); assert (fullname); @@ -100,8 +100,8 @@ int IOFlexIO_Output3DGH (cGH *GH) unconditional output of a variable using the IOFlexIO 3D output method @enddesc @calls CCTK_DecomposeName - CCTK_GetVarIndex - CCTK_GetGHExtensionHandle + CCTK_VarIndex + CCTK_GHExtensionHandle IOFlexIO_Write3D @calledby IOFlexIO_Output3DGH @history @@ -133,10 +133,10 @@ int IOFlexIO_Output3DVarAs (cGH *GH, const char *fullname, const char *alias) int index, first; flexioGH *myGH; - index = CCTK_GetVarIndex(fullname); + index = CCTK_VarIndex(fullname); /* Get the GH extension for IOFlexIO */ - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Output with correct file opening behaviour */ first = (myGH->IO_3Dnum [index] == 1); @@ -163,11 +163,11 @@ int IOFlexIO_Output3DVarAs (cGH *GH, const char *fullname, const char *alias) Decides if it is time to output a variable using the IOFlexIO 3D output method @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetVarGType + @calls CCTK_GHExtensionHandle + CCTK_GroupTypeFromVarI CCTK_WARN - CCTK_QueryGroupStorage_ByIndex - CCTK_GetGroupNameFromVar_ByIndex + CCTK_QueryGroupStorageI + CCTK_GroupNameFromVarI @calledby IOFlexIO_Output3DGH @history @@ -192,8 +192,8 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index) flexioGH *myGH; /* Get the GH extension for IOUtil and IOFlexIO */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Check this GF should be output */ if (! (myGH->IO_3Dnum [index] != 0 && @@ -207,9 +207,9 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index) } /* Check GF has storage */ - if (! CCTK_QueryGroupStorage_ByIndex (GH, - CCTK_GetGroupIndexFromVar_ByIndex(index))) { - char *fullname = CCTK_GetFullName (index); + if (! CCTK_QueryGroupStorageI (GH, + CCTK_GroupIndexFromVarI(index))) { + char *fullname = CCTK_FullName (index); char *msg = (char *) malloc (80 + strlen (fullname)); sprintf (msg, "No IOFlexIO 3D output for '%s' (no storage)", fullname); @@ -231,8 +231,8 @@ int IOFlexIO_TimeFor3D (cGH *GH, int index) Triggers the output a variable using the IOFlexIO 3D output method @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetVarName + @calls CCTK_GHExtensionHandle + CCTK_VarName IOFlexIO_Write3D @calledby @history @@ -259,10 +259,10 @@ int IOFlexIO_TriggerOutput3D (cGH *GH, int index) flexioGH *myGH; char *varname; - varname = CCTK_GetVarName (index); + varname = CCTK_VarName (index); /* Get the GH extension for IOFlexIO */ - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Output with correct file opening behaviour */ first = (myGH->IO_3Dnum [index] == 1); diff --git a/src/RecoverGH.c b/src/RecoverGH.c index 0d86946..176b261 100644 --- a/src/RecoverGH.c +++ b/src/RecoverGH.c @@ -65,7 +65,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) { -#ifdef CACTUSBASE_PUGH +#ifdef CACTUSPUGH_PUGH DECLARE_CCTK_PARAMETERS IOFile ifp; @@ -89,12 +89,12 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) /* Get the handles for PUGH and IOUtil extensions */ - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; /* identify myself */ - nprocs = CCTK_GetnProcs (GH); - myproc = CCTK_GetMyProc (GH); + nprocs = CCTK_nProcs (GH); + myproc = CCTK_MyProc (GH); /* initialize timers */ CactusResetTimer (&total_time); @@ -338,6 +338,8 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) total_time.total.basic [0]); } +#endif /* CACTUSPUGH_PUGH */ + return (0); -#endif /* CACTUSBASE_PUGH */ + } diff --git a/src/RestoreFile.c b/src/RestoreFile.c index 3192184..0d70472 100644 --- a/src/RestoreFile.c +++ b/src/RestoreFile.c @@ -88,7 +88,7 @@ int GetCommonAttributes (cGH *GH, IOFile ifp, int unchunked, int *index, CACTUS_IEEEIO_ERROR (IOreadAttribute (ifp, i, fullname)); /* check if there is a matching variable */ - *index = CCTK_GetVarIndex (fullname); + *index = CCTK_VarIndex (fullname); if (*index < 0) { sprintf (msg, "No matching variable found for '%s'", fullname); CCTK_WARN (2, msg); @@ -103,7 +103,7 @@ int GetCommonAttributes (cGH *GH, IOFile ifp, int unchunked, int *index, return (1); } CACTUS_IEEEIO_ERROR (IOreadAttribute (ifp, i, groupname)); - if (! CCTK_Equals (groupname, CCTK_GetGroupNameFromVar_ByIndex (*index))) { + if (! CCTK_Equals (groupname, CCTK_GroupNameFromVarI (*index))) { sprintf (msg, "Groupnames don't match for '%s'", fullname); CCTK_WARN (2, msg); return (1); @@ -138,7 +138,7 @@ int GetCommonAttributes (cGH *GH, IOFile ifp, int unchunked, int *index, *timelevel = timelevel_stored; /* verify group type, variable type, dims, sizes and ntimelevels */ - CCTK_GetGroupData (CCTK_GetGroupIndex (groupname), gtype, &vtype, &rank, + CCTK_GroupData (CCTK_GroupIndex (groupname), gtype, &vtype, &rank, &i, &ntimelevels); if (*gtype != gtype_stored) { sprintf (msg, "Group types don't match for '%s'", fullname); @@ -201,8 +201,8 @@ int GetCommonAttributes (cGH *GH, IOFile ifp, int unchunked, int *index, return (1); } - if (! CCTK_QueryGroupStorage_ByIndex (GH, - CCTK_GetGroupIndexFromVar_ByIndex (*index))) { + if (! CCTK_QueryGroupStorageI (GH, + CCTK_GroupIndexFromVarI (*index))) { CCTK_WARN (2, "Can't read into variable with no storage"); return (1); } @@ -229,7 +229,7 @@ int GetChunkAttributes (cGH *GH, IOFile ifp, int index) /* Get the handle for PUGH extensions */ - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; /* read the next dataset's info from the file */ result = IOreadInfo (ifp, &vtype_stored, &rank_stored, dims_stored, MAXDIM); @@ -248,7 +248,7 @@ int GetChunkAttributes (cGH *GH, IOFile ifp, int index) CACTUS_IEEEIO_ERROR (IOreadAttribute (ifp, i, fullname)); /* check if there is a matching variable */ - if (index != CCTK_GetVarIndex (fullname)) { + if (index != CCTK_VarIndex (fullname)) { sprintf (msg, "No matching variable found for '%s'", fullname); CCTK_WARN (2, msg); return (1); @@ -279,7 +279,7 @@ int GetChunkAttributes (cGH *GH, IOFile ifp, int index) int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, int file_ioproc_every, int file_unchunked) { -#ifdef CACTUSBASE_PUGH +#ifdef CACTUSPUGH_PUGH DECLARE_CCTK_PARAMETERS int index, gtype; @@ -295,10 +295,10 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, /* Get the handles for PUGH and IO extensions */ - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; - myproc = CCTK_GetMyProc (GH); - nprocs = CCTK_GetnProcs (GH); + myproc = CCTK_MyProc (GH); + nprocs = CCTK_nProcs (GH); /* all IO procs determine the number of datasets in their checkpoint files */ if (myproc == file_ioproc) { @@ -355,7 +355,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, else { if (IO_verbose) { - char *varname = CCTK_GetFullName (index); + char *varname = CCTK_FullName (index); printf (" dataset %d: %s (timelevel %d)\n", currentDataset, varname, timelevel); @@ -371,7 +371,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, int chunkdims [3], *chunkorigin; int element_size, mpi_type; - switch (CCTK_GetVarVType (index)) { + switch (CCTK_VarTypeI (index)) { case CCTK_VARIABLE_CHAR: element_size = sizeof (CCTK_CHAR); mpi_type = PUGH_MPI_CHAR; break; @@ -495,7 +495,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, if (index < 0) break; - switch (CCTK_GetVarVType (index)) { + switch (CCTK_VarTypeI (index)) { case CCTK_VARIABLE_CHAR: mpi_type = PUGH_MPI_CHAR; break; case CCTK_VARIABLE_INT: mpi_type = PUGH_MPI_INT; break; case CCTK_VARIABLE_REAL: mpi_type = PUGH_MPI_REAL; break; @@ -515,6 +515,8 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, #endif } +#endif /* CACTUSPUGH_PUGH */ + return (0); -#endif /* CACTUSBASE_PUGH */ + } diff --git a/src/Write2D.c b/src/Write2D.c index 8b53daf..b15ccb9 100644 --- a/src/Write2D.c +++ b/src/Write2D.c @@ -47,9 +47,9 @@ static char *rcsid = "$Id$"; @author Gabrielle Allen @desc Writes the 2D data of a variable into separate IEEEIO files @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetMyProc - CCTK_GetnProcs + @calls CCTK_GHExtensionHandle + CCTK_MyProc + CCTK_nProcs CCTK_WARN @calledby IOFlexIO_Output2DVarAs IOFlexIO_TriggerOutput2D @@ -108,13 +108,13 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias, int first) /* Get the handles for pugh, IOFlexIO and IOUtil extensions */ - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* What processor are we on? */ - myproc = CCTK_GetMyProc (GH); - nprocs = CCTK_GetnProcs (GH); + myproc = CCTK_MyProc (GH); + nprocs = CCTK_nProcs (GH); if (IO_verbose) { printf ("<><><><><><><><><><><><><><><><><>\n"); @@ -169,12 +169,12 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias, int first) nrempoints = (CCTK_INT *) malloc (nprocs * sizeof (CCTK_INT)); assert (nrempoints); - timelevel = CCTK_GetNumTimeLevels_ByIndex (index) - 1; + timelevel = CCTK_NumTimeLevelsFromVarI (index) - 1; if (timelevel > 0) timelevel--; - data = CCTK_GetVarDataPtr_ByIndex (GH, timelevel, index); + data = CCTK_VarDataPtrI (GH, timelevel, index); - variable_type = CCTK_GetVarVType (index); + variable_type = CCTK_VarTypeI (index); switch (variable_type) { case CCTK_VARIABLE_CHAR: ioflex_type = FLEXIO_CHAR; diff --git a/src/Write3D.c b/src/Write3D.c index d0bf57b..9921b51 100644 --- a/src/Write3D.c +++ b/src/Write3D.c @@ -94,9 +94,9 @@ void IOFlexIO_DumpVar (cGH *GH, int index, int timelevel, IOFile iof); Finally notice that @seeroutine main guarantees that this is never called on a 1- or 2-D grid. @enddesc - @calls CCTK_GetGHExtensionHandle - CCTK_GetMyProc - CCTK_GetnProcs + @calls CCTK_GHExtensionHandle + CCTK_MyProc + CCTK_nProcs CCTK_WARN @calledby IOFlexIO_Output3DVarAs IOFlexIO_TriggerOutput3D @@ -145,8 +145,8 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias, int first) /* Get the handle for IOUtil and IOFlexIO extensions */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* Get filename and reference to file handle */ filename = myGH->IEEEfname_3D [index]; @@ -162,8 +162,8 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias, int first) } /* What processor are we on? */ - myproc = CCTK_GetMyProc (GH); - nprocs = CCTK_GetnProcs (GH); + myproc = CCTK_MyProc (GH); + nprocs = CCTK_nProcs (GH); /* build the filename for output */ @@ -191,7 +191,7 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias, int first) IOFlexIO_Write3D_openFile (GH, filename, iofile, first); /* get the current timelevel */ - timelevel = CCTK_GetNumTimeLevels_ByIndex (index) - 1; + timelevel = CCTK_NumTimeLevelsFromVarI (index) - 1; if (timelevel > 0) timelevel--; @@ -240,8 +240,8 @@ void IOFlexIO_Write3D_closeFile (cGH *GH, const char *filename, IOFile *iofile) ioGH *ioUtilGH; flexioGH *myGH; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; if (*iofile == NULL) return; @@ -288,8 +288,8 @@ void IOFlexIO_Write3D_openFile (cGH *GH, const char *filename, IOFile *iofile, i ioGH *ioUtilGH; flexioGH *myGH; - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* If we are the first time through, or writing one file per slice, we need to open a file in write mode. Or, if we are reusing file handles we will @@ -373,14 +373,14 @@ void IOFlexIO_Write3D_filename (cGH *GH, char *filename, const char *name) char extradir [256]; /* Extra stuff for an output dir */ char createdir [256]; /* Text for system call to create output directory */ - ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; - pughGH = (pGH *) GH->extensions [CCTK_GetGHExtensionHandle ("PUGH")]; + ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; + pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")]; extra [0] = '\0'; extradir [0] = '\0'; - nprocs = CCTK_GetnProcs (GH); - myproc = CCTK_GetMyProc (GH); + nprocs = CCTK_nProcs (GH); + myproc = CCTK_MyProc (GH); #if 0 /* Say if we have a chunked data in the output file(s) */ |