[MCNPX] How to run an entire folder?

  • Thread starter Thread starter Alexander Camargo
  • Start date Start date
  • Tags Tags
    Mcnp Mcnpx
Click For Summary
SUMMARY

To run an entire folder of MCNP input files, users must create a batch file for either Windows or Linux, as MCNP programs do not support this functionality natively. For large-scale simulations, such as those involving over 12,000 entries, automation is essential. The WORM tool is mentioned as a method for generating input files but does not execute MCNP or extract results. Python scripts can also be utilized to edit input files, execute MCNP 6, and extract results efficiently.

PREREQUISITES
  • Familiarity with MCNP 6 simulation software
  • Basic knowledge of batch file scripting for Windows or Linux
  • Understanding of Python programming for automation tasks
  • Experience with file management tools like Notepad++ and Advanced Renamer
NEXT STEPS
  • Research how to create batch files for running MCNP simulations on Windows and Linux
  • Explore the capabilities of the WORM tool for input file generation
  • Learn how to automate MCNP runs using Python scripts
  • Investigate methods for extracting results from MCNP simulations programmatically
USEFUL FOR

This discussion is beneficial for computational physicists, researchers conducting large-scale MCNP simulations, and developers looking to automate simulation workflows.

Alexander Camargo
Messages
37
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
 
  • Like
Likes   Reactions: Alex A

Similar threads

Replies
0
Views
834
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
6
Views
7K
Replies
1
Views
3K