ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
base_device::information Namespace Reference

Functions

int get_node_rank_with_mpi_shared (const MPI_Comm mpi_comm=MPI_COMM_WORLD)
 Get the local rank within the node using MPI_COMM_TYPE_SHARED.
bool probe_gpu_availability ()
 Safely probes for GPU availability without exiting on error.
std::string get_device_flag (const std::string &device, const std::string &basis_type)
 Get the device flag object for source_io PARAM.inp.device.
std::string get_device_name (std::string device_flag)
 Get the device name for source_esolver.
int get_device_num (std::string device_flag)
 Get the device number for source_esolver.
void output_device_info (std::ostream &output, const std::string &device)
 Output the device information for source_esolver.
template<typename Device>
void print_device_info (const Device *dev, std::ofstream &ofs_device)
template<typename Device>
void record_device_memory (const Device *dev, std::ofstream &ofs_device, std::string str, size_t size)

Function Documentation

◆ get_device_flag()

std::string base_device::information::get_device_flag ( const std::string & device,
const std::string & basis_type )

Get the device flag object for source_io PARAM.inp.device.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_device_name()

std::string base_device::information::get_device_name ( std::string device_flag)

Get the device name for source_esolver.

Here is the caller graph for this function:

◆ get_device_num()

int base_device::information::get_device_num ( std::string device_flag)

Get the device number for source_esolver.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_node_rank_with_mpi_shared()

int base_device::information::get_node_rank_with_mpi_shared ( const MPI_Comm mpi_comm = MPI_COMM_WORLD)

Get the local rank within the node using MPI_COMM_TYPE_SHARED.

Parameters
mpi_commMPI communicator (default: MPI_COMM_WORLD)
Returns
Local rank within the node
Here is the caller graph for this function:

◆ output_device_info()

void base_device::information::output_device_info ( std::ostream & output,
const std::string & device )

Output the device information for source_esolver.

Parameters
outputoutput stream.
devicedevice flag, "cpu" / "gpu" / "dsp".
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_device_info()

template<typename Device>
void base_device::information::print_device_info ( const Device * dev,
std::ofstream & ofs_device )

◆ probe_gpu_availability()

bool base_device::information::probe_gpu_availability ( )

Safely probes for GPU availability without exiting on error.

Returns
True if at least one GPU is found and usable, false otherwise.
Here is the caller graph for this function:

◆ record_device_memory()

template<typename Device>
void base_device::information::record_device_memory ( const Device * dev,
std::ofstream & ofs_device,
std::string str,
size_t size )
Here is the caller graph for this function: