aboutsummaryrefslogtreecommitdiff
path: root/src/Write.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Write.c')
-rw-r--r--src/Write.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Write.c b/src/Write.c
index 3eab8c3..44ace87 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -9,12 +9,10 @@
@@*/
-#include <stdio.h>
#include <stdlib.h>
#include "cctk.h"
#include "cctk_Parameters.h"
-#include "CactusPUGH/PUGH/src/include/pugh.h"
#include "CactusBase/IOUtil/src/ioGH.h"
#include "CactusBase/IOUtil/src/ioutil_Utils.h"
#include "ioFlexGH.h"
@@ -67,7 +65,8 @@ static IEEEfile_t *OpenFile (const cGH *GH, const char *alias, int *is_new_file)
@@*/
int IOFlexIO_Write (const cGH *GH, int vindex, const char *alias)
{
- ioGH *ioUtilGH;
+ const flexioGH *myGH;
+ const ioGH *ioUtilGH;
int len, is_new_file, retval;
char buffer[128];
char *fullname;
@@ -85,9 +84,6 @@ int IOFlexIO_Write (const cGH *GH, int vindex, const char *alias)
return (-1);
}
- /* get the handle for IOUtil and IOFlexIO extensions */
- ioUtilGH = (ioGH *) CCTK_GHExtension (GH, "IO");
-
if (verbose)
{
CCTK_VInfo (CCTK_THORNSTRING, "IOFlexIO output of variable '%s', "
@@ -98,6 +94,7 @@ int IOFlexIO_Write (const cGH *GH, int vindex, const char *alias)
file = OpenFile (GH, alias, &is_new_file);
/* nothing to do for an already opened file which is kept open all the time */
+ ioUtilGH = (const ioGH *) CCTK_GHExtension (GH, "IO");
if (CCTK_MyProc (GH) == ioUtilGH->ioproc)
{
if (is_new_file || reuse_filehandles)
@@ -150,7 +147,7 @@ int IOFlexIO_Write (const cGH *GH, int vindex, const char *alias)
FLEXIO_ERROR (IOresume (file->iofile));
}
- /* Turn on buffer cache (with default size chosen by IEEEIO lib) */
+ /* turn on buffer cache (with default size chosen by IEEEIO lib) */
if (file->iofile)
{
IEEEbufferOn (file->iofile, 0);
@@ -170,7 +167,8 @@ int IOFlexIO_Write (const cGH *GH, int vindex, const char *alias)
}
/* output the data */
- retval = IOFlexIO_DumpVar (GH, vindex, 0, file->iofile);
+ myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
+ retval = IOFlexIO_DumpVar (GH, myGH->requests[vindex], file->iofile);
/* output the GH extensions and parameters */
if (file->iofile)