Commit 2a41cfe6 authored by incardon's avatar incardon

Latest modules

parent 5b3fd9bd
......@@ -153,6 +153,10 @@ else()
message( FATAL_ERROR "LibHilbert is required in order to install OpenFPM")
endif()
if(SUITESPARSE_FOUND)
set(DEFINE_HAVE_SUITESPARSE "#define HAVE_SUITESPARSE")
endif()
if(APPLE)
set(DEFINE_HAVE_OSX "#define HAVE_OSX")
endif()
......
......@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
// randomly in the domain, we create a Box that define our domain, boundary conditions and ghost
//
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
typedef Point<2,float> s;
......@@ -87,7 +87,7 @@ int main(int argc, char* argv[])
// decomposition
//
{
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > vd(4096,box,bc,g);
vector_dist<2,float, Point_test<float> > vd(4096,box,bc,g);
//
// ### WIKI 6 ###
......@@ -112,8 +112,8 @@ int main(int argc, char* argv[])
// we create, now two of them using new
//
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > * vd1 = new vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> >(4096,box,bc,g);
vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> > * vd2 = new vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> >(4096,box,bc,g);
vector_dist<2,float, Point_test<float> > * vd1 = new vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> >(4096,box,bc,g);
vector_dist<2,float, Point_test<float> > * vd2 = new vector_dist<2,float, Point_test<float>, CartDecomposition<2,float> >(4096,box,bc,g);
//
// ### WIKI 8 ###
......
......@@ -36,7 +36,7 @@ int main(int argc, char* argv[])
// * throw_on_allocation throw when one allocation is reached, producing the termination of the program and a core dump (if no try catch is set-up)
//
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
throw_on_alloc(10);
// message_on_alloc(10);
......
......@@ -270,7 +270,7 @@ PX,Y Processor X, sub-domain Y</pre><p>The point # has</p>
//! \cond [reduce] \endcond
// Get the VCluster object
Vcluster & vcl = create_vcluster();
Vcluster<> & vcl = create_vcluster();
// queue an operation of sum for the counter count
vcl.sum(count);
......
......@@ -393,7 +393,7 @@ int main(int argc, char* argv[])
// Get the maximum across processor to calculate the norm infinity of the error
// Norm infinity of the error is the maximum error across all the grid points
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
v_cl.max(error);
v_cl.execute();
......
......@@ -406,7 +406,7 @@ void comp_vel(grid_type_s & gr_ps,
solError serr;
serr = solver.get_residual_error(phi_s[i],b);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
if (v_cl.getProcessUnitID() == 0)
{std::cout << "Solved component " << i << " Error: " << serr.err_inf << std::endl;}
......@@ -665,7 +665,7 @@ template<typename vector, typename grid> void check_point_and_save(vector & part
grid & g_dvort,
size_t i)
{
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
if (v_cl.getProcessingUnits() < 24)
{
......@@ -775,7 +775,7 @@ int main(int argc, char* argv[])
Vector<double,PETSC_BASE> x_;
// Parallel object
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// print out the spacing of the grid
if (v_cl.getProcessUnitID() == 0)
......
......@@ -61,7 +61,7 @@ int main(int argc, char* argv[])
//! \cond [create] \endcond
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
long int N_prc = v_cl.getProcessingUnits();
//! \cond [create] \endcond
......
......@@ -39,7 +39,7 @@ int main(int argc, char* argv[])
//! \cond [initialization] \endcond
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
//! \cond [initialization] \endcond
......
......@@ -124,7 +124,7 @@ int main(int argc, char* argv[])
//! \cond [initialization] \endcond
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
//! \cond [initialization] \endcond
......
......@@ -34,7 +34,7 @@ int main(int argc, char* argv[])
//! \cond [Initialization and parameters] \endcond
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// we will place the particles on a grid like way with 128 particles on each direction
size_t sz[3] = {128,128,128};
......
......@@ -5,6 +5,7 @@ CC=nvcc #${CC_SCOREP}
CC_MPI=mpic++
LDIR =
OPT=
OBJ_GPU = main_gpu.o
OBJ_CPU = main_cpu.o
......@@ -12,14 +13,17 @@ OBJ_CPU_BEST = main_cpu_best.o
all: md_dyn_gpu md_dyn_cpu md_dyn_cpu_best
md_dyn_gpu_test: OPT += -DTEST_RUN
md_dyn_gpu_test: all
%.o: %.cu
$(CC) -O3 -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
$(CC) $(OPT) -O3 -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
%.o: %.cpp
$(CC_MPI) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
$(CC_MPI) $(OPT) -O3 -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
md_dyn_gpu: $(OBJ_GPU)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH_NVCC) $(LIBS) -L/home/i-bird/MPI/lib -L/usr/local/cuda/lib64 -lcudart -lmpi -L/usr/local/cuda/extras/CUPTI/lib64 -lhdf5
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS) -L/home/i-bird/MPI/lib -L/usr/local/cuda/lib64 -lcudart -lmpi -L/usr/local/cuda/extras/CUPTI/lib64 -lhdf5
md_dyn_cpu: $(OBJ_CPU)
$(CC_MPI) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
......@@ -27,7 +31,7 @@ md_dyn_cpu: $(OBJ_CPU)
md_dyn_cpu_best: $(OBJ_CPU_BEST)
$(CC_MPI) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
run: all
run: md_dyn_gpu_test
mpirun -np 3 ./md_dyn_gpu && mpirun -np 3 ./md_dyn_cpu && mpirun -np 3 ./md_dyn_cpu_best;
.PHONY: clean all run
......
......@@ -10,7 +10,7 @@ OBJ_SER = main_ser.o
all: vect_cp vect_ser
%.o: %.cpp
$(CC) -O0 -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
$(CC) -O3 -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
vect_cp: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS_PATH) $(LIBS)
......
......@@ -284,7 +284,7 @@ int main(int argc, char* argv[])
size_t fg = vd.size_local();
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
if (v_cl.getProcessUnitID() == 0)
{
for ( ; fg < vd.size_local()+4 ; fg++)
......
......@@ -504,7 +504,7 @@ int main(int argc, char* argv[])
size_t fg = vd.size_local();
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// Only the master processor print
if (v_cl.getProcessUnitID() == 0)
......
......@@ -43,7 +43,7 @@ int main(int argc, char* argv[])
openfpm_init(&argc,&argv);
// Vcluster for general usage
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// The domain
Box<3,float> box({0.0,0.0,0.0},{1.0,1.0,1.0});
......
......@@ -235,7 +235,7 @@ int main(int argc, char* argv[])
openfpm::vector<openfpm::vector<double>> y;
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// we will use it do place particles on a 40x40x40 Grid like
size_t sz[3] = {40,40,40};
......
......@@ -50,7 +50,7 @@ int main(int argc, char* argv[])
openfpm::vector<openfpm::vector<double>> y;
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// we will use it do place particles on a 10x10x10 Grid like
size_t sz[3] = {40,40,40};
......
......@@ -284,7 +284,7 @@ int main(int argc, char* argv[])
openfpm::vector<openfpm::vector<double>> y;
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// we will use it do place particles on a 10x10x10 Grid like
size_t sz[3] = {10,10,10};
......
......@@ -357,7 +357,7 @@ int main(int argc, char* argv[])
openfpm::vector<openfpm::vector<double>> y;
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
// we will use it do place particles on a 10x10x10 Grid like
size_t sz[3] = {10,10,10};
......
......@@ -12,7 +12,7 @@ sph_dlb_test: OPT += -DTEST_RUN
sph_dlb_test: sph_dlb
%.o: %.cu
nvcc -O3 -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
nvcc -O3 $(OPT) -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
%.o: %.cpp
$(CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
......
......@@ -438,7 +438,7 @@ template<typename CellList> inline void calc_forces(particles & vd, CellList & N
calc_forces_gpu<<<part.wthr,part.thr>>>(vd.toKernel(),NN.toKernel(),W_dap,cbar);
max_visc = reduce<red,_max_>(vd);
max_visc = reduce_local<red,_max_>(vd);
}
template<typename vector_type>
......@@ -460,8 +460,8 @@ void max_acceleration_and_velocity(particles & vd, real_number & max_acc, real_n
max_acceleration_and_velocity_gpu<<<part.wthr,part.thr>>>(vd.toKernel());
max_acc = reduce<red,_max_>(vd);
max_vel = reduce<red2,_max_>(vd);
max_acc = reduce_local<red,_max_>(vd);
max_vel = reduce_local<red2,_max_>(vd);
Vcluster<> & v_cl = create_vcluster();
v_cl.max(max_acc);
......
......@@ -12,7 +12,7 @@ sph_dlb_test: OPT += -DTEST_RUN
sph_dlb_test: sph_dlb
%.o: %.cu
nvcc -O3 -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
nvcc -O3 $(OPT) -g -c -isystem=/home/i-bird/MPI/include --std=c++11 -o $@ $< $(INCLUDE_PATH_NVCC)
%.o: %.cpp
$(CC) -O3 $(OPT) -g -c --std=c++11 -o $@ $< $(INCLUDE_PATH)
......
......@@ -641,7 +641,7 @@ void max_acceleration_and_velocity(particles & vd, double & max_acc, double & ma
max_acc = sqrt(max_acc);
max_vel = sqrt(max_vel);
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
v_cl.max(max_acc);
v_cl.max(max_vel);
v_cl.execute();
......@@ -757,7 +757,7 @@ void verlet_int(particles & vd, double dt, double & max_disp)
/*! \cond [max_across_proc] \endcond */
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
v_cl.max(max_disp);
v_cl.execute();
......@@ -848,7 +848,7 @@ void euler_int(particles & vd, double dt, double & max_disp)
++part;
}
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
v_cl.max(max_disp);
v_cl.execute();
......@@ -1040,7 +1040,7 @@ int main(int argc, char* argv[])
double max_disp;
while (t <= t_end)
{
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
timer it_time;
/*! \cond [update_verlet] \endcond */
......
......@@ -194,7 +194,7 @@ int main(int argc, char* argv[])
#endif
double mu = 0.5;
double max_vel;
Vcluster & v_cl = create_vcluster();
Vcluster<> & v_cl = create_vcluster();
Box<3,double> domain({0.0,0.0,0.0},{17.04,6.0,6.6});
Ghost<3,double> g(cutoff + skin);
......
openfpm_numerics @ 1f2e7ab7
Subproject commit e9a2083b6c4d9ce84519bc8163fbff032db4ff1c
Subproject commit 1f2e7ab78f971a280cdeba27105beeafd88c7ab1
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