diff --git a/src/QMCTools/CMakeLists.txt b/src/QMCTools/CMakeLists.txt index 081f57d437..f2360490a9 100644 --- a/src/QMCTools/CMakeLists.txt +++ b/src/QMCTools/CMakeLists.txt @@ -42,7 +42,7 @@ ADD_LIBRARY(mocommon ${MOSRCS}) set(QTOOLS convert4qmc extract-eshdf-kvectors) ADD_EXECUTABLE(getSupercell getSupercell.cpp) -ADD_EXECUTABLE(checkAffinity checkAffinity.cpp) +ADD_EXECUTABLE(qmc-check-affinity check-affinity.cpp) FOREACH(p ${QTOOLS}) diff --git a/src/QMCTools/checkAffinity.cpp b/src/QMCTools/check-affinity.cpp similarity index 65% rename from src/QMCTools/checkAffinity.cpp rename to src/QMCTools/check-affinity.cpp index 3d17d7bcf1..83d251553c 100644 --- a/src/QMCTools/checkAffinity.cpp +++ b/src/QMCTools/check-affinity.cpp @@ -1,6 +1,17 @@ +////////////////////////////////////////////////////////////////////////////////////// +// This file is distributed under the University of Illinois/NCSA Open Source License. +// See LICENSE file in top directory for details. +// +// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. +// +// File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory +// +// File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory +////////////////////////////////////////////////////////////////////////////////////// + #ifdef __bgq__ #include -#else +#elif __linux__ #include #endif #include @@ -15,9 +26,11 @@ int get_core() #ifdef __bgq__ int core = Kernel_ProcessorCoreID(); return core; -#else +#elif __linux__ int cpuid = sched_getcpu(); return cpuid; +#else + return -1; #endif } @@ -36,6 +49,7 @@ int get_hwthread() int main() { + std::cout << "Note: -1 means the property is not accessible on this platform." << std::endl << std::endl; #pragma omp parallel { int L1_thread_id = omp_get_thread_num();