Commit f88af630 authored by incardon's avatar incardon
Browse files

Adding changes for PDATA_FULL

parent 1e1eb139
......@@ -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 ///////////////////////
......
......@@ -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);
}
......
......@@ -20,13 +20,24 @@ BOOST_AUTO_TEST_CASE( raw_reader_read_test )
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/raw_read_sv_test.bin");
#else
std::string c2 = std::string("test_data/raw_read_sv_test.bin");
#endif
grid_cpu<3,aggregate<float,float[3]>> read_bin_test;
GridRawReader<3,aggregate<float,float[3]>,int> rr;
#ifndef SE_CLASS3
rr.read("test_data/raw_read_sv_test.bin",read_bin_test,FORTRAN_STYLE | STRUCT_OF_ARRAY,12);
rr.read(c2,read_bin_test,FORTRAN_STYLE | STRUCT_OF_ARRAY,12);
auto it = read_bin_test.getIterator();
......
......@@ -221,12 +221,23 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_graph3D )
// Write the VTK file
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/vtk_graph_v2_test.vtk");
#else
std::string c2 = std::string("test_data/vtk_graph_v2_test.vtk");
#endif
VTKWriter<Graph_CSR<vertex2,edge>,VTK_GRAPH> vtk(gr);
vtk.write("vtk_graph_v2.vtk");
// check that match
bool test = compare("vtk_graph_v2.vtk","test_data/vtk_graph_v2_test.vtk");
bool test = compare("vtk_graph_v2.vtk",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -304,12 +315,23 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_graph3D_edge )
// Write the VTK file
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/vtk_graph_v4_test.vtk");
#else
std::string c2 = std::string("test_data/vtk_graph_v4_test.vtk");
#endif
VTKWriter<Graph_CSR<vertex2,vertex2>,VTK_GRAPH> vtk(gr);
vtk.write("vtk_graph_v4.vtk");
// check that match
bool test = compare("vtk_graph_v4.vtk","test_data/vtk_graph_v4_test.vtk");
bool test = compare("vtk_graph_v4.vtk",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -396,12 +418,23 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_graph2D )
// Write the VTK file
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/vtk_graph_v3_test.vtk");
#else
std::string c2 = std::string("test_data/vtk_graph_v3_test.vtk");
#endif
VTKWriter<Graph_CSR<vertex3,edge>,VTK_GRAPH> vtk(gr);
vtk.write("vtk_graph_v3.vtk");
// check that match
bool test = compare("vtk_graph_v3.vtk","test_data/vtk_graph_v3_test.vtk");
bool test = compare("vtk_graph_v3.vtk",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -479,6 +512,17 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_graph)
gr.addEdge(7,3);
gr.addEdge(3,1);
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/vtk_graph_test.vtk");
#else
std::string c2 = std::string("test_data/vtk_graph_test.vtk");
#endif
// Write the VTK file
VTKWriter<Graph_CSR<vertex,edge>,VTK_GRAPH> vtk(gr);
......@@ -486,7 +530,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_graph)
// check that match
bool test = compare("vtk_graph.vtk","test_data/vtk_graph_test.vtk");
bool test = compare("vtk_graph.vtk",c2);
BOOST_REQUIRE_EQUAL(true,test);
}
......@@ -497,6 +541,21 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_vector_box)
if (v_cl.getProcessUnitID() != 0)
return;
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/vtk_box_test.vtk");
std::string c3 = std::string("openfpm_io/test_data/vtk_box_3D_test.vtk");
std::string c4 = std::string("openfpm_io/test_data/vtk_box_3D_2_test.vtk");
#else
std::string c2 = std::string("test_data/vtk_box_test.vtk");
std::string c3 = std::string("test_data/vtk_box_3D_test.vtk");
std::string c4 = std::string("test_data/vtk_box_3D_2_test.vtk");
#endif
// Create a vector of boxes
openfpm::vector<Box<2,float>> vb;
......@@ -513,7 +572,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_vector_box)
vtk_box.write("vtk_box.vtk");
// Check that match
bool test = compare("vtk_box.vtk","test_data/vtk_box_test.vtk");
bool test = compare("vtk_box.vtk",c2);
BOOST_REQUIRE_EQUAL(test,true);
// Create a vector of boxes
......@@ -532,7 +591,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_vector_box)
vtk_box2.write("vtk_box_3D.vtk");
// Check that match
test = compare("vtk_box_3D.vtk","test_data/vtk_box_3D_test.vtk");
test = compare("vtk_box_3D.vtk",c3);
BOOST_REQUIRE_EQUAL(test,true);
// Create a vector of boxes
......@@ -551,7 +610,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_vector_box)
vtk_box3.write("vtk_box_3D_2.vtk");
// Check that match
test = compare("vtk_box_3D_2.vtk","test_data/vtk_box_3D_2_test.vtk");
test = compare("vtk_box_3D_2.vtk",c4);
BOOST_REQUIRE_EQUAL(test,true);
}
......@@ -656,6 +715,25 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
if (v_cl.getProcessUnitID() != 0)
{return;}
#ifdef OPENFPM_PDATA
if (v_cl.rank() != 0) {return;}
std::string c2 = std::string("openfpm_io/test_data/vtk_grids_test_1d.vtk");
std::string c3 = std::string("openfpm_io/test_data/vtk_grids_test.vtk");
std::string c4 = std::string("openfpm_io/test_data/vtk_grids_st_test.vtk");
std::string c5 = std::string("openfpm_io/test_data/vtk_grids_prp_test.vtk");
std::string c6 = std::string("openfpm_io/test_data/vtk_grids_test.vtk");
#else
std::string c2 = std::string("test_data/vtk_grids_test_1d.vtk");
std::string c3 = std::string("test_data/vtk_grids_test.vtk");
std::string c4 = std::string("test_data/vtk_grids_st_test.vtk");
std::string c5 = std::string("test_data/vtk_grids_prp_test.vtk");
std::string c6 = std::string("test_data/vtk_grids_test.vtk");
#endif
{
// Create box grids
......@@ -705,7 +783,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_grids_1d.vtk","test_data/vtk_grids_test_1d.vtk");
bool test = compare("vtk_grids_1d.vtk",c2);
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -760,7 +838,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_grids.vtk","test_data/vtk_grids_test.vtk");
bool test = compare("vtk_grids.vtk",c3);
BOOST_REQUIRE_EQUAL(test,true);
#endif
......@@ -817,7 +895,7 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_grids)