mirror of
https://github.com/nwchemgit/nwchem.git
synced 2026-07-27 21:55:30 -04:00
commit
b2730bc475
4 changed files with 84 additions and 8 deletions
|
|
@ -0,0 +1,22 @@
|
|||
From 9402df5604e69f86f58953e3883f33f98c930baf Mon Sep 17 00:00:00 2001
|
||||
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
|
||||
Date: Wed, 14 Sep 2022 21:44:34 +0200
|
||||
Subject: [PATCH] Fix missing external declaration
|
||||
|
||||
---
|
||||
driver/others/blas_server_omp.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/driver/others/blas_server_omp.c b/driver/others/blas_server_omp.c
|
||||
index 1a5fd06a32..c158f92ee3 100644
|
||||
--- a/driver/others/blas_server_omp.c
|
||||
+++ b/driver/others/blas_server_omp.c
|
||||
@@ -69,6 +69,8 @@
|
||||
|
||||
int blas_server_avail = 0;
|
||||
|
||||
+extern int openblas_omp_adaptive_env();
|
||||
+
|
||||
static void * blas_thread_buffer[MAX_PARALLEL_NUMBER][MAX_CPU_NUMBER];
|
||||
#ifdef HAVE_C11
|
||||
static atomic_bool blas_buffer_inuse[MAX_PARALLEL_NUMBER];
|
||||
|
|
@ -26,6 +26,7 @@ patch -p0 -s -N < ../makesys.patch
|
|||
#patch -p0 -s -N < ../icc_avx512.patch
|
||||
# patch for pgi/nvfortran missing -march=armv8
|
||||
patch -p0 -s -N < ../arm64_fopt.patch
|
||||
patch -p1 -s -N < ../9402df5604e69f86f58953e3883f33f98c930baf.patch
|
||||
if [[ -z "${FORCETARGET}" ]]; then
|
||||
FORCETARGET=" "
|
||||
UNAME_S=$(uname -s)
|
||||
|
|
@ -35,7 +36,11 @@ if [[ ${UNAME_S} == Linux ]]; then
|
|||
elif [[ ${UNAME_S} == Darwin ]]; then
|
||||
CPU_FLAGS=$(/usr/sbin/sysctl -n machdep.cpu.features)
|
||||
if [[ "$arch" == "x86_64" ]]; then
|
||||
CPU_FLAGS_2=$(/usr/sbin/sysctl -n machdep.cpu.leaf7_features)
|
||||
# CPU_FLAGS_2=$(/usr/sbin/sysctl -n machdep.cpu.leaf7_features)
|
||||
if [[ $(/usr/sbin/sysctl -n hw.optional.avx2_0) == 1 ]]; then
|
||||
echo got AVX2
|
||||
CPU_FLAGS_2="AVX2"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
GOTSSE2=$(echo ${CPU_FLAGS} | tr 'A-Z' 'a-z'| awk ' /sse2/ {print "Y"}')
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ c
|
|||
integer g_ta_mirr,g_tb_mirr,g_ta_org,g_tb_org
|
||||
logical util_mirrmat,tuhfreplicated
|
||||
external util_mirrmat
|
||||
integer util_mirrmem,mem_mirr
|
||||
external util_mirrmem
|
||||
c
|
||||
integer l_ia_uv, k_ia_uv, l_tmp, k_tmp, l_ia_jb, k_ia_jb
|
||||
double precision ddot
|
||||
|
|
@ -89,14 +91,23 @@ c
|
|||
$ call errquit('could not alloc ga for T_b',1, GA_ERR)
|
||||
if (.not.rtdb_get(rtdb, 'mp2:tuhfreplicated', mt_log, 1,
|
||||
T tuhfreplicated)) tuhfreplicated=.true.
|
||||
do_mirra=.false.
|
||||
do_mirrb=.false.
|
||||
if(tuhfreplicated) then
|
||||
do_mirra=util_mirrmat(1,g_t_a,g_ta_mirr,
|
||||
D .false., .true.)
|
||||
do_mirrb=util_mirrmat(1,g_t_b,g_tb_mirr,
|
||||
D .false., .true.)
|
||||
else
|
||||
do_mirra=.false.
|
||||
do_mirrb=.false.
|
||||
mem_mirr=
|
||||
M util_mirrmem(1,g_t_a)+
|
||||
M util_mirrmem(1,g_t_b)
|
||||
if(ga_nodeid().eq.0) then
|
||||
write(6,14) ' needed by mirroring: ', mem_mirr
|
||||
write(6,14) ' ga_memory_avail() : ', ga_memory_avail()
|
||||
endif
|
||||
14 format(a,i10,' bytes')
|
||||
if(ga_memory_avail().gt. mem_mirr) then
|
||||
do_mirra=util_mirrmat(1,g_t_a,g_ta_mirr,
|
||||
D .false., .true.)
|
||||
do_mirrb=util_mirrmat(1,g_t_b,g_tb_mirr,
|
||||
D .false., .true.)
|
||||
endif
|
||||
endif
|
||||
if(do_mirra.and.do_mirrb) then
|
||||
if(ga_nodeid().eq.0)
|
||||
|
|
|
|||
|
|
@ -136,3 +136,41 @@ c
|
|||
call util_mirrstop(g_densdis)
|
||||
return
|
||||
end
|
||||
integer function util_mirrmem(nmat,g_a)
|
||||
implicit none
|
||||
#include "global.fh"
|
||||
#include "mafdecls.fh"
|
||||
integer g_a(*)
|
||||
integer nmat
|
||||
c
|
||||
integer ppn
|
||||
integer nbytes,i,imat
|
||||
integer maxdim
|
||||
parameter(maxdim=10)
|
||||
integer type, dims(maxdim),ndim
|
||||
util_mirrmem=0
|
||||
call util_getppn(ppn)
|
||||
do imat=1,nmat
|
||||
call nga_inquire(g_a(imat), type, ndim, dims)
|
||||
if(ndim.gt.maxdim) call errquit(
|
||||
Q ' mirrmem: increase maxdim to ',ndim,0)
|
||||
#if 1
|
||||
if(ga_nodeid().eq.0) then
|
||||
write(0,123) ' ndim ',ndim,' dims ',
|
||||
D (dims(i),i=1,ndim)
|
||||
endif
|
||||
123 format(A,I2,A,3I10)
|
||||
#endif
|
||||
nbytes=1
|
||||
do i=1,ndim
|
||||
nbytes=nbytes*dims(i)
|
||||
enddo
|
||||
nbytes=ma_sizeof(mt_dbl,1,mt_byte)*nbytes
|
||||
util_mirrmem=util_mirrmem+nbytes
|
||||
enddo
|
||||
if(ga_nnodes().ne.1) then
|
||||
c divide by ppn & round it by 30%
|
||||
util_mirrmem=(util_mirrmem*130)/(ppn*100)
|
||||
endif
|
||||
return
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue