diff options
author | lanfer <lanfer@0888f3d4-9f52-45d2-93bc-d00801ff5e46> | 2000-08-02 18:35:59 +0000 |
---|---|---|
committer | lanfer <lanfer@0888f3d4-9f52-45d2-93bc-d00801ff5e46> | 2000-08-02 18:35:59 +0000 |
commit | df38b6a39abacc3c1b163fd8af951a9aae13979f (patch) | |
tree | 6db1978362293c05ec99873cd9a875794f094640 | |
parent | 8cac1b4a2b14ce2d19f4e6146c05abfabecdd111 (diff) |
fix for slab specification, returns on error, set error values
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOStreamedHDF5/trunk@19 0888f3d4-9f52-45d2-93bc-d00801ff5e46
-rw-r--r-- | src/DumpVar.c | 26 | ||||
-rw-r--r-- | src/ParseGeometry.c | 2 | ||||
-rw-r--r-- | src/ParseVars.c | 5 |
3 files changed, 31 insertions, 2 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c index 777c0d5..190787c 100644 --- a/src/DumpVar.c +++ b/src/DumpVar.c @@ -72,6 +72,8 @@ int StreamedHDF5_DumpVar (cGH *GH, int index, int timelevel, hid_t fid) StreamedHDF5GH *myGH; StreamGeo_t geo; int vtype; + + int sdir[3] = {0,0,0}; /* Get the handle for StreamedHDF5 extensions */ @@ -93,8 +95,30 @@ int StreamedHDF5_DumpVar (cGH *GH, int index, int timelevel, hid_t fid) data = NULL; + /* TEMPORARY FIX DUE TO INCONSISTENT DIR SPECIFICATION */ + /* direction vector of 1d line in 3d volume */ + if (geo.sdim==1) { + sdir[0] = (geo.direction[0]==0) ? 1:0; + sdir[1] = (geo.direction[0]==1) ? 1:0; + sdir[2] = (geo.direction[0]==2) ? 1:0; + } + /* norm vector of 2d surface in 3d volume */ + else if (geo.sdim==2) + { + sdir[0] = (geo.direction[1]&&geo.direction[2]) ? 1:0; + sdir[1] = (geo.direction[0]&&geo.direction[2]) ? 1:0; + sdir[2] = (geo.direction[0]&&geo.direction[1]) ? 1:0; + } + /* spanning directions for 3d */ + else if (geo.sdim==3) + { + sdir[0] = geo.direction[0]; + sdir[1] = geo.direction[1]; + sdir[2] = geo.direction[2]; + } + if (Hyperslab_GetHyperslab (GH, 0, index, timelevel, geo.sdim, geo.origin, - geo.direction, geo.length, geo.downs, + sdir, geo.length, geo.downs, &data, hsizes) < 0) { char *fullname = CCTK_FullName (index); diff --git a/src/ParseGeometry.c b/src/ParseGeometry.c index 64f84d9..e522797 100644 --- a/src/ParseGeometry.c +++ b/src/ParseGeometry.c @@ -88,6 +88,7 @@ int GeometryParser(const char *before, char **outname, StreamGeo_t *geo) { CCTK_WARN(1,"No variable name found in StreamedHDF5::out_vars"); retval = -1; + return(retval); } if(pmatch[2].rm_so != -1 && @@ -105,6 +106,7 @@ int GeometryParser(const char *before, char **outname, StreamGeo_t *geo) } else { retval=-1; + return(retval); } /* Pattern match the hyperslab string geo_s*/ diff --git a/src/ParseVars.c b/src/ParseVars.c index 3e3837e..3e11408 100644 --- a/src/ParseVars.c +++ b/src/ParseVars.c @@ -89,7 +89,10 @@ void ParseVarsForOutput (StreamedHDF5GH *h5GH, const char *var_list) { /* Extract geometry information */ ierr=GeometryParser(before, &outname, &geo_tmp); - if (ierr<0) printf("GeometryParser failed: >%s<\n",before); + if ((ierr<0)||(outname==NULL)) { + CCTK_WARN(1,"GeometryParser failed."); + return(-1); + } /* Look for any special tokens */ if (CCTK_Equals(outname,"all")) |