Command Line Options

General options


Print minimal help.

$ fred -h


Print version info: number, changeset and build date.

$ fred -v
fred Version 3.0  (028d8d2c3da) - 2019/10/01


Print the version number only.

$ fred -vn

New in version 3.58.7

-f path

use path as main input file instead of default fred.inp

fred -f waterphantom.f

-i path

Use path as input directory instead of the current working directory.

$ fred -i myInputDir

-o path

Use path as output directory instead of default out.

$ fred -o myOutputDir

-benchmark N

Run the standard benchmark for N primary particles

$ fred -benchmark 1E5


Run the system performance scan both for CPU and GPU.


Run the GPU resource locator.


Manage FRED installed versions: change, delete, move, etc. For system-wide installations it will require root privileges.


List available FRED versions installed on the system.

-useVers fredVersion

Switch to fredVersion version temporary (only for current simulation).

$ fred -useVers fred_3.0.18

-colorOutput | -C

Activate color output for ANSI compatible terminals.


Print information on defined particles.


Print information on built-in material definitions.

Simulation control


Run simulation in a dry run. No particles will be generated or tracked.

-nprim N

Set number of primary particles per pencil beam. This command overrides any other nprim definition in the input files.

$ fred -nprim 1e5

-nrep N

Repeat the simulation N times. Every time a statistically independent run is performed, so you can afterwards evaluate the statistical fluctuations in the simulated maps.

$ fred -nrep 5


In order to have different runs, the randSeedRoot must not be defined in the input files or set to 0. In this way the random seed is taken from a high resolution generator connected to the system clock.


After 5 repetitions, the simulation folder will look like shown below, with out folders for each repetition.



This option can be used in combination with -o option to obtain a numbered sequence of output directories. For instance, the command:

$ fred -nrep 4 -o mytest

will produce:


-repbeg N

Index of the first repetition. For instance, to run 4 repetitions starting from index 15:

$ fred -nrep 4 -repbeg 15

and we get:


-rseed N

Initialize the seed of the random generator. N must be a 64-bit unsigned integer (uint64). This overrides any other randSeedRoot definition in the input files.

$ fred -rseed 4637646287

Execution control


Single thread execution on a CPU (sequential non-parallel execution). This is a shortcut for -numThreads 1 (see below).


Do not use GPU, if present: run on CPU only.


Require GPU execution. This will fail if no GPU is available.

-numThreads N

Run with N parallel threads at the CPU level. For instance, if you want to run with 32 threads on the CPU without using any GPU, run:

$ fred -numThreads 32 -nogpu

-nspawn N

Launch N independent copies of the simulation. It is meant to be used in combination with option -nrep, to accelerate repetitions by running them in parallel. This is especially needed when running with a plugin that demands for serial execution.


Use this option with care. It can easily bring a workstation to its knees by using all computing resources, memory and disk space.


For instance, if you want to run 1000 repetitions in serial mode (1 thread per simulation) using 10 cores at the same time, you can use:

$ fred -nrep 1000 -serial -nspawn 10

Plugin control


Do not load and use any plugin.


Run only if at least a plugin is found and loaded.

-plugindir path

Use path as starting directory to search for plugins.


Create a plugin directory from the built-in template.

$ fred -install-plugin


Make sure that plugin interface library is aligned with current version of FRED executable.

$ fred -update-plugin