Home Academic Reports Classes FAQ Forum Getting The Code Latest Release Manual Nuclear Data Reference Collection User Symposia Contact the MCNP Team

Frequently Asked Questions

General

How should I reference the MCNP code in reports and papers?

MCNP6.2, Either or both of:

  • C. J. Werner, et al., "MCNP6.2 Release Notes", Los Alamos National Laboratory, report LA-UR-18-20808 (2018).
  • C. J. Werner (editor), "MCNP Users Manual - Code Version 6.2", Los Alamos National Laboratory, report LA-UR-17-29981 (2017).

MCNP6.1.1:

  • J. T. Goorley, "MCNP6.1.1-Beta Release Notes", LA-UR-14-24680 (2014).

MCNP6.1:

  • J. T. Goorley, et al., "Initial MCNP6 Release Overview", Nuclear Technology, 180, pp 298-315 (Dec 2012).

MCNP5:

  • X-5 Monte Carlo Team, i "MCNP - Version 5, Vol. I: Overview and Theory", LA-UR-03-1987 (2003).

MCNPX:

  • D.B. Pelowitz, Ed., "MCNPX Users Manual Version 2.7.0" LA-CP-11-00438 (2011).

Can you send me a copy of the MCNP code?

No. See How to Get the Code.

Can the MCNP code run on GPUs (or graphics cards, or video processors)?

No. MCNP6 can run in parallel using the different cpu-cores in any computer (threading), or using different nodes in a cluster (MPI), or both. See the discussion of parallel processing in this FAQ page.

While Monte Carlo codes can certainly be adapted to vector-style parallelism using GPUs, many structural and algorithmic changes are required. The effort required to adapt a very large, mature Monte Carlo code such as MCNP to GPUs is huge, and there are no current plans to do so.

MCNP6.2 Plotter Troubleshooting

Getting the plotter to work on Windows

If you are getting errors like "xlib: unable to connect to server display", start reading at the "Installing an X11 Server" section. If you have installed an X11 server, see the section on "Modifying the MCNP Environment Batch File" and make sure the X11 server is running.

Installing an X11 Server

The first thing required for the MCNP6.2 plotter to work on Windows is an X11 Server. The MCNP team generally recommends Xming, and although other alternatives exist, the instructions in this section are specific to Xming.

After downloading Xming, simply run the installer executable. We recommend choosing the install location as somewhere you have full write access to without requiring administrative privileges. A location like C:\Users\YourUsername or C:\temp\Xming is a good choice. The minimum installation of Xming that works with the MCNP code is shown in the following seven screenshots: 1, 2, 3, 4, 5, 6, 7.

Alternatively, if the install location is not C:\Program Files and the other options are left defaulted, then during installation, multiple error messages (6) will pop up. You can click "ignore" on each of these errors and the software should successfully install. Of course, the Xming software may also be installed without any changes to the options (including the install location) if the user has administrator privileges.

To confirm the successful installation of Xming, after the installer finishes, a small orange and black "X" symbol should appear in the system tray (the area of the taskbar next to the clock; sometimes collapsed into a "^" symbol). If you do not see this symbol, search for "Xming" in the Windows search area, or navigate to the Xming folder in your start menu and choose "Xming".

Modifying the MCNP Environment Batch File

After getting an X11 server, the MCNP DISPLAY environment variable must be set appropriately. By default, the MCNP installer writes the mcnp_env_620.bat file to C:\Users\YourUsername\mcnp_env_620.bat. Locate this file and edit it by right-clicking on it and choosing to edit. It may also be opened directly from your favorite raw-text editor like Notepad/Notepad++, VIM, etc. Locate the line that reads: if "%DISPLAY%" == "" set DISPLAY=0:0. For Xming, change the aforementioned line to: if "%DISPLAY%" == "" set DISPLAY=localhost:0. You must ensure that there are NO TRAILING SPACES on this line; pressing the right arrow key at the end of the text should either do nothing or jump the cursor to the next line.

With an X11 server installed, and the mcnp_env_620.bat file setting the DISPLAY variable appropriately, the geometry and tally plotter should work properly when the MCNP Command Prompt is restarted. If it doesn't work, try restarting the computer and ensure the X11 server is running. Then launch the MCNP Command Prompt and try the plotter again. If this still doesn't work, please email mcnp_help@lanl.gov with the steps you've taken to get the plotter working.

Getting the MCNP Plotter to Work on macOS

Users on macOS should install the XQuartz software. After installing and rebooting, the geometry and tally plotters should work. If they do not work, please email mcnp_help@lanl.gov with the steps you've taken to get the plotter working.

Getting the MCNP Plotter to Work on Linux

Linux users should have X11 servers installed by default. If you cannot get the plotter to work, ensure your system has the appropriate packages installed. These vary between systems, and the MCNP team cannot make a general recommendation for Linux.

Cloud

An Internet-based "Cloud" installation the MCNP code is provided by Oak Ridge National Laboratory. All questions regarding this service should be sent to the RSICC email.

Linux

Considerations on building MCNP5—MCNP6.2

The MCNP6 build system uses the GNU version of make, so you need to be careful about any environment variables that affect building and testing.

The MCNP developers always compile the code with multiple threads: make build GNUJ=8 which would be equivalent to setting the environment variable MAKEFLAGS as: export MAKEFLAGS=' -j 8 ' && make build

For running REGRESSION tests or other tests, parallel execution using multiple make instances does not work, since some of the tests must be run in a certain order.

  • To run the tests sequentially: make test
  • To run the tests threaded: make test NTRD=8
Do not use the -j 8 flag for make, and do not set it via the MAKEFLAGS environment variable.

macOS

I installed MCNP6.2 on macOS 10.15+ and it's not working. Why?

Beginning with macOS Catalina, the default user shell has been changed from Bash to Z shell. The MCNP code expects to be installed in a Bash shell and thus sets up Bash dotfiles with the necessary environment variables. The current shell can be queried with the following command: echo $SHELL. If the terminal reports "/bin/zsh", continue reading. If the terminal reports "/bin/bash", first try starting a new termial session. If that still doesn't work, send an email to mcnp_help@lanl.gov.

A user has several options to get the MCNP code working on macOS with Z shell:
The simplest option is to execute the following command: echo "source ~/.bashrc" >> ~/.zshrc && source ~/.zshrc. This command will read in the entirety of the primary Bash dotfile file to the Z shell dotfile. A user should be aware of any unexpected lines that may be present in the Bash dotfile that are not relevant to the MCNP code configuration. Undoing changes to the Z shell dotfile is as simple as opening the file in a text editor (e.g., vim ~/.zshrc or open ~/.zshrc) and removing the "source ~/.bashrc" line.
The other option is to open both the Bash and Z shell dotfiles (~/.bashrc and ~/.zshrc respectively) side by side in a text editor. In the Bash dotfile, find the line "#### path for mcnp620". Copy the lines starting here through "ulimit -S -s hard" from the Bash dotfile and paste them at the end of the Z shell dotfile.

If you have followed these steps and are still encountering issues, send an email to mcnp_help@lanl.gov.

Microsoft Windows

Where is the mcnp_env.bat file? I can't find it.

The mcnp_env.bat file is created when you install MCNP6. It is placed into the home folder of the user who performed the installation. If you can't find it, do this from a command window: echo %HOMEDRIVE%%HOMEPATH%

If someone else installed MCNP6 for you (e.g., a system administrator or computer support person), you should ask them to copy the mcnp_env.bat file from their folder %HOMEDRIVE%%HOMEPATH% to yours.

How can I run MCNP6 from a Windows .bat script, without using the MCNP Command window?

You need to use a text editor to create a file, called myjob.bat below, that includes commands to set the proper Windows environment variables for MCNP6 and Windows, and then runs MCNP6.

For example, assuming that C:\my_mcnp\ is where you installed MCNP, put the following in the myjob.bat file. Then you can run the job by double-clicking the myjob.bat file, which contains:

      @ PATH C:\my_mcnp\MCNP_CODE\bin;%PATH%
      @ set DATAPATH=C:\my_mcnp\MCNP_DATA
      @ set DISPLAY=localhost:0
      start/wait  mcnp6  i=myinp.txt   tasks 4
      pause

The start/wait and pause are optional. The start/wait allows the batch file to pick up where it left off if you interrupt a run, then return to it (after checking status or plotting). The pause keeps the window open after MCNP6 completes, so that you can see any messages. (Thanks to Mark Hogue for the suggestions.)

How can I fix the error "This application was unable to start correctly (0xc000007b)"?

Typical situation: I've tried multiple installs of the MCNP6 package from RSICC on two machines with Windows 7 and one in XP. In all cases with Windows 7 the installation looks good, but it will not run. I get this error when trying to run the test problems: The fact that I succeeded on the XP machine suggests that this is not user error. Any suggestions?

We have seen this problem a number of times -- it's due to Windows, not MCNP. Here are 2 possible solutions:

  1. Earlier versions of Windows 7 did NOT include this DLL file: msvcr100.dll A later WIndows upgrade did include that DLL file. So, one possible solution to your problem is: upgrade your Windows 7 to the latest version (i.e., apply patches or updates).
  2. If you don't want to do that (or aren't allowed), then here is a workaround:
    1. In the folder MCNP_CODE\MCNP6\bin\windows there are files named x64_msvcr100.dll and x86_msvcr100.dll. If you have a 64-bit Windows OS (probably), then choose the x64_ version; if a 32-bit Windows OS, then choose the x86_ version.
    2. Copy that file to the folder MCNP_CODE\bin and then rename it (in the new folder) as msvcr100.dll
    3. Then, also copy that new file to the folder MCNP_CODE\MCNP6\bin
That should fix the problem. (It did for us on an un-updated Windows 7 system.) Run the installation tests to check.

CAUTION: This msvcr100.dll file will be used by anything that needs it, if you run from the MCNP command window, since it puts MCNP_CODE\bin first on its execution search path. If you someday bring your Windows 7 up to date, then you will want to delete the file MCNP_CODE\bin\msvcr100.dll

You may want to discuss either of the above fixes with your computer sysadmin.

The installation for MCNP6.2 is failing at Step 4 and I don't get the square blue desktop icon.

It may be that your IT/IT Security team has disabled running Visual Basic script (.vbs) files. Please work with them to ensure you can execute a .vbs file. If you can, it may instead be that the file is not associated properly with the Windows-based Script Host. This StackOverflow post or similar may provide a way to overcome this. A normal Windows MCNP6.2 installation should behave as shown here.

Parallel Processing

This section refers to the July 2013 release of MCNP6.1 from RSICC and newer versions of the MCNP code.

MCNP6 supports 2 types of parallel processing that can be used separately or together:

  • Threading: OpenMP threading on a single multicore computer (eg, laptop, office computer) or on a single node of a server or cluster (eg, 1 node in a cluster, with 1 or more processors or cores sharing memory)
  • MPI: Message-passing between nodes on a cluster using some external MPI environment and libraries.

Details on Threading

All recent computers use multi-core processors. By default, MCNP6 will only use one of the processor cores (to avoid consuming all of the system resources). If you want to use more than one CPU core, just add tasks n to the MCNP execution line command, where "n" is the number of CPU cores that you want MCNP6 to use.

For example, mcnp6 i=myinp.txt tasks 4 would direct MCNP6 to use 4 cpu-cores when following histories. The value "n" should be chosen considering your specific processor: For my laptop, with an Intel i7 with 2 cpu-cores and 2 hyperthreads per core, one might use "tasks 4".

The default version of MCNP6 from the installation includes the aforementioned threading capability. It is not necessary to copy other versions, rename executables, etc. Just run the code with the appropriate "tasks n" supplied.

Details on MPI and High-performance Computing Clusters

If you want to run MCNP6 using multiple nodes on a cluster, then you must first install an MPI package on your cluster.

For Windows clusters, the precompiled MCNP6 executable is based on the MPICH2 package obtained from Argonne National Laboratory. That was found to be reasonably easy to install in precompiled binaries. The MCNP6 executable for 64-bit Windows is found at MCNP_CODE\MCNP6\bin\windows\mcnp6_windows_x86_64_omp_mp and should be copied (and renamed) to MCNP_CODE\bin\mcnp6_mpi.exe. You can then run an MPI job as mpirun -np 8 mcnp6_mpi i=myinp.txt.

For macOS and Linux, you will need to install a version of MPI. The MCNP development team uses OpenMPI from The OpenMPI website. Then, you must compile the MCNP6 executable yourself, so that the proper linkage to MPI libraries is made. For example, one might use the command cd ~/MyMCNP/MCNP_CODE/MCNP6 && make CONFIG='intel plot omp openmpi' install.

When MCNP6 is built for MPI, an executable called mcnp6.mpi is created in the MCNP_CODE/MCNP6/bin directory. You should also copy this to the MCNP_CODE/bin directory. Then an MPI job can be run as mpirun -np 8 mcnp6.mpi i=myinp.txt

Details on Combining Threading & MPI

If MPI is installed, and an mcnp6.mpi executable was built, then threading and MPI can both be used. For an 8-node cluster with 16 cpu-cores per node, you could run with 128 cpu-cores by

    mpirun -np 8 -bynode mcnp6.mpi i=myinp.txt tasks 16

Other Comments on High-performance Computing Clusters

Unfortunately, most clusters are configured differently, with job queuing systems such as Moab or LSF, different "module" packages, different versions of MPI, etc. Installing MPI & having the cluster software configured consistently is not for beginners. You may need to consult with your cluster administrator, or enlist the aid of some talented young student...