Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sbalzarini Lab
S
Software
P
Parallel Computing
OpenFPM
openfpm_pdata
Commits
42321812
Commit
42321812
authored
May 04, 2016
by
Pietro Incardona
Browse files
pdata compiling
parent
30f0df95
Changes
15
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
42321812
...
...
@@ -237,17 +237,17 @@ AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_IOSTREAMS
if test x"$ax_cv_boost_unit_test_framework" = x"no"; then
echo "Notify boost not usable"
echo "Notify boost
unit test framework
not usable"
exit 202
fi
if test x"$ax_cv_boost_iostreams" = x"no"; then
echo "Notify boost not usable"
echo "Notify boost
iostream
not usable"
exit 202
fi
if test x"$ax_cv_boost_programs_options" = x"no"; then
echo "Notify boost not usable"
echo "Notify boost
program options
not usable"
exit 202
fi
...
...
install
View file @
42321812
...
...
@@ -50,7 +50,7 @@ remove_old $i_dir
## Check and try to install the prerequisites
pre_req
pre_req
$i_dir
## clone the dependencies
...
...
openfpm_data
@
a13bc3f7
Subproject commit
84d4222309a64ba0a9336b339abfc13a958bf4e4
Subproject commit
a13bc3f781fa23c92d81b4f2a75848351f6d7f87
openfpm_io
@
088fa4a3
Subproject commit
bc080489d4254f6d91c18d9f08c5cd1cc0f5718f
Subproject commit
088fa4a38c15f09f48cc78165f56d327d1a399bb
openfpm_numerics
@
905bfba7
Subproject commit 9
1947e2190a530994353f0eb30e1dce75fbe5a84
Subproject commit 9
05bfba7c4b169e5501fafa80d2d2cb52b3a3037
openfpm_vcluster
@
dae9b992
Subproject commit
02c935545524000d318f0b84578af704896eeee4
Subproject commit
dae9b992284a9b6c4d3ad673bfaa11e216ce8e70
script/install_MPI.sh
View file @
42321812
...
...
@@ -6,10 +6,11 @@ if [ -d "$1/MPI" ]; then
echo
"MPI already installed"
exit
0
fi
wget http://ppmcore.mpi-cbg.de/upload/openmpi-1.8.7.tar.bz2
tar
-xvf
openmpi-1.8.7.tar.bz2
cd
openmpi-1.8.7
rm
-rf
openmpi-1.10.2
rm
openmpi-1.10.2.tar.bz2
wget http://ppmcore.mpi-cbg.de/upload/openmpi-1.10.2.tar.bz2
tar
-xvf
openmpi-1.10.2.tar.bz2
cd
openmpi-1.10.2
#
# --disable-mca-dso \
...
...
@@ -24,7 +25,10 @@ cd openmpi-1.8.7
#
#
sh
./configure
--prefix
=
$1
/MPI
--enable-
opal-multi-threads
--enable-mpi-f90
$2
$3
./configure
--prefix
=
$1
/MPI
--enable-
mpi-fortran
=
yes
make
-j
4
mkdir
$1
/MPI
make
install
# Mark the installation
echo
1
>
$1
/MPI/version
script/install_Metis.sh
View file @
42321812
...
...
@@ -8,8 +8,8 @@ if [ -d "$1/METIS" ]; then
fi
## Remove old download
rm
metis-5.1.0.tar.gz
rm
-rf
metis-5.1.0
wget http://ppmcore.mpi-cbg.de/upload/metis-5.1.0.tar.gz
tar
-xf
metis-5.1.0.tar.gz
cd
metis-5.1.0
...
...
script/install_PETSC.sh
0 → 100755
View file @
42321812
#! /bin/bash
# check if the directory $1/PETSC exist
if
[
-d
"
$1
/PETSC"
]
;
then
echo
"PETSC already installed"
exit
0
fi
## If some dependencies has been installed feed them to PETSC
MUMPS_extra_libs
=
""
configure_options
=
""
configure_options_scalapack
=
""
configure_options_superlu
=
""
configure_trilinos_options
=
" -D TPL_ENABLE_MPI=ON -D Trilinos_ENABLE_OpenMP=ON"
configure_options_hypre
=
""
if
[
-d
"
$1
/OPENBLAS"
]
;
then
configure_options
=
"
$configure_options
--with-blas-lib=
$1
/OPENBLAS/lib/libopenblas.a --with-lapack-lib=
$1
/OPENBLAS/lib/libopenblas.a"
configure_trilinos_options
=
"
$configure_trilinos_options
-D TPL_ENABLE_BLAS=ON -D BLAS_LIBRARY_NAMES=openblas -D BLAS_LIBRARY_DIRS=
$1
/OPENBLAS/lib -D TPL_ENABLE_LAPACK=ON -D LAPACK_LIBRARY_NAMES=openblas -D LAPACK_LIBRARY_DIRS=
$1
/OPENBLAS/lib -D TPL_ENABLE_Netcdf=OFF -DTPL_ENABLE_GLM=OFF "
configure_options_superlu
=
"
$configure_options_superlu
-Denable_blaslib=OFF -DTPL_BLAS_LIBRARIES=
$1
/OPENBLAS/lib/libopenblas.a "
configure_options_hypre
=
"--with-blas-libs=-lopenblas --with-blas-lib-dirs=
$1
/OPENBLAS/lib --with-lapack-libs=-lopenblas --with-lapack-lib-dirs=
$1
/OPENBLAS/lib "
configure_options_scalapack
=
"
$configure_options_scalapack
-D LAPACK_LIBRARIES=
$1
/OPENBLAS/lib/libopenblas.a -D BLAS_LIBRARIES=
$1
/OPENBLAS/lib/libopenblas.a"
fi
if
[
-d
"
$1
/PARMETIS"
]
;
then
configure_options
=
"
$configure_options
--with-parmetis=yes --with-parmetis-dir=
$1
/PARMETIS/ "
configure_options_superlu
=
"-DTPL_PARMETIS_INCLUDE_DIRS=
$1
/PARMETIS/include;
$1
/METIS/include -DTPL_PARMETIS_LIBRARIES=
$1
/PARMETIS/lib/libparmetis.a;
$1
/METIS/lib/libmetis.so
$configure_options_superlu
"
fi
if
[
-d
"
$1
/METIS"
]
;
then
configure_options
=
"
$configure_options
--with-metis=yes --with-metis-dir=
$1
/METIS "
fi
if
[
-d
"
$1
/HDF5"
]
;
then
configure_options
=
"
$configure_options
--with-hdf5=yes --with-hdf5-dir=
$1
/HDF5 "
fi
if
[
-d
"
$1
/SUITESPARSE"
]
;
then
configure_options
=
"
$configure_options
--with-suitesparse=yes --with-suitesparse-dir=
$1
/SUITESPARSE "
fi
if
[
-d
"
$1
/BOOST"
]
;
then
configure_options
=
"
$configure_options
--with-boost=yes --with-boost-dir=
$1
/BOOST "
fi
if
[
-d
"
$1
/MPI"
]
;
then
configure_trilinos_options
=
"
$configure_trilinos_options
-D MPI_BASE_DIR=
$1
/MPI "
fi
### It seem that the PETSC --download-packege option has several problems and cannot produce
### a valid compilation command for most of the package + it seem also seem that some library
### are compiled without optimization enabled, so we provide manual installation for that packages
if
[
!
-d
"
$1
/TRILINOS"
]
;
then
rm
trilinos-12.6.1-Source.tar.gz
rm
-rf
trilinos-12.6.1-Source
wget http://ppmcore.mpi-cbg.de/upload/trilinos-12.6.1-Source.tar.gz
if
[
$?
-ne
0
]
;
then
echo
-e
"
\0
33[91;5;1m FAILED Installation require an Internet connection
\0
33[0m"
exit
1
fi
tar
-xf
trilinos-12.6.1-Source.tar.gz
cd
trilinos-12.6.1-Source
mkdir
build
cd
build
cmake
-D
CMAKE_INSTALL_PREFIX:PATH
=
$1
/TRILINOS
-D
CMAKE_BUILD_TYPE
=
RELEASE
-D
Trilinos_ENABLE_TESTS
=
OFF
-D
Trilinos_ENABLE_ALL_PACKAGES
=
ON
$configure_trilinos_options
../.
make
-j
4
if
[
$?
-eq
0
]
;
then
make
install
configure_options
=
"
$configure_options
--with-trilinos=yes -with-trilinos-dir=
$1
/TRILINOS"
fi
else
echo
"Trilinos already installed"
configure_options
=
"
$configure_options
--with-trilinos=yes -with-trilinos-dir=
$1
/TRILINOS"
fi
### Scalapack installation
if
[
!
-d
"
$1
/SCALAPACK"
]
;
then
rm
scalapack-2.0.2.tgz
rm
-rf
scalapack-2.0.2
wget http://ppmcore.mpi-cbg.de/upload/scalapack-2.0.2.tgz
if
[
$?
-ne
0
]
;
then
echo
-e
"
\0
33[91;5;1m FAILED Installation require an Internet connection
\0
33[0m"
exit
1
fi
tar
-xf
scalapack-2.0.2.tgz
cd
scalapack-2.0.2
mkdir
build
cd
build
cmake
-D
CMAKE_EXE_LINKER_FLAGS
=
-pthread
-D
CMAKE_BUILD_TYPE
=
RELEASE
-D
CMAKE_Fortran_FLAGS_RELEASE
=
-fpic
-D
MPI_C_COMPILER_FLAGS
=
-fpic
-D
MPI_Fortran_COMPILER_FLAGS
=
-fpic
-D
CMAKE_C_FLAGS
=
-fpic
-D
CMAKE_INSTALL_PREFIX
=
"
$1
/SCALAPACK"
$configure_options_scalapack
../.
make
-j
4
if
[
$?
-eq
0
]
;
then
make
install
configure_options
=
"
$configure_options
--with-scalapack=yes -with-scalapack-dir=
$1
/SCALAPACK"
fi
else
echo
"Scalapack already installed"
configure_options
=
"
$configure_options
--with-scalapack=yes -with-scalapack-dir=
$1
/SCALAPACK"
fi
### MUMPS installation
if
[
!
-d
"
$1
/MUMPS"
]
;
then
rm
MUMPS_5.0.1.tar.gz
rm
-rf
MUMPS_5.0.1
wget http://ppmcore.mpi-cbg.de/upload/MUMPS_5.0.1.tar.gz
if
[
$?
-ne
0
]
;
then
echo
-e
"
\0
33[91;5;1m FAILED Installation require an Internet connection
\0
33[0m"
exit
1
fi
tar
-xf
MUMPS_5.0.1.tar.gz
cd
MUMPS_5.0.1
cp
Make.inc/Makefile.inc.generic Makefile.inc
if
[
x
"
$platform
"
=
x
"osx"
]
;
then
# installation for OSX
echo
"OSX TO DO BYE"
exit
1
else
# Installation for linux
sed
-i
"/CC
\s\+
=
\s
cc/c
\C
C = mpicc"
Makefile.inc
sed
-i
"/FC
\s\+
=
\s
f90/c
\F
C = mpif90"
Makefile.inc
sed
-i
"/FL
\s\+
=
\s
f90/c
\F
L = mpif90"
Makefile.inc
sed
-i
"/SCALAP
\s\+
=
\s
-lscalapack
\s
-lblacs/c
\S
CALAP = -L
$1
/SCALAPACK/lib -L
$1
/OPENBLAS/lib -lscalapack"
Makefile.inc
sed
-i
"/LIBBLAS
\s\+
=
\s\-
lopenblas/c
\L
IBBLAS = -lopenblas"
Makefile.inc
sed
-i
"/OPTF
\s\+
=
\s\-
O/c
\O
PTF = -fpic -O3"
Makefile.inc
sed
-i
"/OPTC
\s\+
=
\s\-
O
\s
-I./c
\O
PTC = -fpic -O3 -I."
Makefile.inc
sed
-i
"/OPTL
\s\+
=
\s\-
O/c
\O
PTL = -fpic -O3"
Makefile.inc
sed
-i
"/LIBBLAS
\s
=
\s
-lblas/c
\L
IBBLAS = -lopenblas"
Makefile.inc
fi
make
-j
4
if
[
$?
-eq
0
]
;
then
## Copy LIB and include in the target directory
mkdir
$1
/MUMPS
cp
-r
include
$1
/MUMPS
cp
-r
lib
$1
/MUMPS
configure_options
=
"
$configure_options
--with-mumps=yes --with-mumps-lib=
\"
$1
/MUMPS/lib/libdmumps.a
$1
/MUMPS/lib/libmumps_common.a
$1
/MUMPS/lib/libpord.a
\"
--with-mumps-include=
$1
/MUMPS/include"
fi
else
echo
"MUMPS already installed"
configure_options
=
"
$configure_options
--with-mumps=yes --with-mumps-include=
$1
/MUMPS/include"
MUMPS_extra_lib
=
"
$1
/MUMPS/lib/libdmumps.a
$1
/MUMPS/lib/libmumps_common.a
$1
/MUMPS/lib/libpord.a"
fi
## SuperLU installation
if
[
!
-d
"
$1
/SUPERLU_DIST"
]
;
then
rm
superlu_dist_4.3.tar.gz
rm
-rf
SuperLU_DIST_4.3
wget http://ppmcore.mpi-cbg.de/upload/superlu_dist_4.3.tar.gz
if
[
$?
-ne
0
]
;
then
echo
-e
"
\0
33[91;5;1m FAILED Installation require an Internet connection
\0
33[0m"
exit
1
fi
tar
-xf
superlu_dist_4.3.tar.gz
cd
SuperLU_DIST_4.3
if
[
x
"
$platform
"
=
x
"osx"
]
;
then
# installation for OSX
echo
"OSX TO DO BYE"
exit
1
else
# Installation for linux
sed
-i
"/DSuperLUroot
\s\+
=
\s\$
{HOME}
\/
Release_Codes
\/
SuperLU_DIST_4.3/c
\D
SuperLUroot = ../"
make.inc
# sed -i "/DSUPERLULIB\s\+=\s../lib//c\DSUPERLULIB = ../lib/libsuperlu_4.3.a" make.inc
sed
-i
"/BLASLIB
\s\+
=/c
\B
LASLIB =
$1
/OPENBLAS/lib/libopenblas.a"
make.inc
sed
-i
"/LOADOPTS
\s\+
=
\s
-openmp/c
\L
OADOPTS = -fopenmp"
make.inc
sed
-i
"/PARMETIS_DIR
\s\+
=
\/
project
\/
projectdirs
\/
mp127
\/
parmetis-4.0.3-g/c
\P
ARMETIS_DIR :=
$1
/PARMETIS"
make.inc
sed
-i
"/METISLIB
\s
:=
\s
-L
\$
{PARMETIS_DIR}
\/
build
\/
Linux-x86_64
\/
libmetis
\s
-lmetis/c
\M
ETISLIB := -L
$1
/METIS/lib -lmetis"
make.inc
sed
-i
"/PARMETISLIB
\s
:=
\s
-L
\$
{PARMETIS_DIR}
\/
build
\/
Linux-x86_64
\/
libparmetis
\s
-lparmetis/c
\P
ARMETISLIB := -L
$1
/PARMETIS/lib -lparmetis"
make.inc
sed
-i
"/I_PARMETIS
\s
:=
\s
-I
\$
{PARMETIS_DIR}
\/
include
\s
-I
\$
{PARMETIS_DIR}
\/
metis
\/
include/c
\I
_PARMETIS := -I
$1
/PARMETIS/include -I
$1
/METIS/include"
make.inc
sed
-i
"/CC
\s\+
=
\s
cc/c
\C
C = mpicc"
make.inc
sed
-i
"/FORTRAN
\s\+
=
\s
ftn/c
\F
ORTRAN = mpif90"
make.inc
sed
-i
"/CFLAGS
\s\+
=
\s
-fast
\s
-m64
\s
-std=c99
\s
-Wall
\s
-openmp
\s\\\/
c
\C
FLAGS =-fpic -O3 -m64 -std=c99 -Wall -fopenmp
\$
(I_PARMETIS) -DDEBUGlevel=0 -DPRNTlevel=0 -DPROFlevel=0"
make.inc
sed
-i
"/
\s\$
(I_PARMETIS)
\s
-DDEBUGlevel=0
\s
-DPRNTlevel=0
\s
-DPROFlevel=0
\s\\\/
c
\
"
make.inc
fi
make
if
[
$?
-eq
0
]
;
then
mkdir
$1
/SUPERLU_DIST
mkdir
$1
/SUPERLU_DIST/include
cp
-r
lib/
$1
/SUPERLU_DIST
cp
SRC/
*
.h
$1
/SUPERLU_DIST/include
configure_options
=
"
$configure_options
--with-superlu_dist=yes --with-superlu_dist-lib=
$1
/SUPERLU_DIST/lib/libsuperlu_dist_4.3.a --with-superlu_dist-include=
$1
/SUPERLU_DIST/include/"
fi
else
echo
"SUPERLU already installed"
configure_options
=
"
$configure_options
--with-superlu_dist=yes --with-superlu_dist-lib=
$1
/SUPERLU_DIST/lib/libsuperlu_dist_4.3.a --with-superlu_dist-include=
$1
/SUPERLU_DIST/include/"
fi
## HYPRE installation
if
[
!
-d
"
$1
/HYPRE"
]
;
then
rm
hypre-2.11.0.tar.gz
rm
-rf
hypre-2.11.0
wget http://ppmcore.mpi-cbg.de/upload/hypre-2.11.0.tar.gz
if
[
$?
-ne
0
]
;
then
echo
-e
"
\0
33[91;5;1m FAILED Installation require an Internet connection
\0
33[0m"
exit
1
fi
tar
-xf
hypre-2.11.0.tar.gz
cd
hypre-2.11.0
cd
src
./configure
CFLAGS
=
-fpic
$configure_options_hypre
--prefix
=
$1
/HYPRE
make
-j
4
if
[
$?
-eq
0
]
;
then
make
install
configure_options
=
"
$configure_options
--with-hypre=yes -with-hypre-dir=
$1
/HYPRE"
fi
else
echo
"HYPRE already installed"
configure_options
=
"
$configure_options
--with-hypre=yes -with-hypre-dir=
$1
/HYPRE"
fi
rm
petsc-lite-3.6.4.tar.gz
rm
-rf
petsc-3.6.4
wget http://ppmcore.mpi-cbg.de/upload/petsc-lite-3.6.4.tar.gz
if
[
$?
-ne
0
]
;
then
echo
-e
"
\0
33[91;5;1m FAILED Installation require an Internet connection
\0
33[0m"
exit
1
fi
tar
-xf
petsc-lite-3.6.4.tar.gz
cd
petsc-3.6.4
echo
"./configure --with-cxx-dialect=C++11 --with-mpi-dir=
$1
/MPI
$configure_options
--prefix=
$1
/PETSC"
./configure
--with-cxx-dialect
=
C++11
--with-openmp
=
yes
--with-mpi-dir
=
$1
/MPI
$configure_options
--with-mumps-lib
=
"
$MUMPS_extra_lib
"
--prefix
=
$1
/PETSC
make all
test
make
install
# if empty remove the folder
if
[
!
"
$(
ls
-A
$1
/PETSC
)
"
]
;
then
rm
-rf
$1
/PETSC
fi
script/pre_req
View file @
42321812
...
...
@@ -215,6 +215,7 @@ else
fi
MPI_valid
=
no
command
-v
mpirun
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
-e
"No MPI"
...
...
@@ -239,5 +240,28 @@ else
echo
-e
"mpirun
$major
.
$middle
.
$minor
\0
33[91;5;1m FAILED
\0
33[0m is too old, 1.8.1 at least required"
fi
fi
if
[
x
"
$MPI_valid
"
==
x
"yes"
]
;
then
## Check for potential problem in the MPI installation
if
[
-d
$1
/MPI
]
;
then
where_mpi
=
$(
which mpic++
)
if
[
x
"
$where_mpi
"
!=
x
"
$1
/MPI/bin/mpic++"
]
;
then
echo
-e
"
\0
33[91;5;1m MPI instalation: CONFLICT
\0
33[0m"
echo
"Performing a
\"
which mpic++
\"
, we found that you have installed one system wide MPI "
echo
-e
"
\0
33[1m
$where_mpi
\0
33[0m"
echo
"this MPI has priority over OpenFPM MPI installation in: "
echo
-e
"
\0
33[1m
$1
/MPI/bin/mpic++
\0
33[0m"
echo
"Such configuration is not supported, one MPI must be uniquely selected"
echo
"The possible solutions are: "
echo
-e
"
\0
33[1m 1) Set your PATH to give priority to
$1
/MPI/bin
\0
33[0m"
echo
-e
"
\0
33[1m 2) Eliminate OpenFPM MPI removing
$1
/MPI
\0
33[0m"
echo
-e
"
\0
33[1m 3) Eliminate the system wide MPI
\0
33[0m"
exit
1
fi
fi
fi
}
script/remove_old
View file @
42321812
...
...
@@ -116,6 +116,24 @@ function remove_old()
rm
-rf
$1
/PARMETIS
fi
fi
if
[
-d
$1
/MPI
]
;
then
version
=
$(
cat
$1
/MPI/version
)
if
[
x
"
$version
"
!=
x
"1"
]
;
then
echo
-e
"
\0
33[1;34;5m ----------------------------------------------------------------------
\0
33[0m"
echo
-e
"
\0
33[1;34;5m MPI has been updated, the component will be updated automatically
\0
33[0m"
echo
-e
"
\0
33[1;34;5m ----------------------------------------------------------------------
\0
33[0m"
sleep
5
rm
-rf
$1
/MPI/include
rm
-rf
$1
/MPI/lib
rm
-rf
$1
/MPI/bin
rm
-rf
$1
/MPI/etc
rm
-rf
$1
/MPI/share
rm
-rf
$1
/MPI
rm
-rf
$1
/HDF5
fi
fi
}
src/Decomposition/CartDecomposition.hpp
View file @
42321812
...
...
@@ -101,7 +101,12 @@ protected:
//! This is the key type to access data_s, for example in the case of vector
//! acc_key is size_t
typedef
typename
openfpm
::
vector
<
SpaceBox
<
dim
,
T
>
,
Memory
,
openfpm
::
vector_grow_policy_default
,
openfpm
::
vect_isel
<
SpaceBox
<
dim
,
T
>>::
value
>::
access_key
acc_key
;
typedef
typename
openfpm
::
vector
<
SpaceBox
<
dim
,
T
>
,
Memory
,
typename
memory_traits_lin
<
SpaceBox
<
dim
,
T
>>::
type
,
memory_traits_lin
,
openfpm
::
vector_grow_policy_default
,
openfpm
::
vect_isel
<
SpaceBox
<
dim
,
T
>>::
value
>::
access_key
acc_key
;
//! the set of all local sub-domain as vector
openfpm
::
vector
<
SpaceBox
<
dim
,
T
>>
sub_domains
;
...
...
src/Graph/dist_map_graph.hpp
View file @
42321812
...
...
@@ -69,15 +69,19 @@
#define NO_EDGE -1
#define DIST_GRAPH_ERROR 7001
template
<
typename
V
,
typename
E
,
template
<
typename
,
typename
,
typename
,
unsigned
int
>
class
VertexList
,
template
<
typename
,
typename
,
typename
,
unsigned
int
>
class
EdgeList
,
typename
Memory
,
typename
grow_p
>
template
<
typename
V
,
typename
E
,
typename
Memory
,
typename
layout_v
,
typename
layout_e
,
template
<
typename
>
class
layout_v_base
,
template
<
typename
>
class
layout_e_base
,
typename
grow_p
>
class
DistGraph_CSR
;
class
v_info
{
public:
typedef
boost
::
fusion
::
vector
<
size_t
,
size_t
>
type
;
typedef
typename
memory_traits_inte
<
type
>::
type
memory_int
;
typedef
typename
memory_traits_lin
<
type
>::
type
memory_lin
;
type
data
;
...
...
@@ -132,8 +136,6 @@ class e_info
{
public:
typedef
boost
::
fusion
::
vector
<
size_t
,
size_t
>
type
;
typedef
typename
memory_traits_inte
<
type
>::
type
memory_int
;
typedef
typename
memory_traits_lin
<
type
>::
type
memory_lin
;
type
data
;
...
...
@@ -197,7 +199,12 @@ public:
*
*/
template
<
typename
V
,
typename
E
=
no_edge
,
template
<
typename
,
typename
,
typename
,
unsigned
int
>
class
VertexList
=
openfpm
::
vector
,
template
<
typename
,
typename
,
typename
,
unsigned
int
>
class
EdgeList
=
openfpm
::
vector
,
typename
Memory
=
HeapMemory
,
template
<
typename
V
,
typename
E
=
no_edge
,
typename
Memory
=
HeapMemory
,
typename
layout_v
=
typename
memory_traits_lin
<
V
>
::
type
,
typename
layout_e
=
typename
memory_traits_lin
<
E
>::
type
,
template
<
typename
>
class
layout_v_base
=
memory_traits_lin
,
template
<
typename
>
class
layout_e_base
=
memory_traits_lin
,
typename
grow_p
=
openfpm
::
grow_policy_double
>
class
DistGraph_CSR
{
...
...
@@ -214,25 +221,25 @@ class DistGraph_CSR
size_t
v_slot
;
// Structure that store the vertex properties
VertexList
<
V
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>
v
;
openfpm
::
vector
<
V
,
Memory
,
layout_v
,
layout_v_base
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>
v
;
// Structure that store the vertex id and global id
VertexList
<
v_info
,
M
emory
,
grow_p
,
openfpm
::
vect_isel
<
v_info
>::
value
>
v_m
;
openfpm
::
vector
<
v_info
,
Memory
,
typename
memory_traits_lin
<
v_info
>::
type
,
m
emory
_traits_lin
,
grow_p
,
openfpm
::
vect_isel
<
v_info
>::
value
>
v_m
;
// Structure that store the number of adjacent vertex in e_l for each vertex
VertexList
<
size_t
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
size_t
>::
value
>
v_l
;
openfpm
::
vector
<
size_t
,
Memory
,
typename
layout_v_base
<
size_t
>::
type
,
layout_v_base
,
grow_p
,
openfpm
::
vect_isel
<
size_t
>::
value
>
v_l
;
// Structure that store the edge properties
EdgeList
<
E
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
E
>::
value
>
e
;
openfpm
::
vector
<
E
,
Memory
,
layout_e
,
layout_e_base
,
grow_p
,
openfpm
::
vect_isel
<
E
>::
value
>
e
;
// Structure that store the edge properties
EdgeList
<
e_info
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
e_info
>::
value
>
e_m
;
openfpm
::
vector
<
e_info
,
Memory
,
typename
layout_e_base
<
e_info
>::
type
,
layout_e_base
,
grow_p
,
openfpm
::
vect_isel
<
e_info
>::
value
>
e_m
;
// Structure that store for each vertex the adjacent the vertex id and edge id (for property into e)
EdgeList
<
e_map
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
e_map
>::
value
>
e_l
;
openfpm
::
vector
<
e_map
,
Memory
,
typename
memory_traits_lin
<
e_map
>::
type
,
layout_e_base
,
grow_p
,
openfpm
::
vect_isel
<
e_map
>::
value
>
e_l
;
// invalid edge element, when a function try to create an in valid edge this object is returned
EdgeList
<
E
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
E
>::
value
>
e_invalid
;
openfpm
::
vector
<
E
,
Memory
,
layout_e
,
layout_e_base
,
grow_p
,
openfpm
::
vect_isel
<
E
>::
value
>
e_invalid
;
// Map to access to the global vertex id given the vertex id
std
::
unordered_map
<
size_t
,
size_t
>
id2glb
;
...
...
@@ -341,7 +348,7 @@ class DistGraph_CSR
// Reallocate with double slot
// Create an new Graph
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
>
g_new
(
2
*
v_slot
,
v
.
size
());
DistGraph_CSR
<
V
,
E
>
g_new
(
2
*
v_slot
,
v
.
size
());
// Copy the graph
for
(
size_t
i
=
0
;
i
<
v
.
size
();
i
++
)
...
...
@@ -975,10 +982,10 @@ public:
typedef
E
E_type
;
// Object container for the vertex, for example can be encap<...> (map_grid or openfpm::vector)
typedef
typename
VertexList
<
V
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>::
container
V_container
;
typedef
typename
openfpm
::
vector
<
V
,
Memory
,
layout_v
,
layout_v_base
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>::
container
V_container
;
// Object container for the edge, for example can be encap<...> (map_grid or openfpm::vector)
typedef
typename
EdgeList
<
E
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
E
>::
value
>::
container
E_container
;
typedef
typename
openfpm
::
vector
<
E
,
Memory
,
layout_e
,
layout_e_base
,
grow_p
,
openfpm
::
vect_isel
<
E
>::
value
>::
container
E_container
;
/*! \brief It duplicate the graph
*
...
...
@@ -986,9 +993,9 @@ public:
*
*/
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
,
grow_p
>
duplicate
()
const
DistGraph_CSR
<
V
,
E
,
Memory
,
layout_v
,
layout_e
,
layout_v_base
,
layout_e_base
,
grow_p
>
duplicate
()
const
{
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
,
grow_p
>
dup
;
DistGraph_CSR
<
V
,
E
,
Memory
,
layout_v
,
layout_e
,
layout_v_base
,
layout_e_base
,
grow_p
>
dup
;
dup
.
v_slot
=
v_slot
;
...
...
@@ -1130,7 +1137,7 @@ public:
/*! \brief Copy constructor
*
*/
DistGraph_CSR
(
Vcluster
&
vcl
,
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
>
&&
g
)
:
DistGraph_CSR
(
Vcluster
&
vcl
,
DistGraph_CSR
<
V
,
E
,
Memory
>
&&
g
)
:
vcl
(
vcl
)
{
swap
(
g
);
...
...
@@ -1141,7 +1148,7 @@ public:
* \param g graph to copy
*
*/
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
>
&
operator
=
(
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
>
&&
g
)
DistGraph_CSR
<
V
,
E
,
Memory
>
&
operator
=
(
DistGraph_CSR
<
V
,
E
,
Memory
>
&&
g
)
{
swap
(
g
);
...
...
@@ -1153,7 +1160,7 @@ public:
* \param g graph to copy
*
*/
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
>
&
operator
=
(
const
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
,
Memory
>
&
g
)
DistGraph_CSR
<
V
,
E
,
Memory
>
&
operator
=
(
const
DistGraph_CSR
<
V
,
E
,
Memory
>
&
g
)
{
swap
(
g
.
duplicate
());
...
...
@@ -1508,7 +1515,7 @@ public:
* \return the number of childs
*
*/
inline
size_t
getNChilds
(
typename
VertexList
<
V
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>::
iterator_key
&
c
)
inline
size_t
getNChilds
(
typename
openfpm
::
vector
<
V
,
Memory
,
layout_v
,
layout_v_base
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>::
iterator_key
&
c
)
{
return
v_l
.
template
get
<
0
>(
c
.
get
());
}
...
...
@@ -1621,7 +1628,7 @@ public:
* \return the target i connected by an edge node, for the node v
*
*/
inline
size_t
getChild
(
typename
VertexList
<
V
,
Memory
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>::
iterator_key
&
v
,
size_t
i
)
inline
size_t
getChild
(
typename
openfpm
::
vector
<
V
,
Memory
,
layout_v
,
layout_v_base
,
grow_p
,
openfpm
::
vect_isel
<
V
>::
value
>::
iterator_key
&
v
,
size_t
i
)
{
#ifdef DEBUG
if
(
i
>=
v_l
.
template
get
<
0
>(
v
.
get
()))
...
...
@@ -1681,7 +1688,6 @@ public:
*/
template
<
unsigned
int
dim
,
typename
Mem
>
inline
void
add_vertex
(
const
encapc
<
dim
,
V
,
Mem
>
&
vrt
,
size_t
id
,
size_t
gid
)
{
// Create vertex info object
v_info
vm
;
vm
.
template
get
<
v_info
::
id
>()
=
id
;
...
...
@@ -1909,7 +1915,7 @@ public:
*
* \param g The source graph
*/
inline
void
swap
(
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
>
&
g
)
inline
void
swap
(
DistGraph_CSR
<
V
,
E
>
&
g
)
{
// switch the memory
v
.
swap
(
g
.
v
);
...
...
@@ -1933,7 +1939,7 @@ public:
*
* \param g The source graph
*/
inline
void
swap
(
DistGraph_CSR
<
V
,
E
,
VertexList
,
EdgeList
>
&&
g
)
inline
void
swap
(
DistGraph_CSR
<
V
,
E
>
&&
g
)
{
// switch the memory
v
.
swap
(
g
.
v
);
...
...
@@ -1969,9 +1975,9 @@ public: