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

Classes

struct  DriverContext
struct  ComputedFrame

Enumerations

enum class  DriverState

Functions

std::string read_header_bcast (IpiSocket &socket, const DriverState state)
void handle_status (IpiSocket &socket, const DriverState state)
void handle_init (IpiSocket &socket, DriverContext &context, std::ofstream &ofs_running)
void handle_posdata (IpiSocket &socket, DriverContext &context, std::ofstream &ofs_running)
void handle_getforce (IpiSocket &socket, DriverContext &context)
void handle_exit (std::ofstream &ofs_running)
bool all_ranks_converged (const bool local_converged)
void bcast_double_vector (std::vector< double > &values)
std::string bcast_header (std::string header)
void bcast_int32 (std::int32_t &value)
void fail_during_collective_stage (const char *stage, const std::string &message)
 Terminate the socket run after a failure inside a collective stage.
std::vector< double > flatten_forces_hartree_per_bohr (const ModuleBase::matrix &force, const int nat)
std::vector< double > ipi_cell_bohr_from_unitcell (const UnitCell &ucell)
bool is_root ()
SocketFrame::Matrix9 matrix9_from_stress (const ModuleBase::matrix &stress)
double max_abs_delta (const std::vector< double > &a, const std::vector< double > &b)
double max_wrapped_direct_delta_from_unitcell (const UnitCell &ucell, const std::vector< double > &positions_bohr)
std::string properties_extra (const ComputedFrame &frame)
void quit_if_root_failed (int root_failed, std::string root_message)
void set_positions_from_ipi_bohr (UnitCell &ucell, const std::vector< double > &positions_bohr)
void throw_if_any_rank_failed (int local_failed, std::string local_message)
double unchanged_cell_tolerance (const SocketFrame::Matrix9 &cell)
std::vector< double > vector_from_matrix9 (const SocketFrame::Matrix9 &values)

Variables

constexpr double kInverseAbsoluteTolerance
constexpr double kInverseRelativeTolerance
constexpr double kMaxCellCondition
constexpr std::int32_t kMaxInitBytes
constexpr double kRyToHartree
constexpr double kStressAbsoluteTolerance
constexpr double kStressRelativeTolerance

Enumeration Type Documentation

◆ DriverState

enum class SocketUtils::DriverState
strong

Function Documentation

◆ all_ranks_converged()

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

◆ bcast_double_vector()

void SocketUtils::bcast_double_vector ( std::vector< double > & values)

◆ bcast_header()

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

◆ bcast_int32()

void SocketUtils::bcast_int32 ( std::int32_t & value)
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 )

◆ handle_exit()

void SocketHandlers::handle_exit ( std::ofstream & ofs_running)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_getforce()

void SocketHandlers::handle_getforce ( IpiSocket & socket,
DriverContext & context )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_init()

void SocketHandlers::handle_init ( IpiSocket & socket,
DriverContext & context,
std::ofstream & ofs_running )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_posdata()

void SocketHandlers::handle_posdata ( IpiSocket & socket,
DriverContext & context,
std::ofstream & ofs_running )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_status()

void SocketHandlers::handle_status ( IpiSocket & socket,
const DriverState state )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ipi_cell_bohr_from_unitcell()

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

◆ is_root()

Here is the caller graph for this function:

◆ matrix9_from_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 )

◆ properties_extra()

std::string SocketUtils::properties_extra ( const ComputedFrame & frame)
Here is the caller graph for this function:

◆ quit_if_root_failed()

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

◆ read_header_bcast()

std::string SocketHandlers::read_header_bcast ( IpiSocket & socket,
const DriverState state )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_positions_from_ipi_bohr()

void SocketUtils::set_positions_from_ipi_bohr ( UnitCell & ucell,
const std::vector< double > & positions_bohr )

◆ throw_if_any_rank_failed()

void SocketUtils::throw_if_any_rank_failed ( int local_failed,
std::string local_message )

◆ unchanged_cell_tolerance()

◆ vector_from_matrix9()

std::vector< double > SocketUtils::vector_from_matrix9 ( const SocketFrame::Matrix9 & values)
Here is the caller graph for this function:

Variable Documentation

◆ kInverseAbsoluteTolerance

◆ kInverseRelativeTolerance

◆ kMaxCellCondition

◆ kMaxInitBytes

std::int32_t SocketUtils::kMaxInitBytes
constexpr

◆ kRyToHartree

double SocketUtils::kRyToHartree
constexpr

◆ kStressAbsoluteTolerance

◆ kStressRelativeTolerance