ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Global synchronizing context. More...
#include <GlobalContext.hpp>
Public Member Functions | |
GlobalContext (std::shared_ptr< Communication::MpiCallbacks > const &callbacks, std::shared_ptr< LocalContext > node_local_context) | |
void | notify_set_parameter (const ObjectHandle *o, std::string const &name, Variant const &value) override |
void | notify_call_method (const ObjectHandle *o, std::string const &name, VariantMap const &arguments) override |
std::shared_ptr< ObjectHandle > | make_shared (std::string const &name, const VariantMap ¶meters) override |
Get a new reference counted instance of a script interface object by name. | |
std::shared_ptr< ObjectHandle > | make_shared_local (std::string const &name, VariantMap const ¶meters) override |
boost::string_ref | name (const ObjectHandle *o) const override |
bool | is_head_node () const override |
void | parallel_try_catch (std::function< void()> const &cb) const override |
boost::mpi::communicator const & | get_comm () const override |
Public Member Functions inherited from ScriptInterface::Context | |
virtual | ~Context ()=default |
Additional Inherited Members | |
Protected Member Functions inherited from ScriptInterface::Context | |
void | set_context (ObjectHandle *o) |
Set the context of an object to this. | |
Global synchronizing context.
Objects created in this context are synchronized between multiple MPI ranks. That is, for each instance created on the head node, a copy is created on all other ranks. If the original copy is mutated via notify_set_parameter(), this change is also applied to all the copies. Calls to notify_call_method() are also propagated to all ranks. The lifetime of the copies is tied to the original, if the original copy is destroyed on the head node, the remote copies are also destroyed.
Definition at line 65 of file GlobalContext.hpp.
|
inline |
Definition at line 91 of file GlobalContext.hpp.
References name().
|
inlineoverridevirtual |
Implements ScriptInterface::Context.
Definition at line 178 of file GlobalContext.hpp.
|
inlineoverridevirtual |
Implements ScriptInterface::Context.
Definition at line 174 of file GlobalContext.hpp.
Referenced by make_shared().
|
overridevirtual |
Get a new reference counted instance of a script interface object by name.
Remote objects are automatically constructed.
Implements ScriptInterface::Context.
Definition at line 103 of file GlobalContext.cpp.
References is_head_node(), name(), ScriptInterface::object_id(), and ScriptInterface::Context::set_context().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 92 of file GlobalContext.cpp.
References name(), and ScriptInterface::Context::set_context().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 129 of file GlobalContext.cpp.
Referenced by GlobalContext(), make_shared(), make_shared_local(), notify_call_method(), and notify_set_parameter().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 85 of file GlobalContext.cpp.
References name(), ScriptInterface::object_id(), and ScriptInterface::pack().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 70 of file GlobalContext.cpp.
References name(), ScriptInterface::object_id(), and ScriptInterface::pack().
|
inlineoverridevirtual |
Implements ScriptInterface::Context.
Definition at line 175 of file GlobalContext.hpp.
References ScriptInterface::ParallelExceptionHandler::parallel_try_catch().