aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortradke <tradke@38c3d835-c875-442e-b0fe-21c19ce1d001>2001-11-05 15:11:35 +0000
committertradke <tradke@38c3d835-c875-442e-b0fe-21c19ce1d001>2001-11-05 15:11:35 +0000
commit479143043f760896065a8d7c4a2e059adb8c41c5 (patch)
tree50e6becf0a33181256986b4e35dde5519ad2ab2e /src
parent55621c8c7e0e7e87df88aedce0c476c7c9f198b2 (diff)
Added const qualifier to the 'cGH *' argument of some more IO functions.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOPanda/trunk@27 38c3d835-c875-442e-b0fe-21c19ce1d001
Diffstat (limited to 'src')
-rw-r--r--src/DumpVar.c22
-rw-r--r--src/GHExtension.c9
-rw-r--r--src/Output3D.c42
-rw-r--r--src/Startup.c10
-rw-r--r--src/make.configuration.defn4
5 files changed, 52 insertions, 35 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index b378bb4..5715d9e 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -18,8 +18,14 @@
#include "ioPandaGH.h"
-void IOPanda_getDumpData (cGH *GH, int index, int timelevel, void **outme,
- int *free_outme, CCTK_INT4 *geom, int element_size)
+void IOPanda_getDumpData (const cGH *GH, int vindex, int timelevel,
+ void **outme, int *free_outme, CCTK_INT4 *geom,
+ int element_size);
+
+
+void IOPanda_getDumpData (const cGH *GH, int vindex, int timelevel,
+ void **outme, int *free_outme, CCTK_INT4 *geom,
+ int element_size)
{
DECLARE_CCTK_PARAMETERS
int i, myproc, do_downsample, dim;
@@ -29,7 +35,7 @@ void IOPanda_getDumpData (cGH *GH, int index, int timelevel, void **outme,
CCTK_BYTE *char_ptr;
CCTK_INT *int_ptr;
pGExtras *extras;
- void *data = CCTK_VarDataPtrI (GH, timelevel, index);
+ void *data = CCTK_VarDataPtrI (GH, timelevel, vindex);
/* to make the compiler happy */
single_ptr = NULL;
@@ -44,10 +50,10 @@ void IOPanda_getDumpData (cGH *GH, int index, int timelevel, void **outme,
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
/* get the pGExtras pointer as a shortcut */
- extras = ((pGA ***) PUGH_pGH (GH)->variables) [index][timelevel]->extras;
+ extras = ((pGA ***) PUGH_pGH (GH)->variables) [vindex][timelevel]->extras;
/* get the dimension of the variable */
- dim = CCTK_GroupDimI (CCTK_GroupIndexFromVarI (index));
+ dim = CCTK_GroupDimI (CCTK_GroupIndexFromVarI (vindex));
do_downsample = 0;
for (i = 0; i < dim; i++)
@@ -57,7 +63,7 @@ void IOPanda_getDumpData (cGH *GH, int index, int timelevel, void **outme,
For other-dimensional variables we print a warning
and return the non-downsampled data. */
if (do_downsample && dim != 3) {
- char *fullname = CCTK_FullName (index);
+ char *fullname = CCTK_FullName (vindex);
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"No downsampling for %dD variable '%s' ! Downsampling is only "
@@ -94,7 +100,7 @@ void IOPanda_getDumpData (cGH *GH, int index, int timelevel, void **outme,
/* NOTE: the following downsampling code is hard-coded for 3D data */
int start [3], end [3];
- int i, j, k, l;
+ int j, k, l;
/* downsampled global shape */
for (i = 0; i < 3; i++) {
@@ -146,7 +152,7 @@ void IOPanda_getDumpData (cGH *GH, int index, int timelevel, void **outme,
/* I hate it to repeat the loops for each case label
but that way produces much more efficient code */
l = 0;
- switch (CCTK_VarTypeI (index)) {
+ switch (CCTK_VarTypeI (vindex)) {
case CCTK_VARIABLE_CHAR:
char_ptr = (CCTK_BYTE *) *outme;
for (k = start [2]; k <= end [2]; k += ioUtilGH->downsample [2])
diff --git a/src/GHExtension.c b/src/GHExtension.c
index 735b407..b3cdd1d 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -19,6 +19,10 @@
#include "CactusBase/IOUtil/src/ioGH.h"
#include "ioPandaGH.h"
+void *IOPanda_SetupGH (tFleshConfig *config,
+ int convergence_level,
+ cGH *GH);
+int IOPanda_InitGH (cGH *GH);
void Panda_Create(int, int);
@@ -57,6 +61,11 @@ void *IOPanda_SetupGH (tFleshConfig *config,
pandaGH *newGH;
+ /* avoid warnings about unused arguments */
+ config = config;
+ convergence_level = convergence_level;
+ GH = GH;
+
numvars = CCTK_NumVars ();
newGH = (pandaGH *) malloc (sizeof (pandaGH));
diff --git a/src/Output3D.c b/src/Output3D.c
index 35b2b47..3af7864 100644
--- a/src/Output3D.c
+++ b/src/Output3D.c
@@ -25,11 +25,11 @@ CCTK_FILEVERSION(BetaThorns_IOPanda_Output3D_c)
/* function prototypes */
-int IOPanda_Output3DGH (cGH *GH);
-int IOPanda_TriggerOutput3D (cGH *GH, int vindex);
-int IOPanda_Output3DVarAs (cGH *GH, const char *var, const char *alias);
-int IOPanda_TimeFor3D (cGH *GH, int vindex);
-void IOPanda_getDumpData (cGH *GH, int vindex, int timelevel, void **outme,
+int IOPanda_Output3DGH (const cGH *GH);
+int IOPanda_TriggerOutput3D (const cGH *GH, int vindex);
+int IOPanda_Output3DVarAs (const cGH *GH, const char *var, const char *alias);
+int IOPanda_TimeFor3D (const cGH *GH, int vindex);
+void IOPanda_getDumpData (const cGH *GH, int vindex, int timelevel, void **outme,
int *free_outme, CCTK_INT4 *geom, int element_size);
void PandaTimestep(ArrayInfo *);
int PandaIsNewFile(char *);
@@ -38,10 +38,10 @@ void Panda_WriteAttribute(const char *, const char *, int, int, const void *);
static int CheckOutputVar (int vindex);
static void CheckSteerableParameters (pandaGH *myGH);
static void SetOutputFlag (int vindex, const char *optstring, void *arg);
-static void IOPanda_Timestep (cGH *GH, int vindex, const char *alias);
-static void IOPanda_IEEEIOStructDump (cGH *GH, const char *fname);
-static void IOPanda_AddCommonAttributes (cGH *GH, int vindex, int timelevel, int global_size[3], char *fname);
-static void IOPanda_AddChunkAttributes (cGH *GH, int vindex, CCTK_INT4 *geom, char *fname);
+static void IOPanda_Timestep (const cGH *GH, int vindex, const char *alias);
+static void IOPanda_IEEEIOStructDump (const cGH *GH, const char *fname);
+static void IOPanda_AddCommonAttributes (const cGH *GH, int vindex, int timelevel, int global_size[3], char *fname);
+static void IOPanda_AddChunkAttributes (const cGH *GH, int vindex, CCTK_INT4 *geom, char *fname);
/*@@
@routine IOPanda_Output3DGH
@@ -52,11 +52,11 @@ static void IOPanda_AddChunkAttributes (cGH *GH, int vindex, CCTK_INT4 *geom, ch
@enddesc
@var GH
@vdesc Pointer to CCTK GH
- @vtype cGH *
+ @vtype const cGH *
@vio in
@endvar
@@*/
-int IOPanda_Output3DGH (cGH *GH)
+int IOPanda_Output3DGH (const cGH *GH)
{
DECLARE_CCTK_PARAMETERS
int vindex;
@@ -113,7 +113,7 @@ int IOPanda_Output3DGH (cGH *GH)
@calledby IOPanda_Output3DGH
@var GH
@vdesc Pointer to CCTK GH
- @vtype cGH
+ @vtype const cGH *
@vio in
@endvar
@var fullname
@@ -128,7 +128,7 @@ int IOPanda_Output3DGH (cGH *GH)
@vio in
@endvar
@@*/
-int IOPanda_Output3DVarAs (cGH *GH,
+int IOPanda_Output3DVarAs (const cGH *GH,
const char *fullname,
const char *alias)
{
@@ -163,7 +163,7 @@ int IOPanda_Output3DVarAs (cGH *GH,
@calledby IOPanda_Output3DGH
@var GH
@vdesc Pointer to CCTK GH
- @vtype cGH
+ @vtype const cGH *
@vio in
@endvar
@var vindex
@@ -172,7 +172,7 @@ int IOPanda_Output3DVarAs (cGH *GH,
@vio in
@endvar
@@*/
-int IOPanda_TimeFor3D (cGH *GH,
+int IOPanda_TimeFor3D (const cGH *GH,
int vindex)
{
pandaGH *myGH;
@@ -221,7 +221,7 @@ int IOPanda_TimeFor3D (cGH *GH,
@enddesc
@var GH
@vdesc Pointer to CCTK GH
- @vtype cGH
+ @vtype const cGH *
@vio in
@endvar
@var vindex
@@ -230,7 +230,7 @@ int IOPanda_TimeFor3D (cGH *GH,
@vio in
@endvar
@@*/
-int IOPanda_TriggerOutput3D (cGH *GH,
+int IOPanda_TriggerOutput3D (const cGH *GH,
int vindex)
{
DECLARE_CCTK_PARAMETERS
@@ -347,7 +347,7 @@ static void SetOutputFlag (int vindex,
}
-static void IOPanda_Timestep (cGH *GH,
+static void IOPanda_Timestep (const cGH *GH,
int vindex,
const char *alias)
{
@@ -470,7 +470,7 @@ static void IOPanda_Timestep (cGH *GH,
}
-static void IOPanda_AddCommonAttributes (cGH *GH,
+static void IOPanda_AddCommonAttributes (const cGH *GH,
int vindex,
int timelevel,
int global_size[3],
@@ -552,7 +552,7 @@ static void IOPanda_AddCommonAttributes (cGH *GH,
}
-static void IOPanda_AddChunkAttributes (cGH *GH,
+static void IOPanda_AddChunkAttributes (const cGH *GH,
int vindex,
CCTK_INT4 *geom,
char *fname)
@@ -582,7 +582,7 @@ static void IOPanda_AddChunkAttributes (cGH *GH,
}
-static void IOPanda_IEEEIOStructDump (cGH *GH,
+static void IOPanda_IEEEIOStructDump (const cGH *GH,
const char *fname)
{
DECLARE_CCTK_PARAMETERS
diff --git a/src/Startup.c b/src/Startup.c
index 1eb47c7..d4cd4eb 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -18,14 +18,16 @@
#include "CactusBase/IOUtil/src/ioGH.h"
/* prototypes of functions to be registered */
-int IOPanda_Output3DGH (cGH *GH);
-int IOPanda_TriggerOutput3D (cGH *GH, int);
-int IOPanda_TimeFor3D (cGH *GH, int);
-int IOPanda_Output3DVarAs (cGH *GH, const char *var, const char *alias);
+int IOPanda_Output3DGH (const cGH *GH);
+int IOPanda_TriggerOutput3D (const cGH *GH, int);
+int IOPanda_TimeFor3D (const cGH *GH, int);
+int IOPanda_Output3DVarAs (const cGH *GH, const char *var, const char *alias);
void *IOPanda_SetupGH (tFleshConfig *config, int convergence_level, cGH *GH);
int IOPanda_InitGH (cGH *GH);
int IOPanda_RecoverGH (cGH *GH, const char *basename, int called_from);
+void IOPanda_Startup (void);
+void IOPanda_Finalize(void);
void Panda_Finalize(void);
/*@@
diff --git a/src/make.configuration.defn b/src/make.configuration.defn
index d2ad580..75357f2 100644
--- a/src/make.configuration.defn
+++ b/src/make.configuration.defn
@@ -10,8 +10,8 @@ MissingPUGHinIOPanda:
exit 2
endif
-MPI_CONFIGURED := $(shell grep CCTK_MPI $(CONFIG)/cctk_Extradefs.h)
-ifneq ("$(MPI_CONFIGURED)", "\#define CCTK_MPI CCTK_MPI")
+MPI_CONFIGURED := $(shell grep -l CCTK_MPI $(CONFIG)/cctk_Extradefs.h)
+ifneq ("$(MPI_CONFIGURED)", "$(CONFIG)/cctk_Extradefs.h")
.pseudo: MissingMPIinIOPanda
MissingMPIinIOPanda:
@echo "IOPanda: requires MPI"