mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 03:23:29 +01:00
Merge branch 'macos' into dev-stable
This commit is contained in:
commit
6b4b7afbe4
4
bin/python
Executable file
4
bin/python
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
exec python3 $@
|
||||||
|
|
3
bin/qpsh
3
bin/qpsh
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
export QP_ROOT=$(dirname "$(readlink -f "$0")")/..
|
REALPATH=$( cd "$(dirname "$0")" ; pwd -P )
|
||||||
|
export QP_ROOT=${REALPATH}/..
|
||||||
|
|
||||||
bash --init-file <(cat << EOF
|
bash --init-file <(cat << EOF
|
||||||
[[ -f /etc/bashrc ]] && source /etc/bashrc
|
[[ -f /etc/bashrc ]] && source /etc/bashrc
|
||||||
|
22
bin/zcat
Executable file
22
bin/zcat
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# On Darwin: try gzcat if available, otherwise use Python
|
||||||
|
|
||||||
|
if [[ $(uname -s) = Darwin ]] ; then
|
||||||
|
which gzcat &> /dev/null
|
||||||
|
if [[ $? -eq 0 ]] ; then
|
||||||
|
exec gzcat $@
|
||||||
|
else
|
||||||
|
|
||||||
|
exec python3 << EOF
|
||||||
|
import sys
|
||||||
|
import gzip
|
||||||
|
with gzip.open("$1", "rt") as f:
|
||||||
|
print(f.read())
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
command=$(which -a zcat | grep -v 'qp2/bin/' | head -1)
|
||||||
|
exec $command $@
|
||||||
|
fi
|
||||||
|
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
[COMMON]
|
[COMMON]
|
||||||
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native
|
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native -std=legacy
|
||||||
LAPACK_LIB : -lblas -llapack
|
LAPACK_LIB : -lblas -llapack
|
||||||
IRPF90 : irpf90
|
IRPF90 : irpf90
|
||||||
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
[COMMON]
|
[COMMON]
|
||||||
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native
|
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native -std=legacy
|
||||||
LAPACK_LIB : -larmpl_lp64_mp
|
LAPACK_LIB : -larmpl_lp64_mp
|
||||||
IRPF90 : irpf90
|
IRPF90 : irpf90
|
||||||
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
[COMMON]
|
[COMMON]
|
||||||
FC : gfortran -ffree-line-length-none -I . -mavx -g -fPIC
|
FC : gfortran -ffree-line-length-none -I . -mavx -g -fPIC -std=legacy
|
||||||
LAPACK_LIB : -llapack -lblas
|
LAPACK_LIB : -llapack -lblas
|
||||||
IRPF90 : irpf90
|
IRPF90 : irpf90
|
||||||
IRPF90_FLAGS : --ninja --align=32 -DSET_NESTED
|
IRPF90_FLAGS : --ninja --align=32 -DSET_NESTED
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
[COMMON]
|
[COMMON]
|
||||||
FC : gfortran -g -ffree-line-length-none -I . -fPIC
|
FC : gfortran -g -ffree-line-length-none -I . -fPIC -std=legacy
|
||||||
LAPACK_LIB : -lblas -llapack
|
LAPACK_LIB : -lblas -llapack
|
||||||
IRPF90 : irpf90
|
IRPF90 : irpf90
|
||||||
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
||||||
|
62
config/gfortran_macos.cfg
Normal file
62
config/gfortran_macos.cfg
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
# Common flags
|
||||||
|
##############
|
||||||
|
#
|
||||||
|
# -ffree-line-length-none : Needed for IRPF90 which produces long lines
|
||||||
|
# -lblas -llapack : Link with libblas and liblapack libraries provided by the system
|
||||||
|
# -I . : Include the curent directory (Mandatory)
|
||||||
|
#
|
||||||
|
# --ninja : Allow the utilisation of ninja. (Mandatory)
|
||||||
|
# --align=32 : Align all provided arrays on a 32-byte boundary
|
||||||
|
#
|
||||||
|
#
|
||||||
|
[COMMON]
|
||||||
|
FC : gfortran -ffree-line-length-none -I . -g -fPIC -std=legacy
|
||||||
|
LAPACK_LIB : -llapack -lblas
|
||||||
|
IRPF90 : irpf90
|
||||||
|
IRPF90_FLAGS : --ninja --align=32 -DSET_NESTED -DMACOS
|
||||||
|
|
||||||
|
# Global options
|
||||||
|
################
|
||||||
|
#
|
||||||
|
# 1 : Activate
|
||||||
|
# 0 : Deactivate
|
||||||
|
#
|
||||||
|
[OPTION]
|
||||||
|
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
|
||||||
|
CACHE : 0 ; Enable cache_compile.py
|
||||||
|
OPENMP : 1 ; Append OpenMP flags
|
||||||
|
|
||||||
|
# Optimization flags
|
||||||
|
####################
|
||||||
|
#
|
||||||
|
# -Ofast : Disregard strict standards compliance. Enables all -O3 optimizations.
|
||||||
|
# It also enables optimizations that are not valid
|
||||||
|
# for all standard-compliant programs. It turns on
|
||||||
|
# -ffast-math and the Fortran-specific
|
||||||
|
# -fno-protect-parens and -fstack-arrays.
|
||||||
|
[OPT]
|
||||||
|
FCFLAGS : -Ofast -march=native
|
||||||
|
|
||||||
|
# Profiling flags
|
||||||
|
#################
|
||||||
|
#
|
||||||
|
[PROFILE]
|
||||||
|
FC : -p -g
|
||||||
|
FCFLAGS : -Ofast
|
||||||
|
|
||||||
|
# Debugging flags
|
||||||
|
#################
|
||||||
|
#
|
||||||
|
# -fcheck=all : Checks uninitialized variables, array subscripts, etc...
|
||||||
|
# -g : Extra debugging information
|
||||||
|
#
|
||||||
|
[DEBUG]
|
||||||
|
FCFLAGS : -fcheck=all -g
|
||||||
|
|
||||||
|
# OpenMP flags
|
||||||
|
#################
|
||||||
|
#
|
||||||
|
[OPENMP]
|
||||||
|
FC : -fopenmp
|
||||||
|
IRPF90_FLAGS : --openmp
|
||||||
|
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
[COMMON]
|
[COMMON]
|
||||||
FC : mpif90 -ffree-line-length-none -I . -g -fPIC
|
FC : mpif90 -ffree-line-length-none -I . -g -fPIC -std=legacy
|
||||||
LAPACK_LIB : -lblas -llapack
|
LAPACK_LIB : -lblas -llapack
|
||||||
IRPF90 : irpf90
|
IRPF90 : irpf90
|
||||||
IRPF90_FLAGS : --ninja --align=32 -DMPI -DSET_NESTED
|
IRPF90_FLAGS : --ninja --align=32 -DMPI -DSET_NESTED
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
[COMMON]
|
[COMMON]
|
||||||
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native
|
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native -std=legacy
|
||||||
LAPACK_LIB : -lopenblas
|
LAPACK_LIB : -lopenblas
|
||||||
IRPF90 : irpf90
|
IRPF90 : irpf90
|
||||||
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED
|
||||||
|
7
configure
vendored
7
configure
vendored
@ -19,7 +19,11 @@ git submodule init
|
|||||||
git submodule update
|
git submodule update
|
||||||
|
|
||||||
# Update ARM or x86 dependencies
|
# Update ARM or x86 dependencies
|
||||||
ARCHITECTURE=$(uname -m)
|
SYSTEM=$(uname -s)
|
||||||
|
if [[ $SYSTEM = "Linux" ]] ; then
|
||||||
|
SYSTEM=""
|
||||||
|
fi
|
||||||
|
ARCHITECTURE=$(uname -m)$SYSTEM
|
||||||
cd ${QP_ROOT}/external/qp2-dependencies
|
cd ${QP_ROOT}/external/qp2-dependencies
|
||||||
git checkout master
|
git checkout master
|
||||||
git pull
|
git pull
|
||||||
@ -275,6 +279,7 @@ EOF
|
|||||||
cd "\${QP_ROOT}"/external
|
cd "\${QP_ROOT}"/external
|
||||||
tar --gunzip --extract --file qp2-dependencies/zeromq-4.2.5.tar.gz
|
tar --gunzip --extract --file qp2-dependencies/zeromq-4.2.5.tar.gz
|
||||||
cd zeromq-*
|
cd zeromq-*
|
||||||
|
[[ "${SYSTEM}" = "Darwin" ]] && ./autogen.sh
|
||||||
./configure --prefix="\$QP_ROOT" --without-libsodium --enable-libunwind=no
|
./configure --prefix="\$QP_ROOT" --without-libsodium --enable-libunwind=no
|
||||||
make -j 8
|
make -j 8
|
||||||
make install
|
make install
|
||||||
|
@ -11,7 +11,11 @@ fi
|
|||||||
|
|
||||||
cd ${QP_ROOT}/data
|
cd ${QP_ROOT}/data
|
||||||
rm -f executables
|
rm -f executables
|
||||||
|
if [[ "$(uname -s)" = "Darwin" ]] ; then
|
||||||
|
EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -perm +111 -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort )
|
||||||
|
else
|
||||||
EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -executable -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort )
|
EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -executable -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort )
|
||||||
|
fi
|
||||||
|
|
||||||
for EXE in $EXES
|
for EXE in $EXES
|
||||||
do
|
do
|
||||||
|
@ -53,7 +53,6 @@ function run {
|
|||||||
|
|
||||||
|
|
||||||
@test "B-B" {
|
@test "B-B" {
|
||||||
qp set_file b2_stretched.ezfio
|
|
||||||
run b2_stretched.zmt 1 0 6-31g
|
run b2_stretched.zmt 1 0 6-31g
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,8 @@ BEGIN_PROVIDER [ character*(1024), ezfio_filename ]
|
|||||||
|
|
||||||
call ezfio_set_file(ezfio_filename)
|
call ezfio_set_file(ezfio_filename)
|
||||||
|
|
||||||
|
IRP_IF MACOS
|
||||||
|
IRP_ELSE
|
||||||
! Adjust out-of-memory killer flag such that the current process will be
|
! Adjust out-of-memory killer flag such that the current process will be
|
||||||
! killed first by the OOM killer, allowing compute nodes to survive
|
! killed first by the OOM killer, allowing compute nodes to survive
|
||||||
integer :: getpid
|
integer :: getpid
|
||||||
@ -40,6 +42,7 @@ BEGIN_PROVIDER [ character*(1024), ezfio_filename ]
|
|||||||
write(pidc,*) getpid()
|
write(pidc,*) getpid()
|
||||||
write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj'
|
write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj'
|
||||||
call system(command)
|
call system(command)
|
||||||
|
IRP_ENDIF
|
||||||
|
|
||||||
PROVIDE file_lock
|
PROVIDE file_lock
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ rm -rf $EZFIO
|
|||||||
qp create_ezfio -b def2-svp hcn.xyz -o $EZFIO
|
qp create_ezfio -b def2-svp hcn.xyz -o $EZFIO
|
||||||
qp run scf
|
qp run scf
|
||||||
mv hcn_charges.xyz ${EZFIO}_point_charges.xyz
|
mv hcn_charges.xyz ${EZFIO}_point_charges.xyz
|
||||||
python write_pt_charges.py ${EZFIO}
|
python3 write_pt_charges.py ${EZFIO}
|
||||||
qp set nuclei point_charges True
|
qp set nuclei point_charges True
|
||||||
qp run scf | tee ${EZFIO}.pt_charges.out
|
qp run scf | tee ${EZFIO}.pt_charges.out
|
||||||
energy="$(ezfio get hartree_fock energy)"
|
energy="$(ezfio get hartree_fock energy)"
|
||||||
|
@ -33,6 +33,8 @@ subroutine resident_memory(value)
|
|||||||
call usleep(10)
|
call usleep(10)
|
||||||
|
|
||||||
value = 0.d0
|
value = 0.d0
|
||||||
|
IRP_IF MACOS
|
||||||
|
IRP_ELSE
|
||||||
iunit = getUnitAndOpen('/proc/self/status','r')
|
iunit = getUnitAndOpen('/proc/self/status','r')
|
||||||
do
|
do
|
||||||
read(iunit,*,err=10,end=20) key, value
|
read(iunit,*,err=10,end=20) key, value
|
||||||
@ -43,6 +45,7 @@ subroutine resident_memory(value)
|
|||||||
end do
|
end do
|
||||||
20 continue
|
20 continue
|
||||||
close(iunit)
|
close(iunit)
|
||||||
|
IRP_ENDIF
|
||||||
value = value / (1024.d0*1024.d0)
|
value = value / (1024.d0*1024.d0)
|
||||||
call unlock_io()
|
call unlock_io()
|
||||||
end function
|
end function
|
||||||
@ -58,6 +61,9 @@ subroutine total_memory(value)
|
|||||||
double precision, intent(out) :: value
|
double precision, intent(out) :: value
|
||||||
|
|
||||||
call lock_io()
|
call lock_io()
|
||||||
|
value = 0.d0
|
||||||
|
IRP_IF MACOS
|
||||||
|
IRP_ELSE
|
||||||
iunit = getUnitAndOpen('/proc/self/status','r')
|
iunit = getUnitAndOpen('/proc/self/status','r')
|
||||||
do
|
do
|
||||||
read(iunit,*,err=10,end=20) key, value
|
read(iunit,*,err=10,end=20) key, value
|
||||||
@ -68,6 +74,7 @@ subroutine total_memory(value)
|
|||||||
end do
|
end do
|
||||||
20 continue
|
20 continue
|
||||||
close(iunit)
|
close(iunit)
|
||||||
|
IRP_ENDIF
|
||||||
value = value / (1024.d0*1024.d0)
|
value = value / (1024.d0*1024.d0)
|
||||||
call unlock_io()
|
call unlock_io()
|
||||||
end function
|
end function
|
||||||
|
Loading…
Reference in New Issue
Block a user