Commit dfcf0a2d authored by absingh's avatar absingh
Browse files

Merge remote-tracking branch 'origin/master' into FD_solver

# Conflicts:
#	src/VTKWriter/VTKWriter_grids_util.hpp
parents b2b9d762 49900f22
Pipeline #3678 passed with stages
in 5 minutes and 4 seconds
......@@ -39,9 +39,10 @@ cd "$1/openfpm_io"
#rm -rf $HOME/openfpm_dependencies/openfpm_io/$branch/HDF5
#rm -rf $HOME/openfpm_dependencies/openfpm_io/$branch/BOOST
if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de" ]; then
source /opt/rh/devtoolset-7/enable
./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_MPI.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
......@@ -50,7 +51,7 @@ if [ x"$hostname" == x"cifarm-centos-node.mpi-cbg.de" ]; then
fi
if [ x"$hostname" == x"cifarm-ubuntu-node" ]; then
./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_MPI.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
export PATH="/opt/bin:$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
......@@ -60,7 +61,7 @@ fi
if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de" ]; then
export PATH="/usr/local/bin:$PATH"
./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_MPI.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
./install_BOOST.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_HDF5.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
......
......@@ -37,9 +37,9 @@ else
fi
### 1.8.19 does not compile on CYGWIN
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.10.6.tar.gz
tar -xf hdf5-1.10.6.tar.gz
cd hdf5-1.10.6
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.10.7.tar.gz
tar -xf hdf5-1.10.7.tar.gz
cd hdf5-1.10.7
if [ x"$platform" != x"cygwin" ]; then
CC=mpicc ./configure --with-zlib=$1/ZLIB --enable-parallel --prefix=$1/HDF5
......@@ -54,4 +54,4 @@ if [ $? -ne 0 ]; then
echo "HDF5 error installing"
exit 0
fi
echo 2 > $1/HDF5/version
echo 3 > $1/HDF5/version
#!/bin/bash
# check if the directory $1/MPI exist
if [ -d "$1/MPI" ]; then
echo "MPI already installed"
exit 0
fi
./script/download_MPI.sh
cd openmpi-4.1.1
if [ -f ../mpi_add_options ]; then
mpi_options=$(cat ../mpi_add_options)
echo "Adding MPI options: $mpi_options"
fi
if [ x"$3" == x"1" ]; then
echo "Installing MPI with GPU support"
# Detect where is nvcc
cuda_location=$(dirname $(dirname $(which nvcc)) )
./configure --with-hwloc=internal --with-libevent=internal $mpi_options --with-cuda=$cuda_location --prefix=$1/MPI --enable-mpi-fortran=yes CC=$4 CXX=$5 F77=$6 FC=$7 $8
else
echo "Installing MPI without GPU support"
./configure --with-hwloc=internal --with-libevent=internal $mpi_options --prefix=$1/MPI --enable-mpi-fortran=yes CC=$4 CXX=$5 F77=$6 FC=$7 $8
fi
make -j $2
make install
# Mark the installation
echo 10 > $1/MPI/version
......@@ -6,11 +6,11 @@ if [ -d "$1/MPI" ]; then
echo "MPI already installed"
exit 0
fi
rm -rf mpich-3.3
rm mpich-3.3.tar.gz
wget http://ppmcore.mpi-cbg.de/upload/mpich-3.3.tar.gz
tar -xvf mpich-3.3.tar.gz
cd mpich-3.3
rm -rf mpich-3.4.2
rm mpich-3.4.2.tar.gz
wget http://ppmcore.mpi-cbg.de/upload/mpich-3.4.2.tar.gz
tar -xvf mpich-3.4.2.tar.gz
cd mpich-3.4.2
#
# --disable-mca-dso \
......@@ -28,10 +28,10 @@ cd mpich-3.3
if [ x"$6" == x"1" ]; then
echo "Installing MPI with GPU support"
./configure --prefix=$1/MPI --enable-fortran CC=$3 CXX=$4 F77=$5 FC=$5
./configure --prefix=$1/MPI --enable-fortran CC=$3 CXX=$4 F77=$5 FC=$5 FFLAGS=-fallow-argument-mismatch
else
echo "Installing MPI without GPU support"
./configure --prefix=$1/MPI --enable-fortran CC=$3 CXX=$4 F77=$5 FC=$5
./configure --prefix=$1/MPI --enable-fortran CC=$3 CXX=$4 F77=$5 FC=$5 FFLAGS=-fallow-argument-mismatch
fi
make -j $2
make install
......
#!/bin/bash
# check if the directory $1/MPI exist
rm -rf openmpi-4.1.1
rm openmpi-4.1.1.tar.gz
wget http://ppmcore.mpi-cbg.de/upload/openmpi-4.1.1.tar.gz
tar -xvf openmpi-4.1.1.tar.gz
......@@ -14,6 +14,20 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/csv_out_test.csv");
std::string c3 = std::string("openfpm_io/test_data/csv_out_unk_test.csv");
#else
std::string c2 = std::string("test_data/csv_out_test.csv");
std::string c3 = std::string("test_data/csv_out_unk_test.csv");
#endif
{
// Allocate a property vector
auto v_prp = allocate_openfpm_prp(16);
......@@ -34,7 +48,7 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
// Write the CSV
csv_writer.write("csv_out.csv",v_pos,v_prp);
bool test = compare("csv_out.csv","test_data/csv_out_test.csv");
bool test = compare("csv_out.csv",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -61,7 +75,7 @@ BOOST_AUTO_TEST_CASE( csv_writer_particles )
// In case of SE_CLASS3 enabled the number of properties change
#ifndef SE_CLASS3
bool test = compare("csv_out_unk.csv","test_data/csv_out_unk_test.csv");
bool test = compare("csv_out_unk.csv",c3);
BOOST_REQUIRE_EQUAL(true,test);
#endif
}
......
......@@ -87,6 +87,19 @@ BOOST_AUTO_TEST_CASE( graphml_writer_use)
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/test_graph2_test.graphml");
std::string c3 = std::string("openfpm_io/test_data/test_graph_test.graphml");
#else
std::string c2 = std::string("test_data/test_graph2_test.graphml");
std::string c3 = std::string("test_data/test_graph_test.graphml");
#endif
Graph_CSR<ne_cp,ne_cp> g_csr2;
// Add 4 vertex and connect
......@@ -124,7 +137,7 @@ BOOST_AUTO_TEST_CASE( graphml_writer_use)
// check that match
bool test = compare("test_graph2.graphml","test_data/test_graph2_test.graphml");
bool test = compare("test_graph2.graphml",c2);
BOOST_REQUIRE_EQUAL(true,test);
//! Create a graph
......@@ -148,7 +161,7 @@ BOOST_AUTO_TEST_CASE( graphml_writer_use)
// check that match
test = compare("test_graph.graphml","test_data/test_graph_test.graphml");
test = compare("test_graph.graphml",c3);
BOOST_REQUIRE_EQUAL(true,test);
}
......
......@@ -12,7 +12,7 @@
#include "hdf5.h"
BOOST_AUTO_TEST_SUITE( vd_hdf5_chckpnt_rstrt_test )
BOOST_AUTO_TEST_SUITE( vd_hdf5_chckpnt_rstrt_test_io )
// Dimensionality
const size_t dim = 3;
......@@ -76,6 +76,16 @@ BOOST_AUTO_TEST_CASE( vector_dist_hdf5_load_test )
{
Vcluster<> & v_cl = create_vcluster();
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/vector_dist_24.h5");
#else
std::string c2 = std::string("test_data/vector_dist_24.h5");
#endif
openfpm::vector<Point<3,float>> vpos;
openfpm::vector<aggregate<float[dim]>> vprp;
......@@ -84,7 +94,7 @@ BOOST_AUTO_TEST_CASE( vector_dist_hdf5_load_test )
size_t g_m = 0;
// Load the vector
h5.load("test_data/vector_dist_24.h5",vpos,vprp,g_m);
h5.load(c2,vpos,vprp,g_m);
/////////////////// Checking data ///////////////////////
......
......@@ -366,7 +366,7 @@ class GoogleChart
X & y,
Xs& ... xy)
{
if (low == x.get(counters[0]))
if (counters[0] < x.size() && low == x.get(counters[0]))
{
point[0] = y.get(counters[0]);
counters[0]++;
......
......@@ -21,6 +21,16 @@ BOOST_AUTO_TEST_CASE( google_chart_bar_string )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out_sc_test.html");
#else
std::string c2 = std::string("test_data/gc_out_sc_test.html");
#endif
//! [Producing an Histogram graph]
openfpm::vector<std::string> x;
......@@ -67,7 +77,7 @@ BOOST_AUTO_TEST_CASE( google_chart_bar_string )
//! [Producing an Histogram graph]
bool test = compare("gc_out_sc.html","test_data/gc_out_sc_test.html");
bool test = compare("gc_out_sc.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -79,6 +89,16 @@ BOOST_AUTO_TEST_CASE( google_chart )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out_test.html");
#else
std::string c2 = std::string("test_data/gc_out_test.html");
#endif
//! [Producing an Histogram graph]
openfpm::vector<std::string> x;
......@@ -124,7 +144,7 @@ BOOST_AUTO_TEST_CASE( google_chart )
//! [Producing an Histogram graph]
bool test = compare("gc_out.html","test_data/gc_out_test.html");
bool test = compare("gc_out.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -135,6 +155,16 @@ BOOST_AUTO_TEST_CASE( google_chart2 )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out2_test.html");
#else
std::string c2 = std::string("test_data/gc_out2_test.html");
#endif
openfpm::vector<std::string> x;
openfpm::vector<openfpm::vector<float>> y;
openfpm::vector<std::string> yn;
......@@ -173,7 +203,7 @@ BOOST_AUTO_TEST_CASE( google_chart2 )
cg.AddHistGraph(x,y,yn,options);
cg.write("gc_out2.html");
bool test = compare("gc_out2.html","test_data/gc_out2_test.html");
bool test = compare("gc_out2.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -184,6 +214,16 @@ BOOST_AUTO_TEST_CASE( google_chart3 )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out3_test.html");
#else
std::string c2 = std::string("test_data/gc_out3_test.html");
#endif
openfpm::vector<std::string> x;
openfpm::vector<openfpm::vector<float>> y;
openfpm::vector<std::string> yn;
......@@ -221,7 +261,7 @@ BOOST_AUTO_TEST_CASE( google_chart3 )
cg.AddHistGraph(x,y,yn,options);
cg.write("gc_out3.html");
bool test = compare("gc_out3.html","test_data/gc_out3_test.html");
bool test = compare("gc_out3.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -232,6 +272,16 @@ BOOST_AUTO_TEST_CASE( google_chart4 )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out4_test.html");
#else
std::string c2 = std::string("test_data/gc_out4_test.html");
#endif
openfpm::vector<std::string> x;
openfpm::vector<openfpm::vector<float>> y;
openfpm::vector<std::string> yn;
......@@ -262,7 +312,7 @@ BOOST_AUTO_TEST_CASE( google_chart4 )
cg.AddHistGraph(x,y,yn);
cg.write("gc_out4.html");
bool test = compare("gc_out4.html","test_data/gc_out4_test.html");
bool test = compare("gc_out4.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -273,6 +323,16 @@ BOOST_AUTO_TEST_CASE( google_chart5 )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out5_test.html");
#else
std::string c2 = std::string("test_data/gc_out5_test.html");
#endif
openfpm::vector<std::string> x;
openfpm::vector<openfpm::vector<float>> y;
......@@ -295,7 +355,7 @@ BOOST_AUTO_TEST_CASE( google_chart5 )
cg.AddHistGraph(x,y);
cg.write("gc_out5.html");
bool test = compare("gc_out5.html","test_data/gc_out5_test.html");
bool test = compare("gc_out5.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -306,6 +366,16 @@ BOOST_AUTO_TEST_CASE( google_chart6 )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out6_test.html");
#else
std::string c2 = std::string("test_data/gc_out6_test.html");
#endif
openfpm::vector<openfpm::vector<float>> y;
// Each colums can have multiple data-set
......@@ -320,7 +390,7 @@ BOOST_AUTO_TEST_CASE( google_chart6 )
cg.AddHistGraph(y);
cg.write("gc_out6.html");
bool test = compare("gc_out6.html","test_data/gc_out6_test.html");
bool test = compare("gc_out6.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -331,6 +401,16 @@ BOOST_AUTO_TEST_CASE( google_chart_with_inject_HTML )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_out7_test.html");
#else
std::string c2 = std::string("test_data/gc_out7_test.html");
#endif
//! [Producing a set of histograms graphs]
openfpm::vector<std::string> x;
......@@ -383,7 +463,7 @@ BOOST_AUTO_TEST_CASE( google_chart_with_inject_HTML )
//! [Producing a set of histograms graphs]
bool test = compare("gc_out7.html","test_data/gc_out7_test.html");
bool test = compare("gc_out7.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -394,6 +474,16 @@ BOOST_AUTO_TEST_CASE( google_chart_number )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_num_plot_test.html");
#else
std::string c2 = std::string("test_data/gc_num_plot_test.html");
#endif
//! [Producing a set of histograms graphs]
openfpm::vector<float> x;
......@@ -437,7 +527,7 @@ BOOST_AUTO_TEST_CASE( google_chart_number )
//! [Producing a set of histograms graphs]
bool test = compare("gc_num_plot.html","test_data/gc_num_plot_test.html");
bool test = compare("gc_num_plot.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -448,6 +538,16 @@ BOOST_AUTO_TEST_CASE( google_chart_number_lines_different_x )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_num_ydif_plot_test.html");
#else
std::string c2 = std::string("test_data/gc_num_ydif_plot_test.html");
#endif
//! [Producing a set of histograms graphs]
openfpm::vector<float> x1;
......@@ -503,7 +603,7 @@ BOOST_AUTO_TEST_CASE( google_chart_number_lines_different_x )
//! [Producing a set of histograms graphs]
bool test = compare("gc_num_ydif_plot.html","test_data/gc_num_ydif_plot_test.html");
bool test = compare("gc_num_ydif_plot.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -514,6 +614,16 @@ BOOST_AUTO_TEST_CASE( google_chart_linear_plot )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_plot_out_test.html");
#else
std::string c2 = std::string("test_data/gc_plot_out_test.html");
#endif
//! [Producing lines graph with style]
openfpm::vector<std::string> x;
......@@ -570,7 +680,7 @@ BOOST_AUTO_TEST_CASE( google_chart_linear_plot )
//! [Producing lines graph with style]
bool test = compare("gc_plot_out.html","test_data/gc_plot_out_test.html");
bool test = compare("gc_plot_out.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -581,6 +691,16 @@ BOOST_AUTO_TEST_CASE( google_chart_linear_plot2 )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
std::string c2 = std::string("openfpm_io/test_data/gc_plot2_out_test.html");
#else
std::string c2 = std::string("test_data/gc_plot2_out_test.html");
#endif
//! [Producing lines]
openfpm::vector<std::string> x;
......@@ -619,7 +739,7 @@ BOOST_AUTO_TEST_CASE( google_chart_linear_plot2 )
//! [Producing lines]
bool test = compare("gc_plot2_out.html","test_data/gc_plot2_out_test.html");
bool test = compare("gc_plot2_out.html",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......
......@@ -41,9 +41,9 @@ inline bool exists_test (const std::string& name) {
* #pixels per dimension.
* @return Std::vector containing the count of pixels for each dimension as it was read from the csv file.
*/
std::vector<size_t> get_size(const std::string & path_to_file)
std::vector<int> get_size(const std::string & path_to_file)
{
std::vector<size_t> stack_dimst_1d;
std::vector<int> stack_dimst_1d;
// check if file exists and stream input csv file
if(!exists_test(path_to_file)){
std::cout << "------------------------------------------------------------------------" << std::endl;
......@@ -67,7 +67,7 @@ std::vector<size_t> get_size(const std::string & path_to_file)
while ( getline(file, field) ) // 1 field per axis
{
std::istringstream iss(field);
size_t val;
int val;
iss >> val;
stack_dimst_1d.push_back(val); // add the #pixels for current axis to the array
}
......@@ -89,7 +89,7 @@ std::vector<size_t> get_size(const std::string & path_to_file)
* manually or loaded from a csv file before (see: #get_size())
*/
template <size_t Phi_0, typename grid_type>
void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <size_t> & stack_dims)
void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <int> & stack_dims)
{
constexpr size_t x = 0;
constexpr size_t y = 1;
......@@ -107,7 +107,7 @@ void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <
auto & v_cl = create_vcluster();
if (v_cl.rank() == 0)
{
for (size_t d = 0; d < grid_type::dims; d++)
for (int d = 0; d < grid_type::dims; d++)
{
std::cout << "# grid points in dimension " << d << " = " << grid.size(d) << std::endl;
}
......@@ -121,14 +121,14 @@ void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <
std::vector<BYTE> pixel_line; // one x-line of the image stack which will be read
size_t sz_img[grid_type::dims];
for (size_t d = 0; d < grid_type::dims; d++)
for (int d = 0; d < grid_type::dims; d++)
{
sz_img[d] = stack_dims[d];
}
grid_sm<grid_type::dims,void> ginfo_image(sz_img); // in order to get the image related key later on
double refinement[grid_type::dims];
for (size_t d = 0; d < grid_type::dims; d++)
for (int d = 0; d < grid_type::dims; d++)
{
refinement[d] = (double) grid.size(d) / (double)stack_dims[d]; // get the factor, by which the grid resolution differs from the image stack resolution
if (v_cl.rank() == 0) std::cout << "effective refinement in dimension " << d << " = " << refinement[d] << std::endl;
......@@ -141,7 +141,7 @@ void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <
// In case a patch starts within a group of nodes to which same pixel-value should be assigned, get the
// respective rest-offset
size_t rest_offset = (size_t) (fmod(gkey.get(0), refinement[x])); // get the remainder
int rest_offset = (int) (fmod(gkey.get(0), refinement[x])); // get the remainder
// get l as the length of one x-line of the original image stack for the specific patch on the processor
......@@ -154,7 +154,7 @@ void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <
// in case that the grid has a different resolution than the underlying image stack:
// create a key which is used to get the offset for the file reading
// the indices in this key are corrected by the refinement factor
for (size_t d = 0; d < grid_type::dims; d++)
for (int d = 0; d < grid_type::dims; d++)
{
gkey.set_d(d, floor(gkey.get(d) / refinement[d]));
}
......@@ -172,7 +172,7 @@ void load_pixel_onto_grid(grid_type & grid, std::string file_name, std::vector <
// run over a whole grid-line in x and assign pixel values from pixel_line to grid nodes
// if the grid is finer in x as the image stack, the same pixel value from pixel_line is
// assigned refinement[x] times
for (size_t k = 0; k < patch_size; ++k)