Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In BEAMnrc phsp files are not overwritten properly when re-rerunning #1014

Open
rtownson opened this issue Jun 14, 2023 · 4 comments
Open

In BEAMnrc phsp files are not overwritten properly when re-rerunning #1014

rtownson opened this issue Jun 14, 2023 · 4 comments
Assignees
Labels

Comments

@rtownson
Copy link
Collaborator

Describe the bug
When you run the same simulation repeatedly, the new particles are just added to the end of the existing phase-space, and the header is updated to correspond only to the new particles that were added. This results in an invalid phase-space, where the header doesn't correspond to the full size of the file. New simulations of the same input file should really overwrite the existing phsp, not append, or there should be an option to append and the header updated appropriately.

EGSnrc version
Tested on v2023 but this has been a bug for a very long time.

@rtownson rtownson added the bug label Jun 14, 2023
@rtownson rtownson self-assigned this Jun 14, 2023
@crcrewso
Copy link
Contributor

I've wondered about this for a long time. Either manually prepping the folder before any run or moving the previous result files into a 'prev run' folder. Do you have an idea about the behaviour that EGSnrc should have?

@ftessier
Copy link
Member

One option is to prevent running (with an appropriate error message) if there is already a phase space file of the same name present in the folder. The current behaviour (appending) could be allowed when the restart option is selected.

@blakewalters
Copy link
Contributor

@rtownson: I never knew this was an issue! There should be a relatively easy fix to ensure that a BEAMnrc overwrites its previous phase space, unless, of course, it's a restart. I'll take a look.

@blakewalters
Copy link
Contributor

blakewalters commented Aug 19, 2024

@rtownson: I'm not able to reproduce this issue. Are you referring to cases where the no. of particles scored in the 2nd run, Nscore_2, is less than that scored in the first run, Nscore_1, in which case, data for the first Nscore_2 particles is overwritten with the phase space data from the 2nd run (and the header is rewritten to reflect data scored for the 2nd run), but the size of the phase space file remains what it was for the Nscore_1 particles from the first run (i.e., Nscore_1*28+28 instead of Nscore_2*28+28)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants