From c6bc088fa1f87b0e5a57fc86596c2b6e1f91d0be Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Thu, 14 Mar 2019 10:03:53 +0100 Subject: [PATCH] Blind out affinity module if OpenMP is not used. Remove obsolete pthread switch. --- include_CLANG.mk | 4 ++-- include_GCC.mk | 4 ++-- include_ICC.mk | 4 ++-- src/affinity.c | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include_CLANG.mk b/include_CLANG.mk index 913c44d..43328ee 100644 --- a/include_CLANG.mk +++ b/include_CLANG.mk @@ -5,8 +5,8 @@ ifeq ($(ENABLE_OPENMP),true) OPENMP = -fopenmp endif -CFLAGS = -Ofast -ffreestanding -std=c99 -pthread $(OPENMP) -LFLAGS = -pthread $(OPENMP) +CFLAGS = -Ofast -ffreestanding -std=c99 $(OPENMP) +LFLAGS = $(OPENMP) DEFINES = -D_GNU_SOURCE INCLUDES = LIBS = diff --git a/include_GCC.mk b/include_GCC.mk index afdb9f1..d85fe65 100644 --- a/include_GCC.mk +++ b/include_GCC.mk @@ -5,8 +5,8 @@ ifeq ($(ENABLE_OPENMP),true) OPENMP = -fopenmp endif -CFLAGS = -Ofast -ffreestanding -std=c99 -pthread $(OPENMP) -LFLAGS = -pthread $(OPENMP) +CFLAGS = -Ofast -ffreestanding -std=c99 $(OPENMP) +LFLAGS = $(OPENMP) DEFINES = -D_GNU_SOURCE INCLUDES = LIBS = diff --git a/include_ICC.mk b/include_ICC.mk index 8bc051d..dd1cb99 100644 --- a/include_ICC.mk +++ b/include_ICC.mk @@ -5,8 +5,8 @@ ifeq ($(ENABLE_OPENMP),true) OPENMP = -qopenmp endif -CFLAGS = -qopt-report -Ofast -xHost -std=c99 -ffreestanding -pthread $(OPENMP) -LFLAGS = -pthread $(OPENMP) +CFLAGS = -qopt-report -Ofast -xHost -std=c99 -ffreestanding $(OPENMP) +LFLAGS = $(OPENMP) DEFINES = -D_GNU_SOURCE INCLUDES = LIBS = diff --git a/src/affinity.c b/src/affinity.c index 7d1663b..cc361c2 100644 --- a/src/affinity.c +++ b/src/affinity.c @@ -26,6 +26,7 @@ */ #ifdef __linux__ +#ifdef _OPENMP #include #include #include @@ -84,4 +85,5 @@ affinity_pinProcess(int processorId) CPU_SET(processorId, &cpuset); sched_setaffinity(0, sizeof(cpu_set_t), &cpuset); } -#endif +#endif /*__linux__*/ +#endif /*_OPENMP*/