diff options
-rw-r--r-- | param.ccl | 42 | ||||
-rw-r--r-- | schedule.ccl | 6 | ||||
-rw-r--r-- | src/DumpGH.c | 16 | ||||
-rw-r--r-- | src/DumpVar.c | 10 | ||||
-rw-r--r-- | src/GHExtension.c | 40 | ||||
-rw-r--r-- | src/Output2D.c | 6 | ||||
-rw-r--r-- | src/Output3D.c | 6 | ||||
-rw-r--r-- | src/RecoverGH.c | 33 | ||||
-rw-r--r-- | src/RestoreFile.c | 6 | ||||
-rw-r--r-- | src/Write2D.c | 20 | ||||
-rw-r--r-- | src/Write3D.c | 32 | ||||
-rw-r--r-- | src/ioFlexGH.h | 2 |
12 files changed, 110 insertions, 109 deletions
@@ -10,11 +10,11 @@ private: ######################## # How often to do output ######################## -INT output2d_every "How often to do 2D output, overrides output_every" +INT out2D_every "How often to do 2D output, overrides out_every" { -1:* :: } -1 -INT output3d_every "How often to do 3D output, overrides output_every" +INT out3D_every "How often to do 3D output, overrides out_every" { -1:* :: } -1 @@ -23,10 +23,10 @@ INT output3d_every "How often to do 3D output, overrides output_every" #################### # Output directories #################### -STRING outdir2d "Name of IO 2D output directory, overrides outdir" +STRING outdir2D "Name of IO 2D output directory, overrides outdir" { } "outdir" -STRING outdir3d "Name of IO 3D output directory, overrides outdir" +STRING outdir3D "Name of IO 3D output directory, overrides outdir" { } "outdir" @@ -34,21 +34,21 @@ STRING outdir3d "Name of IO 3D output directory, overrides outdir" ########################## # What variables to output ########################## -STRING output2D "Variables to output in 2D FlexIO file format" +STRING out2D_vars "Variables to output in 2D FlexIO file format" { :: "default is to output nothing" } "" -STRING output3D "Variables to output in 3D FlexIO file format" +STRING out3D_vars "Variables to output in 3D FlexIO file format" { :: "default is to output nothing" } "" ################ # Various things ################ -LOGICAL checkpoint_FlexIO "Do checkpointing with IOFlexIO" +LOGICAL checkpoint "Do checkpointing with IOFlexIO" { } "no" -LOGICAL reuse_fh "Reuse file handles by closing files after each write operation." +LOGICAL out3d_reuse_filehandles "Reuse file handles by closing files after each write operation." { } "no" @@ -69,7 +69,7 @@ EXTEND STRING outdir "Name of IO output directory" ######################## # How often to do output ######################## -EXTEND INT output_every "How often to do IO output" +EXTEND INT out_every "How often to do IO output" { -1:* :: } -1 @@ -78,16 +78,16 @@ EXTEND INT output_every "How often to do IO output" ################ # various things ################ -EXTEND LOGICAL output_verbose "Give extended screen output in IO?" +EXTEND LOGICAL verbose "Give extended screen output in IO?" { } "no" -EXTEND LOGICAL output3d_datestamp "Write date as attribute to IO 3D output file?" +EXTEND LOGICAL out3D_datestamp "Write date as attribute to IO 3D output file?" { } "yes" -EXTEND LOGICAL output3d_parameters "Write parameters to IO 3D output file?" +EXTEND LOGICAL out3D_parameters "Write parameters to IO 3D output file?" { } "yes" -EXTEND LOGICAL output3d_structures "Write structures to IO 3D output file?" +EXTEND LOGICAL out3D_structures "Write structures to IO 3D output file?" { } "yes" @@ -95,21 +95,21 @@ EXTEND LOGICAL output3d_structures "Write structures to IO 3D output file?" ####################### # Specific to 3D output ####################### -EXTEND KEYWORD iomode "Which mode for 3D IO" +EXTEND KEYWORD out3D_mode "Which mode for 3D IO" { "proc" :: "every processor writes its share of data into a separate file" "np" :: "data is collected and written by every N'th processor into a separate file, where N is specified by the parameter ioproc_every" "onefile" :: "all output is written into a single file by processor 0" } "proc" -EXTEND INT ioproc_every "Do IO on every N processors." +EXTEND INT out3D_procs "Do IO on every N processors." { 1:* :: "Must be a positive integer" } 8 -EXTEND LOGICAL onefileperslice "Write one file per time slice, as opposed to all data in one file" +EXTEND LOGICAL out3D_septimefiles "Write one file per time slice, as opposed to all data in one file" { } "no" -EXTEND LOGICAL unchunked "Don't write data in chunks." +EXTEND LOGICAL out3D_unchunked "Don't write data in chunks." { } "no" @@ -117,19 +117,19 @@ EXTEND LOGICAL unchunked "Don't write data in chunks." ############################################## # Downsampling parameters (only for 3D output) ############################################## -EXTEND INT downsample_x "Factor by which to downsample output in x direction. Point (0,0,0) is always included." +EXTEND INT out3D_downsample_x "Factor by which to downsample output in x direction. Point (0,0,0) is always included." { 1:* :: "Must be a positive integer" } 1 -EXTEND INT downsample_y "Factor by which to downsample output in y direction. Point (0,0,0) is always included." +EXTEND INT out3D_downsample_y "Factor by which to downsample output in y direction. Point (0,0,0) is always included." { 1:* :: "Must be a positive integer" } 1 -EXTEND INT downsample_z "Factor by which to downsample output in z direction. Point (0,0,0) is always included." +EXTEND INT out3D_downsample_z "Factor by which to downsample output in z direction. Point (0,0,0) is always included." { 1:* :: "Must be a positive integer" } 1 -EXTEND LOGICAL out_single "Output 3D data in single precision ? This parameter is ignored for Cactus compiled with SINGLE_PRECISION." +EXTEND LOGICAL out3D_single "Output 3D data in single precision ? This parameter is ignored for Cactus compiled with single precision" { } "no" diff --git a/schedule.ccl b/schedule.ccl index 5b0025b..bafa603 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -12,19 +12,19 @@ schedule IOFlexIO_Startup at STARTUP ######################################################################## ### register checkpointing routines ######################################################################## -if (checkpoint_FlexIO && checkpoint_ID) { +if (checkpoint && checkpoint_ID) { schedule IOFlexIO_InitialDataDumpGH at CCTK_CPINITIAL { LANG:C } "Initial data checkpoint routine" } -if (checkpoint_FlexIO && checkpoint_every > 0) { +if (checkpoint && checkpoint_every > 0) { schedule IOFlexIO_ConditionallyDumpGH at CCTK_CHECKPOINT { LANG:C } "Regular checkpoint routine" } -if (checkpoint_FlexIO) { +if (checkpoint) { schedule IOFlexIO_TerminationDumpGH at CCTK_TERMINATE { LANG:C } "Termination checkpoint routine" diff --git a/src/DumpGH.c b/src/DumpGH.c index a3575e8..54dafeb 100644 --- a/src/DumpGH.c +++ b/src/DumpGH.c @@ -49,7 +49,7 @@ void IOFlexIO_ConditionallyDumpGH (cGH *GH) if (checkpoint_every > 0 && GH->cctk_iteration % checkpoint_every == 0) { - if (output_verbose) { + if (verbose) { printf ("------------------------------------------------------------\n"); printf ("Dumping periodic checkpoint file at iteration %d\n", GH->cctk_iteration); @@ -246,7 +246,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) /* Now open the file */ if (CCTK_MyProc (GH) == ioUtilGH->ioproc) { - if (output_verbose) + if (verbose) printf ("Creating file %s\n", tmpfname); iof = IEEEopen (tmpfname, "w"); if (! IOisValid (iof)) { @@ -260,17 +260,17 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) CactusResetTimer (&write_time); CactusStartTimer (&write_time); - if (output_verbose) + if (verbose) printf ("Dumping Params ...\n -- "); /* first the parameters ... */ if (iof) { /*** FIXME ***/ #if 0 - if (output3d_parameters) + if (out3D_parameters) IOFlexIO_IEEEIOparamDump (iof); #endif - if (output3d_structures) + if (out3D_structures) IOFlexIO_IEEEIOStructDump (GH, iof); } @@ -284,7 +284,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) CCTK_GroupIndexFromVarI (index))) continue; - if (output_verbose) { + if (verbose) { char *varname = CCTK_VarName (index); printf (" %s", varname); @@ -309,7 +309,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) CACTUS_IEEEIO_ERROR (IOclose (iof)); - if (output_verbose) + if (verbose) printf ("\nTime to write: %f sec (%f sec per Grid Func)\n", /*** FIXME: choose right component of basic[] ***/ write_time.total.basic [0], @@ -350,7 +350,7 @@ void IOFlexIO_DumpGH (cGH *GH, int called_from) ioUtilGH->downsample_z = old_downsample_z; CactusStopTimer (&total_time); - if (output_verbose) { + if (verbose) { /*** FIXME: choose right component of basic[] ***/ printf ("Time to checkpoint: %f sec\n", total_time.total.basic [0]); printf ("------------------------------------------------------------\n"); diff --git a/src/DumpVar.c b/src/DumpVar.c index 29a90d9..76b5d42 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -422,7 +422,7 @@ void IOFlexIO_DumpGF (cGH *GH, int index, int timelevel, IOFile iof, /* DATA SEND */ CACTUS_MPI_ERROR (MPI_Send (outme, outgoing, mpi_type, ioUtilGH->ioproc, 2*myproc+IOTAGBASE, pughGH->PUGH_COMM_WORLD)); - if (output_verbose) { + if (verbose) { printf ("Sent %d data points\n", outgoing); fflush (stdout); } @@ -543,7 +543,7 @@ void IOFlexIO_AddCommonAttributes (cGH *GH, int index, int timelevel, CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "timelevel", FLEXIO_INT4, 1, &i_to_IO)); - if (char_time_date && output3d_datestamp) + if (char_time_date && out3D_datestamp) CACTUS_IEEEIO_ERROR (IOwriteAttribute (iof, "date", BYTE, strlen (char_time_date) + 1, char_time_date)); @@ -752,7 +752,7 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, if (GH->cctk_gsh[2] % ioUtilGH->downsample_z) bnd [8]++; - if (output_verbose) + if (verbose) printf ("Downsampled sizes (%d, %d, %d) -> (%d, %d, %d)\n", GH->cctk_gsh[0], GH->cctk_gsh[1], GH->cctk_gsh[2], (int) bnd [6], (int) bnd [7], (int) bnd [8]); @@ -782,7 +782,7 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, bnd [i+3] = (end [i] - start [i]) / downsample + 1; } - if (output_verbose) { + if (verbose) { printf ("Downsample ranges (%d, %d, %d) -> (%d, %d, %d)\n", start [0], start [1], start [2], end [0], end [1], end [2]); @@ -841,7 +841,7 @@ void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel, void **outme, } } - if (output_verbose) { + if (verbose) { printf ("Global size: %d %d %d\n", (int) bnd [6], (int) bnd [7], (int) bnd [8]); printf ("Lower bound: %d %d %d\n", diff --git a/src/GHExtension.c b/src/GHExtension.c index 20a6d48..cdbcc85 100644 --- a/src/GHExtension.c +++ b/src/GHExtension.c @@ -65,23 +65,23 @@ int IOFlexIO_InitGH (cGH *GH) myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; /* How often to output */ - myGH->IO_2Devery = output_every; - myGH->IO_3Devery = output_every; - if (output2d_every > 0) - myGH->IO_2Devery = output2d_every; - if (output3d_every > 0) - myGH->IO_3Devery = output3d_every; + myGH->IO_2Devery = out_every; + myGH->IO_3Devery = out_every; + if (out2D_every > 0) + myGH->IO_2Devery = out2D_every; + if (out3D_every > 0) + myGH->IO_3Devery = out3D_every; - InitIONum (myGH->IO_2Dnum, output2D); - InitIONum (myGH->IO_3Dnum, output3D); + InitIONum (myGH->IO_2Dnum, out2D_vars); + InitIONum (myGH->IO_3Dnum, out3D_vars); /* Deal with the output directories */ myGH->outpfx_2D = outdir; myGH->outpfx_3D = outdir; - if (!CCTK_Equals(outdir2d,"outdir")) - myGH->outpfx_2D = outdir2d; - if (!CCTK_Equals(outdir3d,"outdir")) - myGH->outpfx_3D = outdir3d; + if (!CCTK_Equals(outdir2D,"outdir")) + myGH->outpfx_2D = outdir2D; + if (!CCTK_Equals(outdir3D,"outdir")) + myGH->outpfx_3D = outdir3D; /* Create the output directories */ if (myGH->IO_2Devery > 0) { @@ -108,20 +108,20 @@ int IOFlexIO_InitGH (cGH *GH) for (i=0; i<CCTK_NumVars(); i++) myGH->IO_2Dlast [i] = myGH->IO_3Dlast [i] = -1; - myGH->reuse_fh = reuse_fh; + myGH->out3d_reuse_filehandles = out3d_reuse_filehandles; /* Only have reuse for chunked data */ - if (myGH->reuse_fh && ! ioUtilGH->unchunked) { + if (myGH->out3d_reuse_filehandles && ! ioUtilGH->unchunked) { CCTK_WARN (2, "Cannot reuse handles with unchunked data. " - "Ignoring parameter 'reuse_fh'"); - myGH->reuse_fh = 0; + "Ignoring parameter 'out3d_reuse_filehandles'"); + myGH->out3d_reuse_filehandles = 0; } /* Only have reuse if not one file per slice */ - if (myGH->reuse_fh && onefileperslice) { - CCTK_WARN (2, "Cannot reuse handles with 'onefileperslice = yes'. " - "Ignoring parameter 'reuse_fh'"); - myGH->reuse_fh = 0; + if (myGH->out3d_reuse_filehandles && out3D_septimefiles) { + CCTK_WARN (2, "Cannot reuse handles with 'out3D_septimefiles = yes'. " + "Ignoring parameter 'out3d_reuse_filehandles'"); + myGH->out3d_reuse_filehandles = 0; } myGH->filenameList2D = NULL; diff --git a/src/Output2D.c b/src/Output2D.c index 34ee6ca..a8e5631 100644 --- a/src/Output2D.c +++ b/src/Output2D.c @@ -73,7 +73,7 @@ int IOFlexIO_Output2DGH (cGH *GH) name = CCTK_VarName (i); fullname = CCTK_FullName (i); - if (output_verbose) { + if (verbose) { printf("IOFlexIO Output2DGH : \n"); printf(" fullname/name = %s/%s\n", fullname, name); } @@ -140,7 +140,7 @@ int IOFlexIO_Output2DVarAs (cGH *GH, const char *fullname, const char *alias) /* get the handle for IOFlexIO extensions */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (output_verbose) { + if (verbose) { printf ("\nIn IOFlexIO Output2DVarAs\n-------------------\n"); printf (" Fullname = -%s-\n", fullname); printf (" Alias = -%s-\n", alias); @@ -261,7 +261,7 @@ int IOFlexIO_TriggerOutput2D (cGH *GH, int index) /* get the handle for IOFlexIO extensions */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (output_verbose) { + if (verbose) { printf("\nIn IOFlexIO TriggerOutput2D\n---------------------\n"); printf(" Index = %d\n", index); printf(" Variable = -%s-\n", varname); diff --git a/src/Output3D.c b/src/Output3D.c index 66fc156..02d8248 100644 --- a/src/Output3D.c +++ b/src/Output3D.c @@ -77,7 +77,7 @@ int IOFlexIO_Output3DGH (cGH *GH) assert (fullname); sprintf (fullname, "%s::%s", implementation, name); - if (output_verbose) { + if (verbose) { printf ("IOFlexIO Output3DGH : \n"); printf (" fullname/name = %s/%s\n", fullname, name); } @@ -144,7 +144,7 @@ int IOFlexIO_Output3DVarAs (cGH *GH, const char *fullname, const char *alias) /* Get the GH extension for IOFlexIO */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (output_verbose) { + if (verbose) { printf ("\nIn IOFlexIO Output3DVarAs\n-------------------\n"); printf (" Fullname = -%s-\n", fullname); printf (" Alias = -%s-\n", alias); @@ -264,7 +264,7 @@ int IOFlexIO_TriggerOutput3D (cGH *GH, int index) /* Get the GH extension for IOFlexIO */ myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (output_verbose) { + if (verbose) { printf("\nIn IOFlexIO TriggerOutput3D\n---------------------\n"); printf(" Index = %d\n", index); printf(" Variable = -%s-\n", varname); diff --git a/src/RecoverGH.c b/src/RecoverGH.c index 57bb524..1623450 100644 --- a/src/RecoverGH.c +++ b/src/RecoverGH.c @@ -125,7 +125,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) strcat (fname, ".chkpt"); strcat (fname, ".ieee"); - if (output_verbose) + if (verbose) printf ("Opening file %s\n", fname); /* Open file, make sure the file is valid */ @@ -133,7 +133,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) if (IOisValid (ifp)) is_IEEEIO_file = 1; else { - if (output_verbose) + if (verbose) printf ("Cannot open file '%s'\n", fname); /* now try with the other chunking mode */ @@ -143,7 +143,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) if (called_from == CP_RECOVER_DATA) strcat (fname, ".chkpt"); strcat (fname, ".ieee"); - if (output_verbose) + if (verbose) printf ("Trying now file '%s'...\n", fname); /* Open file, make sure the file is valid */ @@ -195,7 +195,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) */ if (file_ioproc_every == nprocs || file_unchunked) { - if (output_verbose) + if (verbose) printf ("Recovering from one %s file\n", file_unchunked ? "unchunked" : "chunked"); } else { @@ -204,7 +204,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) "or recombine them", file_nprocs); CCTK_WARN (0, msg); } - if (output_verbose) + if (verbose) printf ("Recovering from %d chunked files\n", nprocs / file_ioproc_every + (nprocs % file_ioproc_every?1:0)); } @@ -213,12 +213,13 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) #ifdef MPI /* Broadcast chunking mode to all processors from processor zero */ info [0] = is_IEEEIO_file; - info [1] = unchunked; + info [1] = out3D_unchunked; info [2] = file_ioproc_every; CACTUS_MPI_ERROR (MPI_Bcast (info, 3, PUGH_MPI_INT, 0, pughGH->PUGH_COMM_WORLD)); is_IEEEIO_file = info [0]; - unchunked = info [1]; + /* FIXME: Parameter on LHS */ + out3D_unchunked = info [1]; file_ioproc_every = info [2]; #endif @@ -243,7 +244,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) /* Open chunked files on other IO processors */ if (myproc != 0 && myproc == file_ioproc) { - if (output_verbose) + if (verbose) printf ("Opening chunked file '%s' on processor %d.\n", fname, myproc); @@ -257,7 +258,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) } /* Restore the data */ - if (output_verbose && myproc == 0) + if (verbose && myproc == 0) printf ("Recovering %schunked data with ioproc %d, ioproc_every %d.\n", file_unchunked ? "un" : "", file_ioproc, file_ioproc_every); @@ -268,7 +269,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) /* Close the file. */ if (myproc == file_ioproc) { - if (output_verbose) + if (verbose) printf ("Closing file '%s' after recovery.\n", fname); IOclose (ifp); } @@ -292,14 +293,14 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) } /* Restore the parameters. */ - if (output_verbose) + if (verbose) printf ("Recovering parameters on processor %d.\n", myproc); /*** FIXME ***/ #if 0 IO_IEEEIOparamRestore (ifp, myproc); /* Restore the structure variables. */ - if (output_verbose) + if (verbose) printf ("Recovering GH variables.\n"); IO_IEEEIOStructRestore (GH, ifp); #endif @@ -307,20 +308,20 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) /* Restore global variables */ /* Get the iteration number. */ - if (output_verbose) + if (verbose) printf ("Recovering iteration number.\n"); index = IOreadAttributeInfo (ifp, "iteration", &nt_stored, &nels_stored); if (index >= 0 && nt_stored == FLEXIO_INT4 && nels_stored == 1) { IOreadAttribute (ifp, index, &iteration_stored); - if (output_verbose) + if (verbose) printf ("Iteration number is %d\n", (int) iteration_stored); GH->cctk_iteration = iteration_stored; } else printf ("*Warning* Unable to restore iteration number\n"); /* Close the file. */ - if (output_verbose) + if (verbose) printf ("Closing '%s' after recovery.\n", fname); IOclose (ifp); } @@ -332,7 +333,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from) } /* print timing output */ - if (output_verbose && called_from == CP_RECOVER_DATA && myproc == 0) { + if (verbose && called_from == CP_RECOVER_DATA && myproc == 0) { printf ( "----------------------------------------------------------------\n"); /*** FIXME: choose right component of basic[] ***/ diff --git a/src/RestoreFile.c b/src/RestoreFile.c index 659f8d8..3879225 100644 --- a/src/RestoreFile.c +++ b/src/RestoreFile.c @@ -308,7 +308,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, /* Get the number of sets */ nDatasets = IOnDatasets (ifp); - if (output_verbose) + if (verbose) printf (" Input file has %d datasets\n", nDatasets); } @@ -357,7 +357,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, /* Read in the data */ else { - if (output_verbose) { + if (verbose) { char *varname = CCTK_FullName (index); printf (" dataset %d: %s (timelevel %d)\n", currentDataset, @@ -425,7 +425,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, if (gtype != GROUP_SCALAR) { - if (! unchunked) { + if (! out3D_unchunked) { /* Also increment dataset counter here !!! */ currentDataset++; if (GetChunkAttributes (GH, ifp, index)) { diff --git a/src/Write2D.c b/src/Write2D.c index 9b627dc..b4e27d3 100644 --- a/src/Write2D.c +++ b/src/Write2D.c @@ -114,7 +114,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) myproc = CCTK_MyProc (GH); nprocs = CCTK_nProcs (GH); - if (output_verbose) { + if (verbose) { printf ("<><><><><><><><><><><><><><><><><>\n"); printf ("2D Slice for [%s]\n", alias); #if 0 @@ -240,7 +240,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) nj = GH->cctk_gsh[1]; origin[1] = 0.0; delta[1] = pughGH->dy0; } - if (output_verbose) { + if (verbose) { printf ("Npoints in dir %d is %d -> ",dir,npoints); printf ("Global npoints is %d\n",ngpoints); } @@ -250,7 +250,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) CACTUS_MPI_ERROR (MPI_Gather (&npoints, 1, PUGH_MPI_INT, nrempoints, 1, PUGH_MPI_INT, 0, pughGH->PUGH_COMM_WORLD)); - if (output_verbose && myproc == 0) + if (verbose && myproc == 0) for (i = 0; i < nprocs; i++) printf ("From proc %d: %d\n", i, (int) nrempoints [i]); @@ -263,7 +263,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) for (i = 0; i < nprocs; i++) maxrempt = (nrempoints [i] > maxrempt ? nrempoints [i] : maxrempt); - if (output_verbose) + if (verbose) printf ("Maximum remote points: %d\n", maxrempt); /* OK so we want the ordering in bnd to be yz xz or xy but the @@ -298,7 +298,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) bnd [hi+1] = 0; } - if (output_verbose) + if (verbose) printf ("Local bounds %d: j -> %d %d k -> %d %d\n", dir, locbnd [0], locbnd [1], locbnd [2], locbnd [3]); @@ -369,7 +369,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) for (i = 0; i < nprocs; i++) { void *ud; - if (output_verbose) + if (verbose) printf ("Proceesing proc %d\n",i);fflush(stdout); if (nrempoints [i] > 0) { @@ -377,7 +377,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) ud = locdat; else { - if (output_verbose) { + if (verbose) { printf ("Receiving %d from %d\n", nrempoints [i], i); fflush (stdout); } @@ -388,7 +388,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) i, 2*i+BASE, pughGH->PUGH_COMM_WORLD, &ms)); ud = recd; - if (output_verbose) { + if (verbose) { printf (" Received %d points from %d\n", (int) nrempoints [i], i); printf (" Data lives at [%d %d] -> [%d %d]\n", @@ -397,7 +397,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) } /* End proc != 0 */ - if (output_verbose) + if (verbose) printf ("Remote Bounds %d: j -> %d %d k -> %d %d\n", dir, (int) bnd [0], (int) bnd[1], (int)bnd[2], (int)bnd[3]); @@ -462,7 +462,7 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias) free (nrempoints); #if 0 - if (output_verbose) + if (verbose) cactus_memtrace(); #endif } diff --git a/src/Write3D.c b/src/Write3D.c index ea34b45..2d30a43 100644 --- a/src/Write3D.c +++ b/src/Write3D.c @@ -149,7 +149,7 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias) ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")]; myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (output_verbose) { + if (verbose) { printf ("-------------------------------------------------------\n"); printf ("3D I/O on Grid Function %s\n", alias); printf (" downsample (x,y,z): (%d,%d,%d) ioproc : %d\n", @@ -177,8 +177,8 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias) * Also I have some vague recollection of needing it in some * very strange case ... So leave it here for now (PW 11.5.98) */ - if (IEEEfile_3D->iofile >= 0 && onefileperslice) { - if (output_verbose) + if (IEEEfile_3D->iofile >= 0 && out3D_septimefiles) { + if (verbose) printf ("Closing IEEEfile from previous iteration.\n"); CACTUS_IEEEIO_ERROR (IOclose (IEEEfile_3D->iofile)); IEEEfile_3D->iofile = -1; /* prevent attempts to close it twice! */ @@ -214,7 +214,7 @@ void IOFlexIO_Write3D (cGH *GH, int index, const char *alias) IOFlexIO_Write3D_closeFile (GH, IEEEfile_3D); } - if (output_verbose) + if (verbose) printf ("-------------------\n"); } @@ -244,18 +244,18 @@ void IOFlexIO_Write3D_closeFile (cGH *GH, IEEEfile_3D_t *IEEEfile_3D) myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")]; - if (myGH->reuse_fh) { - if (output_verbose) + if (myGH->out3d_reuse_filehandles) { + if (verbose) printf ("Pausing file %s\n", IEEEfile_3D->filename); IEEEbufferOff (IEEEfile_3D->iofile); CACTUS_IEEEIO_ERROR (IOpause (IEEEfile_3D->iofile)); } else { - if (output_verbose) + if (verbose) printf ("Closing file %s\n", IEEEfile_3D->filename); CACTUS_IEEEIO_ERROR (IOclose (IEEEfile_3D->iofile)); } - if (onefileperslice) + if (out3D_septimefiles) free (IEEEfile_3D); } @@ -289,7 +289,7 @@ void IOFlexIO_Write3D_openFile (cGH *GH, IEEEfile_3D_t *IEEEfile_3D, if (isNewFile) { /* First time through or one file per slice; open anew */ - if (output_verbose) + if (verbose) printf ("Opening file '%s'\n", IEEEfile_3D->filename); IEEEfile_3D->iofile = IEEEopen (IEEEfile_3D->filename, "w"); @@ -302,23 +302,23 @@ void IOFlexIO_Write3D_openFile (cGH *GH, IEEEfile_3D_t *IEEEfile_3D, free (msg); } - } else if (myGH->reuse_fh) { + } else if (myGH->out3d_reuse_filehandles) { /* resume the file (reopen descriptor) This allows descriptor reuse without requiring expensive destruction and reallocation of the associated datastructures */ - if (output_verbose) + if (verbose) printf ("Resuming file '%s'\n", IEEEfile_3D->filename); CACTUS_IEEEIO_ERROR (IOresume (IEEEfile_3D->iofile)); } else { - /* File is closed, not onefileperslice and not first time. + /* File is closed, not out3D_septimefiles and not first time. Therefore we must be conserving file handles and failed to use the pause()/resume methods(), So append. */ - if (output_verbose) + if (verbose) printf ("Re-opening file '%s' in append mode\n", IEEEfile_3D->filename); IEEEfile_3D->iofile = IEEEopen (IEEEfile_3D->filename, "a"); @@ -388,7 +388,7 @@ IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias, int *isNewFile) sprintf (extra, "%s_chunked", extra); #endif - if (onefileperslice) { + if (out3D_septimefiles) { char *tmp = extra; sprintf (extra, "%s.time_%7.3f", extra, GH->cctk_time); @@ -419,7 +419,7 @@ IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias, int *isNewFile) sprintf (createdir, "mkdir -p %s/%s_3d", myGH->outpfx_3D, alias); - if (output_verbose) { + if (verbose) { printf ("Creating output directory with command\n %s\n", createdir); fflush (stdout); } @@ -453,7 +453,7 @@ IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias, int *isNewFile) extradir, alias, extra); /* no need to store file info if used only once */ - if (! onefileperslice) + if (! out3D_septimefiles) StoreNamedData (&myGH->fileList_3D, alias, IEEEfile_3D); /* set flag to indicate that file should be opened in create mode */ diff --git a/src/ioFlexGH.h b/src/ioFlexGH.h index 3513476..add3ee2 100644 --- a/src/ioFlexGH.h +++ b/src/ioFlexGH.h @@ -87,7 +87,7 @@ typedef struct IOFlexIOGH { IOFile *IEEEfile_3D; /* reuse filehandles during IEEEIO */ - int reuse_fh; + int out3d_reuse_filehandles; /* filename database for opened files */ pNamedData *filenameList2D; |