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

Classes

struct  ComputedFrame

Enumerations

enum class  DriverState { NeedInit , Ready , HasData }

Functions

bool all_ranks_converged (const bool local_converged)
void throw_if_any_rank_failed (int local_failed, std::string local_message)
void fail_during_collective_stage (const char *stage, const std::string &message)
 Terminate the socket run after a failure inside a collective stage.
std::string properties_extra (const ComputedFrame &frame)
bool is_root ()
void bcast_double_vector (std::vector< double > &values)
void bcast_int (int &value)
void bcast_int32 (std::int32_t &value)
void bcast_chars (char *value, const int size)
void bcast_string (std::string &value)
void quit_if_root_failed (int root_failed, std::string root_message)
std::string bcast_header (std::string header)
std::string address ()
std::vector< double > ipi_cell_bohr_from_unitcell (const UnitCell &ucell)
double max_wrapped_direct_delta_from_unitcell (const UnitCell &ucell, const std::vector< double > &positions_bohr)
double max_abs_delta (const std::vector< double > &a, const std::vector< double > &b)
double unchanged_cell_tolerance (const SocketFrame::Matrix9 &cell)
void set_positions_from_ipi_bohr (UnitCell &ucell, const std::vector< double > &positions_bohr)
std::vector< double > flatten_forces_hartree_per_bohr (const ModuleBase::matrix &force, const int nat)
SocketFrame::Matrix9 matrix9_from_stress (const ModuleBase::matrix &stress)
std::vector< double > vector_from_matrix9 (const SocketFrame::Matrix9 &values)

Variables

constexpr double kRyToHartree = 0.5
constexpr int kIpiRankRoot = 0
constexpr double kMaxCellCondition = 1.0e12
constexpr double kInverseAbsoluteTolerance = 64.0 * std::numeric_limits<double>::epsilon()
constexpr double kInverseRelativeTolerance = 64.0
constexpr double kStressAbsoluteTolerance = 1.0e-10
constexpr double kStressRelativeTolerance = 1.0e-8
constexpr std::int32_t kMaxInitBytes = static_cast<std::int32_t>(1048576)

Enumeration Type Documentation

◆ DriverState

enum class SocketUtils::DriverState
strong
Enumerator
NeedInit 
Ready 
HasData 

Function Documentation

◆ address()

std::string SocketUtils::address ( )

◆ all_ranks_converged()

bool SocketUtils::all_ranks_converged ( const bool local_converged)
Here is the call graph for this function:

◆ bcast_chars()

void SocketUtils::bcast_chars ( char * value,
const int size )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_double_vector()

void SocketUtils::bcast_double_vector ( std::vector< double > & values)
Here is the call graph for this function:

◆ bcast_header()

std::string SocketUtils::bcast_header ( std::string header)
Here is the call graph for this function:

◆ bcast_int()

void SocketUtils::bcast_int ( int & value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bcast_int32()

void SocketUtils::bcast_int32 ( std::int32_t & value)
Here is the call graph for this function:

◆ bcast_string()

void SocketUtils::bcast_string ( std::string & value)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fail_during_collective_stage()

void SocketUtils::fail_during_collective_stage ( const char * stage,
const std::string & message )

Terminate the socket run after a failure inside a collective stage.

Under MPI the failure may deadlock other ranks waiting in a collective, so print a diagnostic and abort the whole job. In serial builds there is no collective: the exception propagates to Socket_Driver::socket_driver, which reports a clean WARNING_QUIT into the log. Do not replace the serial throw with abort(); serial builds are user-facing.

◆ flatten_forces_hartree_per_bohr()

std::vector< double > SocketUtils::flatten_forces_hartree_per_bohr ( const ModuleBase::matrix & force,
const int nat )

◆ ipi_cell_bohr_from_unitcell()

std::vector< double > SocketUtils::ipi_cell_bohr_from_unitcell ( const UnitCell & ucell)

◆ is_root()

bool SocketUtils::is_root ( )
Here is the caller graph for this function:

◆ matrix9_from_stress()

SocketFrame::Matrix9 SocketUtils::matrix9_from_stress ( const ModuleBase::matrix & stress)

◆ max_abs_delta()

double SocketUtils::max_abs_delta ( const std::vector< double > & a,
const std::vector< double > & b )

◆ max_wrapped_direct_delta_from_unitcell()

double SocketUtils::max_wrapped_direct_delta_from_unitcell ( const UnitCell & ucell,
const std::vector< double > & positions_bohr )
Here is the call graph for this function:

◆ properties_extra()

std::string SocketUtils::properties_extra ( const ComputedFrame & frame)

◆ quit_if_root_failed()

void SocketUtils::quit_if_root_failed ( int root_failed,
std::string root_message )
Here is the call graph for this function:

◆ set_positions_from_ipi_bohr()

void SocketUtils::set_positions_from_ipi_bohr ( UnitCell & ucell,
const std::vector< double > & positions_bohr )
Here is the call graph for this function:

◆ throw_if_any_rank_failed()

void SocketUtils::throw_if_any_rank_failed ( int local_failed,
std::string local_message )
Here is the call graph for this function:

◆ unchanged_cell_tolerance()

double SocketUtils::unchanged_cell_tolerance ( const SocketFrame::Matrix9 & cell)

◆ vector_from_matrix9()

std::vector< double > SocketUtils::vector_from_matrix9 ( const SocketFrame::Matrix9 & values)

Variable Documentation

◆ kInverseAbsoluteTolerance

double SocketUtils::kInverseAbsoluteTolerance = 64.0 * std::numeric_limits<double>::epsilon()
constexpr

◆ kInverseRelativeTolerance

double SocketUtils::kInverseRelativeTolerance = 64.0
constexpr

◆ kIpiRankRoot

int SocketUtils::kIpiRankRoot = 0
constexpr

◆ kMaxCellCondition

double SocketUtils::kMaxCellCondition = 1.0e12
constexpr

◆ kMaxInitBytes

std::int32_t SocketUtils::kMaxInitBytes = static_cast<std::int32_t>(1048576)
constexpr

◆ kRyToHartree

double SocketUtils::kRyToHartree = 0.5
constexpr

◆ kStressAbsoluteTolerance

double SocketUtils::kStressAbsoluteTolerance = 1.0e-10
constexpr

◆ kStressRelativeTolerance

double SocketUtils::kStressRelativeTolerance = 1.0e-8
constexpr