/*@@ @file GHExtension.c @date Fri May 21 1999 @author Thomas Radke @desc IOFlexIO GH extension stuff. @enddesc @history @hauthor Thomas Radke @hdate May 21 1999 @hdesc Just copied from thorn IO. @endhistory @@*/ /*#define DEBUG_IO*/ #include #include #include #include "flesh.h" #include "Groups.h" #include "Comm.h" #include "Misc.h" #include "GHExtensions.h" #include "cctk_parameters.h" #ifdef CACTUSPUGH_PUGH #include "CactusPUGH/PUGH/src/include/pugh.h" #endif #include "CactusBase/IOUtil/src/ioGH.h" #include "ioFlexGH.h" void *IOFlexIO_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH) { int i, numvars; flexioGH *newGH; numvars = CCTK_GetNumVars (); newGH = (flexioGH *) malloc (sizeof (flexioGH)); newGH->IO_2Dnum = (int *) malloc (numvars * sizeof (int)); newGH->IO_3Dnum = (int *) malloc (numvars * sizeof (int)); newGH->IO_2Dlast = (int *) malloc (numvars * sizeof (int)); newGH->IO_3Dlast = (int *) malloc (numvars * sizeof (int)); newGH->IEEEfile_2D = (IOFile **) malloc (numvars * sizeof (IOFile *)); for (i = 0; i < numvars; i++) newGH->IEEEfile_2D [i] = (IOFile *) malloc (3 * sizeof (IOFile)); newGH->IEEEfname_3D = (char **) malloc (numvars * sizeof (char **)); for (i = 0; i < numvars; i++) newGH->IEEEfname_3D [i] = (char *) malloc (512 * sizeof (char)); newGH->IEEEfile_3D = (IOFile *) malloc (numvars * sizeof (IOFile)); return (newGH); } int IOFlexIO_InitGH (cGH *GH) { DECLARE_CCTK_PARAMETERS int i; ioGH *ioUtilGH; flexioGH *myGH; /* get the handles for IOUtil and IOFlexIO extensions */ ioUtilGH = (ioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IO")]; myGH = (flexioGH *) GH->extensions [CCTK_GetGHExtensionHandle ("IOFlexIO")]; InitIONum (myGH->IO_2Dnum, output2D); InitIONum (myGH->IO_3Dnum, output3D); for (i=0; iIO_2Dlast [i] = myGH->IO_3Dlast [i] = -1; myGH->reuse_fh = reuse_fh; /* Only have reuse for chunked data */ if (myGH->reuse_fh && ! ioUtilGH->unchunked) { CCTK_Warn (2, "Cannot reuse handles with unchunked data. " "Ignoring parameter 'reuse_fh'"); myGH->reuse_fh = 0; } return (0); } int IOFlexIO_rfrTraverseGH (cGH *GH, int rfrpoint) { return 0; }