aboutsummaryrefslogtreecommitdiff
path: root/CarpetAttic
diff options
context:
space:
mode:
authorcott <>2004-01-07 12:14:00 +0000
committercott <>2004-01-07 12:14:00 +0000
commitcad6c597fd298c92028ff7395aeab382978cd538 (patch)
treec557fe7ccbcf077165d5b975b30b15e17e5e1a1f /CarpetAttic
parent582c4e8e8c75b630d734f966300e574e353efa7d (diff)
removed obsolete function WriteGS
darcs-hash:20040107121404-19929-279507a275e8bcb9b2ae29c5eb0e87d86b2c34cd.gz
Diffstat (limited to 'CarpetAttic')
-rw-r--r--CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc36
-rw-r--r--CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc93
-rw-r--r--CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh3
3 files changed, 24 insertions, 108 deletions
diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc
index 30a32641d..c01c1d99b 100644
--- a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc
+++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc
@@ -48,7 +48,7 @@
#include "ioflexio.hh"
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc,v 1.17 2004/01/07 12:57:56 cott Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc,v 1.18 2004/01/07 13:14:04 cott Exp $";
CCTK_FILEVERSION(Carpet_CarpetIOFlexIO_checkpointrestart_cc);
}
@@ -64,7 +64,7 @@ namespace CarpetCheckpointRestart {
int RecoverParameters (IObase* reader);
int RecoverGHextensions (cGH* cgh, IObase* reader);
- int RecoverVariables (cGH* cgh, IObase* reader);
+ int RecoverVariables (cGH* cgh, IObase* reader, AmrGridReader* amrreader);
void CarpetIOFlexIO_EvolutionCheckpoint( const cGH* const cgh){
@@ -228,28 +228,32 @@ int CarpetIOFlexIO_Recover (cGH* cgh, const char *basefilename, int called_from)
return (RecoverParameters (reader));
}
+
if (called_from == CP_RECOVER_DATA) {
+ if(myproc ==0){
+ AmrGridReader* amrreader = 0;
+ amrreader = new AmrGridReader(*reader);
- BEGIN_REFLEVEL_LOOP(cgh) {
- BEGIN_MGLEVEL_LOOP(cgh) {
-
+ BEGIN_REFLEVEL_LOOP(cgh) {
+ BEGIN_MGLEVEL_LOOP(cgh) {
+
/* Recover GH extentions */
- CCTK_INFO ("Recovering GH extensions");
- result = RecoverGHextensions (cgh, reader);
-
+ CCTK_INFO ("Recovering GH extensions");
+ result = RecoverGHextensions (cgh, reader);
+
if (! result)
{
/* Recover variables */
CCTK_VInfo (CCTK_THORNSTRING, "Recovering data! ");
- result = RecoverVariables (cgh, reader);
+ result = RecoverVariables (cgh, reader,amrreader);
}
+
+ } END_MGLEVEL_LOOP;
+ } END_REFLEVEL_LOOP;
- } END_MGLEVEL_LOOP;
- } END_REFLEVEL_LOOP;
-
- if (myproc == 0)
delete reader;
-
+ delete amrreader;
+ }
}
@@ -766,11 +770,13 @@ int CarpetIOFlexIO_Recover (cGH* cgh, const char *basefilename, int called_from)
return 0;
}
- int RecoverVariables (cGH* cgh, IObase* reader){
+ int RecoverVariables (cGH* cgh, IObase* reader, AmrGridReader* amrreader){
CCTK_VInfo(CCTK_THORNSTRING,"Starting to recover data for refinement level %d",reflevel);
+
+
return 0;
}
diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc
index eb4558896..3a817202a 100644
--- a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc
+++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc
@@ -45,7 +45,7 @@
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc,v 1.14 2004/01/07 12:57:56 cott Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc,v 1.15 2004/01/07 13:14:04 cott Exp $";
CCTK_FILEVERSION(Carpet_CarpetIOFlexIO_ioflexio_cc);
}
@@ -323,99 +323,10 @@ namespace CarpetIOFlexIO {
} END_COMPONENT_LOOP;
- return 0;
- }
-
- int WriteGS (const cGH* const cgh, IObase* writer, ioRequest* request)
- {
-#warning This function should be obsolete by now!!!
- // writes out a grid scalar
-
- DECLARE_CCTK_PARAMETERS;
-
- const int timelevel = request->timelevel;
- const int varindex = request->vindex;
-
- const int group = CCTK_GroupIndexFromVarI (varindex);
- const int n0 = CCTK_FirstVarIndexI(group);
- assert (n0>=0 && n0<CCTK_NumVars());
- const int var = varindex - n0;
- assert (var>=0 && var<CCTK_NumVars());
- const int tl = 0;
- const int grouptype = CCTK_GroupTypeI(group);
- assert (! (grouptype != CCTK_SCALAR && reflevel>0));
-
-
- int myproc = CCTK_MyProc (cgh);
- int nprocs = CCTK_nProcs (cgh);
- char* fullname = CCTK_FullName (varindex);
-
- int datatype = CCTK_VarTypeI(varindex);
- int datatypesize = CCTK_VarTypeSize(datatype);
-
- char* buffer = (char*) calloc (nprocs, datatypesize);
- memcpy (buffer + myproc*datatypesize,
- CCTK_VarDataPtrI (cgh,timelevel,varindex),
- datatypesize);
-
- if (nprocs > 1) {
- int i = CCTK_ReductionHandle ("sum");
- if (i >= 0)
- {
- i = CCTK_ReduceArray (cgh, -1, i, nprocs, datatype, buffer, 1, 1, datatype, nprocs, buffer);
- }
- if (i < 0)
- {
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "WriteGS: Cannot check whether values on differentprocessors are the same for grid scalar '%s'", fullname);
- // copy this processor's value to the start of buffer
- memcpy (buffer, buffer + myproc*datatypesize, datatypesize);
- }
- else
- {
- int retval = 0;
- for (i = 1; i < nprocs; i++)
- {
- retval |= memcmp (buffer, buffer + i*datatypesize, datatypesize);
- }
- if (retval)
- {
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "WriteGS: value of grid scalar variable '%s' (timelevel %d)"
- " differs between processors, only value from processor 0 "
- "will be written", fullname, timelevel);
- }
- }
- }
-
- if (myproc==0)
- {
- int dim = 1;
-
- // Traverse all components on this refinement and multigrid level
- BEGIN_COMPONENT_LOOP(cgh, grouptype) {
-
- // actually, looping makes no sense here, since a scalar must be the
- // same on all components. in fact, the loop is not being
- // executed for scalars; see macro definition.
-
- if (verbose)
- CCTK_VInfo (CCTK_THORNSTRING, "SCALAR reflevel,component,mglevel %d,%d,%d",reflevel,component,mglevel);
-
- writer->write(FlexIODataType(CCTK_VarTypeI(varindex)),1,&dim,buffer);
- /* scalars have size 0 */
- request->hsize[0] = 0;
- DumpCommonAttributes (cgh,writer,request);
-
- } END_COMPONENT_LOOP;
-
- }
-
- return 0;
+ return 0;
}
-
int OutputVarAs (const cGH* const cgh, const char* const varname,
const char* const alias) {
DECLARE_CCTK_PARAMETERS;
diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh
index f8ca0b2f4..181798404 100644
--- a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh
+++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh,v 1.9 2004/01/07 12:57:56 cott Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.hh,v 1.10 2004/01/07 13:14:04 cott Exp $
#ifndef CARPETIOFLEXIO_HH
#define CARPETIOFLEXIO_HH
@@ -137,7 +137,6 @@ namespace CarpetIOFlexIO {
const char* const fallback);
int WriteGF (const cGH* const cgh, IObase* writer, AMRwriter* amrwriter, ioRequest* request);
- int WriteGS (const cGH* const cgh, IObase* writer, ioRequest* request);
} // namespace CarpetIOFlexIO