GGEMS  1.1
GPU GEant4-based Monte Carlo Simulations
GGEMS.cc
Go to the documentation of this file.
1 // ************************************************************************
2 // * This file is part of GGEMS. *
3 // * *
4 // * GGEMS is free software: you can redistribute it and/or modify *
5 // * it under the terms of the GNU General Public License as published by *
6 // * the Free Software Foundation, either version 3 of the License, or *
7 // * (at your option) any later version. *
8 // * *
9 // * GGEMS is distributed in the hope that it will be useful, *
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 // * GNU General Public License for more details. *
13 // * *
14 // * You should have received a copy of the GNU General Public License *
15 // * along with GGEMS. If not, see <https://www.gnu.org/licenses/>. *
16 // * *
17 // ************************************************************************
18 
31 #include <fcntl.h>
32 #include <thread>
33 
34 #ifdef _WIN32
35 #ifdef _MSC_VER
36 #define NOMINMAX
37 #endif
38 #include <windows.h>
39 #include <wincrypt.h>
40 #else
41 #include <unistd.h>
42 #endif
43 
44 #include "GGEMS/global/GGEMS.hh"
52 
56 
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)
69 {
70  GGcout("GGEMS", "GGEMS", 3) << "GGEMS creating..." << GGendl;
71 
72  GGcout("GGEMS", "GGEMS", 3) << "GGEMS created!!!" << GGendl;
73 }
74 
78 
80 {
81  GGcout("GGEMS", "~GGEMS", 3) << "GGEMS erasing..." << GGendl;
82 
83  GGcout("GGEMS", "~GGEMS", 3) << "GGEMS erased!!!" << GGendl;
84 }
85 
89 
90 void GGEMS::SetOpenCLVerbose(bool const& is_opencl_verbose)
91 {
92  is_opencl_verbose_ = is_opencl_verbose;
93 }
94 
98 
99 void GGEMS::SetMaterialDatabaseVerbose(bool const& is_material_database_verbose)
100 {
101  is_material_database_verbose_ = is_material_database_verbose;
102 }
103 
107 
108 void GGEMS::SetSourceVerbose(bool const& is_source_verbose)
109 {
110  is_source_verbose_ = is_source_verbose;
111 }
112 
116 
117 void GGEMS::SetNavigatorVerbose(bool const& is_navigator_verbose)
118 {
119  is_navigator_verbose_ = is_navigator_verbose;
120 }
121 
125 
126 void GGEMS::SetMemoryRAMVerbose(bool const& is_memory_ram_verbose)
127 {
128  is_memory_ram_verbose_ = is_memory_ram_verbose;
129 }
130 
134 
135 void GGEMS::SetProcessVerbose(bool const& is_process_verbose)
136 {
137  is_process_verbose_ = is_process_verbose;
138 }
139 
143 
144 void GGEMS::SetProfilingVerbose(bool const& is_profiling_verbose)
145 {
146  is_profiling_verbose_ = is_profiling_verbose;
147 }
148 
152 
153 void GGEMS::SetRangeCutsVerbose(bool const& is_range_cuts_verbose)
154 {
155  is_range_cuts_verbose_ = is_range_cuts_verbose;
156 }
157 
161 
162 void GGEMS::SetRandomVerbose(bool const& is_random_verbose)
163 {
164  is_random_verbose_ = is_random_verbose;
165 }
166 
170 
171 void GGEMS::SetTrackingVerbose(bool const& is_tracking_verbose, GGint const& particle_tracking_id)
172 {
173  is_tracking_verbose_ = is_tracking_verbose;
174  particle_tracking_id_ = particle_tracking_id;
175 }
176 
180 
181 void GGEMS::Initialize(GGuint const& seed)
182 {
183  GGcout("GGEMS", "Initialize", 1) << "Initialization of GGEMS Manager singleton..." << GGendl;
184 
185  // Getting the GGEMS singletons
193 
194  // Get the start time
195  ChronoTime start_time = GGEMSChrono::Now();
196 
197  // Printing the banner with the GGEMS version
198  PrintBanner();
199 
200  // Checking if material manager is ready
201  if (!material_database_manager.IsReady()) GGEMSMisc::ThrowException("GGEMS", "Initialize", "Materials are not loaded in GGEMS!!!");
202 
203  // Initialization of the source
205 
206  // Initialization of the navigators (phantom + system)
207  navigator_manager.Initialize(is_tracking_verbose_);
208 
209  // Printing infos about OpenCL
210  if (is_opencl_verbose_) {
211  opencl_manager.PrintPlatformInfos();
212  opencl_manager.PrintDeviceInfos();
213  opencl_manager.PrintActivatedDevices();
214  opencl_manager.PrintBuildOptions();
215  }
216 
217  // Printing infos about material database
218  if (is_material_database_verbose_) material_database_manager.PrintAvailableMaterials();
219 
220  // Printing infos about source(s)
221  if (is_source_verbose_) source_manager.PrintInfos();
222 
223  // Printing infos about navigator(s)
224  if (is_navigator_verbose_) navigator_manager.PrintInfos();
225 
226  // Printing infos about processe(s)
227  if (is_process_verbose_) {
228  processes_manager.PrintAvailableProcesses();
229  processes_manager.PrintInfos();
230  }
231 
232  // Printing infos about range cuts
233  if (is_range_cuts_verbose_) range_cuts_manager.PrintInfos();
234 
235  // Printing infos about random in GGEMS
236  if (is_random_verbose_) source_manager.GetPseudoRandomGenerator()->PrintInfos();
237 
238  // Printing infos about RAM
239  if (is_memory_ram_verbose_) ram_manager.PrintRAMStatus();
240 
241  // Get the end time
242  ChronoTime end_time = GGEMSChrono::Now();
243 
244  GGcout("GGEMS", "Initialize", 0) << "GGEMS initialization succeeded" << GGendl;
245 
246  // Display the elapsed time in GGEMS
247  GGEMSChrono::DisplayTime(end_time - start_time, "GGEMS initialization");
248 }
249 
253 
254 void GGEMS::RunOnDevice(GGsize const& thread_index)
255 {
259 
260  GGsize device_index = opencl_manager.GetIndexOfActivatedDevice(thread_index);
261 
262  // Loop over sources
263  for (GGsize i = 0; i < source_manager.GetNumberOfSources(); ++i) {
264  mutex.lock();
265  std::cout << "[GGEMS GGEMS::RunOnDevice] (thread " << thread_index << ") ## Source " << source_manager.GetNameOfSource(i) << " on " << opencl_manager.GetDeviceName(device_index) << GGendl;
266  mutex.unlock();
267 
268  // Loop over batch
269  GGsize number_of_batchs = source_manager.GetNumberOfBatchs(i, thread_index);
270  for (GGsize j = 0; j < number_of_batchs; ++j) {
271  GGsize number_of_particles = source_manager.GetNumberOfParticlesInBatch(i, thread_index, j);
272 
273  // Generating particles
274  source_manager.GetPrimaries(i, thread_index, number_of_particles);
275 
276  // Loop until ALL particles are dead
277  GGint loop_counter = 0, max_loop = 100; // Prevent infinite loop
278  do {
279  // Step 2: Find closest navigator (phantom, detector) before projection and track operation
280  navigator_manager.FindSolid(thread_index);
281 
282  // Optional step: World tracking
283  navigator_manager.WorldTracking(thread_index);
284 
285  // Step 3: Project particles to solid
286  navigator_manager.ProjectToSolid(thread_index);
287 
288  // Step 4: Track through step, particles are tracked in selected solid
289  navigator_manager.TrackThroughSolid(thread_index);
290 
291  loop_counter++;
292  } while (source_manager.IsAlive(thread_index) || loop_counter == max_loop); // Step 5: Checking if all particles are dead, otherwize go back to step 2
293  }
294  }
295 
296  // Computing dose
297  navigator_manager.ComputeDose(thread_index);
298 }
299 
303 
305 {
306  GGcout("GGEMS", "Run", 0) << "GGEMS simulation started" << GGendl;
307 
308  ChronoTime start_time = GGEMSChrono::Now();
309 
310  // Creating a thread for each OpenCL device
312  GGsize number_of_activated_devices = opencl_manager.GetNumberOfActivatedDevice();
313  std::thread* thread_device = new std::thread[number_of_activated_devices];
314 
315  for (GGsize i = 0; i < number_of_activated_devices; ++i) {
316  thread_device[i] = std::thread(&GGEMS::RunOnDevice, this, i);
317  }
318 
319  for (GGsize i = 0; i < number_of_activated_devices; ++i) thread_device[i].join();
320 
321  // Deleting threads
322  delete[] thread_device;
323 
324  // End of simulation, storing output
325  GGcout("GGEMS", "Run", 1) << "Saving results..." << GGendl;
327  navigator_manager.SaveResults();
328 
329  // Printing elapsed time in kernels
330  if (is_profiling_verbose_) {
332  profiler_manager.PrintSummaryProfile();
333  }
334 
335  ChronoTime end_time = GGEMSChrono::Now();
336 
337  GGcout("GGEMS", "Run", 0) << "GGEMS simulation succeeded" << GGendl;
338 
339  GGEMSChrono::DisplayTime(end_time - start_time, "GGEMS simulation");
340 }
341 
345 
346 void GGEMS::PrintBanner(void) const
347 {
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;
359 }
360 
364 
366 {
367  return new(std::nothrow) GGEMS();
368 }
369 
373 
374 void delete_ggems(GGEMS* ggems)
375 {
376  if (ggems) {
377  delete ggems;
378  ggems = nullptr;
379  }
380 }
381 
385 
386 void initialize_ggems(GGEMS* ggems, GGuint const seed)
387 {
388  ggems->Initialize(seed);
389 }
390 
394 
395 void set_opencl_verbose_ggems(GGEMS* ggems, bool const is_opencl_verbose)
396 {
397  ggems->SetOpenCLVerbose(is_opencl_verbose);
398 }
399 
403 
404 void set_material_database_verbose_ggems(GGEMS* ggems, bool const is_material_database_verbose)
405 {
406  ggems->SetMaterialDatabaseVerbose(is_material_database_verbose);
407 }
408 
412 
413 void set_source_ggems(GGEMS* ggems, bool const is_source_verbose)
414 {
415  ggems->SetSourceVerbose(is_source_verbose);
416 }
417 
421 
422 void set_navigator_ggems(GGEMS* ggems, bool const is_navigator_verbose)
423 {
424  ggems->SetNavigatorVerbose(is_navigator_verbose);
425 }
426 
430 
431 void set_memory_ram_ggems(GGEMS* ggems, bool const is_memory_ram_verbose)
432 {
433  ggems->SetMemoryRAMVerbose(is_memory_ram_verbose);
434 }
435 
439 
440 void set_process_ggems(GGEMS* ggems, bool const is_process_verbose)
441 {
442  ggems->SetProcessVerbose(is_process_verbose);
443 }
444 
448 
449 void set_range_cuts_ggems(GGEMS* ggems, bool const is_range_cuts_verbose)
450 {
451  ggems->SetRangeCutsVerbose(is_range_cuts_verbose);
452 }
453 
457 
458 void set_random_ggems(GGEMS* ggems, bool const is_random_verbose)
459 {
460  ggems->SetRandomVerbose(is_random_verbose);
461 }
462 
466 
467 void set_profiling_ggems(GGEMS* ggems, bool const is_profiling_verbose)
468 {
469  ggems->SetProfilingVerbose(is_profiling_verbose);
470 }
471 
475 
476 void set_tracking_ggems(GGEMS* ggems, bool const is_tracking_verbose, GGint const particle_id_tracking)
477 {
478  ggems->SetTrackingVerbose(is_tracking_verbose, particle_id_tracking);
479 }
480 
484 
485 void run_ggems(GGEMS* ggems)
486 {
487  ggems->Run();
488 }
GGEMS::is_tracking_verbose_
bool is_tracking_verbose_
Definition: GGEMS.hh:219
GGEMSSourceManager::GetInstance
static GGEMSSourceManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSSourceManager.hh:67
GGEMSRAMManager.hh
GGEMS class handling RAM memory.
GGEMSNavigatorManager::ProjectToSolid
void ProjectToSolid(GGsize const &thread_index) const
Project particle to selected solid.
Definition: GGEMSNavigatorManager.cc:187
GGEMSRangeCutsManager.hh
GGEMS class managing the range cuts in GGEMS simulation.
create_ggems
GGEMS * create_ggems(void)
Get the GGEMS pointer for python user.
Definition: GGEMS.cc:365
GGEMSPseudoRandomGenerator::PrintInfos
void PrintInfos(void) const
printing infos about random
Definition: GGEMSPseudoRandomGenerator.cc:194
GGEMSNavigatorManager.hh
GGEMS class handling the navigators (detector + phantom) in GGEMS.
GGEMSSourceManager::GetPrimaries
void GetPrimaries(GGsize const &source_index, GGsize const &thread_index, GGsize const &number_of_particles) const
Generate primary particles for a specific source.
Definition: GGEMSSourceManager.hh:178
GGEMSProcessesManager::PrintInfos
void PrintInfos(void) const
Print all infos about processes.
Definition: GGEMSProcessesManager.cc:146
set_material_database_verbose_ggems
void set_material_database_verbose_ggems(GGEMS *ggems, bool const is_material_database_verbose)
Set the material database verbosity.
Definition: GGEMS.cc:404
GGEMS::is_range_cuts_verbose_
bool is_range_cuts_verbose_
Definition: GGEMS.hh:217
GGEMSChrono::DisplayTime
void DisplayTime(DurationNano const &duration, std::string const &displayed_text)
Print the execution time.
Definition: GGEMSChrono.cc:38
GGEMSSourceManager::GetNumberOfSources
GGsize GetNumberOfSources(void) const
Get the number of sources.
Definition: GGEMSSourceManager.hh:119
GGEMSOpenCLManager::GetNumberOfActivatedDevice
GGsize GetNumberOfActivatedDevice(void) const
get the number of activated devices
Definition: GGEMSOpenCLManager.hh:167
GGEMSOpenCLManager::PrintDeviceInfos
void PrintDeviceInfos(void) const
print all informations about devices
Definition: GGEMSOpenCLManager.cc:479
GGEMSRangeCutsManager::GetInstance
static GGEMSRangeCutsManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSRangeCutsManager.hh:65
GGEMSProfilerManager::GetInstance
static GGEMSProfilerManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSProfilerManager.hh:66
GGEMSRAMManager
GGEMS class handling RAM memory.
Definition: GGEMSRAMManager.hh:51
GGEMSProcessesManager.hh
GGEMS class managing the processes in GGEMS simulation.
GGEMS::SetMaterialDatabaseVerbose
void SetMaterialDatabaseVerbose(bool const &is_material_database_verbose)
set the flag for material database verbosity
Definition: GGEMS.cc:99
GGEMSOpenCLManager::PrintActivatedDevices
void PrintActivatedDevices(void) const
print infos about activated devices
Definition: GGEMSOpenCLManager.cc:655
GGEMS::is_process_verbose_
bool is_process_verbose_
Definition: GGEMS.hh:216
GGEMSRAMManager::GetInstance
static GGEMSRAMManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSRAMManager.hh:69
GGEMSSourceManager::GetPseudoRandomGenerator
GGEMSPseudoRandomGenerator * GetPseudoRandomGenerator(void) const
method returning the OpenCL stack on pseudo random numbers
Definition: GGEMSSourceManager.hh:169
set_process_ggems
void set_process_ggems(GGEMS *ggems, bool const is_process_verbose)
Set the processes verbosity.
Definition: GGEMS.cc:440
GGEMS::is_source_verbose_
bool is_source_verbose_
Definition: GGEMS.hh:213
GGEMS::is_opencl_verbose_
bool is_opencl_verbose_
Definition: GGEMS.hh:211
GGEMSOpenCLManager::PrintPlatformInfos
void PrintPlatformInfos(void) const
print all the informations about the platform
Definition: GGEMSOpenCLManager.cc:461
GGEMSOpenCLManager::PrintBuildOptions
void PrintBuildOptions(void) const
print global build options used during kernel compilation
Definition: GGEMSOpenCLManager.cc:646
GGEMS::Initialize
void Initialize(GGuint const &seed=0)
Initialization of the GGEMS simulation.
Definition: GGEMS.cc:181
GGEMSSourceManager::GetNumberOfParticlesInBatch
GGsize GetNumberOfParticlesInBatch(GGsize const &source_index, GGsize const &device_index, GGsize const &batch_index)
method returning the number of particles in a specific batch
Definition: GGEMSSourceManager.hh:155
GGEMSSourceManager::Initialize
void Initialize(GGuint const &seed, bool const &is_tracking=false, GGint const &particle_tracking_id=0) const
Initialize a GGEMS source.
Definition: GGEMSSourceManager.cc:130
set_tracking_ggems
void set_tracking_ggems(GGEMS *ggems, bool const is_tracking_verbose, GGint const particle_id_tracking)
Set the tracking verbosity.
Definition: GGEMS.cc:476
GGEMS::SetProfilingVerbose
void SetProfilingVerbose(bool const &is_profiling_verbose)
set the flag for profiling timer verbosity
Definition: GGEMS.cc:144
GGEMS::SetOpenCLVerbose
void SetOpenCLVerbose(bool const &is_opencl_verbose)
set the flag for OpenCL verbosity
Definition: GGEMS.cc:90
GGEMSNavigatorManager::PrintInfos
void PrintInfos(void) const
Printing infos about the navigators.
Definition: GGEMSNavigatorManager.cc:162
GGEMSNavigatorManager::GetInstance
static GGEMSNavigatorManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSNavigatorManager.hh:60
GGsize
#define GGsize
Definition: GGEMSTypes.hh:252
set_profiling_ggems
void set_profiling_ggems(GGEMS *ggems, bool const is_profiling_verbose)
Set the profiling verbosity.
Definition: GGEMS.cc:467
ChronoTime
std::chrono::time_point< std::chrono::system_clock > ChronoTime
Definition: GGEMSChrono.hh:39
GGint
#define GGint
Definition: GGEMSTypes.hh:224
run_ggems
void run_ggems(GGEMS *ggems)
Run the GGEMS simulation.
Definition: GGEMS.cc:485
GGEMS::SetTrackingVerbose
void SetTrackingVerbose(bool const &is_tracking_verbose, GGint const &particle_tracking_id)
set the flag for tracking verbosity and an index for particle tracking
Definition: GGEMS.hh:172
GGEMSNavigatorManager::WorldTracking
void WorldTracking(GGsize const &thread_index) const
Tracking particles through world.
Definition: GGEMSNavigatorManager.cc:209
GGEMSMaterialsDatabaseManager::IsReady
bool IsReady(void) const
check if the material manager is ready
Definition: GGEMSMaterialsDatabaseManager.hh:155
delete_ggems
void delete_ggems(GGEMS *ggems)
Delete GGEMS pointer.
Definition: GGEMS.cc:374
GGEMSProfilerManager
GGEMS class managing profiler data.
Definition: GGEMSProfilerManager.hh:48
GGEMSNavigatorManager
GGEMS class handling the navigators (detector + phantom) in GGEMS.
Definition: GGEMSNavigatorManager.hh:42
GGEMS
GGEMS class managing the complete simulation.
Definition: GGEMS.hh:51
GGEMS::is_random_verbose_
bool is_random_verbose_
Definition: GGEMS.hh:218
GGEMS::SetRangeCutsVerbose
void SetRangeCutsVerbose(bool const &is_range_cuts_verbose)
set the flag for range cuts verbosity
Definition: GGEMS.cc:153
GGEMS::SetRandomVerbose
void SetRandomVerbose(bool const &is_random_verbose)
set the flag for random verbosity
Definition: GGEMS.cc:162
GGEMS::is_navigator_verbose_
bool is_navigator_verbose_
Definition: GGEMS.hh:214
GGEMSSourceManager::PrintInfos
void PrintInfos(void) const
Printing infos about the sources.
Definition: GGEMSSourceManager.cc:117
GGEMS::SetSourceVerbose
void SetSourceVerbose(bool const &is_source_verbose)
set the flag for source verbosity
Definition: GGEMS.cc:108
GGEMSNavigatorManager::Initialize
void Initialize(bool const &is_tracking=false) const
Initialize a GGEMS navigators.
Definition: GGEMSNavigatorManager.cc:134
GGEMSProcessesManager::PrintAvailableProcesses
void PrintAvailableProcesses(void) const
Print all infos about available processes.
Definition: GGEMSProcessesManager.cc:171
GGEMS::Run
void Run(void)
run the GGEMS simulation
Definition: GGEMS.cc:304
GGEMSRangeCutsManager::PrintInfos
void PrintInfos(void) const
print infos about range cut manager
Definition: GGEMSRangeCutsManager.cc:72
GGEMSNavigatorManager::TrackThroughSolid
void TrackThroughSolid(GGsize const &thread_index) const
Track particles through selected solid.
Definition: GGEMSNavigatorManager.cc:198
GGEMSMaterialsDatabaseManager::GetInstance
static GGEMSMaterialsDatabaseManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSMaterialsDatabaseManager.hh:97
GGEMSNavigatorManager::SaveResults
void SaveResults(void) const
save all results from navigator in files
Definition: GGEMSNavigatorManager.cc:120
set_navigator_ggems
void set_navigator_ggems(GGEMS *ggems, bool const is_navigator_verbose)
Set the navigator verbosity.
Definition: GGEMS.cc:422
GGEMSSourceManager::IsAlive
bool IsAlive(GGsize const &thread_index) const
check if some particles are alive in OpenCL particle buffer
Definition: GGEMSSourceManager.cc:171
set_source_ggems
void set_source_ggems(GGEMS *ggems, bool const is_source_verbose)
Set the source verbosity.
Definition: GGEMS.cc:413
GGcout
GGEMSStream GGcout
Definition: GGEMSPrint.cc:34
set_memory_ram_ggems
void set_memory_ram_ggems(GGEMS *ggems, bool const is_memory_ram_verbose)
Set the memory RAM verbosity.
Definition: GGEMS.cc:431
GGEMSSourceManager.hh
GGEMS class handling the source(s)
GGEMSSourceManager::GetNameOfSource
std::string GetNameOfSource(GGsize const &source_index) const
get the name of the source
Definition: GGEMSSourceManager.hh:136
GGEMSProfilerManager::PrintSummaryProfile
void PrintSummaryProfile(void) const
print summary profile
Definition: GGEMSProfilerManager.cc:95
GGEMS::is_profiling_verbose_
bool is_profiling_verbose_
Definition: GGEMS.hh:220
GGEMSProcessesManager
GGEMS class managing the processes in GGEMS simulation.
Definition: GGEMSProcessesManager.hh:42
GGEMS::SetMemoryRAMVerbose
void SetMemoryRAMVerbose(bool const &is_memory_ram_verbose)
set the flag for memory RAM verbosity
Definition: GGEMS.cc:126
initialize_ggems
void initialize_ggems(GGEMS *ggems, GGuint const seed)
Initialize GGEMS simulation.
Definition: GGEMS.cc:386
set_random_ggems
void set_random_ggems(GGEMS *ggems, bool const is_random_verbose)
Set the random verbosity.
Definition: GGEMS.cc:458
GGEMS::is_material_database_verbose_
bool is_material_database_verbose_
Definition: GGEMS.hh:212
GGEMS::GGEMS
GGEMS(void)
GGEMS constructor.
Definition: GGEMS.cc:57
GGendl
#define GGendl
overload C++ std::endl
Definition: GGEMSPrint.hh:60
GGEMSOpenCLManager
Singleton class storing all informations about OpenCL and managing GPU/CPU devices,...
Definition: GGEMSOpenCLManager.hh:54
GGEMSSourceManager::GetNumberOfBatchs
GGsize GetNumberOfBatchs(GGsize const &source_index, GGsize const &device_index) const
method returning the number of particles by batch
Definition: GGEMSSourceManager.hh:145
set_range_cuts_ggems
void set_range_cuts_ggems(GGEMS *ggems, bool const is_range_cuts_verbose)
Set the range cuts verbosity.
Definition: GGEMS.cc:449
GGEMS::~GGEMS
~GGEMS(void)
GGEMS destructor.
Definition: GGEMS.cc:79
set_opencl_verbose_ggems
void set_opencl_verbose_ggems(GGEMS *ggems, bool const is_opencl_verbose)
Set the OpenCL verbosity.
Definition: GGEMS.cc:395
GGEMS::RunOnDevice
void RunOnDevice(GGsize const &thread_index)
run the GGEMS simulation on each thread associated to a OpenCL device
Definition: GGEMS.cc:254
GGEMSOpenCLManager::GetDeviceName
std::string GetDeviceName(GGsize const &device_index) const
Get the name of the activated device.
Definition: GGEMSOpenCLManager.hh:145
GGEMSProfilerManager.hh
GGEMS class managing profiler data.
GGEMS.hh
GGEMS class managing the GGEMS simulation.
anonymous_namespace{GGEMSPrint.hh}::mutex
std::mutex mutex
Definition: GGEMSPrint.hh:43
GGEMSSourceManager
GGEMS class handling the source(s)
Definition: GGEMSSourceManager.hh:49
GGEMS::SetProcessVerbose
void SetProcessVerbose(bool const &is_process_verbose)
set the flag for process verbosity
Definition: GGEMS.cc:135
GGEMSPseudoRandomGenerator.hh
Class managing the random number in GGEMS.
GGEMSNavigatorManager::FindSolid
void FindSolid(GGsize const &thread_index) const
Find closest solid before project particle to it.
Definition: GGEMSNavigatorManager.cc:176
GGEMSRAMManager::PrintRAMStatus
void PrintRAMStatus(void) const
print the RAM memory status for activated context
Definition: GGEMSRAMManager.cc:151
GGEMS::SetNavigatorVerbose
void SetNavigatorVerbose(bool const &is_navigator_verbose)
set the flag for navigator verbosity
Definition: GGEMS.cc:117
GGEMS::is_memory_ram_verbose_
bool is_memory_ram_verbose_
Definition: GGEMS.hh:215
GGEMSOpenCLManager::GetIndexOfActivatedDevice
GGsize GetIndexOfActivatedDevice(GGsize const &thread_index) const
get the index of activated device
Definition: GGEMSOpenCLManager.hh:175
GGuint
#define GGuint
Definition: GGEMSTypes.hh:231
GGEMS::particle_tracking_id_
GGint particle_tracking_id_
Definition: GGEMS.hh:221
GGEMSMaterialsDatabaseManager
GGEMS class managing the material database.
Definition: GGEMSMaterialsDatabaseManager.hh:79
GGEMSChrono::Now
ChronoTime Now(void)
Definition: GGEMSChrono.hh:67
GGEMSNavigatorManager::ComputeDose
void ComputeDose(GGsize const &thread_index)
Compute dose in volume.
Definition: GGEMSNavigatorManager.cc:219
GGEMSRangeCutsManager
GGEMS class managing the range cuts in GGEMS simulation.
Definition: GGEMSRangeCutsManager.hh:47
GGEMSProcessesManager::GetInstance
static GGEMSProcessesManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSProcessesManager.hh:60
GGEMS::PrintBanner
void PrintBanner(void) const
Print GGEMS banner.
Definition: GGEMS.hh:194
GGEMSMisc::ThrowException
void ThrowException(std::string const &class_name, std::string const &method_name, std::string const &message)
Throw a C++ exception.
Definition: GGEMSTools.cc:61
GGEMSOpenCLManager::GetInstance
static GGEMSOpenCLManager & GetInstance(void)
Create at first time the Singleton.
Definition: GGEMSOpenCLManager.hh:72
GGEMSMaterialsDatabaseManager::PrintAvailableMaterials
void PrintAvailableMaterials(void) const
Printing all the available materials.
Definition: GGEMSMaterialsDatabaseManager.cc:352