Commit 7dbef663 authored by Pietro Incardona's avatar Pietro Incardona

Fixing documentation

parent b57a0bae
......@@ -14,7 +14,10 @@ grid: $(OBJ)
all: grid
.PHONY: clean all
run: all
source $$HOME/openfpm_vars; mpirun -np 2 ./grid
.PHONY: clean all run
clean:
rm -f *.o *~ core grid
......
......@@ -14,7 +14,10 @@ stencil: $(OBJ)
all: stencil
.PHONY: clean all
run: all
source $$HOME/openfpm_vars; mpirun -np 3 ./stencil
.PHONY: clean all run
clean:
rm -f *.o *~ core stencil
......
......@@ -14,7 +14,10 @@ periodic: $(OBJ)
all: periodic
.PHONY: clean all
run: all
source $$HOME/openfpm_vars; mpirun -np 4 ./periodic
.PHONY: clean all run
clean:
rm -f *.o *~ core periodic
......
......@@ -14,7 +14,10 @@ gray_scott: $(OBJ)
all: gray_scott
.PHONY: clean all
run: all
source $$HOME/openfpm_vars; mpirun -np 4 ./gray_scott
.PHONY: clean all run
clean:
rm -f *.o *~ core gray_scott
......
......@@ -14,7 +14,9 @@ se_classes: $(OBJ)
all: se_classes
.PHONY: clean all
run: all
.PHONY: clean all run
clean:
rm -f *.o *~ core se_classes
......
......@@ -14,7 +14,9 @@ se_classes: $(OBJ)
all: se_classes
.PHONY: clean all
run: all
.PHONY: clean all run
clean:
rm -f *.o *~ core se_classes
......
......@@ -14,7 +14,10 @@ vcluster: $(OBJ)
all: vcluster
.PHONY: clean all
run: all
source $$HOME/openfpm_vars; mpirun -np 3 ./vcluster
.PHONY: clean all run
clean:
rm -f *.o *~ core vcluster
......
......@@ -31,7 +31,7 @@ int main(int argc, char* argv[])
//
Vcluster & v_cl = create_vcluster();
size_t N_prc = v_cl.getProcessingUnits();
long int N_prc = v_cl.getProcessingUnits();
//
// ### WIKI 3 ###
......@@ -40,7 +40,7 @@ int main(int argc, char* argv[])
// processora minus one, only processor 0 print on terminal
//
size_t id = v_cl.getProcessUnitID();
long int id = v_cl.getProcessUnitID();
v_cl.max(id);
v_cl.execute();
......@@ -67,8 +67,8 @@ int main(int argc, char* argv[])
// we can collect information from all processors using the function gather
//
size_t id3 = v_cl.getProcessUnitID();
openfpm::vector<size_t> v;
long int id3 = v_cl.getProcessUnitID();
openfpm::vector<long int> v;
v_cl.allGather(id3,v);
v_cl.execute();
......@@ -109,6 +109,8 @@ int main(int argc, char* argv[])
openfpm::vector<char> v_two(msg_size);
v_two.resize(msg_size);
// Processor 0 receive from 1,2 ...
v_cl.recv(((id3-1)%N_prc + N_prc)%N_prc,0,(void *)v_one.getPointer(),msg_size);
v_cl.recv(((id3-2)%N_prc + N_prc)%N_prc,0,(void *)v_two.getPointer(),msg_size);
v_cl.execute();
......
......@@ -276,6 +276,8 @@ int main(int argc, char* argv[])
vd.template getProp<2>(p)[2][0] += (xp.get(2) - xq.get(2)) * (xp.get(0) - xq.get(0));
vd.template getProp<2>(p)[2][1] += (xp.get(2) - xq.get(2)) * (xp.get(1) - xq.get(1));
vd.template getProp<2>(p)[2][2] += (xp.get(2) - xq.get(2)) * (xp.get(2) - xq.get(2));
++Np;
}
// Next particle p
......
......@@ -61,6 +61,7 @@ int main(int argc, char* argv[])
phases.add( vector_dist<3,float, aggregate<double,double>>(phases.get(0).getDecomposition(),4096) );
phases.add( vector_dist<3,float, aggregate<double,double>>(phases.get(0).getDecomposition(),4096) );
//! \cond [Initialization and parameters] \endcond
......@@ -167,7 +168,7 @@ int main(int argc, char* argv[])
//! \cond [cl usage] \endcond
/* vector_dist<3,float, aggregate<double,double> > & current_phase = phases.get(0);
vector_dist<3,float, aggregate<double,double> > & current_phase = phases.get(0);
// Get the iterator of the particles of phase 0
auto it2 = current_phase.getIterator();
......@@ -203,7 +204,7 @@ int main(int argc, char* argv[])
// Next particle p
++it2;
}*/
}
//! \cond [cl usage] \endcond
......
......@@ -6,11 +6,14 @@ LDIR =
OBJ_DORD = main_data_ord.o
OBJ_CORD = main_comp_ord.o
OPT =
all: md_data_ord md_comp_ord
all_test: OPT += -DTEST_RUN
all_test: md_data_ord_test md_comp_ord_test
%.o: %.cpp
$(CC) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
$(CC) -O3 -g -c --std=c++11 $(OPT) -o $@ $< $(INCLUDE_PATH)
md_data_ord: $(OBJ_DORD)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
......@@ -18,7 +21,16 @@ md_data_ord: $(OBJ_DORD)
md_comp_ord: $(OBJ_CORD)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
.PHONY: clean all
md_data_ord_test: $(OBJ_DORD)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
md_comp_ord_test: $(OBJ_CORD)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
run: all_test
source $$HOME/openfpm_vars; mpirun -np 4 ./md_data_ord_test; mpirun -np 4 ./md_comp_ord_test
.PHONY: clean all run all_test on_test
clean:
rm -f *.o *~ core md_data_ord md_comp_ord
......
......@@ -414,8 +414,14 @@ int main(int argc, char* argv[])
timer time2;
time2.start();
#ifndef TEST_RUN
size_t Nstep = 30000;
#else
size_t Nstep = 300;
#endif
// MD time stepping
for (size_t i = 0; i < 30000 ; i++)
for (size_t i = 0; i < Nstep ; i++)
{
// Get the iterator
auto it3 = vd.getDomainIterator();
......
......@@ -277,8 +277,14 @@ int main(int argc, char* argv[])
timer time2;
time2.start();
#ifndef TEST_RUN
size_t Nstep = 30000;
#else
size_t Nstep = 300;
#endif
// MD time stepping
for (size_t i = 0; i < 30000 ; i++)
for (size_t i = 0; i < Nstep ; i++)
{
// Get the iterator
auto it3 = vd.getDomainIterator();
......
......@@ -93,7 +93,7 @@ private:
//! Virtual cluster
Vcluster & v_cl;
// definition of the send vector for position
//! definition of the send vector for position
typedef openfpm::vector<Point<dim, St>, ExtPreAlloc<Memory>, typename memory_traits_lin<Point<dim, St>>::type, memory_traits_lin , openfpm::grow_policy_identity> send_pos_vector;
//////////////////////////////
......@@ -129,6 +129,7 @@ private:
/*! \brief It store for each processor the position and properties vector of the particles
*
* This structure is used in the map function
*
*/
struct pos_prop
......@@ -139,6 +140,11 @@ private:
openfpm::vector<prop, PreAllocHeapMemory<2>, typename memory_traits_lin<prop>::type, memory_traits_lin, openfpm::grow_policy_identity> prp;
};
/*! \brief for each processor store 2 vector containing the sending buffers
*
* This structure is used in the map_list function
*
*/
template <typename sel_prop>
struct pos_prop_sel
{
......@@ -208,10 +214,6 @@ private:
*
* It count the number of particle to send to each processors and save its ids
*
* \param prc_sz For each processor the number of particles to send
* \param opart id if of the particles to send
* \param shift_id shift correction id
*
* \see nn_prcs::getShiftvectors()
*
*/
......@@ -464,7 +466,7 @@ private:
/*! \brief allocate and fill the send buffer for the map function
*
* \param prc_r List of processor rank involved in the send
* \param prc_r_sz For each processor in the list the size of the message to send
* \param prc_sz_r For each processor in the list the size of the message to send
* \param pb send buffer
*
*/
......@@ -514,7 +516,7 @@ private:
/*! \brief allocate and fill the send buffer for the map function
*
* \param prc_r List of processor rank involved in the send
* \param prc_r_sz For each processor in the list the size of the message to send
* \param prc_sz_r For each processor in the list the size of the message to send
* \param pb send buffer
*
*/
......@@ -632,7 +634,7 @@ private:
/*! \brief Process the received particles
*
* \param list of the out-going particles
* \param out_part list of the out-going particles
*
*/
void process_received_map(openfpm::vector<size_t> & out_part)
......@@ -690,7 +692,7 @@ private:
/*! \brief Process the received particles
*
* \param list of the out-going particles
* \param out_part list of the out-going particles
*
*/
template<typename prp_object , int ... prp> void process_received_map_list(openfpm::vector<size_t> & out_part)
......@@ -861,6 +863,8 @@ public:
*
* \param v vector to copy
*
* \return itself
*
*/
vector_dist<dim,St,prop,Decomposition,Memory> & operator=(const vector_dist<dim,St,prop,Decomposition,Memory> & v)
{
......@@ -877,6 +881,8 @@ public:
*
* \param v vector to copy
*
* \return itself
*
*/
vector_dist<dim,St,prop,Decomposition,Memory> & operator=(vector_dist<dim,St,prop,Decomposition,Memory> && v)
{
......@@ -889,12 +895,9 @@ public:
return *this;
}
/*! \brief Constructor
/*! \brief Copy Constructor
*
* \param np number of elements
* \param box domain where the vector of elements live
* \param boundary conditions
* \param g Ghost margins
* \param v vector to copy
*
*/
vector_dist(const vector_dist<dim,St,prop,Decomposition,Memory> & v)
......@@ -907,12 +910,9 @@ public:
this->operator=(v);
}
/*! \brief Constructor
/*! \brief Copy constructor
*
* \param np number of elements
* \param box domain where the vector of elements live
* \param boundary conditions
* \param g Ghost margins
* \param v vector to copy
*
*/
vector_dist(vector_dist<dim,St,prop,Decomposition,Memory> && v)
......@@ -925,12 +925,10 @@ public:
this->operator=(v);
}
/*! \brief Constructor
/*! \brief Constructor with predefined decomposition
*
* \param np number of elements
* \param box domain where the vector of elements live
* \param boundary conditions
* \param g Ghost margins
* \param dec is the decomposition
* \param np number of particles
*
*/
vector_dist(const Decomposition & dec, size_t np) :
......@@ -948,7 +946,7 @@ public:
*
* \param np number of elements
* \param box domain where the vector of elements live
* \param boundary conditions
* \param bc boundary conditions
* \param g Ghost margins
*
*/
......@@ -1359,11 +1357,8 @@ public:
}
/*! \brief Get the property of the last element
*
* see the vector_dist iterator usage to get an element key
*
* \tparam id property id
* \param vec_key vector element
*
* \return return the selected property of the vector element
*
......@@ -1449,6 +1444,8 @@ public:
* \param r_cut interation radius, or size of each cell
* \param enlarge In case of padding particles the cell list must be enlarged, like a ghost this parameter say how much must be enlarged
*
* \return the CellList
*
*/
template<typename CellL = CellList<dim, St, FAST, shift<dim, St> > > CellL getCellList(St r_cut, const Ghost<dim, St> & enlarge)
{
......@@ -1479,6 +1476,8 @@ public:
* \param r_cut interation radius, or size of each cell
* \param enlarge In case of padding particles the cell list must be enlarged, like a ghost this parameter say how much must be enlarged
*
* \return The Cell-list
*
*/
template<typename CellL = CellList_hilb<dim, St, FAST, shift<dim, St> > > CellL getCellList_hilb(St r_cut, const Ghost<dim, St> & enlarge)
{
......@@ -1666,7 +1665,7 @@ public:
/*! \brief It return the number of particles contained by the previous processors
*
* \Warning It only work with the initial decomposition
* \warning It only work with the initial decomposition
*
* Given 1000 particles and 3 processors, you will get
*
......@@ -1676,6 +1675,8 @@ public:
*
* \param np initial number of particles
*
* \return number of particles contained by the previous processors
*
*/
size_t init_size_accum(size_t np)
{
......@@ -1712,6 +1713,8 @@ public:
*
* Usefull function to place particles on a grid or grid-like (grid + noise)
*
* \param sz size of the grid
*
* \return a Grid iterator
*
*/
......@@ -1739,11 +1742,6 @@ public:
return it_dec;
}
void calculateComputationCosts()
{
}
/*! \brief Get the iterator across the position of the ghost particles
*
* \return an iterator
......@@ -1792,10 +1790,7 @@ public:
/*! \brief Remove one element from the distributed vector
*
* \warning keys must be sorted
*
* \param keys vector of elements to eliminate
* \param start from where to eliminate
* \param key remove one element from the vector
*
*/
void remove(size_t key)
......@@ -1806,6 +1801,9 @@ public:
g_m--;
}
/*! \brief Add the computation cost on the decomposition comming from the particles
*
*/
inline void addComputationCosts()
{
CellDecomposer_sm<dim, St> cdsm;
......@@ -1878,7 +1876,7 @@ public:
/*! \brief Resize the vector (locally)
*
* \warning It automaticallt delete the ghosts
* \warning It automatically delete the ghosts
*
* \param rs
*
......@@ -1896,6 +1894,7 @@ public:
/*! \brief Output particle position and properties
*
* \param out output
* \param iteration (we can append the number at the end of the file_name)
* \param opt NO_GHOST or WITH_GHOST
*
* \return if the file has been written correctly
......@@ -1929,9 +1928,9 @@ public:
/*! \brief Get the Celllist parameters
*
* \param r_cut spacing of the cell-list
* \param division required for the cell-list
* \param div division required for the cell-list
* \param box where the Cell list must be defined (In general Processor domain + Ghost)
* \param Optionally a request to make the space a littler bit larger than Processor domain + Ghost
* \param enlarge Optionally a request to make the space a littler bit larger than Processor domain + Ghost
* keeping the cell list consistent with the requests
*
*/
......@@ -1940,10 +1939,12 @@ public:
box = cl_param_calculate(div,r_cut,enlarge);
}
/* \brief It return the id of structure in the allocation list
/*! \brief It return the id of structure in the allocation list
*
* \see print_alloc and SE_CLASS2
*
* \return the id
*
*/
long int who()
{
......
......@@ -527,8 +527,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_2d )
{
BOOST_TEST_CHECKPOINT( "Testing 2D periodic vector k=" << k );
//! [Create a vector of random elements on each processor 2D]
Box<2,float> box({0.0,0.0},{1.0,1.0});
// Boundary conditions
......@@ -563,8 +561,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_2d )
// sync the ghost, only the property zero
vd.ghost_get<0>();
//! [Create a vector of random elements on each processor 2D]
// Domain + ghost box
Box<2,float> dom_ext = box;
dom_ext.enlarge(ghost2);
......@@ -635,8 +631,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_3d )
{
BOOST_TEST_CHECKPOINT( "Testing 3D periodic vector k=" << k );
//! [Create a vector of random elements on each processor 3D]
Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0});
// Boundary conditions
......@@ -672,8 +666,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_test_use_3d )
// sync the ghost
vd.ghost_get<0>();
//! [Create a vector of random elements on each processor 3D]
// Domain + ghost
Box<3,float> dom_ext = box;
dom_ext.enlarge(ghost2);
......@@ -1234,8 +1226,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_map_list )
print_test("Testing 3D periodic vector with map_list k=",k);
BOOST_TEST_CHECKPOINT( "Testing 3D periodic vector with map_list k=" << k );
//! [Create a vector of random elements on each processor 3D]
Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0});
// Boundary conditions
......@@ -1290,8 +1280,6 @@ BOOST_AUTO_TEST_CASE( vector_dist_periodic_map_list )
// sync the ghost
vd.ghost_get<0>();
//! [Create a vector of random elements on each processor 3D]
// Domain + ghost
Box<3,float> dom_ext = box;
dom_ext.enlarge(ghost2);
......
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