/*! \brief
* Copies values back from options to t_pargs/t_filenm.
*/
- void copyValues(bool bReadNode);
+ void copyValues();
private:
struct FileNameData
GMX_THROW(NotImplementedError("Argument type not implemented"));
}
-void OptionsAdapter::copyValues(bool bReadNode)
+void OptionsAdapter::copyValues()
{
std::list<FileNameData>::const_iterator file;
for (file = fileNameOptions_.begin(); file != fileNameOptions_.end(); ++file)
{
- if (!bReadNode && (file->fnm->flag & ffREAD))
- {
- continue;
- }
if (file->optionInfo->isSet())
{
file->fnm->flag |= ffSET;
gmx::FileNameOptionManager fileOptManager;
fileOptManager.disableInputOptionChecking(
- isFlagSet(PCA_NOT_READ_NODE) || isFlagSet(PCA_DISABLE_INPUT_FILE_CHECKING));
+ isFlagSet(PCA_DISABLE_INPUT_FILE_CHECKING));
options.addManager(&fileOptManager);
if (isFlagSet(PCA_CAN_SET_DEFFNM))
setTimeValue(TDELTA, tdelta);
}
- adapter.copyValues(!isFlagSet(PCA_NOT_READ_NODE));
+ adapter.copyValues();
return TRUE;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
#define PCA_CAN_SET_DEFFNM (1<<10)
/** Do not raise a fatal error when invalid options are encountered. */
#define PCA_NOEXIT_ON_ARGS (1<<11)
-/** Is this node not reading: for parallel all nodes but the master */
-#define PCA_NOT_READ_NODE (1<<16)
/** Don't do any special processing for ffREAD files */
#define PCA_DISABLE_INPUT_FILE_CHECKING (1<<17)
done_filenms(nfile(), fnm);
}
-/********************************************************************
- * Tests for general behavior
- */
-
-TEST_F(ParseCommonArgsTest, HandlesNonReadNode)
-{
- t_filenm fnm[] = {
- { efTPS, "-s", nullptr, ffREAD },
- { efTRX, "-f", nullptr, ffREAD },
- { efTRX, "-f2", nullptr, ffREAD }
- };
- const char *const cmdline[] = {
- "test", "-f", "-f2", "other"
- };
- parseFromArray(cmdline, PCA_NOT_READ_NODE, fnm, gmx::EmptyArrayRef());
- EXPECT_EQ(nullptr, fnm[0].fns);
- EXPECT_EQ(nullptr, fnm[1].fns);
- EXPECT_EQ(nullptr, fnm[2].fns);
- done_filenms(nfile(), fnm);
-}
-
-TEST_F(ParseCommonArgsTest, HandlesNonReadNodeWithDefaultFileName)
-{
- t_filenm fnm[] = {
- { efTPS, "-s", nullptr, ffREAD },
- { efTRX, "-f", nullptr, ffREAD },
- { efTRX, "-f2", nullptr, ffREAD }
- };
- const char *const cmdline[] = {
- "test", "-deffnm", "def", "-f", "-f2", "other"
- };
- parseFromArray(cmdline, PCA_CAN_SET_DEFFNM | PCA_NOT_READ_NODE, fnm, gmx::EmptyArrayRef());
- EXPECT_EQ(nullptr, fnm[0].fns);
- EXPECT_EQ(nullptr, fnm[1].fns);
- EXPECT_EQ(nullptr, fnm[2].fns);
- done_filenms(nfile(), fnm);
-}
-
// This is needed e.g. for tune_pme, which passes unknown arguments on
// to child mdrun processes that it spawns.
TEST_F(ParseCommonArgsTest, CanKeepUnknownArgs)