|
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Go to the documentation of this file.
58 : is_opencl_verbose_(false),
59 is_material_database_verbose_(false),
60 is_source_verbose_(false),
61 is_navigator_verbose_(false),
62 is_memory_ram_verbose_(false),
63 is_process_verbose_(false),
64 is_range_cuts_verbose_(false),
65 is_random_verbose_(false),
66 is_tracking_verbose_(false),
67 is_profiling_verbose_(false),
68 particle_tracking_id_(0)
70 GGcout(
"GGEMS",
"GGEMS", 3) <<
"GGEMS creating..." <<
GGendl;
72 GGcout(
"GGEMS",
"GGEMS", 3) <<
"GGEMS created!!!" <<
GGendl;
81 GGcout(
"GGEMS",
"~GGEMS", 3) <<
"GGEMS erasing..." <<
GGendl;
83 GGcout(
"GGEMS",
"~GGEMS", 3) <<
"GGEMS erased!!!" <<
GGendl;
183 GGcout(
"GGEMS",
"Initialize", 1) <<
"Initialization of GGEMS Manager singleton..." <<
GGendl;
244 GGcout(
"GGEMS",
"Initialize", 0) <<
"GGEMS initialization succeeded" <<
GGendl;
265 std::cout <<
"[GGEMS GGEMS::RunOnDevice] (thread " << thread_index <<
") ## Source " << source_manager.
GetNameOfSource(i) <<
" on " << opencl_manager.
GetDeviceName(device_index) <<
GGendl;
270 for (
GGsize j = 0; j < number_of_batchs; ++j) {
274 source_manager.
GetPrimaries(i, thread_index, number_of_particles);
277 GGint loop_counter = 0, max_loop = 100;
280 navigator_manager.
FindSolid(thread_index);
292 }
while (source_manager.
IsAlive(thread_index) || loop_counter == max_loop);
306 GGcout(
"GGEMS",
"Run", 0) <<
"GGEMS simulation started" <<
GGendl;
313 std::thread* thread_device =
new std::thread[number_of_activated_devices];
315 for (
GGsize i = 0; i < number_of_activated_devices; ++i) {
319 for (
GGsize i = 0; i < number_of_activated_devices; ++i) thread_device[i].join();
322 delete[] thread_device;
325 GGcout(
"GGEMS",
"Run", 1) <<
"Saving results..." <<
GGendl;
337 GGcout(
"GGEMS",
"Run", 0) <<
"GGEMS simulation succeeded" <<
GGendl;
348 std::cout << std::endl;
349 std::cout <<
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" << std::endl;
350 std::cout <<
"$ ___ ___ ___ __ __ ___ _ $" << std::endl;
351 std::cout <<
"$ / _> / _> | __>| \\ \\/ __> _ _ / | $" << std::endl;
352 std::cout <<
"$ | <_/\\| <_/\\| _> | |\\__ \\ | | || | $" << std::endl;
353 std::cout <<
"$ `____/`____/|___>|_|_|_|<___/ |__/ |_| $" << std::endl;
354 std::cout <<
"$ $" << std::endl;
355 std::cout <<
"$ Welcome to GGEMS v1.1 https://ggems.fr $" << std::endl;
356 std::cout <<
"$ Copyright (c) GGEMS Team 2021 $" << std::endl;
357 std::cout <<
"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" << std::endl;
358 std::cout << std::endl;
367 return new(std::nothrow)
GGEMS();
bool is_tracking_verbose_
static GGEMSSourceManager & GetInstance(void)
Create at first time the Singleton.
GGEMS class handling RAM memory.
void ProjectToSolid(GGsize const &thread_index) const
Project particle to selected solid.
GGEMS class managing the range cuts in GGEMS simulation.
GGEMS * create_ggems(void)
Get the GGEMS pointer for python user.
void PrintInfos(void) const
printing infos about random
GGEMS class handling the navigators (detector + phantom) in GGEMS.
void GetPrimaries(GGsize const &source_index, GGsize const &thread_index, GGsize const &number_of_particles) const
Generate primary particles for a specific source.
void PrintInfos(void) const
Print all infos about processes.
void set_material_database_verbose_ggems(GGEMS *ggems, bool const is_material_database_verbose)
Set the material database verbosity.
bool is_range_cuts_verbose_
void DisplayTime(DurationNano const &duration, std::string const &displayed_text)
Print the execution time.
GGsize GetNumberOfSources(void) const
Get the number of sources.
GGsize GetNumberOfActivatedDevice(void) const
get the number of activated devices
void PrintDeviceInfos(void) const
print all informations about devices
static GGEMSRangeCutsManager & GetInstance(void)
Create at first time the Singleton.
static GGEMSProfilerManager & GetInstance(void)
Create at first time the Singleton.
GGEMS class handling RAM memory.
GGEMS class managing the processes in GGEMS simulation.
void SetMaterialDatabaseVerbose(bool const &is_material_database_verbose)
set the flag for material database verbosity
void PrintActivatedDevices(void) const
print infos about activated devices
static GGEMSRAMManager & GetInstance(void)
Create at first time the Singleton.
GGEMSPseudoRandomGenerator * GetPseudoRandomGenerator(void) const
method returning the OpenCL stack on pseudo random numbers
void set_process_ggems(GGEMS *ggems, bool const is_process_verbose)
Set the processes verbosity.
void PrintPlatformInfos(void) const
print all the informations about the platform
void PrintBuildOptions(void) const
print global build options used during kernel compilation
void Initialize(GGuint const &seed=0)
Initialization of the GGEMS simulation.
GGsize GetNumberOfParticlesInBatch(GGsize const &source_index, GGsize const &device_index, GGsize const &batch_index)
method returning the number of particles in a specific batch
void Initialize(GGuint const &seed, bool const &is_tracking=false, GGint const &particle_tracking_id=0) const
Initialize a GGEMS source.
void set_tracking_ggems(GGEMS *ggems, bool const is_tracking_verbose, GGint const particle_id_tracking)
Set the tracking verbosity.
void SetProfilingVerbose(bool const &is_profiling_verbose)
set the flag for profiling timer verbosity
void SetOpenCLVerbose(bool const &is_opencl_verbose)
set the flag for OpenCL verbosity
void PrintInfos(void) const
Printing infos about the navigators.
static GGEMSNavigatorManager & GetInstance(void)
Create at first time the Singleton.
void set_profiling_ggems(GGEMS *ggems, bool const is_profiling_verbose)
Set the profiling verbosity.
std::chrono::time_point< std::chrono::system_clock > ChronoTime
void run_ggems(GGEMS *ggems)
Run the GGEMS simulation.
void SetTrackingVerbose(bool const &is_tracking_verbose, GGint const &particle_tracking_id)
set the flag for tracking verbosity and an index for particle tracking
void WorldTracking(GGsize const &thread_index) const
Tracking particles through world.
bool IsReady(void) const
check if the material manager is ready
void delete_ggems(GGEMS *ggems)
Delete GGEMS pointer.
GGEMS class managing profiler data.
GGEMS class handling the navigators (detector + phantom) in GGEMS.
GGEMS class managing the complete simulation.
void SetRangeCutsVerbose(bool const &is_range_cuts_verbose)
set the flag for range cuts verbosity
void SetRandomVerbose(bool const &is_random_verbose)
set the flag for random verbosity
bool is_navigator_verbose_
void PrintInfos(void) const
Printing infos about the sources.
void SetSourceVerbose(bool const &is_source_verbose)
set the flag for source verbosity
void Initialize(bool const &is_tracking=false) const
Initialize a GGEMS navigators.
void PrintAvailableProcesses(void) const
Print all infos about available processes.
void Run(void)
run the GGEMS simulation
void PrintInfos(void) const
print infos about range cut manager
void TrackThroughSolid(GGsize const &thread_index) const
Track particles through selected solid.
static GGEMSMaterialsDatabaseManager & GetInstance(void)
Create at first time the Singleton.
void SaveResults(void) const
save all results from navigator in files
void set_navigator_ggems(GGEMS *ggems, bool const is_navigator_verbose)
Set the navigator verbosity.
bool IsAlive(GGsize const &thread_index) const
check if some particles are alive in OpenCL particle buffer
void set_source_ggems(GGEMS *ggems, bool const is_source_verbose)
Set the source verbosity.
void set_memory_ram_ggems(GGEMS *ggems, bool const is_memory_ram_verbose)
Set the memory RAM verbosity.
GGEMS class handling the source(s)
std::string GetNameOfSource(GGsize const &source_index) const
get the name of the source
void PrintSummaryProfile(void) const
print summary profile
bool is_profiling_verbose_
GGEMS class managing the processes in GGEMS simulation.
void SetMemoryRAMVerbose(bool const &is_memory_ram_verbose)
set the flag for memory RAM verbosity
void initialize_ggems(GGEMS *ggems, GGuint const seed)
Initialize GGEMS simulation.
void set_random_ggems(GGEMS *ggems, bool const is_random_verbose)
Set the random verbosity.
bool is_material_database_verbose_
GGEMS(void)
GGEMS constructor.
#define GGendl
overload C++ std::endl
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
GGsize GetNumberOfBatchs(GGsize const &source_index, GGsize const &device_index) const
method returning the number of particles by batch
void set_range_cuts_ggems(GGEMS *ggems, bool const is_range_cuts_verbose)
Set the range cuts verbosity.
~GGEMS(void)
GGEMS destructor.
void set_opencl_verbose_ggems(GGEMS *ggems, bool const is_opencl_verbose)
Set the OpenCL verbosity.
void RunOnDevice(GGsize const &thread_index)
run the GGEMS simulation on each thread associated to a OpenCL device
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
GGEMS class managing profiler data.
GGEMS class managing the GGEMS simulation.
GGEMS class handling the source(s)
void SetProcessVerbose(bool const &is_process_verbose)
set the flag for process verbosity
Class managing the random number in GGEMS.
void FindSolid(GGsize const &thread_index) const
Find closest solid before project particle to it.
void PrintRAMStatus(void) const
print the RAM memory status for activated context
void SetNavigatorVerbose(bool const &is_navigator_verbose)
set the flag for navigator verbosity
bool is_memory_ram_verbose_
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
GGint particle_tracking_id_
GGEMS class managing the material database.
void ComputeDose(GGsize const &thread_index)
Compute dose in volume.
GGEMS class managing the range cuts in GGEMS simulation.
static GGEMSProcessesManager & GetInstance(void)
Create at first time the Singleton.
void PrintBanner(void) const
Print GGEMS banner.
void ThrowException(std::string const &class_name, std::string const &method_name, std::string const &message)
Throw a C++ exception.
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
void PrintAvailableMaterials(void) const
Printing all the available materials.