/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2018, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
class System final
{
- public:
- /*! \brief Private implementation class.
- *
- * System::Impl does not have a public interface and is only exposed in opaque pointers.
- */
- class Impl;
+public:
+ /*! \brief Private implementation class.
+ *
+ * System::Impl does not have a public interface and is only exposed in opaque pointers.
+ */
+ class Impl;
- /*! \brief No copy.
- *
- * The semantics of copying a System are ambiguous, so disallow implicit
- * copy.
- * \{
- * \internal
- * Some sort of prototype or clone idiom could be useful, but
- * needs to explicitly identify any expensive operations.
- */
- System(const System &) = delete;
- System &operator=(const System &) = delete;
- /*! \} */
+ /*! \brief No copy.
+ *
+ * The semantics of copying a System are ambiguous, so disallow implicit
+ * copy.
+ * \{
+ * \internal
+ * Some sort of prototype or clone idiom could be useful, but
+ * needs to explicitly identify any expensive operations.
+ */
+ System(const System&) = delete;
+ System& operator=(const System&) = delete;
+ /*! \} */
- /*! \brief Allow move.
- *
- * \{
- */
- System(System && /*unused*/) noexcept;
- System &operator=(System && /*unused*/) noexcept;
- /*! \} */
+ /*! \brief Allow move.
+ *
+ * \{
+ */
+ System(System&& /*unused*/) noexcept;
+ System& operator=(System&& /*unused*/) noexcept;
+ /*! \} */
- /*!
- * \brief Create by taking ownership of an implementation object.
- *
- * \param implementation
- */
- explicit System(std::unique_ptr<Impl> implementation);
+ /*!
+ * \brief Create by taking ownership of an implementation object.
+ *
+ * \param implementation
+ */
+ explicit System(std::unique_ptr<Impl> implementation);
- /*! \cond internal
- * Destructor defined later to allow unique_ptr members of partially-defined types.
- */
- ~System();
- /*! \endcond */
+ /*! \cond internal
+ * Destructor defined later to allow unique_ptr members of partially-defined types.
+ */
+ ~System();
+ /*! \endcond */
- /*!
- * \brief Configure the computing environment for the specified workflow.
- *
- * \return Ownership of a ready-to-run workflow or nullptr if there were errors.
- *
- * If errors occur, they will be stored in the context object. If run without
- * an argument, launch() uses the current context of the System object. If a
- * context argument is given, the system and its configured workflow are
- * translated to the provided context and launched.
- *
- * \param context (optional) execution context in which to launch.
- *
- * \note The Session object does not "own" the Context, but must be able
- * to extend the lifetime of the Context in which it is running.
- *
- * \todo Policy: does System then track the (potentially remote) context or should
- * it be considered to have "forked", and the new session object retrieved from
- * the session handle if needed?
- *
- * \cond internal
- * # Protocol
- *
- * The current implementation of System::launch() performs the following actions.
- *
- * When launch() is called, a new gmxapi::Session is created by passing a
- * gmxapi::Workflow to context->launch().
- * The Workflow basically just contains the TPR filename.
- * 1. A new Mdrunner is created from the information in the gmxapi::Workflow
- * 2. A new Session is created using the ContextImpl and the runner
- *
- * Then, for each module available through getSpec()->getModules(),
- * the session and module are passed to gmxapi::setSessionRestraint().
- * 1. A gmx::IRestraintPotential is retrieved from the module.
- * 2. A unique, named SessionResources is created for the module and attached to the SessionImpl.
- * 1. The module is added as a signaller to the session SignalManager
- * with getSignalManager()->addSignaller(module->name())
- * 2. The SessionResources is passed to IRestraintPotential::bindSession().
- * Currently, the only thing the restraint could do at this point is to
- * save a copy of the pointer and later pass it to gmxapi::getMdrunnerSignal().
- * 3. The restraint is passed to gmx::Mdrunner::addPullPotential(),
- * which adds the restraint to the global gmx::restraint::Manager,
- * which then needs to be `clear()`ed after the runner completes.
- *
- * Shared ownership of the Session is returned to the caller of launch().
- *
- * \endcond
- */
- std::shared_ptr<Session> launch(const std::shared_ptr<Context> &context);
+ /*!
+ * \brief Configure the computing environment for the specified workflow.
+ *
+ * \return Ownership of a ready-to-run workflow or nullptr if there were errors.
+ *
+ * If errors occur, they will be stored in the context object. If run without
+ * an argument, launch() uses the current context of the System object. If a
+ * context argument is given, the system and its configured workflow are
+ * translated to the provided context and launched.
+ *
+ * \param context (optional) execution context in which to launch.
+ *
+ * \note The Session object does not "own" the Context, but must be able
+ * to extend the lifetime of the Context in which it is running.
+ *
+ * \todo Policy: does System then track the (potentially remote) context or should
+ * it be considered to have "forked", and the new session object retrieved from
+ * the session handle if needed?
+ *
+ * \cond internal
+ * # Protocol
+ *
+ * The current implementation of System::launch() performs the following actions.
+ *
+ * When launch() is called, a new gmxapi::Session is created by passing a
+ * gmxapi::Workflow to context->launch().
+ * The Workflow basically just contains the TPR filename.
+ * 1. A new Mdrunner is created from the information in the gmxapi::Workflow
+ * 2. A new Session is created using the ContextImpl and the runner
+ *
+ * Then, for each module available through getSpec()->getModules(),
+ * the session and module are passed to gmxapi::setSessionRestraint().
+ * 1. A gmx::IRestraintPotential is retrieved from the module.
+ * 2. A unique, named SessionResources is created for the module and attached to the SessionImpl.
+ * 1. The module is added as a signaller to the session SignalManager
+ * with getSignalManager()->addSignaller(module->name())
+ * 2. The SessionResources is passed to IRestraintPotential::bindSession().
+ * Currently, the only thing the restraint could do at this point is to
+ * save a copy of the pointer and later pass it to gmxapi::getMdrunnerSignal().
+ * 3. The restraint is passed to gmx::Mdrunner::addPullPotential(),
+ * which adds the restraint to the global gmx::restraint::Manager,
+ * which then needs to be `clear()`ed after the runner completes.
+ *
+ * Shared ownership of the Session is returned to the caller of launch().
+ *
+ * \endcond
+ */
+ std::shared_ptr<Session> launch(const std::shared_ptr<Context>& context);
- private:
- /*!
- * \brief Opaque pointer to implementation.
- */
- std::unique_ptr<Impl> impl_;
+private:
+ /*!
+ * \brief Opaque pointer to implementation.
+ */
+ std::unique_ptr<Impl> impl_;
};
* \returns gmxapi::System object with the specified workflow.
* \ingroup gmxapi
*/
-System fromTprFile(const std::string &filename);
+System fromTprFile(const std::string& filename);
-} // end namespace gmxapi
+} // end namespace gmxapi
#endif // include guard