mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-22 12:23:48 +01:00
Added support for GPI2
This commit is contained in:
parent
e77c7a5244
commit
872ce460ab
13
configure
vendored
13
configure
vendored
@ -43,6 +43,7 @@ except KeyError:
|
|||||||
|
|
||||||
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
||||||
QP_ROOT_LIB = join(QP_ROOT, "lib")
|
QP_ROOT_LIB = join(QP_ROOT, "lib")
|
||||||
|
QP_ROOT_LIB64 = join(QP_ROOT, "lib64")
|
||||||
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
||||||
|
|
||||||
os.environ["PATH"] = os.environ["PATH"] + ":" + QP_ROOT_BIN
|
os.environ["PATH"] = os.environ["PATH"] + ":" + QP_ROOT_BIN
|
||||||
@ -65,6 +66,7 @@ d_dependency = {
|
|||||||
"python": [],
|
"python": [],
|
||||||
"ninja": ["g++", "python"],
|
"ninja": ["g++", "python"],
|
||||||
"make": [],
|
"make": [],
|
||||||
|
"gpi2": ["g++", "make"],
|
||||||
"p_graphviz": ["python"],
|
"p_graphviz": ["python"],
|
||||||
"bats": []
|
"bats": []
|
||||||
}
|
}
|
||||||
@ -140,6 +142,11 @@ f77zmq = Info(
|
|||||||
description=' F77-ZeroMQ',
|
description=' F77-ZeroMQ',
|
||||||
default_path=join(QP_ROOT_LIB, "libf77zmq.a") )
|
default_path=join(QP_ROOT_LIB, "libf77zmq.a") )
|
||||||
|
|
||||||
|
gpi2 = Info(
|
||||||
|
url='https://github.com/cc-hpc-itwm/GPI-2/archive/v1.3.0.tar.gz',
|
||||||
|
description=' GPI-2',
|
||||||
|
default_path=join(QP_ROOT_LIB64, "libGPI2.a") )
|
||||||
|
|
||||||
p_graphviz = Info(
|
p_graphviz = Info(
|
||||||
url='https://github.com/xflr6/graphviz/archive/master.tar.gz',
|
url='https://github.com/xflr6/graphviz/archive/master.tar.gz',
|
||||||
description=' Python library for graphviz',
|
description=' Python library for graphviz',
|
||||||
@ -154,7 +161,7 @@ d_info = dict()
|
|||||||
|
|
||||||
for m in ["ocaml", "m4", "curl", "zlib", "patch", "irpf90", "docopt",
|
for m in ["ocaml", "m4", "curl", "zlib", "patch", "irpf90", "docopt",
|
||||||
"resultsFile", "ninja", "emsl", "ezfio", "p_graphviz",
|
"resultsFile", "ninja", "emsl", "ezfio", "p_graphviz",
|
||||||
"zeromq", "f77zmq","bats"]:
|
"zeromq", "f77zmq", "bats", "gpi2"]:
|
||||||
exec ("d_info['{0}']={0}".format(m))
|
exec ("d_info['{0}']={0}".format(m))
|
||||||
|
|
||||||
|
|
||||||
@ -481,8 +488,8 @@ def create_ninja_and_rc(l_installed):
|
|||||||
'export NINJA={0}'.format(path_ninja.replace(QP_ROOT,"${QP_ROOT}")),
|
'export NINJA={0}'.format(path_ninja.replace(QP_ROOT,"${QP_ROOT}")),
|
||||||
'export PYTHONPATH="${QP_EZFIO}/Python":"${QP_PYTHON}":"${PYTHONPATH}"',
|
'export PYTHONPATH="${QP_EZFIO}/Python":"${QP_PYTHON}":"${PYTHONPATH}"',
|
||||||
'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"',
|
'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"',
|
||||||
'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:"${LD_LIBRARY_PATH}"',
|
'export LD_LIBRARY_PATH="${QP_ROOT}"/lib:${QP_ROOT}"/lib64:"${LD_LIBRARY_PATH}"',
|
||||||
'export LIBRARY_PATH="${QP_ROOT}"/lib:"${LIBRARY_PATH}"',
|
'export LIBRARY_PATH="${QP_ROOT}"/lib:${QP_ROOT}"/lib64:"${LIBRARY_PATH}"',
|
||||||
'export C_INCLUDE_PATH="${C_INCLUDE_PATH}":"${QP_ROOT}"/include',
|
'export C_INCLUDE_PATH="${C_INCLUDE_PATH}":"${QP_ROOT}"/include',
|
||||||
'',
|
'',
|
||||||
'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh',
|
'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh',
|
||||||
|
15
install/scripts/install_gpi2.sh
Executable file
15
install/scripts/install_gpi2.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash -x
|
||||||
|
|
||||||
|
TARGET=gpi2
|
||||||
|
#GPI_OPTIONS=--with-infiniband
|
||||||
|
GPI_OPTIONS=--with-ethernet
|
||||||
|
|
||||||
|
function _install()
|
||||||
|
{
|
||||||
|
cd gpi2
|
||||||
|
./install.sh -p $QP_ROOT $GPI_OPTIONS
|
||||||
|
cp src/GASPI.f90 $QP_ROOT/src/plugins/GPI2/
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
source scripts/build.sh
|
1
plugins/GPI2/NEEDED_CHILDREN_MODULES
Normal file
1
plugins/GPI2/NEEDED_CHILDREN_MODULES
Normal file
@ -0,0 +1 @@
|
|||||||
|
Determinants
|
14
plugins/GPI2/README.rst
Normal file
14
plugins/GPI2/README.rst
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
=====
|
||||||
|
GASPI
|
||||||
|
=====
|
||||||
|
|
||||||
|
Providers for GASPI programs (with the GPI2 library).
|
||||||
|
|
||||||
|
Needed Modules
|
||||||
|
==============
|
||||||
|
.. Do not edit this section It was auto-generated
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
.. Do not edit this section It was auto-generated
|
||||||
|
.. by the `update_README.py` script.
|
13
plugins/GPI2/gpi_test.irp.f
Normal file
13
plugins/GPI2/gpi_test.irp.f
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
program test
|
||||||
|
double precision :: energy(N_states)
|
||||||
|
if (is_gaspi_master) then
|
||||||
|
energy = 1.d0
|
||||||
|
else
|
||||||
|
energy = 0.d0
|
||||||
|
endif
|
||||||
|
call broadcast_wf(energy)
|
||||||
|
print *, 'energy (1.d0) :', GASPI_rank, energy(1)
|
||||||
|
print *, 'coef :', GASPI_rank, psi_coef(1,1)
|
||||||
|
print *, 'det :', GASPI_rank, psi_det (1,1,1)
|
||||||
|
call gaspi_finalize
|
||||||
|
end
|
76
plugins/GPI2/utils.irp.f
Normal file
76
plugins/GPI2/utils.irp.f
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
BEGIN_PROVIDER [ logical, GASPI_is_initialized ]
|
||||||
|
&BEGIN_PROVIDER [ logical, has_gaspi ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! This is true when GASPI_Init has been called
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
has_gaspi = .False.
|
||||||
|
IRP_IF GASPI
|
||||||
|
use GASPI
|
||||||
|
integer(gaspi_return_t) :: res
|
||||||
|
res = gaspi_proc_init(GASPI_BLOCK)
|
||||||
|
if (res /= GASPI_SUCCESS) then
|
||||||
|
print *, res
|
||||||
|
print *, 'GASPI failed to initialize'
|
||||||
|
stop -1
|
||||||
|
endif
|
||||||
|
has_gaspi = .True.
|
||||||
|
IRP_ENDIF
|
||||||
|
GASPI_is_initialized = .True.
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer, GASPI_rank ]
|
||||||
|
&BEGIN_PROVIDER [ integer, GASPI_size ]
|
||||||
|
&BEGIN_PROVIDER [ logical, is_GASPI_master ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Usual GASPI variables
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
PROVIDE GASPI_is_initialized
|
||||||
|
|
||||||
|
IRP_IF GASPI
|
||||||
|
use GASPI
|
||||||
|
integer(gaspi_return_t) :: res
|
||||||
|
integer(gaspi_rank_t) :: n
|
||||||
|
res = gaspi_proc_num(n)
|
||||||
|
GASPI_size = n
|
||||||
|
if (res /= GASPI_SUCCESS) then
|
||||||
|
print *, res
|
||||||
|
print *, 'Unable to get GASPI_size'
|
||||||
|
stop -1
|
||||||
|
endif
|
||||||
|
res = gaspi_proc_rank(n)
|
||||||
|
GASPI_rank = n
|
||||||
|
if (res /= GASPI_SUCCESS) then
|
||||||
|
print *, res
|
||||||
|
print *, 'Unable to get GASPI_rank'
|
||||||
|
stop -1
|
||||||
|
endif
|
||||||
|
is_GASPI_master = (GASPI_rank == 0)
|
||||||
|
IRP_ELSE
|
||||||
|
GASPI_rank = 0
|
||||||
|
GASPI_size = 1
|
||||||
|
is_GASPI_master = .True.
|
||||||
|
IRP_ENDIF
|
||||||
|
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
subroutine gaspi_finalize()
|
||||||
|
implicit none
|
||||||
|
PROVIDE GASPI_is_initialized
|
||||||
|
IRP_IF GASPI
|
||||||
|
use GASPI
|
||||||
|
integer(gaspi_return_t) :: res
|
||||||
|
res = gaspi_proc_term(GASPI_BLOCK)
|
||||||
|
if (res /= GASPI_SUCCESS) then
|
||||||
|
print *, res
|
||||||
|
print *, 'Unable to finalize GASPI'
|
||||||
|
stop -1
|
||||||
|
endif
|
||||||
|
IRP_ENDIF
|
||||||
|
end subroutine
|
||||||
|
|
@ -96,7 +96,8 @@ def ninja_create_env_variable(pwd_config_file):
|
|||||||
l_string.append(str_)
|
l_string.append(str_)
|
||||||
|
|
||||||
lib_lapack = get_compilation_option(pwd_config_file, "LAPACK_LIB")
|
lib_lapack = get_compilation_option(pwd_config_file, "LAPACK_LIB")
|
||||||
str_lib = " ".join([LIB, lib_lapack, EZFIO_LIB, ZMQ_LIB])
|
lib_gpi2 = get_compilation_option(pwd_config_file, "GPI2_LIB")
|
||||||
|
str_lib = " ".join([LIB, lib_lapack, lib_gpi2, EZFIO_LIB, ZMQ_LIB])
|
||||||
l_string.append("LIB = {0} ".format(str_lib))
|
l_string.append("LIB = {0} ".format(str_lib))
|
||||||
|
|
||||||
l_string.append("")
|
l_string.append("")
|
||||||
|
@ -37,7 +37,8 @@ def get_compilation_option(pwd_cfg, flag_name):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
qpackage_root = os.environ['QP_ROOT']
|
qpackage_root = os.environ['QP_ROOT']
|
||||||
pwd_cfg = os.path.join(qpackage_root, "config/gfortran_example.cfg")
|
pwd_cfg = os.path.join(qpackage_root, "config/ifort_gpi2.cfg")
|
||||||
|
|
||||||
print get_compilation_option(pwd_cfg, "FC")
|
print get_compilation_option(pwd_cfg, "FC")
|
||||||
print get_compilation_option(pwd_cfg, "FCFLAGS")
|
print get_compilation_option(pwd_cfg, "FCFLAGS")
|
||||||
|
print get_compilation_option(pwd_cfg, "GPI2_LIB")
|
||||||
|
Loading…
Reference in New Issue
Block a user