From: Berk Hess Date: Thu, 28 Nov 2013 18:35:29 +0000 (+0100) Subject: Fixed zero hardware thread count X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=15326145ce4fc939fb31cfe44d966b411f6d0678;p=alexxy%2Fgromacs.git Fixed zero hardware thread count A missing include caused sysconf not to be called, which lead to the hardware thread count being zero on most non-Windows systems. Change-Id: I102c04f494f2946725bb5714482cb861aa8f69fc --- diff --git a/src/gromacs/gmxlib/gmx_detect_hardware.c b/src/gromacs/gmxlib/gmx_detect_hardware.c index 2638656aa4..48e45e3106 100644 --- a/src/gromacs/gmxlib/gmx_detect_hardware.c +++ b/src/gromacs/gmxlib/gmx_detect_hardware.c @@ -40,6 +40,11 @@ #include #include +#ifdef HAVE_UNISTD_H +/* For sysconf */ +#include +#endif + #include "types/enums.h" #include "types/hw_info.h" #include "types/commrec.h" @@ -497,6 +502,8 @@ static int get_nthreads_hw_avail(FILE *fplog, const t_commrec *cr) ret = sysconf(_SC_NPROCESSORS_CONF); #elif defined(_SC_NPROC_CONF) ret = sysconf(_SC_NPROC_CONF); +#else +#warning "No valid sysconf argument value found. Executables will not be able to determine the number of hardware threads: mdrun will use 1 thread by default!" #endif /* End of check for sysconf argument values */ #else