diff options
3 files changed, 304 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/abinit/fix_for_fujitsu.patch b/var/spack/repos/builtin/packages/abinit/fix_for_fujitsu.patch new file mode 100644 index 0000000000..df9e6b4e17 --- /dev/null +++ b/var/spack/repos/builtin/packages/abinit/fix_for_fujitsu.patch @@ -0,0 +1,215 @@ +diff -uprN src/43_wvl_wrappers/m_abi2big.F90 src/43_wvl_wrappers/m_abi2big.F90 +--- src/43_wvl_wrappers/m_abi2big.F90 2019-01-17 20:49:35.000000000 +0900 ++++ src/43_wvl_wrappers/m_abi2big.F90 2019-05-21 15:05:23.000000000 +0900 +@@ -1333,10 +1333,10 @@ subroutine wvl_setngfft(me_wvl, mgfft, n + + !Arguments ------------------------------------ + !scalars +- integer, intent(out) :: mgfft, nfft ++ integer, intent(inout) :: mgfft, nfft + integer, intent(in) :: n1i, n2i, n3i,n3d, nproc_wvl, me_wvl + !arrays +- integer, intent(out) :: ngfft(18) ++ integer, intent(inout) :: ngfft(18) + + !Local variables------------------------------- + !scalars +diff -uprN src/43_wvl_wrappers/m_wvl_denspot.F90 src/43_wvl_wrappers/m_wvl_denspot.F90 +--- src/43_wvl_wrappers/m_wvl_denspot.F90 2019-01-17 20:49:32.000000000 +0900 ++++ src/43_wvl_wrappers/m_wvl_denspot.F90 2019-05-21 15:06:21.000000000 +0900 +@@ -96,7 +96,7 @@ subroutine wvl_denspot_set(den,gth_param + real(dp), intent(in) :: rprimd(3, 3) + real(dp), intent(in) :: wvl_frmult,wvl_crmult + real(dp), intent(inout) :: xred(3,natom) +- type(wvl_denspot_type), intent(out) :: den ++ type(wvl_denspot_type), intent(inout) :: den + type(wvl_internal_type),intent(in) :: wvl + type(pseudopotential_gth_type),intent(in)::gth_params + +diff -uprN src/43_wvl_wrappers/m_wvl_wfs.F90 src/43_wvl_wrappers/m_wvl_wfs.F90 +--- src/43_wvl_wrappers/m_wvl_wfs.F90 2019-01-17 20:49:33.000000000 +0900 ++++ src/43_wvl_wrappers/m_wvl_wfs.F90 2019-05-21 15:07:08.000000000 +0900 +@@ -103,7 +103,7 @@ subroutine wvl_wfs_set(alphadiis, spinma + integer, intent(in) :: natom, nkpt, nsppol, nspinor, nband, nwfshist,me,nproc + real(dp), intent(in) :: spinmagntarget, wvl_crmult, wvl_frmult, alphadiis + type(pseudopotential_type),intent(in) :: psps +- type(wvl_wf_type),intent(out) :: wfs ++ type(wvl_wf_type),intent(inout) :: wfs + type(wvl_internal_type), intent(in) :: wvl + !arrays + real(dp), intent(in) :: kpt(3,nkpt) +diff -uprN src/52_fft_mpi_noabirule/m_fftw3.F90 src/52_fft_mpi_noabirule/m_fftw3.F90 +--- src/52_fft_mpi_noabirule/m_fftw3.F90 2019-01-17 20:49:35.000000000 +0900 ++++ src/52_fft_mpi_noabirule/m_fftw3.F90 2019-05-21 15:14:52.000000000 +0900 +@@ -4588,7 +4588,7 @@ subroutine fftw3_mpiback_wf(cplexwf,ndat + integer,intent(in) :: cplexwf,ndat,n1,n2,n3,nd1,nd2,nd3proc + integer,intent(in) :: max1,max2,max3,m1,m2,m3,md1,md2proc,md3,comm_fft + real(dp),intent(in) :: zf(2,md1,md3,md2proc,ndat) +- real(dp),intent(out) :: zr(2,nd1,nd2,nd3proc,ndat) ++ real(dp),intent(inout) :: zr(2,nd1,nd2,nd3proc,ndat) + + #ifdef HAVE_FFT_FFTW3 + !Local variables------------------------------- +@@ -4954,7 +4954,7 @@ subroutine fftw3_mpiforw_wf(cplexwf,ndat + integer,intent(in) :: max1,max2,max3,m1,m2,m3,md1,md2proc,md3,comm_fft + !arrays + real(dp),intent(inout) :: zr(2,nd1,nd2,nd3proc,ndat) +- real(dp),intent(out) :: zf(2,md1,md3,md2proc,ndat) ++ real(dp),intent(inout) :: zf(2,md1,md3,md2proc,ndat) + + !Local variables------------------------------- + !scalars +@@ -5311,7 +5311,7 @@ subroutine fftw3_mpiback(cplex,ndat,n1,n + ! real space input + integer,intent(in) :: cplex,ndat,n1,n2,n3,nd1,nd2,nd3,nd1eff,nd2proc,nd3proc,option,comm_fft + real(dp),intent(in) :: zf(2,nd1,nd3,nd2proc,ndat) +- real(dp),intent(out) :: zr(2,nd1eff,nd2,nd3proc,ndat) ++ real(dp),intent(inout) :: zr(2,nd1eff,nd2,nd3proc,ndat) + + !Local variables------------------------------- + !scalaras +@@ -5621,7 +5621,7 @@ subroutine fftw3_mpiforw(cplex,ndat,n1,n + integer,intent(in) :: ndat,n1,n2,n3,nd1,nd2,nd3,nd1eff,nd2proc,nd3proc,option + !arrays + real(dp),intent(in) :: zr(2,nd1eff,nd2,nd3proc,ndat) +- real(dp),intent(out) :: zf(2,nd1,nd3,nd2proc,ndat) ++ real(dp),intent(inout) :: zf(2,nd1,nd3,nd2proc,ndat) + + !Local variables------------------------------- + !scalars +@@ -6839,7 +6839,7 @@ subroutine fftw3_mpiback_manywf(cplexwf, + integer,intent(in) :: cplexwf,ndat,n1,n2,n3,nd1,nd2,nd3proc + integer,intent(in) :: max1,max2,max3,m1,m2,m3,md1,md2proc,md3,comm_fft + real(dp),intent(in) :: zf(2,md1,md3,md2proc,ndat) +- real(dp),intent(out) :: zr(2,nd1,nd2,nd3proc,ndat) ++ real(dp),intent(inout) :: zr(2,nd1,nd2,nd3proc,ndat) + + #ifdef HAVE_FFT_FFTW3 + !Local variables------------------------------- +@@ -7202,7 +7202,7 @@ subroutine fftw3_mpiforw_manywf(cplexwf, + integer,intent(in) :: max1,max2,max3,m1,m2,m3,md1,md2proc,md3,comm_fft + !arrays + real(dp),intent(inout) :: zr(2,nd1,nd2,nd3proc,ndat) +- real(dp),intent(out) :: zf(2,md1,md3,md2proc,ndat) ++ real(dp),intent(inout) :: zf(2,md1,md3,md2proc,ndat) + + !Local variables------------------------------- + !scalars +diff -uprN src/62_poisson/m_psolver.F90 src/62_poisson/m_psolver.F90 +--- src/62_poisson/m_psolver.F90 2019-01-17 20:49:26.000000000 +0900 ++++ src/62_poisson/m_psolver.F90 2019-05-21 15:09:11.000000000 +0900 +@@ -118,7 +118,7 @@ subroutine psolver_rhohxc(enhartr, enxc, + integer,intent(in) :: usexcnhat,usepaw,xclevel + real(dp),intent(in) :: rprimd(3,3) + real(dp), intent(in) :: xc_denpos +- real(dp), intent(out) :: enxc, envxc, enhartr, vxcavg ++ real(dp), intent(inout) :: enxc, envxc, enhartr, vxcavg + type(mpi_type), intent(in) :: mpi_enreg + type(wvl_internal_type), intent(in) :: wvl + type(wvl_denspot_type), intent(inout) :: wvl_den +@@ -128,8 +128,8 @@ subroutine psolver_rhohxc(enhartr, enxc, + real(dp),intent(in) :: xccc3d(n3xccc) + real(dp),intent(in) :: nhat(nfft,nspden*nhatdim) + real(dp),intent(inout) :: rhor(nfft, nspden) +- real(dp),intent(out) :: vhartr(nfft) +- real(dp),intent(out) :: vxc(nfft, nspden) ++ real(dp),intent(inout) :: vhartr(nfft) ++ real(dp),intent(inout) :: vxc(nfft, nspden) + + !Local variables------------------------------- + #if defined HAVE_BIGDFT +@@ -577,12 +577,12 @@ subroutine psolver_hartree(enhartr, hgri + !Arguments ------------------------------------ + !scalars + integer, intent(in) :: nfft, nspden, icoulomb, usewvl, mpi_comm, me, nproc, nscforder +- real(dp), intent(out) :: enhartr ++ real(dp), intent(inout) :: enhartr + !arrays + integer, intent(in) :: ngfft(3) + real(dp),intent(in) :: hgrid(3) + real(dp),intent(in) :: rhor(nfft,nspden) +- real(dp),intent(out) :: vhartr(nfft) ++ real(dp),intent(inout) :: vhartr(nfft) + + !Local variables------------------------------- + #if defined HAVE_BIGDFT +diff -uprN src/62_wvl_wfs/m_wvl_psi.F90 src/62_wvl_wfs/m_wvl_psi.F90 +--- src/62_wvl_wfs/m_wvl_psi.F90 2019-01-17 20:49:14.000000000 +0900 ++++ src/62_wvl_wfs/m_wvl_psi.F90 2019-05-21 15:10:51.000000000 +0900 +@@ -248,16 +248,16 @@ subroutine wvl_psitohpsi(alphamix,eexctX + !scalars + integer, intent(in) :: me, nproc, itrp, iter, iscf, natom, nfft, nspden + real(dp), intent(in) :: alphamix +- real(dp), intent(out) :: rpnrm ++ real(dp), intent(inout) :: rpnrm + logical, intent(in) :: scf + logical, intent(in) :: wvlbigdft + type(wvl_data), intent(inout) :: wvl + real(dp), intent(inout) :: eexctX,eSIC_DC,ehart,eexcu,vexcu, ekin_sum, epot_sum, eproj_sum +- real(dp), dimension(6), intent(out) :: xcstr ++ real(dp), dimension(6), intent(inout) :: xcstr + real(dp), intent(inout) :: xcart(3, natom) + !arrays +- real(dp),intent(out), optional :: vxc(nfft,nspden) +- real(dp),intent(out), optional :: vtrial(nfft,nspden) ++ real(dp),intent(inout), optional :: vxc(nfft,nspden) ++ real(dp),intent(inout), optional :: vtrial(nfft,nspden) + + !Local variables------------------------------- + !scalars +@@ -482,7 +482,7 @@ subroutine wvl_tail_corrections(dtset, e + + !Arguments ------------------------------------ + !scalars +- real(dp),intent(out) :: etotal ++ real(dp),intent(inout) :: etotal + type(MPI_type),intent(in) :: mpi_enreg + type(dataset_type),intent(in) :: dtset + type(energies_type),intent(inout) :: energies +diff -uprN src/67_common/m_mklocl_realspace.F90 src/67_common/m_mklocl_realspace.F90 +--- src/67_common/m_mklocl_realspace.F90 2019-01-17 20:49:35.000000000 +0900 ++++ src/67_common/m_mklocl_realspace.F90 2019-05-21 15:12:07.000000000 +0900 +@@ -1703,7 +1703,7 @@ subroutine local_forces_wvl(iproc,natom, + !arrays + real(dp),intent(in) :: rxyz(3,natom) + real(dp),dimension(*),intent(in) :: rho,pot +- real(dp),intent(out) :: floc(3,natom) ++ real(dp),intent(inout) :: floc(3,natom) + + !Local variables ------------------------- + #if defined HAVE_BIGDFT +diff -uprN src/67_common/mkcore_wvl.F90 src/67_common/mkcore_wvl.F90 +--- src/67_common/mkcore_wvl.F90 2019-01-17 20:49:30.000000000 +0900 ++++ src/67_common/mkcore_wvl.F90 2019-05-21 15:13:04.000000000 +0900 +@@ -138,7 +138,7 @@ subroutine mkcore_wvl(atindx1,corstr,grx + integer,intent(in) :: atindx1(natom),nattyp(ntypat) + real(dp),intent(in) :: rprimd(3,3),xccc1d(n1xccc,6,ntypat),xcccrc(ntypat),xred(3,natom) + real(dp),intent(in),target :: vxc(nfft,nspden) +- real(dp),intent(out) :: corstr(6),grxc(3,natom) ++ real(dp),intent(inout) :: corstr(6),grxc(3,natom) + real(dp),intent(inout) :: xccc3d(n3xccc) + type(pawrad_type),intent(in) :: pawrad(:) + type(pawtab_type),intent(in) :: pawtab(:) +@@ -587,8 +587,8 @@ subroutine mkcore_wvl_old(atindx1,corstr + real(dp),intent(in) :: psppar(0:4,0:6,ntypat),rprimd(3,3) + real(dp),intent(in)::xred(3,natom) + real(dp),intent(in)::vxc(nfft,nspden) +- real(dp),intent(out)::xccc3d(n3xccc) +- real(dp),intent(out) :: corstr(6),dyfrx2(3,3,natom),grxc(3,natom) ++ real(dp),intent(inout)::xccc3d(n3xccc) ++ real(dp),intent(inout) :: corstr(6),dyfrx2(3,3,natom),grxc(3,natom) + type(pawtab_type),intent(in) :: pawtab(ntypat) + type(pawrad_type),intent(in) :: pawrad(ntypat) + +diff -uprN src/98_main/abinit.F90 src/98_main/abinit.F90 +--- src/98_main/abinit.F90 2019-01-17 20:49:35.000000000 +0900 ++++ src/98_main/abinit.F90 2019-08-07 08:29:17.000000000 +0900 +@@ -261,7 +261,7 @@ program abinit + open(unit=ab_out,file=filnam(2),form='formatted',status='new', action="write", iomsg=message, iostat=ios) + #endif + ABI_CHECK(ios == 0, message) +- rewind (unit=ab_out) ++! rewind (unit=ab_out) + codename='ABINIT'//repeat(' ',18) + call herald(codename,abinit_version,ab_out) + call herald(codename,abinit_version,std_out) diff --git a/var/spack/repos/builtin/packages/abinit/package.py b/var/spack/repos/builtin/packages/abinit/package.py index 3804c2801e..d62ebe3bbd 100644 --- a/var/spack/repos/builtin/packages/abinit/package.py +++ b/var/spack/repos/builtin/packages/abinit/package.py @@ -94,6 +94,9 @@ class Abinit(AutotoolsPackage): # conflicts('+elpa', when='~mpi') # conflicts('+elpa', when='+scalapack') + patch('rm_march_settings.patch') + patch('fix_for_fujitsu.patch', level=0, when='%fj') + def configure_args(self): spec = self.spec @@ -114,10 +117,15 @@ class Abinit(AutotoolsPackage): if '+mpi' in spec: # MPI version: # let the configure script auto-detect MPI support from mpi_prefix - oapp('--with-mpi-prefix={0}'.format(spec['mpi'].prefix)) oapp('--enable-mpi=yes') - oapp('--enable-mpi-io=yes') - oapp('MPIFC={0}/mpifc'.format(spec['mpi'].prefix.bin)) + if self.spec.satisfies('%fj'): + oapp('CC={0}'.format(spec['mpi'].mpicc)) + oapp('CXX={0}'.format(spec['mpi'].mpicxx)) + oapp('FC={0}'.format(spec['mpi'].mpifc)) + else: + oapp('--with-mpi-prefix={0}'.format(spec['mpi'].prefix)) + oapp('--enable-mpi-io=yes') + oapp('MPIFC={0}'.format(spec['mpi'].mpifc)) if '~wannier90' in spec: oapp('--with-dft-flavor=atompaw+libxc') @@ -174,6 +182,10 @@ class Abinit(AutotoolsPackage): # dependencies, such as netcdf3 in this case. oapp('--with-trio-flavor=none') + if self.spec.satisfies('%fj'): + oapp('FCFLAGS_MODDIR=-M{0}'.format(join_path( + self.stage.source_path, 'src/mods'))) + return options def check(self): diff --git a/var/spack/repos/builtin/packages/abinit/rm_march_settings.patch b/var/spack/repos/builtin/packages/abinit/rm_march_settings.patch new file mode 100644 index 0000000000..3511fd8d7d --- /dev/null +++ b/var/spack/repos/builtin/packages/abinit/rm_march_settings.patch @@ -0,0 +1,74 @@ +--- spack-src/configure.org 2021-01-18 10:12:04.000000000 +0900 ++++ spack-src/configure 2021-01-20 20:26:16.000000000 +0900 +@@ -17412,7 +17412,7 @@ + case "${enable_optim}" in + aggressive) + enable_optim_opt="aggressive" +- CFLAGS_OPTIM="-O3 -mtune=native -march=native" ++ CFLAGS_OPTIM="-O3 -mtune=native " + ;; + safe) + enable_optim_opt="safe" +@@ -17420,7 +17420,7 @@ + ;; + standard) + enable_optim_opt="standard" +- CFLAGS_OPTIM="-O2 -mtune=native -march=native" ++ CFLAGS_OPTIM="-O2 -mtune=native " + ;; + esac # [case: enable_optim, indent: 2, item: True] + ;; +@@ -17641,7 +17641,7 @@ + case "${enable_optim}" in + aggressive) + enable_optim_opt="aggressive" +- CXXFLAGS_OPTIM="-O3 -mtune=native -march=native" ++ CXXFLAGS_OPTIM="-O3 -mtune=native " + ;; + safe) + enable_optim_opt="safe" +@@ -17649,7 +17649,7 @@ + ;; + standard) + enable_optim_opt="standard" +- CXXFLAGS_OPTIM="-O2 -mtune=native -march=native" ++ CXXFLAGS_OPTIM="-O2 -mtune=native " + ;; + esac # [case: enable_optim, indent: 2, item: True] + ;; +@@ -17815,7 +17815,7 @@ + case "${enable_optim}" in + aggressive) + enable_optim_opt="aggressive" +- FCFLAGS_OPTIM="-O3 -mtune=native -march=native -faggressive-function-elimination -fstack-arrays" ++ FCFLAGS_OPTIM="-O3 -mtune=native -faggressive-function-elimination -fstack-arrays" + ;; + safe) + enable_optim_opt="safe" +@@ -17823,7 +17823,7 @@ + ;; + standard) + enable_optim_opt="standard" +- FCFLAGS_OPTIM="-O2 -mtune=native -march=native" ++ FCFLAGS_OPTIM="-O2 -mtune=native " + ;; + esac # [case: enable_optim, indent: 4, item: True] + ;; +@@ -17833,7 +17833,7 @@ + case "${enable_optim}" in + aggressive) + enable_optim_opt="aggressive" +- FCFLAGS_OPTIM="-O3 -mtune=native -march=native -funroll-loops -faggressive-function-elimination" ++ FCFLAGS_OPTIM="-O3 -mtune=native -funroll-loops -faggressive-function-elimination" + ;; + safe) + enable_optim_opt="safe" +@@ -17841,7 +17841,7 @@ + ;; + standard) + enable_optim_opt="standard" +- FCFLAGS_OPTIM="-O2 -mtune=native -march=native" ++ FCFLAGS_OPTIM="-O2 -mtune=native " + ;; + esac # [case: enable_optim, indent: 4, item: True] + ;; |