SpECTRE
v2024.09.29
|
Utilities for hardware and system interop. More...
Enumerations | |
enum class | PrefetchTo : int { L1Cache = 3 , L2Cache = 2 , L3Cache = 1 , NonTemporal = 0 , WriteL1Cache = 7 , WriteL2Cache = 6 } |
The cache location to prefetch data to. More... | |
Functions | |
void | abort (const std::string &message) |
Abort the program with an error message. More... | |
void | attach_debugger () |
Provide an infinite loop to attach a debugger during startup. Useful for debugging MPI runs. More... | |
void | exit (int exit_code=0) |
Exit the program normally. This should only be called once over all processors. | |
int | number_of_procs () |
Number of processing elements. | |
int | my_proc () |
Index of my processing element. | |
int | number_of_nodes () |
Number of nodes. | |
int | my_node () |
Index of my node. | |
int | procs_on_node (int node_index) |
Number of processing elements on the given node. | |
int | my_local_rank () |
The local index of my processing element on my node. This is in the interval 0, ..., procs_on_node(my_node()) - 1. | |
int | first_proc_on_node (int node_index) |
Index of first processing element on the given node. | |
int | node_of (int proc_index) |
Index of the node for the given processing element. | |
int | local_rank_of (int proc_index) |
The local index for the given processing element on its node. | |
double | wall_time () |
The elapsed wall time in seconds. | |
template<PrefetchTo CacheLocation> | |
void | prefetch (const void *address_to_prefetch) |
Prefetch data into a specific level of data cache. | |
std::ostream & | operator<< (std::ostream &os, PrefetchTo cache_location) |
std::string | pretty_wall_time (double total_seconds) |
Format the wall time in DD-HH:MM:SS format. More... | |
std::string | pretty_wall_time () |
Format the wall time in DD-HH:MM:SS format. More... | |
Utilities for hardware and system interop.
|
strong |
The cache location to prefetch data to.
void sys::attach_debugger | ( | ) |
Provide an infinite loop to attach a debugger during startup. Useful for debugging MPI runs.
Each MPI rank writes a file name spectre_pid_#_host_NAME
to the working directory. This allows you to attach GDB to the running process using gdb --pid=PID
, once for each MPI rank. You must then halt the program using C-c
and then call set var i = 7
inside GDB. Once you've done this on each MPI rank, you can have each MPI rank continue
.
To add support for attaching to a debugger in an executable, you must add sys::attach_debugger
to the Parallel::charmxx::register_init_node_and_proc
init node functions. Then, when you launch the executable launch it as
The environment variable SPECTRE_ATTACH_DEBUGGER
being set tells the code to allow attaching from a debugger.