aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorcott <>2004-03-16 13:40:00 +0000
committercott <>2004-03-16 13:40:00 +0000
commit9e54a0491eac69e7903fd88ab3a107101e217146 (patch)
tree74d20512c2c0db87a5994c95139030f24139327a /Carpet
parent4f6d50ce61b4b7a221a3e3d3f4c9d6c91cf2fe7f (diff)
Minor polishing.
darcs-hash:20040316134004-19929-58dd01e248958bcfb9f9df396d6c4122cc1c2b0e.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/CarpetIOHDF5/src/iohdf5.cc38
-rw-r--r--Carpet/CarpetIOHDF5/src/iohdf5chckpt_recover.cc31
2 files changed, 15 insertions, 54 deletions
diff --git a/Carpet/CarpetIOHDF5/src/iohdf5.cc b/Carpet/CarpetIOHDF5/src/iohdf5.cc
index c7b0e3f87..f8dafbb8d 100644
--- a/Carpet/CarpetIOHDF5/src/iohdf5.cc
+++ b/Carpet/CarpetIOHDF5/src/iohdf5.cc
@@ -17,7 +17,7 @@
#include "cctk_Parameters.h"
extern "C" {
- static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5.cc,v 1.19 2004/03/15 23:45:24 cott Exp $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5.cc,v 1.20 2004/03/16 14:40:04 cott Exp $";
CCTK_FILEVERSION(Carpet_CarpetIOHDF5_iohdf5_cc);
}
@@ -42,8 +42,6 @@ namespace CarpetIOHDF5 {
using namespace Carpet;
-
-
// Variable definitions
int GHExtension;
int IOMethod;
@@ -343,29 +341,8 @@ namespace CarpetIOHDF5 {
const hid_t dataspace = H5Screate_simple (ldim, shape, NULL);
assert (dataspace>=0);
- //cout << varname << endl;
- // if ( CCTK_Equals("CARPETIOASCII::next_output_iteration",varname) ) {
- // const int * testdata = (int * ) tmp->storage();
- // cout << "testdata: " << ((int *)h5data)[0] << endl;
- //}
-
-// hsize_t shape[dim];
-// for (int d=0; d<dim; ++d) {
-// shape[dim-1-d] = (ext.shape() / ext.stride())[d];
-// }
-// const hid_t dataspace = H5Screate_simple (dim, shape, NULL);
-// assert (dataspace>=0);
-//
- // Select datatype
-#if 0
- assert (true
- || (CCTK_VarTypeI(n) == CCTK_VARIABLE_REAL8
- && sizeof(CCTK_REAL8) == sizeof(double))
- || (CCTK_VarTypeI(n) == CCTK_VARIABLE_REAL
- && sizeof(CCTK_REAL) == sizeof(double)));
- // TODO: Set datatype correctly
-#endif
+ // Select datatype
const hid_t datatype = h5DataType(CCTK_VarTypeI(n));
@@ -786,11 +763,12 @@ namespace CarpetIOHDF5 {
ub[i]=0;
}
} else {
- // lb[dim-1] = lb[dim-1] + (ub[dim-1]-lb[dim-1]+1)*(arrdata[group][Carpet::map].hh->processors.at(rl).at(component));
- //ub[dim-1] = ub[dim-1] + (ub[dim-1]-lb[dim-1]+1)*(arrdata[group][Carpet::map].hh->processors.at(rl).at(component));
- const int newlb = lb[gpdim-1] + (ub[gpdim-1]-lb[gpdim-1]+1)*(arrdata[group][Carpet::map].hh->processors.at(rl).at(component));
- const int newub = ub[gpdim-1] + (ub[gpdim-1]-lb[gpdim-1]+1)*(arrdata[group][Carpet::map].hh->processors.at(rl).at(component));
- cout << (ub[gpdim-1]-lb[gpdim-1]+1)*(arrdata[group][Carpet::map].hh->processors.at(rl).at(component)) << endl;
+ const int newlb = lb[gpdim-1] +
+ (ub[gpdim-1]-lb[gpdim-1]+1)*
+ (arrdata[group][Carpet::map].hh->processors.at(rl).at(component));
+ const int newub = ub[gpdim-1] +
+ (ub[gpdim-1]-lb[gpdim-1]+1)*
+ (arrdata[group][Carpet::map].hh->processors.at(rl).at(component));
lb[gpdim-1] = newlb;
ub[gpdim-1] = newub;
}
diff --git a/Carpet/CarpetIOHDF5/src/iohdf5chckpt_recover.cc b/Carpet/CarpetIOHDF5/src/iohdf5chckpt_recover.cc
index 7d062bc05..8c077c6da 100644
--- a/Carpet/CarpetIOHDF5/src/iohdf5chckpt_recover.cc
+++ b/Carpet/CarpetIOHDF5/src/iohdf5chckpt_recover.cc
@@ -18,7 +18,7 @@
#include "cctk_Version.h"
extern "C" {
- static const char* rcsid = "$ $";
+ static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetIOHDF5/src/iohdf5chckpt_recover.cc,v 1.10 2004/03/16 14:40:04 cott Exp $";
CCTK_FILEVERSION(Carpet_CarpetIOHDF5_iohdf5chckpt_recover_cc);
}
@@ -63,13 +63,10 @@ namespace CarpetIOHDF5 {
((checkpoint_every > 0 && cgh->cctk_iteration % checkpoint_every == 0) ||
checkpoint_next))
{
- if (h5verbose)
- {
- CCTK_INFO ("---------------------------------------------------------");
- CCTK_VInfo (CCTK_THORNSTRING, "Dumping periodic checkpoint at "
- "iteration %d", cgh->cctk_iteration);
- CCTK_INFO ("---------------------------------------------------------");
- }
+ CCTK_INFO ("---------------------------------------------------------");
+ CCTK_VInfo (CCTK_THORNSTRING, "Dumping periodic checkpoint at "
+ "iteration %d", cgh->cctk_iteration);
+ CCTK_INFO ("---------------------------------------------------------");
Checkpoint (cgh, CP_EVOLUTION_DATA);
@@ -154,8 +151,6 @@ namespace CarpetIOHDF5 {
// Actually, we do have to do this only once
- // if(reflevel==0){
-
hid_t group = H5Gopen (reader, PARAMETERS_GLOBAL_ATTRIBUTES_GROUP);
assert(group>=0);
hid_t dataset = H5Dopen (group, ALL_PARAMETERS);
@@ -187,12 +182,11 @@ namespace CarpetIOHDF5 {
} else {
CCTK_WARN(0,"BAD BAD BAD! Can't read leveltimes!!");
}
- // Now let us recover the GHextentions
+ } // myproc == 0
- //} // if reflevel==0
- } // myproc == 0
+ // communicate the time on all the mglevels and reflevels
int mpierr = MPI_Bcast (&numberofmgtimes, 1, CARPET_MPI_INT4, 0,MPI_COMM_WORLD);
assert(!mpierr);
@@ -207,13 +201,8 @@ namespace CarpetIOHDF5 {
cctkGH->cctk_time = leveltimes[mglevel][reflevel];
- // int ibuffer = cctkGH->cctk_time;
- //mpierr = MPI_Bcast (&ibuffer,1,MPI_INT,MPI_COMM_WORLD);
-
result += RecoverGHextensions(cctkGH,reader);
- // set tt (ask Erik why...)
- // arrdata[0][0].tt->set_time(reflevel,mglevel,(CCTK_REAL) cctkGH->cctk_iteration/maxreflevelfact);
if (h5verbose) cout << "reflevel: " << reflevel << endl;
result += RecoverVariables (cctkGH,reader);
@@ -227,9 +216,6 @@ namespace CarpetIOHDF5 {
if (myproc == 0 && reflevel==maxreflevels)
H5Fclose(reader);
-
- // CCTK_WARN (-1,"Sorry, this feature is not implemented yet.");
-
return (result);
} // CarpetIOHDF5_Recover
@@ -628,9 +614,6 @@ namespace CarpetIOHDF5 {
} // myproc == 0
} // retval == 0
-
- // CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,"This feature is not working yet. Sorry!");
-
return retval;
} // Checkpoint