Skip to content

Commit

Permalink
Merge pull request #914 from edoapra/flaccid-fraction
Browse files Browse the repository at this point in the history
fixes for OpenBLAS and simd check
  • Loading branch information
nwchemgit authored Nov 24, 2023
2 parents 9465234 + 1f3dc2f commit dc7962f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/NWints/simint/libsimint_source/build_simint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ else
arch=$(uname -m)
fi
if [[ ${UNAME_S} == Linux ]]; then
CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |tail -n 1)
CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |tail -n 1)
CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |grep -v vmx\ f |tail -n 1)
CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags | grep -v vmx\ f |tail -n 1)
elif [[ ${UNAME_S} == Darwin ]]; then
CPU_FLAGS=$(sysctl -n machdep.cpu.features)
if [[ "$arch" == "x86_64" ]]; then
Expand All @@ -43,6 +43,8 @@ else
echo Operating system not supported yet
exit 1
fi
echo CPU_FLAGS $CPU_FLAGS
echo CPU_FLAGS_2 $CPU_FLAGS_2
GOTSSE2=$(echo ${CPU_FLAGS} | tr 'A-Z' 'a-z'| awk ' /sse2/ {print "Y"}')
GOTAVX=$(echo ${CPU_FLAGS} | tr 'A-Z' 'a-z'| awk ' /avx/ {print "Y"}')
GOTAVX2=$(echo ${CPU_FLAGS_2} | tr 'A-Z' 'a-z'| awk ' /avx2/ {print "Y"}')
Expand Down
23 changes: 18 additions & 5 deletions src/config/oblas_ompcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ mylog=/tmp/mylog.txt
NWCHEM_TOP=$1
file_check=$NWCHEM_TOP/src/oblas_ompcheck_done.txt
if [ -f $file_check ]; then
echo $file_check present >> $mylog
# echo $file_check present >> $mylog
cat $file_check
exit 0
fi
echo BLASOPT is $BLASOPT >> $mylog
if [[ -z "${BLASOPT}" ]]; then
echo BLASOPT is empty >> $mylog
echo 0 > $NWCHEM_TOP/src/oblas_ompcheck_done.txt
exit 0
else
echo BLASOPT is not empty @$BLASOPT@ >> $mylog
fi
#extract oblas_dir & oblas_name from BLASOPT
#
oblas_dir=$(echo $BLASOPT | awk 'sub(/.*-L */,""){f=1} f{if ( sub(/ * .*/,"") ) f=0; print}')
Expand All @@ -27,11 +35,16 @@ else
SOSUFFIX=so
fi
# check first against clang libomp
gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libomp | wc -l )
# next check against gcc libgomp
if [ $gotomp -eq 0 ]
if [ -f "$oblas_dir/lib$oblas_name.$SOSUFFIX" ];
then
gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libgomp | wc -l )
gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libomp | wc -l )
# next check against gcc libgomp
if [ $gotomp -eq 0 ]
then
gotomp=$($MYLDD $oblas_dir/lib$oblas_name.$SOSUFFIX | grep libgomp | wc -l )
fi
else
gotomp=0
fi
echo gotomp $gotomp >> $mylog
#conda packages might use OpenMP to thread OpenBLAS
Expand Down
4 changes: 2 additions & 2 deletions src/libext/openblas/build_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if [[ -z "${FORCETARGET}" ]]; then
FORCETARGET=" "
UNAME_S=$(uname -s)
if [[ ${UNAME_S} == Linux ]]; then
CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |tail -n 1)
CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |tail -n 1)
CPU_FLAGS=$(cat /proc/cpuinfo | grep flags | grep -v vmx\ f |tail -n 1)
CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags | grep -v vmx\ f |tail -n 1)
elif [[ ${UNAME_S} == Darwin ]]; then
CPU_FLAGS=$(/usr/sbin/sysctl -n machdep.cpu.features)
if [[ "$arch" == "x86_64" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions travis/guess_simd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
UNAME_S=$(uname -s)
arch=`uname -m`
if [[ ${UNAME_S} == Linux ]]; then
CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |tail -n 1)
CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |tail -n 1)
CPU_FLAGS=$(cat /proc/cpuinfo | grep flags |grep -v vmx\ flags |tail -n 1)
CPU_FLAGS_2=$(cat /proc/cpuinfo | grep flags |grep -v vmx\ flags |tail -n 1)
elif [[ ${UNAME_S} == Darwin ]]; then
CPU_FLAGS=$(/usr/sbin/sysctl -n machdep.cpu.features)
if [[ "$arch" == "x86_64" ]]; then
Expand Down

0 comments on commit dc7962f

Please sign in to comment.