*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019,2020, 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.
/* Wait for the forces to arrive */
MPI_Waitall(messages, pme_pp->req.data(), pme_pp->stat.data());
#else
- gmx_call("MPI not enabled");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_pme_send_force_vir_ener");
GMX_UNUSED_VALUE(pme);
GMX_UNUSED_VALUE(pme_pp);
GMX_UNUSED_VALUE(output);
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2009-2018, The GROMACS development team.
- * Copyright (c) 2019, by the GROMACS development team, led by
+ * Copyright (c) 2019,2020, 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.
#include "gromacs/utility/alignedallocator.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/smalloc.h"
double MPI_Wtime()
{
struct timeval tv;
- gettimeofday(&tv, 0);
+ gettimeofday(&tv, nullptr);
return tv.tv_sec + tv.tv_usec * 1e-6;
}
# else
GMX_MPI_REAL, cart[s]);
}
# else
- gmx_incons("fft5d MPI call without MPI configuration");
+ GMX_RELEASE_ASSERT(false, "Invalid call to fft5d_execute");
# endif /*GMX_MPI*/
#endif /*FFT5D_MPI_TRANSPOSE*/
#ifdef NOGMX
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/mpiinplacebuffers.h"
#include "gromacs/utility/real.h"
void gmx_barrier(const t_commrec gmx_unused* cr)
{
#if !GMX_MPI
- gmx_call("gmx_barrier");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_barrier");
#else
MPI_Barrier(cr->mpi_comm_mygroup);
#endif
void gmx_bcast(int gmx_unused nbytes, void gmx_unused* b, const t_commrec gmx_unused* cr)
{
#if !GMX_MPI
- gmx_call("gmx_bast");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_bcast");
#else
MPI_Bcast(b, nbytes, MPI_BYTE, MASTERRANK(cr), cr->mpi_comm_mygroup);
#endif
void gmx_sumd(int gmx_unused nr, double gmx_unused r[], const t_commrec gmx_unused* cr)
{
#if !GMX_MPI
- gmx_call("gmx_sumd");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumd");
#else
# if MPI_IN_PLACE_EXISTS
if (cr->nc.bUse)
void gmx_sumf(int gmx_unused nr, float gmx_unused r[], const t_commrec gmx_unused* cr)
{
#if !GMX_MPI
- gmx_call("gmx_sumf");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumf");
#else
# if MPI_IN_PLACE_EXISTS
if (cr->nc.bUse)
void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused* cr)
{
#if !GMX_MPI
- gmx_call("gmx_sumi");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumi");
#else
# if MPI_IN_PLACE_EXISTS
if (cr->nc.bUse)
void gmx_sumli(int gmx_unused nr, int64_t gmx_unused r[], const t_commrec gmx_unused* cr)
{
#if !GMX_MPI
- gmx_call("gmx_sumli");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumli");
#else
# if MPI_IN_PLACE_EXISTS
if (cr->nc.bUse)
void gmx_sumd_sim(int gmx_unused nr, double gmx_unused r[], const gmx_multisim_t gmx_unused* ms)
{
#if !GMX_MPI
- gmx_call("gmx_sumd_sim");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumd_sim");
#else
gmx_sumd_comm(nr, r, ms->mpi_comm_masters);
#endif
void gmx_sumf_sim(int gmx_unused nr, float gmx_unused r[], const gmx_multisim_t gmx_unused* ms)
{
#if !GMX_MPI
- gmx_call("gmx_sumf_sim");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumf_sim");
#else
gmx_sumf_comm(nr, r, ms->mpi_comm_masters);
#endif
void gmx_sumi_sim(int gmx_unused nr, int gmx_unused r[], const gmx_multisim_t gmx_unused* ms)
{
#if !GMX_MPI
- gmx_call("gmx_sumi_sim");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumi_sim");
#else
# if MPI_IN_PLACE_EXISTS
MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT, MPI_SUM, ms->mpi_comm_masters);
void gmx_sumli_sim(int gmx_unused nr, int64_t gmx_unused r[], const gmx_multisim_t gmx_unused* ms)
{
#if !GMX_MPI
- gmx_call("gmx_sumli_sim");
+ GMX_RELEASE_ASSERT(false, "Invalid call to gmx_sumli_sim");
#else
# if MPI_IN_PLACE_EXISTS
MPI_Allreduce(MPI_IN_PLACE, r, nr, MPI_INT64_T, MPI_SUM, ms->mpi_comm_masters);
std::vector<int> gatherIntFromMultiSimulation(const gmx_multisim_t* ms, const int localValue)
{
std::vector<int> valuesFromAllRanks;
- if (GMX_MPI && ms != nullptr)
+#if GMX_MPI
+ if (ms != nullptr)
{
valuesFromAllRanks.resize(ms->nsim);
valuesFromAllRanks[ms->sim] = localValue;
{
valuesFromAllRanks.emplace_back(localValue);
}
+#else
+ GMX_UNUSED_VALUE(ms);
+ valuesFromAllRanks.emplace_back(localValue);
+#endif
return valuesFromAllRanks;
}