From 054d8e1382c6e1ab97d005bffc44b15c0c8e0d40 Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Fri, 9 Nov 2012 02:38:37 +0100 Subject: [PATCH] only use CPU_COUNT if it's available The external affinity detection implemented by a6e1181 uses CPU_COUNT from sched.h for a consistency check, but this macro is only available with glibc 2.6 and later. Hence, a check for this macro was needed to avoid issues with glibc <2.6 Change-Id: I6088972e9a5aabefb2b3fa3b38ac8d4ba32662f7 --- src/kernel/runner.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel/runner.c b/src/kernel/runner.c index d8f8a383f5..6343201201 100644 --- a/src/kernel/runner.c +++ b/src/kernel/runner.c @@ -807,7 +807,9 @@ static void check_cpu_affinity_set(FILE *fplog, const t_commrec *cr, } /* Before proceeding with the actual check, make sure that the number of - * detected CPUs is >= the CPUs in the current set. */ + * detected CPUs is >= the CPUs in the current set. + * We need to check for CPU_COUNT as it was added only in glibc 2.6. */ +#ifdef CPU_COUNT if (ncpus < CPU_COUNT(&mask_current)) { if (debug) @@ -817,6 +819,7 @@ static void check_cpu_affinity_set(FILE *fplog, const t_commrec *cr, } return; } +#endif /* CPU_COUNT */ bAllSet = TRUE; for (i = 0; (i < ncpus && i < CPU_SETSIZE); i++) -- 2.22.0