Unverified Commit faefcc77 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

sched_getaffinity() is a Linux specific system call. add preprocessor guards

parent 0774e92e
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -102,18 +102,20 @@ void VerletLRTIntel::setup(int flag)
  }
  }


  #if defined(_LMP_INTEL_LRT_PTHREAD)
  #if defined(_LMP_INTEL_LRT_PTHREAD)
  #if defined(__linux)
  if (comm->me == 0) {
  if (comm->me == 0) {
    cpu_set_t cpuset;
    cpu_set_t cpuset;
    sched_getaffinity(0, sizeof(cpuset), &cpuset);
    sched_getaffinity(0, sizeof(cpuset), &cpuset);
    int my_cpu_count = CPU_COUNT(&cpuset);
    int my_cpu_count = CPU_COUNT(&cpuset);
    if (my_cpu_count < comm->nthreads + 1) {
    if (my_cpu_count < comm->nthreads + 1) {
      char str[128];
      char str[128];
      sprintf(str,"Using %d threads per MPI, but only %d core(s) allocated"
      sprintf(str,"Using %d threads per MPI rank, but only %d core(s)"
                  " per MPI",
                  " allocated for each MPI rank",
              comm->nthreads + 1, my_cpu_count);
              comm->nthreads + 1, my_cpu_count);
      error->warning(FLERR, str);
      error->warning(FLERR, str);
    }
    }
  }
  }
  #endif


  _kspace_ready = 0;
  _kspace_ready = 0;
  _kspace_done = 0;
  _kspace_done = 0;