Convert unhelpful assertion to better documentation.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Fri, 16 Nov 2018 14:16:17 +0000 (17:16 +0300)
committerM. Eric Irrgang <ericirrgang@gmail.com>
Fri, 16 Nov 2018 14:18:10 +0000 (17:18 +0300)
The gmxapi::Context does not yet have a rigorous way to manage
initialization of simulations that may or may not have already
partially run. Its currently handling of checkpoint files relies on
assumptions of behavior that is observed, but not guaranteed. A static
assertion reminded developers to double-check assumptions as GROMACS
evolves, but not in a particularly good or helpful way.

Remove unhelpful logic. Improve comments. Make a "to do" and provide
reference to potential further discussion.

Change-Id: I9a2e0bd8768ae8a4036c43694f97e0261fb3709a

src/api/cpp/context.cpp

index 9bfd993c282319555080f35b4dc040dac2593834..c9875d8bb69b964c736375503d7a788c56494e7f 100644 (file)
@@ -120,23 +120,22 @@ std::shared_ptr<Session> ContextImpl::launch(const Workflow &work)
          * a microstate for gmxapi interfaces.
          */
 
-        // Note: these output options normalize the file names, but not their
-        // paths. gmxapi 0.0.7 changes working directory for each session, so the
-        // relative paths are appropriate, but a near-future version will avoid
-        // changing directories once the process starts and manage file paths explicitly.
-        using gmxapi::c_majorVersion;
-        using gmxapi::c_minorVersion;
-        using gmxapi::c_patchVersion;
-        static_assert(!(c_majorVersion != 0 || c_minorVersion != 0 || c_patchVersion > 7),
-                      "Developer notice: check assumptions about working directory and relative file paths for this "
-                      "software version.");
-
         // Set input TPR name
         mdArgs_.emplace_back("-s");
         mdArgs_.emplace_back(filename);
+
         // Set checkpoint file name
         mdArgs_.emplace_back("-cpi");
         mdArgs_.emplace_back("state.cpt");
+        /* Note: we normalize the checkpoint file name, but not its full path.
+         * Through version 0.0.8, gmxapi clients change working directory
+         * for each session, so relative path(s) below are appropriate.
+         * A future gmxapi version should avoid changing directories once the
+         * process starts and instead manage files (paths) in an absolute and
+         * immutable way, with abstraction provided through the Context chain-of-responsibility.
+         * TODO: API abstractions for initializing simulations that may be new or partially complete.
+         * Reference gmxapi milestone 13 at https://redmine.gromacs.org/issues/2585
+         */
 
         // Create a mock argv. Note that argv[0] is expected to hold the program name.
         const int  offset = 1;