Commit d058871d authored by Pietro Incardona's avatar Pietro Incardona

Fixing installation

parent 44232a31
......@@ -46,6 +46,10 @@ INCLUDES_PATH=" "
# Create a file with the install base folder
echo "$base" > install_dir
# Needed for build library
AC_PROG_RANLIB
AM_PROG_AR
# Checks for programs.
AC_PROG_CXX
......
......@@ -131,11 +131,11 @@ int main(int argc, char* argv[])
// Get again another iterator, iterate across all the domain points, calculating a Laplace stencil
//
//
dom = g_dist.getDomainIterator();
auto dom2 = g_dist.getDomainIterator();
while (dom.isNext())
while (dom2.isNext())
{
auto key = dom.get();
auto key = dom2.get();
// Laplace stencil
g_dist.template get<B>(key)[1] = g_dist.template get<A>(key.move(x,1))[0] + g_dist.template get<A>(key.move(x,-1))[0] +
......@@ -144,7 +144,7 @@ int main(int argc, char* argv[])
6*g_dist.template get<A>(key)[0];
++dom;
++dom2;
}
//
......
......@@ -26,17 +26,14 @@ template<typename T> class Particle
{
public:
typedef boost::fusion::vector<T,T,T,T,T[3],T[3][3]> type;
typedef boost::fusion::vector<T,T[3],T[3][3]> type;
type data;
static const unsigned int x = 0;
static const unsigned int y = 1;
static const unsigned int z = 2;
static const unsigned int s = 3;
static const unsigned int v = 4;
static const unsigned int t = 5;
static const unsigned int max_prop = 6;
static const unsigned int s = 0;
static const unsigned int v = 1;
static const unsigned int t = 2;
static const unsigned int max_prop = 3;
};
int main(int argc, char* argv[])
......@@ -58,8 +55,8 @@ int main(int argc, char* argv[])
std::default_random_engine eg;
std::uniform_real_distribution<float> ud(0.0f, 1.0f);
Box<2,float> box({0.0,0.0},{1.0,1.0});
size_t bc[2]={PERIODIC,PERIODIC};
Box<2,float> domain({0.0,0.0},{1.0,1.0});
size_t bc[2]={PERIODIC,PERIODIC};
Ghost<2,float> g(0.01);
//
......@@ -82,12 +79,12 @@ int main(int argc, char* argv[])
// objects with an undefined position in space. This non-space decomposition is also called data-driven
// decomposition
//
vector_dist<2,float, Particle<float>, CartDecomposition<2,float> > vd(4096,box,bc,g);
vector_dist<2,float, Particle<float>, CartDecomposition<2,float> > vd(4096,domain,bc,g);
//
// ### WIKI 5 ###
//
// Get an iterator that go throught the objects, in an undefined position state and define its position
// Get an iterator that go through the particles, in an undefined position state and define its position
//
auto it = vd.getIterator();
......@@ -124,10 +121,29 @@ int main(int argc, char* argv[])
{
auto key = it.get();
if (ct.isLocal(vd.template getPos<s::x>(key)) == false)
// The template parameter is unuseful and will probably disappear
if (ct.isLocal(vd.template getPos<0>(key)) == false)
std::cerr << "Error particle is not local" << "\n";
// set the all the properties to 0.0
// scalar
vd.template getProp<0>(key) = 0.0;
vd.template getProp<1>(key)[0] = 0.0;
vd.template getProp<1>(key)[1] = 0.0;
vd.template getProp<1>(key)[2] = 0.0;
vd.template getProp<2>(key)[0][0] = 0.0;
vd.template getProp<2>(key)[0][1] = 0.0;
vd.template getProp<2>(key)[0][2] = 0.0;
vd.template getProp<2>(key)[1][0] = 0.0;
vd.template getProp<2>(key)[1][1] = 0.0;
vd.template getProp<2>(key)[1][2] = 0.0;
vd.template getProp<2>(key)[2][0] = 0.0;
vd.template getProp<2>(key)[2][1] = 0.0;
vd.template getProp<2>(key)[2][2] = 0.0;
cnt++;
++it;
......
......@@ -218,7 +218,7 @@ fi
install_base=$(cat install_dir)
echo "INCLUDE_PATH=-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/BOOST/include" > example.mk
echo "LIBS_PATH= -L$install_base/openfpm_devices/lib -L$install_base/openfpm_vcluster/lib -L$i_dir/METIS/lib -L$i_dir/BOOST/lib " >> example.mk
echo "LIBS=-lvcluster -lofpmmemory -lmetis -lboost_iostreams" >> example.mk
echo "LIBS=-lvcluster -lofpm_pdata -lofpmmemory -lmetis -lboost_iostreams" >> example.mk
echo "LIBS_SE2=-lvcluster -lofpmmemory_se2 -lmetis -lboost_iostreams" >> example.mk
cp example.mk src/example.mk
cp example.mk example/example.mk
......
......@@ -10,7 +10,7 @@
#include "VCluster.hpp"
openfpm::vector<SpaceBox<3,float>> create3Ddecomposition(Vcluster & vcl)
/*openfpm::vector<SpaceBox<3,float>> create3Ddecomposition(Vcluster & vcl)
{
vb3.add(Box<3,float>({0.2,0.2,0.5},{1.0,0.5,1.0}));
vb3.add(Box<3,float>({0.0,0.0,0.5},{0.2,0.2,1.0}));
......@@ -18,7 +18,7 @@ openfpm::vector<SpaceBox<3,float>> create3Ddecomposition(Vcluster & vcl)
vb3.add(Box<3,float>({0.5,0.0,0.5},{1.0,0.2,1.0}));
vb3.add(Box<3,float>({0.0,0.2,0.5},{0.2,0.5,1.0}));
vb3.add(Box<3,float>({0.0,0.5,0.5},{1.0,1.0,1.0}));
}
}*/
......
......@@ -113,22 +113,6 @@ class grid_dist_iterator<dim,device_grid,FREE>
public:
/*! \brief Copy operator=
*
* \param tmp iterator to copy
*
*/
grid_dist_iterator<dim,device_grid,FREE> & operator=(const grid_dist_iterator<dim,device_grid,FREE> & tmp)
{
g_c = tmp.g_c;
gList = tmp.gList;
gdb_ext = tmp.gdb_ext;
a_it.reinitialize(tmp.a_it);
stop = tmp.stop;
return *this;
}
/*! \brief Constructor of the distributed grid iterator
*
* \param gk std::vector of the local grid
......
LINKLIBS = $(METIS_LIB) $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS)
noinst_PROGRAMS = pdata
pdata_SOURCES = main.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
pdata_SOURCES = main.cpp lib/pdata.cpp test_multiple_o.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
pdata_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) -Wno-unused-local-typedefs
pdata_CFLAGS = $(CUDA_CFLAGS)
pdata_LDADD = $(LINKLIBS) -lmetis
nobase_include_HEADERS = Decomposition/CartDecomposition.hpp Decomposition/common.hpp Decomposition/Decomposition.hpp Decomposition/ie_ghost.hpp \
Decomposition/nn_processor.hpp Decomposition/ie_loc_ghost.hpp Decomposition/ORB.hpp \
Graph/CartesianGraphFactory.hpp \
Grid/grid_dist_id.hpp Grid/grid_dist_id_iterator_sub.hpp Grid/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp \
Grid/grid_dist_id.hpp Grid/grid_dist_id_iterator_dec.hpp Grid/grid_dist_util.hpp Grid/grid_dist_id_iterator_sub.hpp Grid/grid_dist_id_iterator.hpp Grid/grid_dist_key.hpp \
Vector/vector_dist.hpp Vector/vector_dist_ofb.hpp Vector/vector_dist_iterator.hpp Vector/vector_dist_key.hpp \
config/config.h \
example.mk \
metis_util.hpp dec_optimizer.hpp SubdomainGraphNodes.hpp
lib_LIBRARIES = libofpm_pdata.a
libofpm_pdata_a_SOURCES = lib/pdata.cpp
libofpm_pdata_a_CXXFLAGS = $(INCLUDES_PATH) $(BOOST_CPPFLAGS) -I/usr/local/include
libofpm_pdata_a_CFLAGS =
.cu.o :
$(NVCC) $(NVCCFLAGS) -o $@ -c $<
#ifndef SUBDOMAIN_NODES_HPP
#define SUBDOMAIN_NODES_HPP
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/include/at_c.hpp>
#include "Grid/Encap.hpp"
/* In a decomposition graph each node represent a sub-domain while an edge represent
* an interaction between sub-domain (it mean that they have to communicate).
*
......@@ -32,9 +36,6 @@ struct nm_v
//! The node contain 3 unsigned long integer for communication computation memory and id
typedef boost::fusion::vector<float,float,float,size_t,size_t,size_t,size_t,long int> type;
typedef typename memory_traits_inte<type>::type memory_int;
typedef typename memory_traits_lin<type>::type memory_lin;
//! type of the positional field
typedef float s_type;
......@@ -87,8 +88,6 @@ struct nm_v
};
const std::string nm_v::attributes::name[] = {"x","y","z","communication","computation","memory","id","sub_id"};
/*! \brief sub-domain edge graph node
*
*/
......@@ -98,9 +97,6 @@ struct nm_e
//! The node contain 3 unsigned long integer for comunication computation and memory
typedef boost::fusion::vector<size_t> type;
typedef typename memory_traits_inte<type>::type memory_int;
typedef typename memory_traits_lin<type>::type memory_lin;
//! Attributes name
struct attributes
{
......@@ -116,7 +112,6 @@ struct nm_e
static const unsigned int max_prop = 1;
};
const std::string nm_e::attributes::name[] = {"communication"};
/*! \brief Reduced sub-domain vertex graph node
*
......@@ -129,9 +124,6 @@ struct nm_part_v
//! The node contain 3 unsigned long integer for comunication computation and memory
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;
typedef float s_type;
//! Attributes name
......@@ -166,9 +158,6 @@ struct nm_part_v
};
const std::string nm_part_v::attributes::name[] = {"id","sub_id"};
/*! \brief Reduced edge graph node
*
* It contain only the communication between nodes
......@@ -180,9 +169,6 @@ struct nm_part_e
//! The node contain 3 unsigned long integer for comunication computation and memory
typedef boost::fusion::vector<> type;
typedef typename memory_traits_inte<type>::type memory_int;
typedef typename memory_traits_lin<type>::type memory_lin;
//! The data
type data;
......@@ -197,6 +183,4 @@ struct nm_part_e
};
};
const std::string nm_part_e::attributes::name[] = {"id"};
#endif
......@@ -1149,12 +1149,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_cell_verlet_test )
correct &= (first_NN == 6);
correct &= (second_NN == 12);
correct &= (third_NN == 8);
if (correct == false)
{
int debug = 0;
debug++;
}
}
BOOST_REQUIRE_EQUAL(correct,true);
......
......@@ -2,17 +2,17 @@
LINKLIBS = $(METIS_LIB) $(PTHREAD_LIBS) $(OPT_LIBS) $(BOOST_LDFLAGS) $(BOOST_IOSTREAMS_LIB) $(CUDA_LIBS)
noinst_PROGRAMS = cart_dec metis_dec dom_box
cart_dec_SOURCES = CartDecomposition_gen_vtk.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
cart_dec_SOURCES = CartDecomposition_gen_vtk.cpp ../src/lib/pdata.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
cart_dec_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) -I../src -Wno-unused-function -Wno-unused-local-typedefs
cart_dec_CFLAGS = $(CUDA_CFLAGS)
cart_dec_LDADD = $(LINKLIBS) -lmetis
metis_dec_SOURCES = Metis_gen_vtk.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
metis_dec_SOURCES = Metis_gen_vtk.cpp ../src/lib/pdata.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
metis_dec_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) -I../src -Wno-unused-function -Wno-unused-local-typedefs
metis_dec_CFLAGS = $(CUDA_CFLAGS)
metis_dec_LDADD = $(LINKLIBS) -lmetis
dom_box_SOURCES = domain_gen_vtk.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
dom_box_SOURCES = domain_gen_vtk.cpp ../src/lib/pdata.cpp ../openfpm_devices/src/memory/HeapMemory.cpp ../openfpm_devices/src/memory/PtrMemory.cpp ../openfpm_vcluster/src/VCluster.cpp ../openfpm_devices/src/Memleak_check.cpp
dom_box_CXXFLAGS = $(CUDA_CFLAGS) $(INCLUDES_PATH) $(METIS_INCLUDE) $(BOOST_CPPFLAGS) -I../src -Wno-unused-function -Wno-unused-local-typedefs
dom_box_CFLAGS = $(CUDA_CFLAGS)
dom_box_LDADD = $(LINKLIBS)
......
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