aboutsummaryrefslogtreecommitdiff
path: root/src/DumpVar.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2003-01-07 10:26:26 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2003-01-07 10:26:26 +0000
commit2c169e55d2f12ad2b8c84ef6edcbdb93d3d43449 (patch)
treee01e3a612eb22446de4a057bfcb3b4d3c2e4aa00 /src/DumpVar.c
parent0986fc27d88e180899adce3fe5ec9fa352afe58f (diff)
Fixed compiler warnings for non-MPI configurations.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@268 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/DumpVar.c')
-rw-r--r--src/DumpVar.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index e014212..8c29137 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -217,13 +217,13 @@ static int WriteGS (const cGH *GH, const ioRequest *request, IOFile file)
} fakeGH;
- ioUtilGH = (ioGH *) CCTK_GHExtension (GH, "IO");
+ ioUtilGH = CCTK_GHExtension (GH, "IO");
myproc = CCTK_MyProc (GH);
nprocs = CCTK_nProcs (GH);
fullname = CCTK_FullName (request->vindex);
hdatatypesize = CCTK_VarTypeSize (request->hdatatype);
- buffer = (char *) calloc (nprocs, hdatatypesize);
+ buffer = calloc (nprocs, hdatatypesize);
memcpy (buffer + myproc*hdatatypesize,
CCTK_VarDataPtrI (GH, request->timelevel, request->vindex),
hdatatypesize);
@@ -315,12 +315,12 @@ static int WriteGS (const cGH *GH, const ioRequest *request, IOFile file)
@@*/
static int WriteGA (const cGH *GH, const ioRequest *request, IOFile file)
{
- int i, myproc, mapping, hdatasize, retval;
+ int i, mapping, hdatasize, retval;
void *hdata;
char *fullname;
const ioGH *ioUtilGH;
#ifdef CCTK_MPI
- int nprocs;
+ int myproc, nprocs;
int *hsize_chunk;
void *tmpd;
MPI_Comm comm;
@@ -382,8 +382,7 @@ static int WriteGA (const cGH *GH, const ioRequest *request, IOFile file)
}
/* dump data held on I/O processor */
- myproc = CCTK_MyProc (GH);
- ioUtilGH = (ioGH *) CCTK_GHExtension (GH, "IO");
+ ioUtilGH = CCTK_GHExtension (GH, "IO");
if (ioUtilGH->ioproc_every == 1)
{
EachProcDump (GH, request, hdata, file);
@@ -391,6 +390,7 @@ static int WriteGA (const cGH *GH, const ioRequest *request, IOFile file)
#ifdef CCTK_MPI
else
{
+ myproc = CCTK_MyProc (GH);
nprocs = CCTK_nProcs (GH);
comm = PUGH_pGH (GH)->PUGH_COMM_WORLD;
mpitype = PUGH_MPIDataType (PUGH_pGH (GH), request->hdatatype);
@@ -400,7 +400,7 @@ static int WriteGA (const cGH *GH, const ioRequest *request, IOFile file)
if (ioUtilGH->unchunked)
{
/* need to copy CCTK_INT[] to int[] */
- hsize_chunk = (int *) malloc (request->hdim * sizeof (int));
+ hsize_chunk = malloc (request->hdim * sizeof (int));
/* first calculate the local size and reserve the chunk */
for (i = 0; i < request->hdim; i++)
@@ -534,7 +534,7 @@ static void AddCommonAttributes (const cGH *GH, const ioRequest *request,
DECLARE_CCTK_PARAMETERS
- itmp = (CCTK_INT4 *) malloc (request->hdim * sizeof (CCTK_INT4));
+ itmp = malloc (request->hdim * sizeof (CCTK_INT4));
name = CCTK_FullName (request->vindex);
FLEXIO_ERROR (IOwriteAttribute (file, "name", FLEXIO_CHAR,
@@ -563,12 +563,12 @@ static void AddCommonAttributes (const cGH *GH, const ioRequest *request,
/* FIXME: This is hardcoded for cartesian coordinate systems.
A better solution would be to be able to query the coordinate
system which is associated with the variable. */
- ioUtilGH = (ioGH *) CCTK_GHExtension (GH, "IO");
+ ioUtilGH = CCTK_GHExtension (GH, "IO");
sprintf (coord_system_name, "cart%dd", request->hdim);
if (CCTK_GroupTypeFromVarI (request->vindex) == CCTK_GF &&
CCTK_CoordSystemHandle (coord_system_name) >= 0)
{
- dtmp = (CCTK_REAL *) malloc (3 * request->hdim * sizeof (CCTK_REAL));
+ dtmp = malloc (3 * request->hdim * sizeof (CCTK_REAL));
for (i = 0; i < request->hdim; i++)
{
CCTK_CoordRange (GH, &dtmp[i], &dtmp[i + request->hdim], i + 1,
@@ -652,7 +652,7 @@ static void AddChunkAttributes (const cGH *GH, const ioRequest *request,
return;
}
- itmp = (CCTK_INT4 *) malloc (2 * request->hdim * sizeof (CCTK_INT4));
+ itmp = malloc (2 * request->hdim * sizeof (CCTK_INT4));
/* copy from CCTK_INT[] to CCTK_INT4[] */
for (i = 0; i < request->hdim; i++)
@@ -699,7 +699,7 @@ static void EachProcDump (const cGH *GH, const ioRequest *request, void *hdata,
/* copy from CCTK_INT[] to int[] */
- chunk_dims = (int *) malloc (request->hdim * sizeof (int));
+ chunk_dims = malloc (request->hdim * sizeof (int));
for (i = 0; i < request->hdim; i++)
{
chunk_dims[i] = request->hsize_chunk[i];
@@ -741,7 +741,7 @@ static void ProcDump (const cGH *GH, const ioRequest *request, void *hdata,
/* copy from CCTK_INT[] to int[] */
- chunk_origin = (int *) malloc (2*request->hdim * sizeof (int));
+ chunk_origin = malloc (2*request->hdim * sizeof (int));
chunk_dims = chunk_origin + request->hdim;
for (i = 0; i < request->hdim; i++)
{
@@ -749,7 +749,7 @@ static void ProcDump (const cGH *GH, const ioRequest *request, void *hdata,
chunk_dims[i] = request->hsize_chunk[request->hdim + i];
}
- ioUtilGH = (ioGH *) CCTK_GHExtension (GH, "IO");
+ ioUtilGH = CCTK_GHExtension (GH, "IO");
if (ioUtilGH->unchunked)
{
/* unchunked data */