![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Global synchronizing context. More...
#include <GlobalContext.hpp>
Inheritance diagram for ScriptInterface::GlobalContext:
Collaboration diagram for ScriptInterface::GlobalContext:Public Member Functions | |
| GlobalContext (std::shared_ptr< Communication::MpiCallbacks > const &callbacks, std::shared_ptr< LocalContext > node_local_context) | |
| void | notify_set_parameter (ObjectHandle const *o, std::string const &name, Variant const &value) override |
| void | notify_call_method (ObjectHandle const *o, std::string const &name, VariantMap const &arguments) override |
| std::shared_ptr< ObjectHandle > | make_shared (std::string const &name, VariantMap const ¶meters) override |
| Get a new reference counted instance of a script interface object by name. | |
| std::string_view | name (ObjectHandle const *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 67 of file GlobalContext.hpp.
|
inline |
Definition at line 93 of file GlobalContext.hpp.
References ScriptInterface::get_value(), and name().
|
inlineoverridevirtual |
Implements ScriptInterface::Context.
Definition at line 177 of file GlobalContext.hpp.
|
inlineoverridevirtual |
Implements ScriptInterface::Context.
Definition at line 173 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 91 of file GlobalContext.cpp.
References ScriptInterface::get_value(), is_head_node(), name(), and ScriptInterface::Context::set_context().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 122 of file GlobalContext.cpp.
References ScriptInterface::get_value().
Referenced by GlobalContext(), make_shared(), notify_call_method(), and notify_set_parameter().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 84 of file GlobalContext.cpp.
References ScriptInterface::get_value(), name(), and ScriptInterface::pack().
|
overridevirtual |
Implements ScriptInterface::Context.
Definition at line 69 of file GlobalContext.cpp.
References ScriptInterface::get_value(), name(), and ScriptInterface::pack().
|
inlineoverridevirtual |
Implements ScriptInterface::Context.
Definition at line 174 of file GlobalContext.hpp.
References ScriptInterface::get_value(), and ScriptInterface::ParallelExceptionHandler::parallel_try_catch().