diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index e3adb6c268..20e60bab26 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -105,6 +105,7 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) // print summary of settings if (comm->me == 0) { +#if defined(_OPENMP) const char * const nmode = _neighbor ? "multi-threaded" : "serial"; if (screen) { @@ -118,6 +119,10 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) fprintf(logfile,"set %d OpenMP thread(s) per MPI task\n", nthreads); fprintf(logfile,"using %s neighbor list subroutines\n", nmode); } +#else + error->warning(FLERR,"OpenMP support not enabled during compilation; " + "using 1 thread only."); +#endif } // allocate list for per thread accumulator manager class instances diff --git a/src/comm.cpp b/src/comm.cpp index f29d1bf7df..070fd8575a 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -87,7 +87,8 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) } else if (getenv("OMP_NUM_THREADS") == NULL) { nthreads = 1; if (me == 0) - error->warning(FLERR,"OMP_NUM_THREADS environment is not set."); + error->warning(FLERR,"OMP_NUM_THREADS environment is not set. " + "Defaulting to 1 thread."); } else { nthreads = omp_get_max_threads(); }