"-Wno-source-uses-openmp" #Don't warn for no-omp build
"-Wno-c++17-extensions" #Allowed in attributes (compilers are required to ignore unknown attributes)
"-Wno-documentation-unknown-command" #Custom commands are used
+ "-Wno-covered-switch-default" #GCC gives maybe-uninitialized without default label and checks for illegal enum values.
#Following ones are undecided/TODO
- "-Wno-missing-field-initializers"
- "-Wno-sign-conversion"
"-Wno-disabled-macro-expansion"
"-Wno-cast-align"
"-Wno-undefined-reinterpret-cast"
- "-Wno-covered-switch-default"
"-Wno-reserved-id-macro"
"-Wno-global-constructors"
- "-Wno-unreachable-code"
"-Wno-comma"
- "-Wno-unreachable-code-return"
"-Wno-exit-time-destructors"
"-Wno-unused-macros"
"-Wno-weak-vtables"
}
gmx_fatal(FARGS, "No integer option %s in pargs", option);
-
- return 0;
}
gmx_bool opt2parg_bool(const char *option, int nparg, t_pargs pa[])
}
gmx_fatal(FARGS, "No real option %s in pargs", option);
-
- return 0.0;
}
const char *opt2parg_str(const char *option, int nparg, t_pargs pa[])
}
gmx_fatal(FARGS, "No string option %s in pargs", option);
-
- return nullptr;
}
gmx_bool opt2parg_bSet(const char *option, int nparg, const t_pargs *pa)
}
gmx_fatal(FARGS, "No such option %s in pargs", option);
-
- return nullptr;
}
/********************************************************************
break;
default:
gmx_incons("unimplemented");
- cg_cm = nullptr;
}
bBondComm = comm->bBondComm;
gmx_fatal(FARGS, "Could not find an appropriate number of separate PME ranks. i.e. >= %5f*#ranks (%d) and <= #ranks/2 (%d) and reasonable performance wise (grid_x=%d, grid_y=%d).\n"
"Use the -npme option of mdrun or change the number of ranks or the PME grid dimensions, see the manual for details.",
ratio, (int)(0.95*ratio*nrank_tot + 0.5), nrank_tot/2, ir->nkx, ir->nky);
- /* Keep the compiler happy */
- npme = 0;
}
else
{
break;
default:
gmx_incons("unimplemented");
- home_pos_cg = 0;
}
int vec = 0;
}
gmx_fatal(FARGS, "Could not find energy term named '%s'. Either the energy file is from a different run or this state variable is not stored in the energy file. In the latter case (and if you did not modify the T/P-coupling setup), you can read the state in mdrun instead, by passing in a checkpoint file.", name);
-
- return 0;
}
* infrequently we don't want to issue lots of warnings before we
* have written anything to the log.
*/
- if (0)
+ if (/* DISABLES CODE */ (false))
{
fprintf(stderr, "\nTrying to get md5sum: EOF: %s\n", fio->fn);
}
else
{
gmx_file(fio->fn);
- rc = -1;
}
gmx_fio_unlock(fio);
return rc;
break;
default:
gmx_fatal(FARGS, "Invalid file opening mode %c", mode);
- p = "";
- break;
}
return p;
}
break;
default:
gmx_incons("Illegal datatype when converting values to a real array!");
- return;
}
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,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.
{
*bOK = FALSE;
gmx_fatal(FARGS, "Failed to find GROMACS magic number in trr frame header, so this is not a trr file!\n");
- return *bOK;
}
if (bRead)
gmx_rmpbc_done(gpbc);
close_trx(status);
- if (0)
+ if (/* DISABLES CODE */ (0))
{
FILE *fp;
fp = fopen("koko.xvg", "w");
break;
default:
gmx_fatal(FARGS, "No valid value for -axis-. Exiting.\n");
- /* make compiler happy */
- normal[0] = 1; normal[1] = 0; normal[2] = 0;
}
clear_rvec(dipole);
{
gmx_fatal(FARGS, "pbc = %s is not supported by g_mindist",
epbc_names[ePBC]);
- nsz = 0; /* Keep compilers quiet */
}
nshift = 0;
{
gmx_incons("Unknown datatype in t_enxblock");
}
- return 0.0;
}
static int *select_it(int nre, char *nm[], int *nset)
/* Check for number of files disabled, as FOPEN_MAX is not the correct
* number to check for. In my linux box it is only 16.
*/
- if (0 && (clust->clust->nr > FOPEN_MAX-4))
+ if (/* DISABLES CODE */ (0) && (clust->clust->nr > FOPEN_MAX-4))
{
gmx_fatal(FARGS, "Can not open enough (%d) files to write all the"
" trajectories.\ntry splitting the index file in %d parts.\n"
{
gmx_fatal(FARGS, "Unknown file type of %s. Should be tpr, xvg, or pdo.\n", fn);
}
- return whamin_unknown;
}
//! Read the files names in pdo-files.dat, pullf/x-files.dat, tpr-files.dat
return fndx;
}
-
- return 0;
}
extern int gmx_structurefactors_get_sf(gmx_structurefactors_t *gsf, int elem, real a[4], real b[4], real *c)
if (fr->bAllvsAll)
{
gmx_incons("All-vs-all kernels have not been implemented in version 4.6");
- return;
}
if (eNL >= 0)
const int nff = static_cast<int>(ffdirs.size());
/* Replace with unix path separators */
- if (DIR_SEPARATOR != '/')
+#if DIR_SEPARATOR != '/'
+ for (int i = 0; i < nff; ++i)
{
- for (int i = 0; i < nff; ++i)
- {
- std::replace(ffdirs[i].dir.begin(), ffdirs[i].dir.end(), DIR_SEPARATOR, '/');
- }
+ std::replace(ffdirs[i].dir.begin(), ffdirs[i].dir.end(), DIR_SEPARATOR, '/');
}
+#endif
/* Store the force field names in ffs */
std::vector<std::string> ffs;
}
gmx_fatal(FARGS, "this QM method or basisset (%s) is not implemented\n!", s);
-
- return -1;
-
} /* search_QMstring */
/* We would like gn to be const as well, but C doesn't allow this */
"names, in which case you must supply an index file to the '-n' option\n"
"of grompp.",
s);
-
- return -1;
}
static gmx_bool do_numbering(int natoms, gmx_groups_t *groups, int ng, char *ptrs[],
if (((ir->eI) == eiSteep) || ((ir->eI) == eiCG) || ((ir->eI) == eiLBFGS) || ((ir->eI) == eiNM))
{
gmx_fatal(FARGS, "%s Energy minimization via steep, CG, lbfgs and nm in parallel is currently not supported by IMD.\n", IMDstr);
- return;
}
}
}
int gmx_unused *global_atom_index)
{
gmx_impl("*** you are using a not implemented function");
-
- return 0.0; /* To make the compiler happy */
}
real restrangles(int nbonds,
break;
default:
gmx_incons("surface_frac called with unsupported cluster_size");
- area_rel = 1.0;
}
return area_rel/cluster_size;
case nbnxnkNR:
default:
gmx_fatal(FARGS, "Illegal kernel type selected");
- returnvalue = nullptr;
- break;
}
return returnvalue;
};
}
gmx_fatal(FARGS, "mol_id %d larger than total number of molecules %d.\n", mol_id, nmol);
-
- return -1;
}
/* Get a list of all the molecule types that are present in a group of atoms. *
"names, in which case you must supply an index file to the '-n' option\n"
"of grompp.",
s);
-
- return -1;
}
gmx_membed_t *init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop_t *mtop,
#include "gromacs/mdlib/qm_orca.h"
#endif
-
-
-
+#if GMX_QMMM
/* this struct and these comparison functions are needed for creating
* a QMMM input for the QM routines from the QMMM neighbor list.
*/
/* makes a call to the requested QM routine (qm->QMmethod)
* Note that f is actually the gradient, i.e. -f
*/
- real
- QMener = 0.0;
-
/* do a semi-empiprical calculation */
if (qm->QMmethod < eQMmethodRHF && !(mm->nrMMatoms))
#if GMX_QMMM_MOPAC
if (qm->bSH)
{
- QMener = call_mopac_SH(qm, mm, f, fshift);
+ return call_mopac_SH(qm, mm, f, fshift);
}
else
{
- QMener = call_mopac(qm, mm, f, fshift);
+ return call_mopac(qm, mm, f, fshift);
}
#else
gmx_fatal(FARGS, "Semi-empirical QM only supported with Mopac.");
if (qm->bSH && qm->QMmethod == eQMmethodCASSCF)
{
#if GMX_QMMM_GAUSSIAN
- QMener = call_gaussian_SH(fr, qm, mm, f, fshift);
+ return call_gaussian_SH(fr, qm, mm, f, fshift);
#else
gmx_fatal(FARGS, "Ab-initio Surface-hopping only supported with Gaussian.");
#endif
else
{
#if GMX_QMMM_GAMESS
- QMener = call_gamess(fr, qm, mm, f, fshift);
+ return call_gamess(fr, qm, mm, f, fshift);
#elif GMX_QMMM_GAUSSIAN
- QMener = call_gaussian(fr, qm, mm, f, fshift);
+ return call_gaussian(fr, qm, mm, f, fshift);
#elif GMX_QMMM_ORCA
- QMener = call_orca(fr, qm, mm, f, fshift);
+ return call_orca(fr, qm, mm, f, fshift);
#else
gmx_fatal(FARGS, "Ab-initio calculation only supported with Gamess, Gaussian or ORCA.");
#endif
}
}
- return (QMener);
}
-#if !(GMX_QMMM_MOPAC || GMX_QMMM_GAMESS || GMX_QMMM_GAUSSIAN || GMX_QMMM_ORCA)
-[[ noreturn ]]
-#endif
static void init_QMroutine(const t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
{
/* makes a call to the requested QM routine (qm->QMmethod)
}
} /* update_QMMM_rec */
-
real calculate_QMMM(const t_commrec *cr,
rvec f[],
const t_forcerec *fr)
}
return(QMener);
} /* calculate_QMMM */
+#else
+real calculate_QMMM(const t_commrec * /*unused*/,
+ rvec * /*unused*/,
+ const t_forcerec * /*unused*/)
+{
+ gmx_incons("Compiled without QMMM");
+}
+t_QMMMrec *mk_QMMMrec(void)
+{
+ return nullptr;
+}
+void init_QMMMrec(const t_commrec * /*unused*/,
+ gmx_mtop_t * /*unused*/,
+ t_inputrec * /*unused*/,
+ const t_forcerec * /*unused*/)
+{
+ gmx_incons("Compiled without QMMM");
+}
+void update_QMMMrec(const t_commrec * /*unused*/,
+ const t_forcerec * /*unused*/,
+ const rvec * /*unused*/,
+ const t_mdatoms * /*unused*/,
+ const matrix /*unused*/)
+{
+ gmx_incons("Compiled without QMMM");
+}
+#endif
/* end of QMMM core routines */
#ifndef GMX_MDLIB_QMMM_H
#define GMX_MDLIB_QMMM_H
+#include "config.h"
+
#include "gromacs/math/vectypes.h"
#include "gromacs/mdlib/tgroup.h"
+#define GMX_QMMM (GMX_QMMM_MOPAC || GMX_QMMM_GAMESS || GMX_QMMM_GAUSSIAN || GMX_QMMM_ORCA)
+
struct gmx_localtop_t;
struct gmx_mtop_t;
struct t_commrec;
t_QMMMrec *mk_QMMMrec(void);
/* allocates memory for QMMMrec */
+#if !GMX_QMMM
+[[noreturn]]
+#endif
void init_QMMMrec(const t_commrec *cr,
gmx_mtop_t *mtop,
t_inputrec *ir,
* resp. inputrec->QMmult the nelecs and multiplicity are determined
* and md->cQMMM gives numbers of the MM and QM atoms
*/
-
+#if !GMX_QMMM
+[[noreturn]]
+#endif
void update_QMMMrec(const t_commrec *cr,
const t_forcerec *fr,
const rvec *x,
* routine should be called at every step, since it updates the MM
* elements of the t_QMMMrec struct.
*/
-
real calculate_QMMM(const t_commrec *cr,
rvec f[],
const t_forcerec *fr);
const ReplicaExchangeParameters &replExParams)
{
real pres;
- int i, j, k;
+ int i, j;
struct gmx_repl_ex *re;
gmx_bool bTemp;
gmx_bool bLambda = FALSE;
erename[re->type],
re->q[re->type][i], re->q[re->type][j],
erename[re->type]);
-
- k = re->ind[i];
- re->ind[i] = re->ind[j];
- re->ind[j] = k;
}
else if (re->q[re->type][re->ind[j]] == re->q[re->type][re->ind[i]])
{
break;
default:
gmx_incons("Unknown etc value");
- n = 0;
}
return n;
break;
default:
gmx_incons("Unknown epc value");
- n = 0;
}
return n;
break;
default:
gmx_incons("Invalid enumeration value for eGeom");
- /* Keep static analyzer happy */
- clear_dvec(dr0);
- clear_dvec(dr1);
}
/* DEBUG */
GMX_THROW(gmx::InternalError("Unsupported method type"));
}
}
- return INVALID; /* Should not be reached */
}
int
default:
delete yylval->sel;
GMX_THROW(gmx::InternalError("Unsupported variable type"));
- return INVALID;
}
/* This position should not be reached. */
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,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.
}
}
gmx_fatal(FARGS, "symtab lookup \"%s\" not found", *name);
- return -1;
}
char **get_symtab_handle(t_symtab *symtab, int name)
}
}
gmx_fatal(FARGS, "symtab get_symtab_handle %d not found", name);
- return nullptr;
}
static t_symbuf *new_symbuf(void)
int gmx_physicalnode_id_hash(void)
{
- int hash;
+ int hash = 0;
if (GMX_MPI)
{
hash = mpi_hostname_hash();
}
- else
- {
- hash = 0;
- }
if (debug)
{
return fp;
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
- return nullptr;
}
char *gmxlibfn(const char *file)
std::string Path::normalize(const std::string &path)
{
std::string result(path);
- if (DIR_SEPARATOR != '/')
- {
- std::replace(result.begin(), result.end(), '/', DIR_SEPARATOR);
- }
+#if DIR_SEPARATOR != '/'
+ std::replace(result.begin(), result.end(), '/', DIR_SEPARATOR);
+#endif
return result;
}