diff --git a/etc/bashrc b/etc/bashrc index 1d919022f..046dbf65d 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -142,18 +142,7 @@ export WM_COMPILER_LIB_ARCH= : ${WM_MPLIB:=OPENMPI}; export WM_MPLIB # WM_NCOMPPROCS = -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.physicalcpu` - ;; - esac -fi +: ${WM_NCOMPPROCS:=`foamGetSystemInfo -nbrCores`}; export WM_NCOMPPROCS # Run options (floating-point signal handling and memory initialisation) diff --git a/etc/cshrc b/etc/cshrc index d9e23a626..245ce8d8d 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -134,19 +134,7 @@ if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI # WM_NCOMPPROCS = -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.physicalcpu` - breaksw - - endsw -endif - +if ( ! $?WM_NCOMPPROCS ) setenv WM_NCOMPPROCS `foamGetSystemInfo -nbrCores` # Run options (floating-point signal handling and memory initialisation) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~