Compatibility: auto NCOMPPROCS for Mac

This commit is contained in:
Henrik Rusche 2013-07-05 18:15:23 +02:00
parent c1b2dfb509
commit ac008a3ca0
2 changed files with 28 additions and 3 deletions

View file

@ -128,7 +128,6 @@ export WM_COMPILER_LIB_ARCH=
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: ${WM_NCOMPPROCS:=`grep -c processor /proc/cpuinfo`}; export WM_NCOMPPROCS
# WM_ARCH_OPTION = 32 | 64
: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION
@ -142,6 +141,20 @@ export WM_COMPILER_LIB_ARCH=
# WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
# WM_NCOMPPROCS = <number of processes to use>
if [ -z "${WM_NCOMPPROCS+xxx}" ]
then
case `uname -s` in
Linux)
export WM_NCOMPPROCS=`grep -c processor /proc/cpuinfo`
;;
Darwin)
export WM_NCOMPPROCS=`sysctl -n hw.ncpu`
;;
esac
fi
# Run options (floating-point signal handling and memory initialisation)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -119,8 +119,6 @@ setenv WM_COMPILER_LIB_ARCH
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?WM_NCOMPPROCS ) setenv WM_NCOMPPROCS=`grep -c processor /proc/cpuinfo`
# WM_ARCH_OPTION = 32 | 64
if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
@ -135,6 +133,20 @@ if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
# WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
# WM_NCOMPPROCS = <number of processes to use>
if ( ! $?WM_NCOMPPROCS ) then
switch (`uname -s`)
case Linux:
setenv WM_NCOMPPROCS `grep -c processor /proc/cpuinfo`
breaksw
case Darwin:
setenv WM_NCOMPPROCS `sysctl -n hw.ncpu`
breaksw
endsw
endif
# Run options (floating-point signal handling and memory initialisation)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~