From 8b1ad0654692060c6d0ef33c6983a985a7f7d03c Mon Sep 17 00:00:00 2001 From: goodale Date: Fri, 22 Sep 2000 11:48:01 +0000 Subject: Fixing for parallel operation. Tom git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOJpeg/trunk@16 eff87b29-5268-4891-90a3-a07138403961 --- src/DumpVar.c | 31 +++++++++++++++++-------------- src/Write2D.c | 8 +++++--- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'src') 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); -- cgit v1.2.3