ASCOT5
|
Simulation is initialized and run from here. More...
#include <string.h>
#include <unistd.h>
#include "endcond.h"
#include "particle.h"
#include "plasma.h"
#include "wall.h"
#include "boozer.h"
#include "mhd.h"
#include "neutral.h"
#include "B_field.h"
#include "E_field.h"
#include "random.h"
#include "simulate.h"
#include "print.h"
#include "simulate/simulate_ml_adaptive.h"
#include "simulate/simulate_gc_adaptive.h"
#include "simulate/simulate_gc_fixed.h"
#include "simulate/simulate_fo_fixed.h"
#include "simulate/mccc/mccc.h"
#include "gctransform.h"
#include "asigma.h"
Go to the source code of this file.
Functions | |
void | sim_monitor (char *filename, volatile int *n, volatile int *finished) |
Monitor simulation progress. | |
void | simulate (int n_particles, particle_state *p, sim_data *sim) |
Execute marker simulation. | |
void | simulate_init (sim_data *sim) |
Initialize simulation data struct. | |
Simulation is initialized and run from here.
This module acts as an interface through which different types of simulations are initialized and run. This module handles no IO operations (with the exception of writing of progress update), no offloading (only unpacking and initialization is done here).
Thread level parallelisation is done here and the threads have shared access on the data once it has been initialized. However, threads should only modify marker and diagnostic data.
Definition in file simulate.c.
void sim_monitor | ( | char * | filename, |
volatile int * | n, | ||
volatile int * | finished ) |
Monitor simulation progress.
This function contains a loop that is repeated until all markers have finished simulation. Loops are executed at interval defined by A5_PRINTPROGRESSINTERVAL in ascot5.h.
At each loop, number of markers that have finished simulation is written to output file, along with time spent on simulation and estimated time remaining for the simulation to finish.
filename | pointer to file where progress is written. File is opened and closed outside this function |
n | pointer to number of total markers in simulation queue |
finished | pointer to number of finished markers in simulation queue |
Definition at line 334 of file simulate.c.
void simulate | ( | int | n_particles, |
particle_state * | p, | ||
sim_data * | sim ) |
Execute marker simulation.
This simulates markers using given inputs and options. All different types of simulations are initialized and run via this function.
This function proceeds as follows:
n_particles | total number of markers to be simulated |
p | pointer to array storing all marker states to be simulated |
sim_offload | pointer to simulation offload data |
offload_data | pointer to the rest of the offload data |
offload_array | pointer to input data offload array |
int_offload_array | pointer to input data int offload array |
diag_offload_array | pointer to diagnostics offload array |
Definition at line 83 of file simulate.c.
void simulate_init | ( | sim_data * | sim | ) |
Initialize simulation data struct.
sim | pointer to data struct |
Definition at line 306 of file simulate.c.