39 using artn_fn = void (*)(
const int nat,
const double *etot,
const double *f,
40 int const *ityp,
double *
const tau,
const int *order,
41 const double *lat,
const int *if_pos,
int *disp_code,
42 double *disp_vec,
bool *lconv);
44 using set_param_fn = int (*)(
const char *
const name,
const int crank,
45 const int *csize,
const void *cval);
51 double *
const force,
int const *ityp,
52 double *
const pos,
const double *box,
53 const int *if_pos,
double *displ_vec,
114 template <
typename Fn> Fn
load_sym(
const char *name)
const {
print_caller_fn print_caller_
int(*)(const char *name, void **cval) get_data_fn
bool is_loaded() const noexcept
True if libartn was successfully loaded.
void(*)() artn_destroy_fn
void require_loaded() const
Throws std::runtime_error if libartn is not available.
void(*)(const int nat, const double etot, double *const force, int const *ityp, double *const pos, const double *box, const int *if_pos, double *displ_vec, bool *lconv) artn_step_fn
void(*)(const int nat, bool *cerr) setup_artn_fn
std::mutex library_mutex
Global mutex to ensure only one thread accesses ARTn library at a time.
void(*)(const int nat, const double *etot, const double *f, int const *ityp, double *const tau, const int *order, const double *lat, const int *if_pos, int *disp_code, double *disp_vec, bool *lconv) artn_fn
void(*)() print_caller_fn
ARTnResource(const ARTnResource &)=delete
Non-copyable, non-movable.
int(*)(const char *const name, const int crank, const int *csize, const void *cval) set_param_fn
ARTnResource & operator=(const ARTnResource &)=delete
artn_create_fn artn_create_
set_param_fn get_set_param_fn() const
get_param_fn get_get_param_fn() const
artn_step_fn get_artn_step_fn() const
artn_fn get_artn_fn() const
int(*)(const char *name, void *cval) get_runparam_fn
get_runparam_fn get_runparam_
print_caller_fn get_print_caller_fn() const
get_runparam_fn get_get_runparam_fn() const
Fn load_sym(const char *name) const
Try to load a symbol; returns nullptr on failure.
artn_destroy_fn artn_destroy_
get_data_fn get_get_data_fn() const
artn_create_fn get_create_fn() const
setup_artn_fn get_setup_fn() const
setup_artn_fn setup_artn_
get_error_fn get_get_error_fn() const
May be null on older pARTn builds that predate the C get_error wrapper; callers must null-check befor...
artn_destroy_fn get_destroy_fn() const
int(*)(void **cmsg) get_error_fn
Retrieve pARTn error code + c_malloc'd message pointer.
int(*)(const char *name, void *cval) get_param_fn
static ARTnResource & instance()
Singleton accessor (Meyer's pattern).
void * sym(Handle h, const char *name) noexcept
RAII resource manager for the ARTn C library with global synchronization.
ARTnResource & get_artn_resource()
Global access to thread-safe ARTn resource.