Commit 846176c8 authored by incardon's avatar incardon

Fixing installation on OpenSUSE

parent b5527337
......@@ -394,8 +394,14 @@ fi
install_base=$(cat install_dir)
openmp_flags="$(cat openmp_flags) $(cat openfpm_flags)"
if [ -d "$i_dir/HDF5/lib" ]; then
hdf5_lib=$i_dir/HDF5/lib
elif [ -d "$i_dir/HDF5/lib64" ]; then
hdf5_lib=$i_dir/HDF5/lib64
fi
echo "INCLUDE_PATH= $openmp_flags -I. -I$install_base/openfpm_numerics/include -I$install_base/openfpm_pdata/include/config -I$install_base/openfpm_pdata/include -I$install_base/openfpm_data/include -I$install_base/openfpm_vcluster/include -I$install_base/openfpm_io/include -I$install_base/openfpm_devices/include -I$i_dir/METIS/include -I$i_dir/PARMETIS/include -I$i_dir/BOOST/include -I$i_dir/HDF5/include -I$i_dir/LIBHILBERT/include $lin_alg_inc" > example.mk
echo "LIBS_PATH= $openmp_flags -L$install_base/openfpm_devices/lib -L$install_base/openfpm_pdata/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/PARMETIS/lib -L$i_dir/BOOST/lib -L$i_dir/HDF5/lib -L$i_dir/LIBHILBERT/lib $lin_alg_dir" >> example.mk
echo "LIBS_PATH= $openmp_flags -L$install_base/openfpm_devices/lib -L$install_base/openfpm_pdata/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/PARMETIS/lib -L$i_dir/BOOST/lib -L$hdf5_lib -L$i_dir/LIBHILBERT/lib $lin_alg_dir" >> example.mk
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lparmetis -lmetis -lboost_iostreams -lhdf5 -llibhilbert $lin_alg_lib" >> example.mk
cp example.mk src/example.mk
......@@ -456,7 +462,7 @@ fi
if [ -d "$i_dir/HDF5" ]; then
installation_report="$installation_report \033[92;1mHDF5\033[0m Installed: \033[1m $i_dir/HDF5 \033[0m\n"
bash_library="$bash_library:$i_dir/HDF5/lib"
bash_library="$bash_library:$hdf5_lib"
fi
if [ -d "$i_dir/LIBHILBERT" ]; then
......
......@@ -208,104 +208,108 @@ template<typename V, typename E = no_edge,
typename grow_p = openfpm::grow_policy_double>
class DistGraph_CSR
{
// Vcluster communication object
//! Vcluster communication object
Vcluster & vcl;
// Distribution vector
//! Distribution vector
openfpm::vector<idx_t> vtxdist;
// Fixed distribution vector, it never changes, it maintains always the first decomposition and topology
//! Fixed distribution vector, it never changes, it maintains always the first decomposition and topology
openfpm::vector<idx_t> fvtxdist;
// number of slot per vertex
//! number of slot per vertex
size_t v_slot;
// Structure that store the vertex properties
//! Structure that store the vertex properties
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
//! Structure that store the vertex id and global id
openfpm::vector<v_info, Memory, typename memory_traits_lin<v_info>::type, memory_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
//! Structure that store the number of adjacent vertex in e_l for each vertex
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
//! Structure that store the edge properties
openfpm::vector<E, Memory, layout_e, layout_e_base, grow_p, openfpm::vect_isel<E>::value> e;
// Structure that store the edge properties
//! Structure that store the edge properties
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)
//! Structure that store for each vertex the adjacent the vertex id and edge id (for property into e)
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
//! invalid edge element, when a function try to create an in valid edge this object is returned
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
//! Map to access to the global vertex id given the vertex id
std::unordered_map<size_t, size_t> id2glb;
// Map to access the vertex id given the global vertex id
//! Map to access the vertex id given the global vertex id
std::unordered_map<size_t, size_t> glb2id;
// Map to access the local vertex id given the global one
//! Map to access the local vertex id given the global one
std::unordered_map<size_t, size_t> glb2loc;
// Struct containing the (sub)graph to send
//! Struct containing the (sub)graph to send
typedef struct
{
// vertex send buffer
//! vertex send buffer
openfpm::vector<V> send_v;
// vertex info send buffer
//! vertex info send buffer
openfpm::vector<v_info> send_v_m;
// edge send buffer
//! edge send buffer
openfpm::vector<E> send_e;
// edge info send buffer
//! edge info send buffer
openfpm::vector<e_info> send_e_m;
// For each edge contain the child vertex id
//! For each edge contain the child vertex id
openfpm::vector<size_t> send_el;
// For each vertex contain the number of children
//! For each vertex contain the number of children
openfpm::vector<size_t> send_es;
// Indicates if the pack is empty or not
//! Indicates if the pack is empty or not
bool isEmpty = true;
} SendGraphPack;
// Pack storing that data to send to other processors
//! Pack storing that data to send to other processors
openfpm::vector<SendGraphPack> sgp;
// Array containing the sent vertices and that will be deleted from the graph
//! Array containing the sent vertices and that will be deleted from the graph
openfpm::vector<size_t> v_td;
// Structure needed to get vertex position by global id
//! Structure needed to get vertex position by global id
typedef struct
{
// vertex id
//! vertex id
size_t id;
// processor containing the vertex
size_t pid;
} GlobalVInfo;
//TODO update description from pdf
//!TODO update description from pdf
// Map of GlobalVInfo containing informations of vertices of the INITIAL distribution contained in this processor
// ex. if this will contain the first 4 vertices of the distribution (0,1,2,3) it will maintain informations only about these vertices
// The key is the vertex global id
std::unordered_map<size_t, GlobalVInfo> glbi_map;
// Queue of vertex requests
//! Queue of vertex requests
openfpm::vector<openfpm::vector<size_t>> vr_queue;
// Map containing the ghost vertices of this graph, if bool is false the ghost will be deleted in the next vertices exchange
//! Map containing the ghost vertices of this graph, if bool is false the ghost will be deleted in the next vertices exchange
std::unordered_map<size_t, bool> ghs_map;
// Structure to store a add request of an edge
//! Structure to store a add request of an edge
typedef struct
{
//! source vertex
size_t v1;
//! target vertex
size_t v2;
//! source vertex global index
size_t v1n;
//! destination vertex global index
size_t v2n;
} EdgeReq;
// Queue of requests to add edges
//! Queue of requests to add edges
openfpm::vector<EdgeReq> e_queue;
/*! \brief add edge on the graph
......@@ -315,6 +319,8 @@ class DistGraph_CSR
* \param v1 start vertex
* \param v2 end vertex
*
* \return the index of the edge created
*
*/
template<typename CheckPolicy = NoCheck> inline size_t addEdge_(size_t v1, size_t v2)
{
......@@ -976,16 +982,16 @@ class DistGraph_CSR
public:
// Vertex typedef
//! Vertex typedef
typedef V V_type;
// Edge typedef
//! Edge typedef
typedef E E_type;
// Object container for the vertex, for example can be encap<...> (map_grid or openfpm::vector)
//! Object container for the vertex, for example can be encap<...> (map_grid or openfpm::vector)
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)
//! Object container for the edge, for example can be encap<...> (map_grid or openfpm::vector)
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
......@@ -1136,6 +1142,9 @@ public:
}
/*! \brief Copy constructor
*
* \param v_cl vcluster
* \param gg distributed graph to copy
*
*/
DistGraph_CSR(Vcluster & vcl, DistGraph_CSR<V, E, Memory> && g) :
......@@ -1144,10 +1153,12 @@ public:
swap(g);
}
/*! \breif Copy the graph
/*! \brief Copy the graph
*
* \param g graph to copy
* \param g distributed graph to copy
*
* \return itself
*
*/
DistGraph_CSR<V, E, Memory> & operator=(DistGraph_CSR<V, E, Memory> && g)
{
......@@ -1156,10 +1167,12 @@ public:
return *this;
}
/*! \breif Copy the graph
/*! \brief Copy the graph
*
* \param g graph to copy
*
* \return itself
*
*/
DistGraph_CSR<V, E, Memory> & operator=(const DistGraph_CSR<V, E, Memory> & g)
{
......@@ -1175,6 +1188,8 @@ public:
* \tparam i property to access
* \param id of the vertex to access
*
* \return a reference to the vertex property
*
*/
template<unsigned int i> auto vertex_p(size_t id) -> decltype( v.template get<i>(id) )
{
......@@ -1186,6 +1201,8 @@ public:
* \tparam i property to access
* \param id of the vertex to access
*
* \return a reference to the vertex property
*
*/
template<unsigned int i> auto vertex_p(grid_key_dx<1> id) -> decltype( v.template get<i>(id) )
{
......@@ -1196,6 +1213,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex
*
*/
auto vertex(size_t id) -> decltype( v.get(id) )
{
......@@ -1208,6 +1227,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex
*
*/
auto vertex(grid_key_dx<1> id) -> decltype( v.get(id.get(0)) )
{
......@@ -1220,6 +1241,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex
*
*/
auto vertex(openfpm::vector_key_iterator id) -> decltype( v.get(0) )
{
......@@ -1230,6 +1253,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex
*
*/
auto vertex(size_t id) const -> const decltype( v.get(id) )
{
......@@ -1242,6 +1267,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex
*
*/
auto vertex(grid_key_dx<1> id) const -> const decltype( v.get(id.get(0)) )
{
......@@ -1254,6 +1281,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex
*
*/
auto vertex(openfpm::vector_key_iterator id) const -> const decltype( v.get(0) )
{
......@@ -1266,6 +1295,8 @@ public:
*
* \param id of the vertex to access
*
* \return the vertex global id
*
*/
auto vertex_info(openfpm::vector_key_iterator id) const -> const decltype( v_m.get(0) )
{
......@@ -1276,6 +1307,8 @@ public:
*
* \param id GLOBAL id of the vertex to access
*
* \return the vertex
*
*/
auto getVertex(size_t id) -> decltype( v.get(id) )
{
......@@ -1297,6 +1330,8 @@ public:
*
* \param id GLOBAL id of the vertex to access
*
* \return the vertex
*
*/
auto getVertex(size_t id) const -> const decltype( v.get(0) )
{
......@@ -1317,6 +1352,8 @@ public:
*
* \param id id of the vertex to access
*
* \return id of the vertex
*
*/
size_t nodeById(size_t id) const
{
......@@ -1428,6 +1465,8 @@ public:
* \tparam i property to access
* \param id of the edge to access
*
* \return a reference to the edge property
*
*/
template<unsigned int i> auto edge_p(grid_key_dx<1> id) -> decltype ( e.template get<i>(id) )
{
......@@ -1439,6 +1478,8 @@ public:
* \tparam i property to access
* \param id of the edge to access
*
* \return a reference to the edge property
*
*/
template<unsigned int i> auto edge_p(size_t id) -> decltype ( e.template get<i>(id) )
{
......@@ -1449,6 +1490,8 @@ public:
*
* \param id of the edge to access
*
* \return a reference to the edge
*
*/
auto edge(grid_key_dx<1> id) const -> const decltype ( e.get(id.get(0)) )
{
......@@ -1459,6 +1502,8 @@ public:
*
* \param ek key of the edge
*
* \return a reference to the edge
*
*/
auto edge(edge_key ek) const -> const decltype ( e.get(0) )
{
......@@ -1469,6 +1514,8 @@ public:
*
* \param ek key of the edge
*
* \param return a reference to the edge
*
*/
auto getEdge(edge_key ek) const -> const decltype ( e.get(0) )
{
......@@ -1491,6 +1538,8 @@ public:
*
* \param id of the edge to access
*
* \return a reference to the edge
*
*/
auto edge(size_t id) const -> const decltype ( e.get(id) )
{
......@@ -1546,6 +1595,8 @@ public:
* \param v vertex
* \param v_e edge id
*
* \return the edge
*
*/
inline auto getChildEdge(size_t v, size_t v_e) -> decltype(e.get(0))
{
......@@ -1557,6 +1608,8 @@ public:
* \param v vertex
* \param v_e edge id
*
* \return the id of the edge
*
*/
inline auto getChildInfo(size_t v, size_t v_e) -> decltype(e_m.get(0))
{
......@@ -1568,6 +1621,8 @@ public:
* \param v vertex global id
* \param v_e edge id
*
* \return the edge
*
*/
inline auto getEdge(size_t v, size_t v_e) -> decltype(e.get(0))
{
......@@ -1590,10 +1645,9 @@ public:
* \return the edge id that connect v with the target at position i
*
*/
inline size_t getChild(size_t v, size_t i) const
{
#ifdef DEBUG
#ifdef SE_CLASS1
if (i >= v_l.template get<0>(v))
{
std::cerr << "Error " << __FILE__ << " line: " << __LINE__ << " vertex " << v << " does not have edge " << i << " on processor " << vcl.getProcessUnitID() << "\n";
......@@ -1610,7 +1664,7 @@ public:
/*! \brief Get the child edge
*
* \param id of the child
* \param i id of the child
*
* \return the edge id that connect v with the target at position i
*
......@@ -1685,6 +1739,7 @@ public:
/*! \brief Add vertex vrt with global id and id properties
*
* \param vrt vertex object to add
* \param id of the vertex
* \param gid global id, unique in global graph
*/
template<unsigned int dim, typename Mem> inline void add_vertex(const encapc<dim, V, Mem> & vrt, size_t id, size_t gid)
......
......@@ -32,8 +32,10 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
//! Extension of each grid: domain and ghost + domain
openfpm::vector<GBoxes<Decomposition::dims>> gdb_ext;
//! Internal grid sub-iterator
grid_key_dx_iterator_sub<Decomposition::dims> a_it;
//! Internal struct
struct gp_sub
{
//! from which grid this iterator come from
......@@ -42,6 +44,12 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
//! Iterator
grid_key_dx_iterator_sub<Decomposition::dims> it;
/*! \brief constructor
*
* \param gc sub-domain
* \param it iterator
*
*/
gp_sub(size_t gc, grid_key_dx_iterator_sub<Decomposition::dims> && it)
:gc(gc),it(it)
{}
......@@ -142,7 +150,9 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
/*! \brief Constructor of the distributed grid iterator
*
* \param dec Decomposition
* \param sz size of the grid
* \param g_sm grid size on each direction
* \param A box A (must be contained into B)
* \param B box B
* \param bc boundary conditions
*
*/
......@@ -168,17 +178,16 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
selectValidGrid();
}
// Destructor
//! Destructor
~grid_dist_id_iterator_dec_skin()
{
}
/*! \brief Get the next element
*
* \return the next grid_key
* \return itself
*
*/
inline grid_dist_id_iterator_dec_skin<Decomposition> & operator++()
{
++a_it;
......@@ -215,7 +224,9 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
/*! \brief Get the spacing of the grid
*
* \param i
* \param i dimension
*
* \return the spacing
*
*/
inline typename Decomposition::stype getSpacing(size_t i)
......@@ -254,6 +265,8 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
*
* \param tmp iterator to copy
*
* \return itself
*
*/
grid_dist_id_iterator_dec_skin<Decomposition> & operator=(const grid_dist_id_iterator_dec_skin<Decomposition> & tmp)
{
......@@ -274,6 +287,8 @@ class grid_dist_id_iterator_dec_skin : protected grid_skin_iterator_bc<Decomposi
*
* \param tmp iterator to copy
*
* \return itself
*
*/
grid_dist_id_iterator_dec_skin<Decomposition> & operator=(grid_dist_id_iterator_dec_skin<Decomposition> && tmp)
{
......
......@@ -66,13 +66,21 @@ struct vtk_write<ele,vtk,false>
template<typename T>
struct extends
{
//! number of elements
/*! \brief Scalar case
*
* \return 1 component
*
*/
static inline size_t mul()
{
return 1;
}
//! number of indexes
/*! \brief Dimensionality
*
* \return 0
*
*/
static inline size_t dim()
{
return 0;
......@@ -83,13 +91,21 @@ struct extends
template<typename T,size_t N1>
struct extends<T[N1]>
{
//! number of elements
/*! \brief Vector case return N1 component
*
* \return N1
*
*/
static inline size_t mul()
{
return N1;
}
//! number of indexes
/*! Dimensionality 1
*
* \return 1
*
*/
static inline size_t dim()
{
return 1;
......@@ -100,13 +116,21 @@ struct extends<T[N1]>
template<typename T,size_t N1,size_t N2>
struct extends<T[N1][N2]>
{
//! number of elements
/*! \brief Matrix case return N1*N2 component
*
* \return N1*N2
*
*/
static inline size_t mul()
{
return N1 * N2;
}
//! number of indexes
/*! Dimensionality 2
*
* \return 2
*
*/
static inline size_t dim()
{
return 2;
......@@ -256,8 +280,7 @@ struct extends<T[N1][N2][N3][N4][N5][N6][N7][N8][N9][N10]>
* \param T property to write
* \param dim dimansionality
* \param St type of space
* \param VTKW VTK writer
* \param
* \param VTK VTK writer
*
*/
template<typename T>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment