27#include "communication.hpp"
47 return (name_comp == 0) ? a.
id < b.
id : name_comp < 0;
57 std::vector<EspressoGpuDevice> devices;
64 for (
int i = 0; i < n_devices; ++i) {
72 std::set<EspressoGpuDevice, CompareDevices> device_set;
73 std::ranges::copy(devices, std::inserter(device_set, device_set.begin()));
75 std::ranges::copy(device_set, std::back_inserter(devices));
83std::pair<int, std::string> get_node_info() {
85 char proc_name[MPI_MAX_PROCESSOR_NAME];
86 MPI_Get_processor_name(proc_name, &proc_name_len);
Communicator communicator
boost::mpi::communicator comm_cart
The communicator.
int this_node
The number of this node.
void invoke_skip_cuda_exceptions(F &&f, Args &&...args)
Invoke a function and silently ignore any thrown cuda_runtime_error error.
std::vector< EspressoGpuDevice > cuda_gather_gpus()
Gather list of CUDA devices from all nodes on the head node.
void cuda_on_program_start()
Called on program start.
EspressoGpuDevice cuda_get_device_props(int dev)
Get properties of a CUDA device.
int cuda_get_n_gpus()
Get the number of CUDA devices on the local host.
void cuda_init()
Initializes the CUDA stream.
void gather_buffer(std::vector< T, Allocator > &buffer, boost::mpi::communicator const &comm, int root=0)
Gather buffer with different size on each node.
Helper class for device sets.
bool operator()(const EspressoGpuDevice &a, const EspressoGpuDevice &b) const
Struct to hold information relevant to ESPResSo about GPUs.
std::string proc_name
Node identification.
int id
Local CUDA device id.