/*@@ @file Startup.c @date Fri May 21 1999 @author Thomas Radke @desc Startup routines for IOFlexIO. @enddesc @history @hauthor Thomas Radke @hdate May 21 1999 @hdesc Just copied from thorn IOFlexIO. @endhistory @@*/ #include #include #include "cctk.h" #include "cctk_Parameters.h" #include "CactusBase/IOUtil/src/ioGH.h" /* prototypes of functions to be registered */ int IOFlexIO_Output2DGH (cGH *GH); int IOFlexIO_TriggerOutput2D (cGH *GH, int); int IOFlexIO_TimeFor2D (cGH *GH, int); int IOFlexIO_Output2DVarAs (cGH *GH, const char *var, const char *alias); int IOFlexIO_Output3DGH (cGH *GH); int IOFlexIO_TriggerOutput3D (cGH *GH, int); int IOFlexIO_TimeFor3D (cGH *GH, int); int IOFlexIO_Output3DVarAs (cGH *GH, const char *var, const char *alias); void *IOFlexIO_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH); int IOFlexIO_InitGH (cGH *GH); int IOFlexIO_Recover (cGH *GH, const char *basename, int called_from); /*@@ @routine IOFlexIO_Startup @date Fri May 21 1999 @author Thomas Radke @desc The startup registration routine for IOFlexIO. Registers the GH extensions needed for IOFlexIO and the registerable routines used for each method of IOFlexIO. IOFlexIO does not overload any functions. @enddesc @calledby CCTK scheduler at STARTUP @history @endhistory @@*/ void IOFlexIO_Startup (void) { DECLARE_CCTK_PARAMETERS int IO_GHExtension; int IOMethod; if (CCTK_GHExtensionHandle ("IO") < 0) { CCTK_WARN (1, "Thorn IOUtil was not activated. " "No IOFlexIO IO methods will be enabled."); return; } if (CCTK_GHExtensionHandle ("PUGH") < 0) { CCTK_WARN (1, "Thorn PUGH was not activated. " "No IOFlexIO IO methods will be enabled."); return; } IO_GHExtension = CCTK_RegisterGHExtension ("IOFlexIO"); CCTK_RegisterGHExtensionSetupGH (IO_GHExtension, IOFlexIO_SetupGH); CCTK_RegisterGHExtensionInitGH (IO_GHExtension, IOFlexIO_InitGH); /* Register the 2D and 3D IOFlexIO routines as output methods */ IOMethod = CCTK_RegisterIOMethod ("IOFlexIO_2D"); CCTK_RegisterIOMethodOutputGH (IOMethod, IOFlexIO_Output2DGH); CCTK_RegisterIOMethodOutputVarAs (IOMethod, IOFlexIO_Output2DVarAs); CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOFlexIO_TimeFor2D); CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOFlexIO_TriggerOutput2D); IOMethod = CCTK_RegisterIOMethod ("IOFlexIO_3D"); CCTK_RegisterIOMethodOutputGH (IOMethod, IOFlexIO_Output3DGH); CCTK_RegisterIOMethodOutputVarAs (IOMethod, IOFlexIO_Output3DVarAs); CCTK_RegisterIOMethodTimeToOutput (IOMethod, IOFlexIO_TimeFor3D); CCTK_RegisterIOMethodTriggerOutput (IOMethod, IOFlexIO_TriggerOutput3D); /* Register the IOFlexIO recovery routine to thorn IOUtil */ if (IOUtil_RegisterRecover ("IOFlexIO recovery", IOFlexIO_Recover) < 0) CCTK_WARN (1, "Failed to register IOFlexIO recovery routine"); }