On Thursday 10 July 2008 10:48:01 am you wrote: > Hi Darren, > > I have tried rerunning our code with the change you suggested in the > make_dvi and make_png functions. I am still noticing failures however. I > put these at the bottom of this message. Strangely enough, these errors > don't seem to occur when there are a lot of files in my tex.cache > directory. For example, I ran the code (consisting of ~40 codes all making > ~10-20 plots each), successfully 3 times (the OSError wasn't raised at all, > I used a print statement to check). I realised after this that a lot of > temp files were in my tex.cache directory, so I emptied it and then I > noticed that a lot of failures occured when I ran the code the next time > (the OSError I showed previously was raised as well as the error messages > shown below). It seems weird that it should run fine when a lot of files > are left in my temp directory and not when it is empty?
Most of those files are not temporary files, but cached files. The error you reported only occurs when a required file does not already exist in the cache, and like you said, it appears to be the case that two jobs are trying to add the same file to the cache at the same time, and one job is failing because the other deletes a temporary file that is being used by both. I guess. > Here are the error messages that are occuring now: > > Traceback (most recent call last): > File > "/home/spxiwh/ihope/852450000-852700000/nsbhinj_summary_plots/../executable >s/plotinspmissed", line 625, in ? > savePlot( opts, filename, titleText) > File > "/home/spxiwh/ihope/852450000-852700000/nsbhinj_summary_plots/../executable >s/plotinspmissed", line 108, in savePlot > dpi_thumb=opts.figure_resolution) > File > "/home/spxiwh/lscsoft/executables/cbc_s5_1yr_20070129/pylal//lib64/python2. >4/site-packages/pylal/InspiralUtils.py", line 54, in savefig_pylal > fig.savefig(filename, dpi=dpi) > File "/home/spxiwh/test/matplotlib/figure.py", line 682, in savefig > self.canvas.print_figure(*args, **kwargs) > File "/home/spxiwh/test/matplotlib/backends/backend_agg.py", line 456, in > print_figure > self.draw() > File "/home/spxiwh/test/matplotlib/backends/backend_agg.py", line 392, in > draw > self.figure.draw(renderer) > File "/home/spxiwh/test/matplotlib/figure.py", line 544, in draw > for a in self.axes: a.draw(renderer) > File "/home/spxiwh/test/matplotlib/axes.py", line 1063, in draw > a.draw(renderer) > File "/home/spxiwh/test/matplotlib/axis.py", line 595, in draw > self.label.draw(renderer) > File "/home/spxiwh/test/matplotlib/text.py", line 340, in draw > bbox, info = self._get_layout(renderer) > File "/home/spxiwh/test/matplotlib/text.py", line 187, in _get_layout > w,h = renderer.get_text_width_height( > File "/home/spxiwh/test/matplotlib/backends/backend_agg.py", line 240, in > get_text_width_height > Z = texmanager.get_rgba(s, size, self.dpi.get(), rgb) > File "/home/spxiwh/test/matplotlib/texmanager.py", line 334, in get_rgba > pngfile = self.make_png(tex, fontsize, dpi, force=False) > File "/home/spxiwh/test/matplotlib/texmanager.py", line 255, in make_png > fh = file(outfile) > IOError: [Errno 2] No such file or directory: > '/home/spxiwh/.matplotlib/tex.cache/fb2014e54961855bd04020b61190867c.output >' That doesnt make any sense to me. file defaults to open a file in append mode, it doesnt matter if a file exists or not. Maybe you could try to figure out why that fails and report back. > And once I noticed: > > Traceback (most recent call last): > File > "/home/spxiwh/ihope/852450000-852700000/allinj_summary_plots/../executables >/plotinspmissed", line 661, in ? > dpi_thumb=opts.figure_resolution) > File > "/home/spxiwh/lscsoft/executables/cbc_s5_1yr_20070129/pylal//lib64/python2. >4/site-packages/pylal/InspiralUtils.py", line 54, in savefig_pylal > fig.savefig(filename, dpi=dpi) > File "/usr/lib64/python2.4/site-packages/matplotlib/figure.py", line 682, > in savefig > self.canvas.print_figure(*args, **kwargs) > File > "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 456, in print_figure > self.draw() > File > "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 392, in draw > self.figure.draw(renderer) > File "/usr/lib64/python2.4/site-packages/matplotlib/figure.py", line 544, > in draw > for a in self.axes: a.draw(renderer) > File "/usr/lib64/python2.4/site-packages/matplotlib/axes.py", line 1063, > in draw > a.draw(renderer) > File "/usr/lib64/python2.4/site-packages/matplotlib/text.py", line 340, > in draw > bbox, info = self._get_layout(renderer) > File "/usr/lib64/python2.4/site-packages/matplotlib/text.py", line 187, > in _get_layout > w,h = renderer.get_text_width_height( > File > "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 240, in get_text_width_height > Z = texmanager.get_rgba(s, size, self.dpi.get(), rgb) > File "/usr/lib64/python2.4/site-packages/matplotlib/texmanager.py", line > 330, in get_rgba > X = readpng(os.path.join(self.texcache, pngfile)) > RuntimeError: _image_module::readpng: file not recognized as a PNG file No idea, sorry. Darren ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users