PRIMUS_output.log not always being created #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
On several of my PRIMUS runs, the PRIMUS_output.log file was not being created. My runs were failing (for other reasons on my part) and I was hoping I could look at the log file but it was never made. I realized this issue was occurring only when I would rerun primus without removing the output directory from the previous run.
Explanation :
I think what is happening is that when PRIMUS renames the previous output directory, the $LOG filehandle gets shut accidentally and then there is no where but stdout for the logging messages to go to. This would also explain the several warning messages that I was receiving about writing to a closed file see issue #1.
Code change:
This code moves the part of primus_kickoff7.pl that checks for the previous output directory (previous lines 129-132) to lines 121-124 above the open($LOG, ...) statement. Then I added additional code to create the output directory if it doesn't already exist to line 126. I'm sure that line 126 introduces redundancy but the if statement makes sure that it will not try to recreate an already existing directory. This change ensures that the output directory is made and fixes issue #1