aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-02-18 15:05:43 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2000-02-18 15:05:43 +0000
commitcbccd2d2565f6e751ce633886f4adad87147ce8c (patch)
treedf7fd0231fa622aeacff5eef1d79e0cad7c9e275 /src
parentb4f3fffcd5262fa53d81f7ca5136427e7d969468 (diff)
Made CactusPUGHIO thorns aware of future multi-patch or multi-block changes
to PUGH. The current pGH extensions are now queried via Tom's pugh_pGH() routine. The 'identity_string' provided by PUGH for each GH goes into output filenames. Thomas git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@92 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src')
-rw-r--r--src/DumpVar.c22
-rw-r--r--src/GHExtension.c4
-rw-r--r--src/RecoverGH.c2
-rw-r--r--src/RestoreFile.c4
-rw-r--r--src/Write2D.c18
-rw-r--r--src/Write3D.c13
6 files changed, 37 insertions, 26 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index 7956f35..d9eb530 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -374,9 +374,9 @@ static void IOFlexIO_DumpGF (cGH *GH, int index, int timelevel, IOFile iof,
#endif
- /* Get the handles for pugh and IO extensions */
+ /* Get the handles for PUGH and IO extensions */
+ pughGH = pugh_pGH (GH);
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
myproc = CCTK_MyProc (GH);
nprocs = CCTK_nProcs (GH);
@@ -660,13 +660,19 @@ static void IOFlexIO_AddChunkAttributes (cGH *GH, int index, CCTK_INT4 bnd [9],
@endhistory
@var GH
@vdesc Identifies grid hierachy
- @vtype pGH *
+ @vtype cGH *
@vio in
@vcomment
@endvar
- @var GF
- @vdesc Identifies grid function
- @vtype pGF *
+ @var index
+ @vdesc index of the variable to dump
+ @vtype int
+ @vio in
+ @vcomment
+ @endvar
+ @var timelevel
+ @vdesc timelevel of the variable to dump
+ @vtype int
@vio in
@vcomment
@endvar
@@ -716,8 +722,10 @@ static void IOFlexIO_getDumpData (cGH *GH, int index, int timelevel,
char_ptr = NULL;
int_ptr = NULL;
+
+ /* get GH extensions for PUGH and IO */
+ pughGH = pugh_pGH (GH);
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
if (ioUtilGH->downsample_x == 1 &&
ioUtilGH->downsample_y == 1 &&
diff --git a/src/GHExtension.c b/src/GHExtension.c
index 6726f46..3dae241 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -197,8 +197,8 @@ static void SetupSliceCenter (cGH *GH)
flexioGH *myGH;
- /* Get the handles for PUGH IOFlexIO extensions */
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
+ /* Get the handles for PUGH and IOFlexIO extensions */
+ pughGH = pugh_pGH (GH);
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
slice_center=1;
diff --git a/src/RecoverGH.c b/src/RecoverGH.c
index 8478410..19b4b42 100644
--- a/src/RecoverGH.c
+++ b/src/RecoverGH.c
@@ -97,7 +97,7 @@ int IOFlexIO_RecoverGH (cGH *GH, const char *basename, int called_from)
file_unchunked = 0;
/* Get the handles for PUGH, IOUtil, and IOFlexIO extensions */
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
+ pughGH = pugh_pGH (GH);
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
diff --git a/src/RestoreFile.c b/src/RestoreFile.c
index bddd9bb..7cfe2fb 100644
--- a/src/RestoreFile.c
+++ b/src/RestoreFile.c
@@ -98,8 +98,8 @@ int IOFlexIO_RestoreIEEEIOfile (cGH *GH, IOFile ifp, int file_ioproc,
#endif
- /* Get the handles for PUGH and IO extensions */
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
+ /* Get the handles for PUGH extensions */
+ pughGH = pugh_pGH (GH);
myproc = CCTK_MyProc (GH);
nprocs = CCTK_nProcs (GH);
diff --git a/src/Write2D.c b/src/Write2D.c
index 0dc697a..1022228 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -102,8 +102,8 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
return;
}
- /* Get the handles for pugh, IOFlexIO and IOUtil extensions */
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
+ /* Get the handles for PUGH, IOUtil, and IOFlexIO extensions */
+ pughGH = pugh_pGH (GH);
ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
@@ -157,16 +157,16 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
/* see if output file for this alias name was already created */
IEEEfile_2D = (IOFile *) GetNamedData (myGH->filenameList2D, alias);
if (IEEEfile_2D == NULL) {
- int len;
char *fname;
IEEEfile_2D = (IOFile *) malloc (3 * sizeof (IOFile));
- len = strlen (myGH->outdir2D) + strlen (alias);
- fname = (char *) malloc (len + 20);
+ fname = (char *) malloc (strlen (myGH->outdir2D) + strlen (alias) +
+ strlen (pughGH->identity_string) + 20);
assert (IEEEfile_2D && fname);
/* Create files (open mode "w") */
- sprintf (fname, "%s/%s_2d_yz.ieee", myGH->outdir2D, alias);
+ sprintf (fname, "%s/%s_2d_yz%s.ieee", myGH->outdir2D, alias,
+ pughGH->identity_string);
IEEEfile_2D [0] = IEEEopen (fname, "w");
if (! IOisValid (IEEEfile_2D [0])) {
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
@@ -174,7 +174,8 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
return;
}
- sprintf (fname, "%s/%s_2d_xz.ieee", myGH->outdir2D, alias);
+ sprintf (fname, "%s/%s_2d_xz%s.ieee", myGH->outdir2D, alias,
+ pughGH->identity_string);
IEEEfile_2D [1] = IEEEopen (fname, "w");
if (! IOisValid (IEEEfile_2D [1])) {
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
@@ -182,7 +183,8 @@ void IOFlexIO_Write2D (cGH *GH, int index, const char *alias)
return;
}
- sprintf (fname, "%s/%s_2d_xy.ieee", myGH->outdir2D, alias);
+ sprintf (fname, "%s/%s_2d_xy%s.ieee", myGH->outdir2D, alias,
+ pughGH->identity_string);
IEEEfile_2D [2] = IEEEopen (fname, "w");
if (! IOisValid (IEEEfile_2D [2])) {
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
diff --git a/src/Write3D.c b/src/Write3D.c
index f3d5865..e890f85 100644
--- a/src/Write3D.c
+++ b/src/Write3D.c
@@ -378,6 +378,10 @@ static IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias,
char *outputdir; /* the output directory to be created */
IEEEfile_3D_t *IEEEfile_3D;
+
+ /* get the GH extensions for PUGH, IOUtil, and IOFlexIO */
+ pughGH = pugh_pGH (GH);
+ ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
myGH = (flexioGH *) GH->extensions [CCTK_GHExtensionHandle ("IOFlexIO")];
IEEEfile_3D = (IEEEfile_3D_t *) GetNamedData (myGH->fileList_3D, alias);
@@ -387,9 +391,6 @@ static IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias,
return (IEEEfile_3D);
}
- ioUtilGH = (ioGH *) GH->extensions [CCTK_GHExtensionHandle ("IO")];
- pughGH = (pGH *) GH->extensions [CCTK_GHExtensionHandle ("PUGH")];
-
extra [0] = '\0';
extradir [0] = '\0';
@@ -461,9 +462,10 @@ static IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias,
strlen (extradir) +
strlen (alias) +
strlen (extra) +
+ strlen (pughGH->identity_string) +
10);
- sprintf (IEEEfile_3D->filename, "%s/%s%s_3d%s.ieee", myGH->outdir3D,
- extradir, alias, extra);
+ sprintf (IEEEfile_3D->filename, "%s/%s%s_3d%s%s.ieee", myGH->outdir3D,
+ extradir, alias, extra, pughGH->identity_string);
/* no need to store file info if used only once */
if (! out3D_septimefiles)
@@ -474,5 +476,4 @@ static IEEEfile_3D_t *IOFlexIO_Get3Dfile (cGH *GH, const char *alias,
return (IEEEfile_3D);
-
}