[MCNPX] How to run an entire folder?

  • Thread starter Alexander Camargo
  • Start date
  • Tags
    Mcnp Mcnpx
In summary, the person is asking how to run an entire folder in mcnp with entries inside, but it seems that none of the mcnp programs can do that. It is suggested to write a batch file for either Windows or Linux to do the job. They mention having over 12,000 simulations and using a batch method to automate the process. There is a program called WORM that can create input files, but it does not run mcnp or extract results. The person found a solution using Python to edit input files and run mcnp, and is now waiting for the simulations to finish.
  • #1
Alexander Camargo
34
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
  • #2
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?
 
  • #3
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.
 
  • #4
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.
 
  • #5
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 Alex A

FAQ: [MCNPX] How to run an entire folder?

1. How do I run an entire folder in MCNPX?

To run an entire folder in MCNPX, you will need to use the "mcrun" command. This command will execute all the input files in the specified folder.

2. Can I specify the order in which the input files are executed?

Yes, you can specify the order of execution by using the "mcrun -f" command. This will allow you to specify the order of the input files in a text file.

3. What if I want to run only specific input files in the folder?

If you want to run only specific input files in the folder, you can use the "mcrun -i" command. This will allow you to specify the input files you want to run by listing their names in a text file.

4. How can I view the output from all the input files in the folder?

To view the output from all the input files in the folder, you can use the "mcrun -o" command. This will generate a single output file containing the results from all the input files.

5. Is there a way to save the results from each input file separately?

Yes, you can use the "mcrun -s" command to save the results from each input file separately. This will generate individual output files for each input file in the folder.

Similar threads

Replies
2
Views
2K
Replies
14
Views
2K
Replies
2
Views
1K
Replies
5
Views
2K
Replies
15
Views
430
Replies
5
Views
2K
Replies
2
Views
2K
Replies
2
Views
2K
Back
Top