Moved serial mode to target mcelecron_serial.
Implemented parallelization with mpi.
This commit is contained in:
@@ -9,71 +9,49 @@
|
||||
#ifndef simulation_hpp
|
||||
#define simulation_hpp
|
||||
|
||||
#include "h5_file.hpp"
|
||||
#include "timer.hpp"
|
||||
|
||||
#include "logger_builder.hpp"
|
||||
#include "population_builder.hpp"
|
||||
|
||||
#include "injector.hpp"
|
||||
#include "mover_builder.hpp"
|
||||
#include "interaction_builder.hpp"
|
||||
#include "terminator_builder.hpp"
|
||||
|
||||
#include "population_load_saver.hpp"
|
||||
|
||||
#include "particle_looper.hpp"
|
||||
|
||||
class Simulation {
|
||||
static const long int seed;
|
||||
static const long int numberTotalDecays;
|
||||
static const long int simulationStepWidth;
|
||||
|
||||
UniRNG rngUni;
|
||||
NormalRNG rngNormal;
|
||||
long int numberTotalParticles = 0;
|
||||
long int number_local_decays = 0;
|
||||
long int number_global_decays = 0;
|
||||
|
||||
H5_File h5f;
|
||||
Timer timer;
|
||||
Particle_Looper looper;
|
||||
|
||||
Particle_Logger_Manager part_loggers;
|
||||
Population_Manager populations;
|
||||
int mpi_rank;
|
||||
int mpi_size;
|
||||
|
||||
|
||||
Injector injector;
|
||||
Mover_Manager movers;
|
||||
Interaction_Manager interactions;
|
||||
Terminator_Manager terminators;
|
||||
|
||||
Population_Logger_Manager pop_loggers;
|
||||
Population_Load_Saver pop_load_saver;
|
||||
|
||||
|
||||
int numberTotalParticles = 0;
|
||||
int numberDecays = 0;
|
||||
|
||||
int updater_fraction;
|
||||
int number_pop_species;
|
||||
species *pop_species;
|
||||
int *pop_array_lengths;
|
||||
double **global_cum_time_s, **global_offset;
|
||||
|
||||
public:
|
||||
Simulation() {
|
||||
init();
|
||||
pop_load_saver.load();
|
||||
}
|
||||
~Simulation() {
|
||||
pop_load_saver.save();
|
||||
}
|
||||
|
||||
Simulation();
|
||||
~Simulation();
|
||||
private:
|
||||
void init();
|
||||
void set_RNGs();
|
||||
void set_statusUpdater();
|
||||
void init_pop_arrays();
|
||||
void deconstruct_pop_arrays();
|
||||
|
||||
long int calc_ID_offset();
|
||||
long int calc_seed();
|
||||
|
||||
std::string calc_outfile_path();
|
||||
int calc_dir_number();
|
||||
std::string build_dirname(int dir_number);
|
||||
void create_out_dir(std::string dirname);
|
||||
|
||||
public:
|
||||
void doit();
|
||||
private:
|
||||
void do_decays(int number_decays);
|
||||
void sync_cpus();
|
||||
void sync_populations();
|
||||
void do_statusUpdate();
|
||||
|
||||
public:
|
||||
void doTC6();
|
||||
private:
|
||||
void parameterCheck_TC6();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user