atiSetup#

get_linked_objects_to_alias()[source]#

Helper function for set_aliases. Searches for objects in FSROOT + AmpTools shared libraries Linkdef.h files

Returns:

keys = full path location to Linkdef.h file, values = list of objects to alias

Return type:

Dict[str, List[str]]

loadLibraries(accelerator, use_fsroot=False, use_genamp=False, verbose=True)[source]#

Load all libraries

loadLibrary(libName, RANK_MPI=0, IS_REQUESTED=True, verbose=True)[source]#

Load a shared library and print IS_REQUESTED

prepare_mpigpu(accelerator, verbose=True)[source]#
Sets environment variables to use MPI and/or GPU if requested.

Checks who called the python script. If bash (single process). If mpiexec/mpirun (then MPI)

Parameters:

accelerator (str) – accelerator flag from argparse ~ [‘cpu’, ‘mpi’, ‘gpu’, ‘mpigpu’, ‘gpumpi’]

Returns:

True if MPI is to be used USE_GPU (bool): True if GPU is to be used RANK_MPI (int): MPI rank of the process (0 by default even if MPI is not used)

Return type:

USE_MPI (bool)

register_amps_dataio(globals)[source]#

REGISTER OBJECTS FOR AMPTOOLS

set_aliases(called_globals, USE_MPI, USE_GPU, use_fsroot, verbose=False)[source]#

Due to MPI requiring c++ templates and the fact that all classes live under the ROOT namespace, aliasing can clean up the code significantly. A dictionary of aliases is appended to the globals() function of the calling function thereby making the aliases available in the calling function.

Parameters:

called_globals (dict) – globals() from the calling function

setup(calling_globals, accelerator='mpigpu', use_fsroot=False, use_genamp=False, verbose=True)[source]#

Performs basic setup, loading libraries and setting aliases

Parameters:
  • calling_globals (dict) – globals() from the calling function

  • accelerator (str) – accelerator flag from argparse ~ [‘cpu’, ‘mpi’, ‘gpu’, ‘mpigpu’, ‘gpumpi’]

  • use_fsroot (bool) – True if FSRoot library should be loaded

  • use_genamp (bool) – True if GenAmp library should be loaded