Simulations
The simulation is started with:
./ascot5_main
or when using mpirun
(or mpiexec
):
mpirun ./ascot5_main
The default file for reading inputs and storing outputs is ascot.h5
but these can be given explicitly (storing output in the same file with the inputs is strongly recommended):
./ascot5_main --in=in --out=out
The simulation can be given a description (but this can be done in post-processing as well):
ascot5_main --d="TEST This is a test run"
The default behavior is to use inputs that are marked as active in the file, but this can be overridden by providing the input QID explicitly:
ascot5_main --bfield=0123456789
When not using MPI, it is possible to divide the simulation into separate processes manually with:
ascot5_main --mpi_size=size --mpi_rank=rank
Options
Simulation options are listed below. Click on the parameter name for more details. Note that the first underscore does not belong in a parameter name and only appear here for technical reasons.
Simulation mode (1, 2, 3, 4) |
|
Use adaptive time-step (0, 1) |
|
Record GOs as GCs in diagnostics (0, 1) |
|
Define fixed time-step value explicitly (0,1) |
|
User-defined time-step [s] |
|
Time-step is 2pi / ( gyrofrequency * N ) where N is this parameter |
|
Relative error tolerance for orbit following in adaptive scheme |
|
Relative error tolerance for Coulomb collisions in adaptive scheme |
|
Maximum allowed change in rho during one time-step in adaptive scheme |
|
Maximum allowed change in phi during one time-step in adaptive scheme |
Terminate when marker time passes ENDCOND_LIM_SIMTIME or when marker time has advanced ENDCOND_MAX_MILEAGE in a simulation |
|
Terminate marker when the computer has spent ENDCOND_MAX_CPUTIME amount of real time to simulate it |
|
Terminate if marker goes outside given rho boundaries |
|
Terminate when marker energy is below a user-specified value |
|
Terminate when marker intersects a wall element |
|
Terminate when marker has completed user-specified number of orbits |
|
Terminate when the marker becomes neutral |
|
Terminate when the marker becomes ionized |
|
Time when the simulation stops [s] |
|
The maximum amount of time this marker is simulated [s] |
|
Maximum cpu time per marker [s] |
|
Maximum rho value |
|
Minimum rho value |
|
Minimum energy [eV] |
|
Minimum energy limit is local ion thermal energy times this value |
|
Maximum number of toroidal orbits |
|
Maximum number of poloidal orbits |
Trace markers in an electromagnetic field |
|
Markers experience Coulomb collisions with background plasma |
|
Include MHD perturbations to orbit-following |
|
Markers can undergo atomic reactions with background plasma or neutrals |
|
Disable first order guiding center transformation in velocity space |
|
Disable guiding center energy collisions |
|
Disable guiding center pitch collisions |
|
Disable guiding center spatial diffusion |
Collect distribution histogram in [R, phi, z, ppa, ppe, t, q] |
|
Collect distribution histogram in [R, phi, z, pR, pphi, pz, t, q] |
|
Collect distribution histogram in [rho, pol, phi, ppa, ppe, t, q] |
|
Collect distribution histogram in [rho, pol, phi, pR, pphi, pz, t, q] |
|
Minimum bin edge for R coordinate [m] |
|
Maximum bin edge for R coordinate [m] |
|
Number of bins the interval [MIN_R, MAX_R] is divided to |
|
Minimum bin edge for phi coordinate [deg] |
|
Maximum bin edge for phi coordinate [deg] |
|
Number of bins the interval [MIN_PHI, MAX_PHI] is divided to |
|
Minimum bin edge for z coordinate [m] |
|
Maximum bin edge for z coordinate [m] |
|
Number of bins the interval [MIN_Z, MAX_Z] is divided to |
|
Minimum bin edge for rho coordinate [1] |
|
Maximum bin edge for rho coordinate [1] |
|
Number of bins the interval [MIN_RHO, MAX_RHO] is divided to |
|
Minimum bin edge for theta coordinate [deg] |
|
Maximum bin edge for theta coordinate [deg] |
|
Number of bins the interval [MIN_THETA, MAX_THETA] is divided to |
|
Minimum bin edge for ppa coordinate [kg m/s] |
|
Maximum bin edge for ppa coordinate [kg m/s] |
|
Number of bins the interval [MIN_PPA, MAX_PPA] is divided to |
|
Minimum bin edge for ppe coordinate [kg m/s] |
|
Maximum bin edge for ppe coordinate [kg m/s] |
|
Number of bins the interval [MIN_PPE, MAX_PPE] is divided to |
|
Minimum bin edge for pR coordinate [kg m/s] |
|
Maximum bin edge for pR coordinate [kg m/s] |
|
Number of bins the interval [MIN_PR, MAX_PR] is divided to |
|
Minimum bin edge for pphi coordinate [kg m/s] |
|
Maximum bin edge for pphi coordinate [kg m/s] |
|
Number of bins the interval [MIN_PPHI, MAX_PPHI] is divided to |
|
Minimum bin edge for pz coordinate [kg m/s] |
|
Maximum bin edge for pz coordinate [kg m/s] |
|
Number of bins the interval [MIN_PZ, MAX_PZ] is divided to |
|
Minimum bin edge for time coordinate [s] |
|
Maximum bin edge for time coordinate [s] |
|
Number of bins the interval [MIN_TIME, MAX_TIME] is divided to |
|
Minimum bin edge for charge coordinate [e] |
|
Maximum bin edge for charge coordinate [e] |
|
Number of bins the interval [MIN_CHARGE, MAX_CHARGE] is divided to |
Collect constant-of-motion distribution histogram [mu, Ekin, Ptor] |
|
Minimum bin edge for the mu coordinate in COM-dist [J/T] |
|
Maximum bin edge for the mu coordinate in COM-dist [J/T] |
|
Number of bins the interval [MIN_MU, MAX_MU] is divided to |
|
Minimum bin edge for the energy coordinate [J] |
|
Maximum bin edge for the energy coordinate [J] |
|
Number of bins the interval [MIN_EKIN, MAX_EKIN] is divided to |
|
Minimum bin edge for the Ptor coordinate [kg m^2/s] |
|
Maximum bin edge for the Ptor coordinate [kg m^2/s] |
|
Number of bins the interval [MIN_PTOR, MAX_PTOR] is divided to |
Enable diagnostics that store marker orbit |
|
What kind of marker orbit diagnostics are collected |
|
Maximum number of points (per marker) to be written |
|
Poloidal angles of toroidal planes where toroidal plots are collected |
|
Toroidal angles of poloidal planes where poloidal plots are collected |
|
Minor radius coordinate where radial plots are collected |
|
Time interval for writing marker state [s] |
Enable evaluation of transport coefficients. |
|
Time interval for recording data points |
|
Number of subsequent data points that are averaged before calculating coefficients to reduce noise. |
|
Record coefficients in terms of normalized poloidal flux instead of meters. |
Batch jobs
With MPI
#!/bin/bash
## Set required nodes and CPUs (number of processes == number of nodes)
#SBATCH -N10 -n10 -c48
#SBATCH -t 24:00:00
#SBATCH -J ascot5
#SBATCH -e %x.e%j
#SBATCH -o %x.o%j
export <your exports>
module load <your modules>
echo Job name $SLURM_JOB_NAME
echo Job id $SLURM_JOB_ID
# Some platforms require that the number of threads must be given explicitly
# In those cases use (1-2) x number of CPUs (check which is faster)
export OMP_NUM_THREADS=48
INPUTFILE=ascot
date
export FOR_PRINT=$SLURM_JOB_ID.stdout
mpirun ./ascot5_main --in=$INPUTFILE --d="YOURTAG Your description"
date
Without MPI
This results in multiple output files that you have to combine using the python tool a5combine
.
#!/bin/bash
## How many jobs this run is divided into
NJOBS=100
## Name of the input file. Each output file begins with this name followed by
## its "mpi_rank"
INPUTFILE=ascot
for i in $(seq 0 $(($NJOBS-1)))
do
filename=${RANDOM}
cat > $filename << EOF
#!/bin/bash
## Use only single node and single process
#SBATCH -N1 -n1 -c48
#SBATCH -t 24:00:00
#SBATCH -J ascot5
#SBATCH -e ${i}.e%j
#SBATCH -o ${i}.o%j
export <your exports>
module load <your modules>
# Some platforms require that the number of threads must be given explicitly
# In those cases use (1-2) x number of CPUs (check which is faster)
export OMP_NUM_THREADS=96
echo Job name $SLURM_JOB_NAME
echo Job id $SLURM_JOB_ID
date
./ascot5_main --mpi_rank=$i --mpi_size=$NJOBS --in=$INPUTFILE --d="YOURTAG Your description"
date
EOF
sbatch $filename
rm $filename
echo $i
## If multiple jobs are reading from the same file at the same time this can
## cause problems in the system, so give system some time to breathe
sleep 5s
done
Examples
Simulation |
Hardware |
Number of markers |
CPU time |
---|---|---|---|
Alpha particle slowing-down in 3D ITER (Not real numbers!) |
Xeon-Phi, 10 nodes (MARCONI) |
\(1\times10^6\) |
24 h |