Commit 80f86771 authored by incardon's avatar incardon

Adding functionality to grid distributed + big fix

parent 77f54f87
......@@ -176,6 +176,13 @@ if [ $? -ne 0 ]; then
conf_err=1
fi
### Create example.mk
install_base=$(cat install_dir)
echo "INCLUDE_PATH=-I. -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" > example.mk
echo "LIBS_PATH=-L$install_base/openfpm_devices/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib " >> example.mk
echo "LIBS=-lvcluster -lofpmmemory -lmetis -lboost_iostreams" >> example.mk
mv example.mk example/example.mk
echo ""
echo ""
if [ $conf_err -eq 0 ]; then
......
......@@ -560,7 +560,7 @@ public:
* \param v1 grid_key that identify the element in the grid
*
*/
template <unsigned int p>inline auto get(grid_dist_key_dx<dim> & v1) -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
template <unsigned int p>inline auto get(const grid_dist_key_dx<dim> & v1) -> typename std::add_lvalue_reference<decltype(loc_grid.get(v1.getSub()).template get<p>(v1.getKey()))>::type
{
return loc_grid.get(v1.getSub()).template get<p>(v1.getKey());
}
......
......@@ -25,7 +25,7 @@ public:
* \return the id of the local grid
*
*/
size_t getSub() const
inline size_t getSub() const
{
return g_c;
}
......@@ -35,12 +35,27 @@ public:
* \return the local key
*
*/
grid_key_dx<dim> getKey() const
inline grid_key_dx<dim> getKey() const
{
return key;
}
grid_dist_key_dx(int g_c, grid_key_dx<dim> key)
/*! \brief Create a new key moving the old one
*
* \param i dimension id
* \param s number of steps
*
* \return new key
*
*/
inline grid_dist_key_dx<dim> move(size_t i,size_t s)
{
grid_key_dx<dim> key = getKey();
key.set_d(i,key.get(i) + s);
return grid_dist_key_dx<dim>(getSub(),key);
}
inline grid_dist_key_dx(int g_c, grid_key_dx<dim> key)
:g_c(g_c),key(key)
{
}
......
......@@ -9,7 +9,8 @@ nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/commo
Decomposition/nn_processor.hpp Decomposition/DistModel.hpp Decomposition/ie_loc_ghost.hpp Decomposition/ORB.hpp \
Graph/CartesianGraphFactory.hpp \
Grid/grid_dist_id.hpp Grid/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp \
Vector/vector_dist.hpp Vector/vector_dist_iterator.hpp Vector/vector_dist_key.hpp
Vector/vector_dist.hpp Vector/vector_dist_iterator.hpp Vector/vector_dist_key.hpp \
config/config.h
.cu.o :
$(NVCC) $(NVCCFLAGS) -o $@ -c $<
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