Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lock file errors when using a BEAMnrc library
Call beam_finish from beamlib_finish with a different ientry value of 3. This signals that the BEAM source library is done and that there is no need to call egs_pjo_finish, which tries to access the lock file for regular BEAMnrc parallel runs. Previously, while testing the uniform run control object in Mortran apps, fort.* files were left behind in the DOSXYZnrc app folder when using BEAMnrc libraries as a source of particles. This occurred whether or not the simulation relied on a lock file. Interestingly, the problem was noticed using gcc 7.5 on Ubuntu 18.04, but it does not occur with gcc 4.8 on CentOS 7. These spurious fort.* files contained error messages from the BEAM library source, reporting a failure to rewind the lock file. The error message was traced to the egs_pjob_finish routine attempting to rewind and read the lock file. The bug occurs because a BEAM library source does not create a lock file, yet at the end of a parallel run beamlib_finish calls beam_finish(ientry), with the same ientry=1 argument used in regular BEAMnrc simulations (which create a lock file). This bug does not affect the simulation results since it since it aborts the parallel job when it was already done, with a call to $egs_fatal which attempts to ouput an error message to an output file that is already closed.
- Loading branch information