Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:35

0001 //----------------------------------*-C++-*----------------------------------//
0002 // Copyright 2023-2024 UT-Battelle, LLC, and other Celeritas developers.
0003 // See the top-level COPYRIGHT file for details.
0004 // SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 //---------------------------------------------------------------------------//
0006 //! \file geocel/GeantUtils.hh
0007 //---------------------------------------------------------------------------//
0008 #pragma once
0009 
0010 #include "corecel/Config.hh"
0011 
0012 #include "corecel/Assert.hh"
0013 
0014 class G4RunManager;
0015 
0016 namespace celeritas
0017 {
0018 //---------------------------------------------------------------------------//
0019 // Clear Geant4's signal handlers that get installed when linking 11+
0020 void disable_geant_signal_handler();
0021 
0022 //---------------------------------------------------------------------------//
0023 // Get the number of threads in a version-portable way
0024 int get_geant_num_threads(G4RunManager const&);
0025 
0026 //---------------------------------------------------------------------------//
0027 // Get the number of threads using the global G4 run manager
0028 int get_geant_num_threads();
0029 
0030 //---------------------------------------------------------------------------//
0031 // Get the current thread ID (zero if serial)
0032 int get_geant_thread_id();
0033 
0034 //---------------------------------------------------------------------------//
0035 // INLINE DEFINITIONS
0036 //---------------------------------------------------------------------------//
0037 #if !CELERITAS_USE_GEANT4
0038 inline void disable_geant_signal_handler() {}
0039 
0040 inline int get_geant_num_threads(G4RunManager const&)
0041 {
0042     CELER_NOT_CONFIGURED("Geant4");
0043 }
0044 
0045 inline int get_geant_num_threads()
0046 {
0047     CELER_NOT_CONFIGURED("Geant4");
0048 }
0049 
0050 inline int get_geant_thread_id()
0051 {
0052     CELER_NOT_CONFIGURED("Geant4");
0053 }
0054 #endif
0055 //---------------------------------------------------------------------------//
0056 }  // namespace celeritas