#include "config.h"
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/gmxomp.h"
/** Structure with the number of threads for each OpenMP multi-threaded
gmx_bool bCommandLineSetNthreadsOMP = *nthreads_omp > 0;
char buffer[STRLEN];
- assert(nthreads_omp);
+ GMX_RELEASE_ASSERT(nthreads_omp, "nthreads_omp must be a non-NULL pointer");
if ((env = getenv("OMP_NUM_THREADS")) != NULL)
{
nth = 1;
if ((env = getenv("OMP_NUM_THREADS")) != NULL)
{
- if (!bOMP && (strncmp(env, "1", 1) != 0))
+ if (!bOMP && (std::strncmp(env, "1", 1) != 0))
{
gmx_warning("OMP_NUM_THREADS is set, but %s was compiled without OpenMP support!",
ShortProgram());
gmx_bool bThisNodePMEOnly,
gmx_bool bFullOmpSupport)
{
- int nth_pmeonly, gmx_maxth, nppn;
+ int nppn;
gmx_bool bSepPME, bOMP;
#ifdef GMX_OPENMP
{
/* Catch an attempt to set the number of threads on an invalid
* OpenMP module. */
- assert(mod >= 0 && mod < emntNR);
+ GMX_RELEASE_ASSERT(mod >= 0 && mod < emntNR, "Trying to set nthreads on invalid OpenMP module");
modth.nth[mod] = nthreads;
}