namespace rgpot_workspace¶
Overview¶
Per-caller state of the Fortran potentials: one neighbour table and one error message, behind an opaque C pointer. More…
namespace rgpot_workspace {
// global functions
type(c_ptr) function, public rgpot_fortran_workspace_new();
subroutine, public rgpot_fortran_workspace_free(type(c_ptr), value handle);
integer(c_int) function, public rgpot_fortran_workspace_error(type(c_ptr), value handle, character(kind=c_char), dimension(*), intent(out) buffer, integer(c_int), intent(in), value buffer_len);
type(rgpot_workspace_t) function, pointer, public workspace_from_c(type(c_ptr), intent(in) handle);
subroutine, public ws_set_error(type(rgpot_workspace_t), intent(inout) ws, character(len=*), intent(in) text);
subroutine, public ws_clear_error(type(rgpot_workspace_t), intent(inout) ws);
} // namespace rgpot_workspace
Detailed Documentation¶
Per-caller state of the Fortran potentials: one neighbour table and one error message, behind an opaque C pointer.
Each C++ potential instance owns one workspace, so two instances keep separate vesin tables (their Verlet skins track their own geometries) and can evaluate on separate threads at once. The _ws entry points of the kernels take a workspace; the older entry points without it share one module-level workspace and stay process-serial.
Global Functions¶
type(c_ptr) function, public rgpot_fortran_workspace_new()
A fresh workspace, or NULL when allocation fails.
subroutine, public rgpot_fortran_workspace_free(type(c_ptr), value handle)
Release a workspace from rgpot_fortran_workspace_new. NULL is a no-op.
integer(c_int) function, public rgpot_fortran_workspace_error(type(c_ptr), value handle, character(kind=c_char), dimension(*), intent(out) buffer, integer(c_int), intent(in), value buffer_len)
Copy the workspace’s last message into buffer as a NUL-terminated C string; returns the characters written, excluding the terminator.
type(rgpot_workspace_t) function, pointer, public workspace_from_c(type(c_ptr), intent(in) handle)
The workspace behind a C handle (unassociated for NULL).