in reply to Re: Runing "regular" code with threaded perl
in thread Runing "regular" code with threaded perl

OK, this was a helpful comment. Apparently, xspec is silently dying, but only sometimes. So, if I stepped through the debugger, or called xspec outside of my perl script, seemed to run fine, but this test with the sleep command shows me that it sometimes randomly dies (I can make the same call over and over again at the command line, and most of the time it works, but sometimes it fails). So, as suggested, my blaming of threaded perl was misplaced. Xpsec is a pretty standard and well-tested piece of astrophysical data analysis software, so figuring out why it's dying on my new system will be another (non-perl related) problem.
  • Comment on Re^2: Runing "regular" code with threaded perl

Replies are listed 'Best First'.
Re^3: Runing "regular" code with threaded perl
by RatKing (Acolyte) on Jul 14, 2008 at 13:05 UTC

    I'll bet you anything that the problem you are having with Xpsec is what you suspected perl of doing.

    If it works most of the time but only sometimes fails then the most likely problem is that it has troubles with multiple threads and fast CPU's that might actually be able to complete their tasks so fat that the original programmer never expected this to be possible and thus didn't bother to check for this.

    One good option would be to find a mailing list for: Xspec and ask if others find the same issues, check to see if there is a new release etc.

    For the time being try to do the following in your code:

    until ( -e "${tmp}xsfit.dat" ) { bjmsys("xspec - ${tmp}.xcm", $v); } open(DAT, "${tmp}xsfit.dat") || die ("Could not open file!"); my @kT=<DAT>; close DAT;

    This will basically make sure that the file exists and only then continue if the file does not exist it will simply try to create is again, and again until the file is there. It is a very crude way of working but it will certainly do the trick.

    As long as Xspec does not take for ever and ever before it fails you should be saved until the Xspec problem is resolved.