diff options
author | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2000-01-21 18:00:59 +0000 |
---|---|---|
committer | tradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a> | 2000-01-21 18:00:59 +0000 |
commit | 400e340a12e6019f91ded50e5ba1791ee04edda0 (patch) | |
tree | d1e719baf82aa32efd45d36bf6b3ec7aec66713e /src/RestoreFile.c | |
parent | d58e1c47d498896b0c1f208724c7d138abce6349 (diff) |
Added several stuff to IOFlexIO:
- checkpointing/recovery of parameters
- made 'out2D_every', 'out2D_vars', 'out3D_every' and 'out3D_vars' steerable
- fixed compiler warnings
- grdocs
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@78 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/RestoreFile.c')
-rw-r--r-- | src/RestoreFile.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/RestoreFile.c b/src/RestoreFile.c index fbbf125..51528f1 100644 --- a/src/RestoreFile.c +++ b/src/RestoreFile.c @@ -87,7 +87,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, int file_ioproc_every, int file_unchunked) { DECLARE_CCTK_PARAMETERS - int index, gtype; + int i, index, gtype; int myproc, nprocs; int nDatasets, currentDataset; int timelevel; /* current timelevel to be restored */ @@ -174,7 +174,7 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, else { int npoints; void *buffer; - int chunkdims [3], *chunkorigin; + int chunkdims [3], chunkorigin [3]; int element_size, mpi_type; switch (CCTK_VarTypeI (index)) { @@ -187,10 +187,13 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, case CCTK_VARIABLE_REAL: element_size = sizeof (CCTK_REAL); mpi_type = PUGH_MPI_REAL; break; +#if 0 +/* FIXME: Don't know how to support COMPLEX types too !! */ case CCTK_VARIABLE_COMPLEX: element_size = sizeof (CCTK_COMPLEX); mpi_type = pughGH->pugh_mpi_complex; break; +#endif default: CCTK_WARN (1, "Unsupported datatype"); continue; @@ -202,10 +205,10 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, CACTUS_IEEEIO_ERROR ( IOread (ifp, CCTK_VarDataPtrI (GH, timelevel, index))); else { - chunkdims [0] = pughGH->rnsize [file_ioproc][0]; - chunkdims [1] = pughGH->rnsize [file_ioproc][1]; - chunkdims [2] = pughGH->rnsize [file_ioproc][2]; - chunkorigin = pughGH->lb [file_ioproc]; + for (i = 0; i < 3; i++) { + chunkdims [i] = pughGH->rnsize [file_ioproc][i]; + chunkorigin [i] = pughGH->lb [file_ioproc][i]; + } CACTUS_IEEEIO_ERROR (IOreadChunk (ifp, chunkdims, chunkorigin, CCTK_VarDataPtrI (GH, timelevel, index))); @@ -242,10 +245,10 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, CACTUS_IEEEIO_ERROR (IOread (ifp, buffer)); } else { - chunkdims [0] = pughGH->rnsize [proc][0]; - chunkdims [1] = pughGH->rnsize [proc][1]; - chunkdims [2] = pughGH->rnsize [proc][2]; - chunkorigin = pughGH->lb [proc]; + for (i = 0; i < 3; i++) { + chunkdims [i] = pughGH->rnsize [proc][i]; + chunkorigin [i] = pughGH->lb [proc][i]; + } CACTUS_IEEEIO_ERROR ( IOreadChunk (ifp, chunkdims, chunkorigin, buffer)); @@ -309,7 +312,10 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc, 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; +#if 0 +/* FIXME: Don't know how to support COMPLEX types too !! */ case CCTK_VARIABLE_COMPLEX: mpi_type = pughGH->pugh_mpi_complex; break; +#endif default: CCTK_WARN (1, "Unsupported datatype"); continue; @@ -447,19 +453,20 @@ static int GetCommonAttributes (cGH *GH, IOFile ifp, int unchunked, int *index, return (-1); } /* The CCTK variable type defines do not correlate with the IEEEIO defines - so compare them explicitely here. - FlexIO doesn't have an explicite FLEXIO_COMPLEX datatype - so FLEXIO_REAL is used instead. This means we can do only a weak test - - and check whether a given FLEXIO_REAL type matches with - either a CCTK_VARIABLE_REAL or CCTK_VARIABLE_COMPLEX variable. */ + so compare them explicitely here. */ if ((vartype_stored == FLEXIO_REAL && groupdata.vartype == CCTK_VARIABLE_REAL) || (vartype_stored == FLEXIO_INT && groupdata.vartype == CCTK_VARIABLE_INT) || (vartype_stored == FLEXIO_CHAR && groupdata.vartype == CCTK_VARIABLE_CHAR) || +#if 0 +/* FIXME: Don't know how to support COMPLEX type too !! */ (vartype_stored == FLEXIO_REAL && groupdata.vartype == CCTK_VARIABLE_COMPLEX)) { +#else + 0) { +#endif /* everything is okay */ } else { CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, |