[MCNPX] How to run an entire folder?

  • Thread starter Thread starter Alexander Camargo
  • Start date Start date
  • Tags Tags
    Mcnp Mcnpx
AI Thread Summary
To run multiple MCNP simulations from a folder, users cannot directly execute the entire folder with MCNP programs. Instead, creating a batch file for Windows or Linux is recommended to automate the process and manage run files. For extensive simulations, such as 12,000 entries, automation is crucial, and tools like WORM can assist in generating input files, though they do not execute MCNP or extract results. Python scripts can also be utilized to edit input files, run MCNP, and extract results. Users have successfully automated their workflow using Notepad++ and advanced renaming tools to streamline the process.
Alexander Camargo
Messages
33
Reaction score
10
I know that "mcnpx n=filename" I run the file, but how do I run the entire folder with the entries inside?
 
Engineering news on Phys.org
I don't *think* any of the mcnp programs will do that. It's fairly trivial to write a batch file, either for windows or linux to do the job and clean up the run files. Which OS?
 
Alex A said:
I don't *think* any of the mcnp programs will do that. It's fairly trivial to write a batch file, either for windows or linux to do the job and clean up the run files. Which OS?

Hi, thanks for replying. That was the conclusion I came to. I wanted the method I mentioned because I have more than 12 thousand simulations to do. I renamed them all and used the same batch method.
 
That is the kind of use case WORM was created for, but it doesn't run mcnp/x or extract the results, it just creates the input files. I found some example stuff in python that will edit an input file, run mcnp, in this case 6 and extract the result here - https://www.justanswer.com/computer-programming/gfgmq-again-thank-again-excellent-help-think.html
If you have 12k problems, maybe this is worth automating at this level.
 
Alex A said:
That is the kind of use case WORM was created for, but it doesn't run mcnp/x or extract the results, it just creates the input files. I found some example stuff in python that will edit an input file, run mcnp, in this case 6 and extract the result here - https://www.justanswer.com/computer-programming/gfgmq-again-thank-again-excellent-help-think.html
If you have 12k problems, maybe this is worth automating at this level.
Thanks a lot for the help. I automate my entries with notepad++ using macros and "advanced renamer" for the different names of each file. I already put the 12k input to simulate, now just wait about 100 hours. hahaha
 
Hello, I'm currently trying to compare theoretical results with an MCNP simulation. I'm using two discrete sets of data, intensity (probability) and linear attenuation coefficient, both functions of energy, to produce an attenuated energy spectrum after x-rays have passed through a thin layer of lead. I've been running through the calculations and I'm getting a higher average attenuated energy (~74 keV) than initial average energy (~33 keV). My guess is I'm doing something wrong somewhere...
Back
Top