*
* \author Teemu Murtola <teemu.murtola@gmail.com>
*/
+#include "gmxpre.h"
+
#include "legacymodules.h"
#include <cstdio>
#include "gromacs/commandline/cmdlinemodule.h"
#include "gromacs/commandline/cmdlinemodulemanager.h"
-
#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/gmxpreprocess/genconf.h"
#include "gromacs/gmxpreprocess/grompp.h"
-#include "gromacs/gmxpreprocess/genbox.h"
+#include "gromacs/gmxpreprocess/insert-molecules.h"
#include "gromacs/gmxpreprocess/pdb2gmx.h"
#include "gromacs/gmxpreprocess/protonate.h"
+#include "gromacs/gmxpreprocess/solvate.h"
#include "gromacs/gmxpreprocess/x2top.h"
#include "gromacs/tools/check.h"
-#include "gromacs/tools/dump.h"
#include "gromacs/tools/convert_tpr.h"
+#include "gromacs/tools/dump.h"
#include "mdrun/mdrun_main.h"
#include "view/view.h"
return NULL;
}
+ virtual void init(gmx::CommandLineModuleSettings * /*settings*/)
+ {
+ }
virtual int run(int /*argc*/, char * /*argv*/[])
{
printMessage();
}
const char *name_;
+};
+
+// TODO: Consider removing duplication with CMainCommandLineModule from
+// cmdlinemodulemanager.cpp.
+class NoNiceModule : public gmx::CommandLineModuleInterface
+{
+ public:
+ //! \copydoc gmx::CommandLineModuleManager::CMainFunction
+ typedef gmx::CommandLineModuleManager::CMainFunction CMainFunction;
+
+ /*! \brief
+ * Creates a wrapper module for the given main function.
+ *
+ * \param[in] name Name for the module.
+ * \param[in] shortDescription One-line description for the module.
+ * \param[in] mainFunction Main function to wrap.
+ *
+ * Does not throw.
+ */
+ NoNiceModule(const char *name, const char *shortDescription,
+ CMainFunction mainFunction)
+ : name_(name), shortDescription_(shortDescription),
+ mainFunction_(mainFunction)
+ {
+ }
+
+ virtual const char *name() const
+ {
+ return name_;
+ }
+ virtual const char *shortDescription() const
+ {
+ return shortDescription_;
+ }
+ virtual void init(gmx::CommandLineModuleSettings *settings)
+ {
+ settings->setDefaultNiceLevel(0);
+ }
+ virtual int run(int argc, char *argv[])
+ {
+ return mainFunction_(argc, argv);
+ }
+ virtual void writeHelp(const gmx::CommandLineHelpContext &context) const
+ {
+ writeCommandLineHelpCMain(context, name_, mainFunction_);
+ }
+
+ private:
+ const char *name_;
+ const char *shortDescription_;
+ CMainFunction mainFunction_;
};
/*! \brief
manager->addModuleCMain(name, shortDescription, mainFunction);
}
+/*! \brief
+ * Convenience function for creating and registering a module that defaults to
+ * -nice 0.
+ *
+ * \param[in] manager Module manager to which to register the module.
+ * \param[in] mainFunction Main function to wrap.
+ * \param[in] name Name for the new module.
+ * \param[in] shortDescription One-line description for the new module.
+ */
+void registerModuleNoNice(gmx::CommandLineModuleManager *manager,
+ gmx::CommandLineModuleManager::CMainFunction mainFunction,
+ const char *name, const char *shortDescription)
+{
+ gmx::CommandLineModulePointer module(
+ new NoNiceModule(name, shortDescription, mainFunction));
+ manager->addModule(move(module));
+}
+
/*! \brief
* Convenience function for registering a module for an obsolete tool.
*
"Convert coordinate files to topology and FF-compliant coordinate files");
registerModule(manager, &gmx_convert_tpr, "convert-tpr",
"Make a modifed run-input file");
+ registerObsoleteTool(manager, "tpbconv");
registerModule(manager, &gmx_protonate, "protonate",
"Protonate structures");
registerModule(manager, &gmx_x2top, "x2top",
"Generate a primitive topology from coordinates");
- registerModule(manager, &gmx_mdrun, "mdrun",
- "Perform a simulation, do a normal mode analysis or an energy minimization");
+ registerModuleNoNice(manager, &gmx_mdrun, "mdrun",
+ "Perform a simulation, do a normal mode analysis or an energy minimization");
// Modules from gmx_ana.h.
registerModule(manager, &gmx_do_dssp, "do_dssp",
"Convert and manipulates structure files");
registerModule(manager, &gmx_eneconv, "eneconv",
"Convert energy files");
- registerModule(manager, &gmx_genbox, "genbox",
+ registerModule(manager, &gmx_solvate, "solvate",
"Solvate a system");
+ registerModule(manager, &gmx_insert_molecules, "insert-molecules",
+ "Insert molecules into existing vacancies");
+ registerObsoleteTool(manager, "genbox");
registerModule(manager, &gmx_genconf, "genconf",
"Multiply a conformation in 'random' orientations");
registerModule(manager, &gmx_genion, "genion",
"Calculate free energy difference estimates through Bennett's acceptance ratio");
registerObsoleteTool(manager, "bond");
registerObsoleteTool(manager, "dist");
+ registerObsoleteTool(manager, "sas");
registerObsoleteTool(manager, "sgangle");
registerModule(manager, &gmx_bundle, "bundle",
"Calculate local pitch/bending/rotation/orientation inside helices");
registerModule(manager, &gmx_hydorder, "hydorder",
"Compute tetrahedrality parameters around a given atom");
- registerModule(manager, &gmx_kinetics, "kinetics",
- "Analyze kinetic constants from properties based on the Eyring model");
registerModule(manager, &gmx_lie, "lie",
"Estimate free energy from linear combinations");
registerModule(manager, &gmx_mdmat, "mdmat",
"Compute salt bridges");
registerModule(manager, &gmx_sans, "sans",
"Compute small angle neutron scattering spectra");
- registerModule(manager, &gmx_sas, "sas",
- "Compute solvent accessible surface area");
registerModule(manager, &gmx_saxs, "saxs",
"Compute small angle X-ray scattering spectra");
registerModule(manager, &gmx_sham, "sham",
registerModule(manager, &gmx_traj, "traj",
"Plot x, v, f, box, temperature and rotational energy from trajectories");
registerModule(manager, &gmx_tune_pme, "tune_pme",
- "Time mdrun as a function of PME nodes to optimize settings");
+ "Time mdrun as a function of PME ranks to optimize settings");
registerModule(manager, &gmx_vanhove, "vanhove",
"Compute Van Hove displacement and correlation functions");
registerModule(manager, &gmx_velacc, "velacc",
"Perform weighted histogram analysis after umbrella sampling");
registerModule(manager, &gmx_wheel, "wheel",
"Plot helical wheels");
- registerModule(manager, &gmx_view, "view",
- "View a trajectory on an X-Windows terminal");
+ registerModuleNoNice(manager, &gmx_view, "view",
+ "View a trajectory on an X-Windows terminal");
{
gmx::CommandLineModuleGroup group =
group.addModuleWithDescription("editconf", "Edit the box and write subgroups");
group.addModule("protonate");
group.addModule("x2top");
- group.addModule("genbox");
+ group.addModule("solvate");
+ group.addModule("insert-molecules");
group.addModule("genconf");
group.addModule("genion");
group.addModule("genrestr");
group.addModule("principal");
group.addModule("rdf");
group.addModule("saltbr");
- group.addModule("sas");
group.addModule("sorient");
group.addModule("spol");
}
group.addModule("current");
group.addModule("dos");
group.addModule("dyecoupl");
- group.addModule("kinetics");
group.addModule("principal");
group.addModule("tcaf");
group.addModule("traj");