Skip to content

Commit

Permalink
Merge pull request #891 from edoapra/flaccid-fraction
Browse files Browse the repository at this point in the history
update
  • Loading branch information
nwchemgit authored Oct 20, 2023
2 parents 3aaf10d + 9644a1b commit d1110a5
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 28 deletions.
1 change: 1 addition & 0 deletions src/argos/argos_prepare_wrttop.F
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ logical function argos_prepare_wrttop(lfnout,title,lfntop,filtop,
! For most purposes, it is more useful to use the environment variable
! LOGNAME to find out who the user is. This is more flexible precisely
! because the user can set LOGNAME arbitrarily.
call util_getenv('LOGNAME',user)
#else
call getlog(user)
#endif
Expand Down
1 change: 1 addition & 0 deletions src/argos/argos_space_wtmro.F
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ subroutine argos_space_wtmro(lfnmro,stime,pres,temp,tempw,temps,
! For most purposes, it is more useful to use the environment variable
! LOGNAME to find out who the user is. This is more flexible precisely
! because the user can set LOGNAME arbitrarily.
call util_getenv('LOGNAME',user)
#else
call getlog(user)
#endif
Expand Down
1 change: 1 addition & 0 deletions src/argos/argos_space_wtrst.F
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ subroutine argos_space_wtrst(lfnrst,filrst,lveloc,pres,
! For most purposes, it is more useful to use the environment variable
! LOGNAME to find out who the user is. This is more flexible precisely
! because the user can set LOGNAME arbitrarily.
call util_getenv('LOGNAME',user)
#else
call getlog(user)
#endif
Expand Down
4 changes: 1 addition & 3 deletions src/blas/double/xerbla.F
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SUBROUTINE XERBLA( SRNAME, INFO )
#include "errquit.fh"
*
* -- LAPACK auxiliary routine (version 2.0) --
* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
Expand Down Expand Up @@ -40,8 +39,7 @@ SUBROUTINE XERBLA( SRNAME, INFO )
*
WRITE( *, FMT = 9999 )SRNAME, INFO
*
* STOP
call errquit('xerbla:double: lapack error',911, BASIS_ERR)
STOP
*
9999 FORMAT( ' ** On entry to ', A6, ' parameter number ', I2, ' had ',
$ 'an illegal value' )
Expand Down
59 changes: 42 additions & 17 deletions src/config/makefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,15 @@ ifeq ($(TARGET),MACX64)
COPTIONS += -fPIC
endif

ifeq ($(shell $(CNFDIR)/strip_compiler.sh $(FC)),flang)
_FC=gfortran
USE_FLANG=1
endif
ifeq ($(USE_FLANG),1)
FLANG_VERSION=$(shell $(FC) --version |head -1 | sed 's/^.*\(version\)//'|cut -d . -f 1)
FLANG_LT_16 = $(shell [ $(FLANG_VERSION) -lt 16 ] && echo true || echo false)
endif

ifeq ($(_FC),gfortran)
#gcc version
FOPTIONS = -cpp #-Wextra #-Wunused #-ffast-math
Expand All @@ -1326,6 +1335,20 @@ ifeq ($(TARGET),MACX64)
endif

FOPTIMIZE = -O2 -ffast-math

ifdef USE_OPENMP
FOPTIONS += -fopenmp
LDOPTIONS += -fopenmp
endif

ifeq ($(USE_FLANG),1)
GNU_GE_4_6=true
FOPTIONS+=-fno-backslash
DEFINES += -D__FLANG
ifeq ($(FLANG_LT_16),false)
# FOPTIONS+=-fstack-arrays
endif
else
ifeq ($(V),-1)
FOPTIONS += -w
else
Expand Down Expand Up @@ -1381,11 +1404,6 @@ ifeq ($(TARGET),MACX64)
FOPTIONS += -std=legacy
endif

ifdef USE_OPENMP
FOPTIONS += -fopenmp
LDOPTIONS += -fopenmp
endif

ifdef USE_ASAN
FOPTIONS += -fsanitize=address -fsanitize-recover=address
LDOPTIONS += -fsanitize=address -fsanitize-recover=address
Expand All @@ -1394,6 +1412,7 @@ ifeq ($(TARGET),MACX64)
ifdef USE_FPE
FOPTIONS += -ffpe-trap=invalid,zero,overflow -fbacktrace
endif
endif # not USE_FLANG
endif # gfortran

ifdef USE_GPROF
Expand Down Expand Up @@ -2078,6 +2097,16 @@ ifneq ($(TARGET),LINUX)
USE_FLANG=1
endif

ifeq ($(USE_FLANG),1)
FLANG_VERSION=$(shell $(FC) --version |head -1 | sed 's/^.*\(version\)//'|cut -d . -f 1)
FLANG_LT_16 = $(shell [ $(FLANG_VERSION) -lt 16 ] && echo true || echo false)
endif

#@info
#@info flv $(FLANG_VERSION)
#@info FLANG_LT_16 $(FLANG_LT_16)
#@info

ifeq ($(CC),clang)
_CC=gcc
endif
Expand Down Expand Up @@ -2179,7 +2208,7 @@ ifneq ($(TARGET),LINUX)
LDOPTIONS += -fsanitize=address -fsanitize-recover=address
endif
ifdef USE_FPE
ifdef USE_FLANG
ifeq ($(USE_FLANG),1)
$(info )
$(info USE_FPE not ready for flang)
$(info )
Expand All @@ -2191,7 +2220,7 @@ ifneq ($(TARGET),LINUX)
FOPTIONS += -ffast-math #-Wunused
endif
ifeq ($(V),-1)
ifeq ($(FLANG_LT_17),true)
ifeq ($(FLANG_LT_16),true)
FOPTIONS += -w
endif
COPTIONS += -w
Expand All @@ -2202,14 +2231,12 @@ ifneq ($(TARGET),LINUX)
ifeq ($(_CC),$(findstring $(_CC),gcc clang))
COPTIONS += -Wall
endif
ifeq ($(GNU_GE_4_8),true)
ifndef USE_FLANG
ifneq ($(USE_FLANG),1)
ifeq ($(GNU_GE_4_8),true)
FOPTIMIZE += -Wno-maybe-uninitialized
endif
else
ifneq ($(USE_FLANG),1)
else
FOPTIONS += -Wuninitialized
endif
endif
endif
endif

Expand All @@ -2219,9 +2246,7 @@ ifneq ($(TARGET),LINUX)

GNU_GE_4_6=true
FOPTIONS+=-fno-backslash
FLANG_VERSION=$(shell $(FC) --version |head -1 || sed 's/^.*\(version\)//'|cut -d . -f 1)
FLANG_LT_17 = $(shell [ $(FLANG_VERSION) -lt 17 ] && echo true)
ifeq ($(FLANG_LT_17),true)
ifeq ($(FLANG_LT_16),true)
FOPTIONS+=-mcmodel=medium
COPTIONS+=-mcmodel=medium
CFLAGS_FORGA = -mcmodel=medium
Expand Down Expand Up @@ -2743,7 +2768,7 @@ ifneq ($(TARGET),LINUX)
FOPTIMIZE += -ffast-math #2nd time
endif

ifdef USE_FLANG
ifeq ($(USE_FLANG),1)
ifdef USE_OPTREPORT
FOPTIMIZE += -Rpass=loop-vectorize -Rpass-missed=loop-vectorize -Rpass-analysis=loop-vectorize
endif
Expand Down
2 changes: 1 addition & 1 deletion src/ddscf/movecs_frag.F
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ subroutine movecs_fragment(rtdb, geom, basis,
& INPUT_ERR)
if (.not. ga_create(MT_DBL, nbf_frag, nmo_frag(1),
$ ' frag mos', 32, 32, g_frag))
$ call errquit('movecs_fragment: GA for frag MOs', nmo_frag,
$ call errquit('movecs_fragment: GA for frag MOs', nmo_frag(1),
& GA_ERR)
if (.not. ma_push_get(mt_dbl, nbf_frag,
$ ' fragment eva', l_eval, k_eval)) call errquit
Expand Down
8 changes: 5 additions & 3 deletions src/ddscf/uhf_hessv2_ext.F
Original file line number Diff line number Diff line change
Expand Up @@ -2775,7 +2775,8 @@ subroutine uhf_hessv_2e2_opt_cmplx(
& GA_ERR)
enddo ! end-loop-iset (spin A,B)
enddo ! end-loop-cnt
if (.not. ga_destroy(g_Axreim)) call errquit('uhf_hv2e: Axreim',0,
if (.not. ga_destroy(g_Axreim))
c call errquit('uhf_hv2e: Axreim',0,
& GA_ERR)
if (debug) then
if (ga_nodeid().eq.0)
Expand Down Expand Up @@ -4111,8 +4112,9 @@ subroutine uhf_hessv_2e2_opt_cmplx1(
& GA_ERR)
enddo ! end-loop-iset (spin A,B)
enddo ! end-loop-cnt
if (.not. ga_destroy(g_Axreim)) call errquit('uhf_hv2e: Axreim',0,
& GA_ERR)
if (.not. ga_destroy(g_Axreim))
& call errquit('uhf_hv2e: Axreim',0,
& GA_ERR)
if (debug) then
if (ga_nodeid().eq.0)
& write(*,*) '------- g_Az-1------ START'
Expand Down
3 changes: 1 addition & 2 deletions src/geom/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
include ../config/makefile.h
include ../config/makelib.h


ifeq ($(FC),flang-new-17)
ifeq ($(FLANG_LT_16),false)
FOPTIONS += -fno-automatic
endif
ifeq ($(_FC),pgf90)
Expand Down
2 changes: 1 addition & 1 deletion src/libext/openblas/build_openblas.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!/usr/bin/env bash
#!/usr/bin/env bash
#set -v
arch=`uname -m`
VERSION=0.3.24
Expand Down
2 changes: 1 addition & 1 deletion src/nwdft/scf_dft/dft_fock_efield.F
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ subroutine dft_fock_efield (rtdb, efield, g_ddote, lscale)
$ mt_dbl, 1, exp_cutoff)) then

if (exp_cutoff .lt. 0d0)
$ call errquit (pname//"invalid negative exp_cutoff")
$ call errquit (pname//"invalid negative exp_cutoff",0,0)


if (.not. bas_numcont (ao_bas_han, ncont))
Expand Down
1 change: 1 addition & 0 deletions src/prepar/pre_wrttop.F
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ logical function pre_wrttop(lfnout,title,lfntop,filtop,
! For most purposes, it is more useful to use the environment variable
! LOGNAME to find out who the user is. This is more flexible precisely
! because the user can set LOGNAME arbitrarily.
call util_getenv('LOGNAME',user)
#else
call getlog(user)
#endif
Expand Down
1 change: 1 addition & 0 deletions src/space/sp_init.F
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,7 @@ subroutine sp_wtrst(lfnrst,filrst,lveloc,pres,temp,tempw,temps,
! For most purposes, it is more useful to use the environment variable
! LOGNAME to find out who the user is. This is more flexible precisely
! because the user can set LOGNAME arbitrarily.
call util_getenv('LOGNAME',user)
#else
call getlog(user)
#endif
Expand Down
17 changes: 17 additions & 0 deletions src/tools/ga_ma_align_patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
rm -f ga_ma_align.patch
cat > ga_ma_align.patch <<EOF
--- $1/global/src/base.c.org 2023-10-19 15:49:17
+++ $1/global/src/base.c 2023-10-19 15:49:04
@@ -76,7 +76,7 @@
/*#define CHECK_MA yes */
/*uncomment line below to verify if MA base address is alligned wrt datatype*/
-#if !(defined(LINUX) || defined(CRAY) || defined(CYGWIN))
+#if !(defined(LINUX) || defined(CRAY) || defined(CYGWIN) || defined(MACX))
#define CHECK_MA_ALGN 1
#else
#endif
EOF
patch -p0 -s -N < ga_ma_align.patch
echo ga_ma_align.patch applied
1 change: 1 addition & 0 deletions src/tools/get-tools-github
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ if [[ -d "ga-5.8.2" ]]; then
./gamalloc_patch.sh $GA_DIR
./peigstubs_patch.sh $GA_DIR
./mpipr-too-many_patch.sh $GA_DIR
./ga_ma_align_patch.sh $GA_DIR
echo patched
touch ga-5.8.2/patched581
fi
Expand Down

0 comments on commit d1110a5

Please sign in to comment.