4.1. Execution, requisite files, troubleshooting, etc.¶
This section seeks to expand on Section 1 and provide some more information about running DCHAIN and some common issues. The intended method for executing DCHAIN is with the dchain.bat script (dchain.sh for Unix systems) located in the <PHITS-install>/dchain-sp/bin/ directory. If wishing to use an older version of DCHAIN, the executable referenced in this batch script can be easily changed. If installed alongside PHITS, as is intended, the DCHAIN main directory is <PHITS-install>/dchain-sp/, the bin folders for both PHITS and DCHAIN should be added to your system PATH variable, and a shortcut to dchain.bat should be added to the Windows “Send to” menu which appears when right-clicking a file. DCHAIN may be executed by right clicking the input file and selecting “Send to” then “DCHAIN” or on the command line by invoking dchain.bat and providing it with the input filename as the single argument (> dchain.bat example.in).
From version 3.36, parallel computation has become available also in DCHAIN. In DCHAIN calculations, parallel processing is executed independently for each region or each mesh. Therefore, if the number of regions is smaller than the number of parallel processes, the calculation is performed in parallel only up to the number of regions. DCHAIN supports both shared-memory parallelism (OpenMP) and distributed-memory parallelism (MPI). Hybrid parallelism (OpenMP + MPI) is not supported. When running DCHAIN using scripts (dchain.bat or dchain.sh), shared-memory parallel computation can be enabled by specifying $OMP=N (where N is the number of CPU cores to be used) in the first line of the DCHAIN input file. If N = 1, the calculation is not performed in parallel, and the single-version executable is used. Distributed-memory parallel execution with M processes can be performed by specifying $MPI=M. Note that for distributed-memory parallel execution, an MPI parallel environment must be prepared in advance by installing Intel MPI, OpenMPI, MPICH2, or similar software. For details, please refer to Section 11.1.1 of the PHITS manual. If any error messages are displayed, please report them to the PHITS office together with information on the PC environment used for execution.
In principle, a DCHAIN run requires four files: (1) the DCHAIN input file, (2) the neutron flux file (HNFLUXS), (3) the nuclide yield file (HHNMTCF), and (4) dch_link.dat. If a requisite file is missing, the run will abort and print a corresponding error message. DCHAIN relies on data libraries found in <PHITS-install>/dchain-sp/data/, and dch_link.dat is just a single-line file containing the absolute path to this folder. Within PHITS, it is set by file(21) in the [Parameters] section with this default path; if using a custom path, you may need to change this if encountering errors about not being able to find files.
The input file, in principle, can be named whatever you wish with some restrictions. The input filename may not conflict with any of the other requisite files or with any of the output file names listed in Table 4.4.1 (in either the Batch or Standalone columns), detailed in Section 4.4. In this manual, the DCHAIN input file is typically referred to as having the .in extension (example.in) for the sake of clarity; however, one should note this is not the notation adopted in the PHITS documentation. Instead, the PHITS documentation typically assigns this file the .out extension (example.out) as it is indeed the output from the [T-Dchain] tally. (And the PHITS manual typically uses .inp to designate PHITS input files.) The output files produced by DCHAIN will share the same base name as the input file but have differing extensions (example.*).
The neutron flux (.dtrk) and yield (.dyld) tally files, created by [T-Dchain]’s custom [T-Track] and [T-Yield] tallies, respectively, are typically required to be present for DCHAIN to run. However, if JMODE is set to negate the need for these quantities (JMODE of 0 to disable neutron flux, 1 to disable nuclide yields, and -1 to disable both), the files are not required to be present, and any mention of them in the input file is ignored.
If DCHAIN crashes or you forcibly quit it (pressing + while in the DCHAIN terminal window), some of the conflicting files may need to be deleted before DCHAIN can be ran again (specifically, this is usually just yield.out). Otherwise, be warned that DCHAIN will overwrite any preexisting files present in the directory when encountering any conflicting file names. Many scripted error messages are present within DCHAIN, and if any are encountered, DCHAIN will gracefully abort, printing the error message to the end of the .lst file and also to the terminal window (if using the batch script). In the uncommon event that DCHAIN unexpectedly crashes, the end of the .lst file will give you an idea of where the code crashed and perhaps hint toward what may had gone awry. If you wish to receive support relating to DCHAIN or report any issues, please use the contact form on the PHITS website: https://phits.jaea.go.jp/contact/edit/en