aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgoodale <goodale@eff87b29-5268-4891-90a3-a07138403961>2000-09-22 11:48:01 +0000
committergoodale <goodale@eff87b29-5268-4891-90a3-a07138403961>2000-09-22 11:48:01 +0000
commit8b1ad0654692060c6d0ef33c6983a985a7f7d03c (patch)
tree60912ff971b3909d15f98e2ae934bddb312bec1a /src
parent845e1714e0cd458d6b776b9ace7b9bb752219442 (diff)
Fixing for parallel operation.
Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOJpeg/trunk@16 eff87b29-5268-4891-90a3-a07138403961
Diffstat (limited to 'src')
-rw-r--r--src/DumpVar.c31
-rw-r--r--src/Write2D.c8
2 files changed, 22 insertions, 17 deletions
diff --git a/src/DumpVar.c b/src/DumpVar.c
index 33ec428..caafb13 100644
--- a/src/DumpVar.c
+++ b/src/DumpVar.c
@@ -139,20 +139,23 @@ int IOJpeg_Output(cGH *GH, int index, int timelevel, CCTK_REAL *data,
CCTK_VARIABLE_REAL,&min, 1, index);
}
- AutoColorDataSlice(hsize[0],
- hsize[1],
- data,
- dataout,
- min,
- max,
- colormap_bias,
- colormap_factor);
-
- WriteJPEGToFileRGB(hsize[0],
- hsize[1],
- dataout,
- colormap_quality,
- fid);
+ if(CCTK_MyProc(GH) == 0)
+ {
+ AutoColorDataSlice(hsize[0],
+ hsize[1],
+ data,
+ dataout,
+ min,
+ max,
+ colormap_bias,
+ colormap_factor);
+
+ WriteJPEGToFileRGB(hsize[0],
+ hsize[1],
+ dataout,
+ colormap_quality,
+ fid);
+ }
free(dataout);
return(1);
diff --git a/src/Write2D.c b/src/Write2D.c
index fb1fbbd..a1c2270 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -215,9 +215,11 @@ int IOJpeg_Write2D (cGH *GH, int index, const char *alias)
like for HDF5 can go here.
********************************************** */
- /* Close the file */
- fclose (fdset_2D [si]);
-
+ if(CCTK_MyProc(GH) == 0)
+ {
+ /* Close the file */
+ fclose (fdset_2D [si]);
+ }
}
free(fname);