ASCOT5
|
Header file for mpi_interface.c. More...
Go to the source code of this file.
Macros | |
#define | mpi_type_integer MPI_LONG |
ASCOT integer in MPI standard. | |
#define | mpi_type_real MPI_DOUBLE |
ASCOT real in MPI standard | |
#define | mpi_type_a5err MPI_UNSIGNED_LONG_LONG |
ASCOT error in MPI standard | |
Functions | |
void | mpi_interface_barrier () |
Wait until all processes have reached this routine. | |
void | mpi_interface_init (int argc, char **argv, int *mpi_rank, int *mpi_size, int *mpi_root) |
Initialize MPI. | |
void | mpi_interface_finalize () |
Finalize MPI. | |
void | mpi_my_particles (int *start_index, int *n, int ntotal, int mpi_rank, int mpi_size) |
Divide markers to mpi processes. | |
void | mpi_gather_particlestate (particle_state *ps, particle_state **psgathered, int *ngathered, int ntotal, int mpi_rank, int mpi_size, int mpi_root) |
Gather all particle states to the root process. | |
void | mpi_gather_diag (diag_offload_data *data, real *offload_array, int ntotal, int mpi_rank, int mpi_size, int mpi_root) |
Gather all diagnostics to the root process. | |
Header file for mpi_interface.c.
Definition in file mpi_interface.h.
#define mpi_type_integer MPI_LONG |
ASCOT integer in MPI standard.
Definition at line 15 of file mpi_interface.h.
#define mpi_type_real MPI_DOUBLE |
ASCOT real in MPI standard
Definition at line 17 of file mpi_interface.h.
#define mpi_type_a5err MPI_UNSIGNED_LONG_LONG |
ASCOT error in MPI standard
Definition at line 19 of file mpi_interface.h.
void mpi_interface_barrier | ( | ) |
Wait until all processes have reached this routine.
Wrapper for the MPI_Barrier.
Definition at line 69 of file mpi_interface.c.
void mpi_interface_init | ( | int | argc, |
char ** | argv, | ||
int * | mpi_rank, | ||
int * | mpi_size, | ||
int * | mpi_root ) |
Initialize MPI.
This function initializes MPI and sets the mpi_rank and mpi_size accordingly. If compiled without MPI, mpirank is set to zero and mpi_size is set to one.
argc | count of the command line arguments |
argv | pointers to the command line arguments |
mpi_rank | pointer to the determined rank of this MPI process |
mpi_size | pointer to the determined number of MPI processes |
mpi_root | pointer to the determined rank of the root MPI process |
Definition at line 30 of file mpi_interface.c.
void mpi_interface_finalize | ( | ) |
Finalize MPI.
This function finalizes the MPI environment, to be called at the end of execution.
Definition at line 58 of file mpi_interface.c.
void mpi_my_particles | ( | int * | start_index, |
int * | n, | ||
int | n_tot, | ||
int | mpi_rank, | ||
int | mpi_size ) |
Divide markers to mpi processes.
This function divides ntotal markers evenly and returns the starting index and number of markers to be simulated for each process.
start_index | pointer to variable for starting index in input markers |
n | pointer to variable for number of markers for this process |
n_tot | number of markers in the simulation |
mpi_rank | rank of this MPI process |
mpi_size | total number of MPI processes |
Definition at line 87 of file mpi_interface.c.
void mpi_gather_particlestate | ( | particle_state * | ps, |
particle_state ** | psgathered, | ||
int * | ngathered, | ||
int | ntotal, | ||
int | mpi_rank, | ||
int | mpi_size, | ||
int | mpi_root ) |
Gather all particle states to the root process.
This function gathers the particle states from each process to an array in the root process. In condor-style execution only particle states for current process are stored. An allocated array for gathered particle states is stored in psgathered and number of states in ngathered.
ps | pointer to array particle states for this process |
ps_gather | pointer to pointer to array where markers are gathered |
n_gather | pointer to variable for number of gathered markers |
n_tot | total number of markers in the simulation |
mpi_rank | rank of this MPI process |
mpi_size | total number of MPI processes |
mpi_root | rank of the root process |
Definition at line 117 of file mpi_interface.c.
void mpi_gather_diag | ( | diag_offload_data * | data, |
real * | offload_array, | ||
int | ntotal, | ||
int | mpi_rank, | ||
int | mpi_size, | ||
int | mpi_root ) |
Gather all diagnostics to the root process.
This function gathers the distributions and orbits to the root process. Distributions are summed and orbit data is appended to the root process diagnostics array.
data | diagnostics offload data |
offload_array | pointer to diagnostics offload array |
ntotal | total number of markers in the simulation |
mpi_rank | rank of this MPI process |
mpi_size | total number of MPI processes |
mpi_root | rank of the root process |
Definition at line 295 of file mpi_interface.c.