Commit f630c5cb authored by incardon's avatar incardon
Browse files

Nerging with master

parents ee9b1c3f 14dae8cc
Pipeline #3044 failed with stages
in 1 minute and 35 seconds
......@@ -20,9 +20,14 @@ set(OPENFPM_PDATA_DIR CACHE PATH "OpenFPM_pdata dirs")
set(PETSC_ROOT CACHE PATH "If compiling with linear algebra indicate the PETSC root directory")
set(ENV{PETSC_DIR} ${PETSC_ROOT})
if (ENABLE_GPU)
set(CUDA_ON_CPU OFF)
enable_language(CUDA)
find_package(CUDA)
endif()
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CUDA_STANDARD 11)
set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CUDA_STANDARD 14)
if(NOT TINYOBJLOADER_FOUND)
set(TINYOBJLOADER_ROOT CACHE PATH "TinyObjLoader library path")
......@@ -31,28 +36,7 @@ endif()
set(ENV{PATH} "$ENV{PATH}:${HDF5_ROOT}/bin")
set(HDF5_PREFER_PARALLEL TRUE)
if(ENABLE_GPU)
enable_language(CUDA)
find_package(CUDA)
if (CUDA_VERSION_MAJOR EQUAL 9 AND CUDA_VERSION_MINOR EQUAL 2)
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=611 --diag_suppress=2885 --diag_suppress=2886 --diag_suppress=2887 --diag_suppress=2888 --diag_suppress=186 --diag_suppress=111 " --expt-extended-lambda)
elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 1 )
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=2915 --diag_suppress=2912 --diag_suppress=2913 --diag_suppress=111 --diag_suppress=186 --diag_suppress=611 " --expt-extended-lambda)
elseif ( CUDA_VERSION_MAJOR EQUAL 10 AND CUDA_VERSION_MINOR EQUAL 2 )
message("CUDA is compatible")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=2977 --diag_suppress=2976 --diag_suppress=2979 --diag_suppress=186" --expt-extended-lambda)
elseif ( CUDA_VERSION_MAJOR EQUAL 11 AND CUDA_VERSION_MINOR EQUAL 0 )
message("CUDA is compatible 11.0")
set(WARNING_SUPPRESSION_AND_OPTION_NVCC -Xcudafe "--display_error_number --diag_suppress=3059 --diag_suppress=3058 --diag_suppress=3057 --diag_suppress=3056 --diag_suppress=611 --diag_suppress=186" --expt-extended-lambda)
else()
message(FATAL_ERROR "CUDA is incompatible, version 9.2 10.1 and 10.2 is only supported")
endif()
endif()
find_package(Boost 1.66.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options)
find_package(Boost 1.72.0 REQUIRED COMPONENTS unit_test_framework iostreams program_options OPTIONAL_COMPONENTS fiber context)
find_package(MPI REQUIRED)
find_package(HDF5 REQUIRED)
find_package(TinyObjLoader)
......@@ -89,10 +73,19 @@ if(PETSC_FOUND)
endif()
if (Boost_FOUND)
set(DEFINE_HAVE_BOOST "#define HAVE_BOOST")
set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS")
set(DEFINE_HAVE_BOOST_PROGRAM_OPTIONS "#define HAVE_BOOST_PROGRAM_OPTIONS")
set(DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK")
set(DEFINE_HAVE_BOOST "#define HAVE_BOOST")
set(DEFINE_HAVE_BOOST_IOSTREAMS "#define HAVE_BOOST_IOSTREAMS")
set(DEFINE_HAVE_BOOST_PROGRAM_OPTIONS "#define HAVE_BOOST_PROGRAM_OPTIONS")
set(DEFINE_HAVE_BOOST_UNIT_TEST_FRAMEWORK "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK")
if (Boost_CONTEXT_FOUND)
set(DEFINE_HAVE_BOOST_CONTEXT "#define HAVE_BOOST_CONTEXT")
else()
#if context is not there CUDA_ON_CPU cannot be activated
set(CUDA_ON_CPU OFF)
endif()
if (Boost_FIBER_FOUND)
set(DEFINE_HAVE_BOOST_FIBER "#define HAVE_BOOST_FIBER")
endif()
else()
message( FATAL_ERROR "BOOST is required in order to install OpenFPM" )
endif()
......@@ -115,5 +108,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config/config_cmake.h.in ${CMAKE_
include_directories(SYSTEM ${MPI_INCLUDE_PATH})
add_subdirectory (../openfpm_vcluster openfpm_vcluster)
set(WARNING_SUPPRESSION_AND_OPTION_NVCC ${WARNING_SUPPRESSION_AND_OPTION_NVCC} PARENT_SCOPE)
set(WARNING_SUPPRESSION_AND_OPTION_NVCC_TEXT ${WARNING_SUPPRESSION_AND_OPTION_NVCC_TEXT} PARENT_SCOPE)
add_subdirectory (src)
......@@ -36,19 +36,27 @@ cd ..
cd "$1/openfpm_io"
#rm -rf $HOME/openfpm_dependencies/openfpm_io/$branch/MPI
#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
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
./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_VCDEVEL.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4 gcc g++
fi
if [ x"$hostname" == x"cifarm-ubuntu-node" ]; then
./install_MPI_mpich.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
export PATH="$HOME/openfpm_dependencies/openfpm_io/$branch/MPI/bin/:$PATH"
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
./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_VCDEVEL.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4 gcc g++
fi
if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de" ]; then
......@@ -57,6 +65,8 @@ if [ x"$hostname" == x"cifarm-mac-node.mpi-cbg.de" ]; then
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
./install_LIBHILBERT.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4
./install_VCDEVEL.sh $HOME/openfpm_dependencies/openfpm_io/$branch/ 4 gcc g++
fi
# Go in the right branch
......@@ -64,22 +74,8 @@ fi
echo "Compiling on $2"
sh ./autogen.sh
if [ "$2" == "master" ]
then
sh ./configure CXX=mpic++ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc --disable-gpu
elif [ "$2" == "gin" ]
then
module load gcc/4.8.2
module load boost/1.54.0
sh ./configure CXX=mpic++ --with-boost=/sw/apps/boost/1.54.0/ --with-hdf5=$HOME/$3/HDF5/bin/h5pcc
else
sh ./configure CXX=mpic++ --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/
fi
sh ./configure CXX=mpic++ --with-vcdevel=$HOME/openfpm_dependencies/openfpm_io/$branch/VCDEVEL --with-libhilbert=$HOME/openfpm_dependencies/openfpm_io/$branch/LIBHILBERT --with-hdf5=$HOME/openfpm_dependencies/openfpm_io/$branch/HDF5 --with-boost=$HOME/openfpm_dependencies/openfpm_io/$branch/BOOST --with-pdata=../../openfpm_pdata/ --enable-cuda-on-cpu
make VERBOSE=1 -j 4
if [ $? -ne 0 ]; then
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\" , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to compile the openfpm_io test \" }] }" https://hooks.slack.com/services/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
exit 1 ;
fi
#!/bin/sh
#!/bin/bash
# configure script
#
#
# Because we moved to cmake this script emulate the configure script from autotools
conf_options=
ld_lib_pathopt=
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
......@@ -99,12 +100,15 @@ enable_debug
with_metis
with_hdf5
with_libhilbert
enable_cuda_on_cpu
enable_scan_coverty
enable_test_performance
enable_test_coverage
with_parmetis
enable_se_class1
enable_se_class2
enable_se_class3
with_alpaka
with_action_on_error
with_boost
with_boost_libdir
......@@ -116,7 +120,9 @@ with_lapack
with_suitesparse
with_petsc
with_eigen
with_vcdevel
enable_gpu
enable_asan
'
rm -rf build
......@@ -124,6 +130,8 @@ if [ ! -d "build" ]; then
mkdir build
fi
echo "/usr/local" > install_dir
##### Go over all options
for ac_option
do
......@@ -219,12 +227,24 @@ do
se_class1)
conf_options="$conf_options -DSE_CLASS1=ON"
;;
se_class2)
conf_options="$conf_options -DSE_CLASS2=ON"
;;
se_class3)
conf_options="$conf_options -DSE_CLASS3=ON"
;;
test_coverage)
conf_options="$conf_options -DTEST_COVERAGE=ON"
;;
scan_coverty)
conf_options="$conf_options -DSCAN_COVERTY=ON"
;;
cuda_on_cpu)
conf_options="$conf_options -DCUDA_ON_CPU=ON"
;;
test_performance)
conf_options="$conf_options -DTEST_PERFORMANCE=ON"
;;
gpu)
if [ x"$CXX" == x"" ]; then
conf_options="$conf_options"
......@@ -233,6 +253,9 @@ do
fi
conf_options="$conf_options -DENABLE_GPU=ON"
;;
asan)
conf_options="$conf_options -DENABLE_ASAN=ON"
;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', '
;;
......@@ -458,16 +481,26 @@ do
;;
suitesparse)
conf_options="$conf_options -DSUITESPARSE_ROOT=$ac_optarg"
ld_lib_pathopt=$ac_optarg/lib
;;
eigen)
conf_options="$conf_options -DEIGEN3_ROOT=$ac_optarg"
;;
boost)
conf_options="$conf_options -DBOOST_ROOT=$ac_optarg"
conf_options="$conf_options -DBOOST_ROOT=$ac_optarg -DBoost_NO_BOOST_CMAKE=ON"
;;
action_on_error)
conf_options="$conf_options -DACTION_ON_ERROR=$ac_optarg"
;;
mpivendor)
conf_options="$conf_options -DMPI_VENDOR=$ac_optarg"
;;
vcdevel)
conf_options="$conf_options -DVc_ROOT=$ac_optarg"
;;
alpaka)
conf_options="$conf_options -DALPAKA_ROOT=$ac_optarg"
;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
......@@ -541,7 +574,7 @@ cd build
## remove enerything
echo "Calling cmake ../. $conf_options"
rm ../error_code
cmake ../. $conf_options
DYLD_LIBRARY_PATH=$ld_lib_pathopt cmake ../. $conf_options
if [ $? != 0 ]; then
#ok something went wrong the install script analyze the return code to potentially fix the problem automatically
# Read the error code and exit with that
......
......@@ -7,9 +7,9 @@ if [ -d "$1/BOOST" ]; then
exit 0
fi
wget http://ppmcore.mpi-cbg.de/upload/boost_1_68_0.tar.bz2
tar -xvf boost_1_68_0.tar.bz2
cd boost_1_68_0
wget http://ppmcore.mpi-cbg.de/upload/boost_1_72_0.tar.bz2
tar -xvf boost_1_72_0.tar.bz2
cd boost_1_72_0
if [ x"$4" != x"" ]; then
if [ -f $HOME/user-config.jam ]; then
mv $HOME/user-config.jam $HOME/user-config.jam_bck
......@@ -23,10 +23,10 @@ fi
./bootstrap.sh --with-toolset=$3
mkdir $1/BOOST
./b2 -j $2 install --prefix=$1/BOOST
rm -rf boost_1_68_0
rm -rf boost_1_72_0
if [ -f $HOME/user-config.jam_bck ]; then
mv $HOME/user-config.jam_bck $HOME/user-config.jam
fi
rm -rf boost_1_68_0.tar.bz2
rm -rf boost_1_72_0.tar.bz2
......@@ -24,7 +24,7 @@ if [ ! -d "$1/ZLIB" -a x"$platform" != x"cygwin" ]; then
CC=mpicc ./configure --prefix=$1/ZLIB
make -j $2
cd ..
if [ $? -eq 0 ]; then
make check install
else
......@@ -37,9 +37,9 @@ else
fi
### 1.8.19 does not compile on CYGWIN
wget http://ppmcore.mpi-cbg.de/upload/hdf5-1.8.19.tar.gz
tar -xf hdf5-1.8.19.tar.gz
cd hdf5-1.8.19
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
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 1 > $1/HDF5/version
echo 2 > $1/HDF5/version
#! /bin/bash
# check if the directory $1/HDF5 exist
if [ -d "$1/LIBHILBERT" ]; then
echo "LIBHILBERT already installed"
exit 0
fi
wget http://ppmcore.mpi-cbg.de/upload/libhilbert-master.tar.gz
rm -rf libhilbert-master
tar -xf libhilbert-master.tar.gz
cd libhilbert-master
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1/LIBHILBERT ..
make all
make install
#! /bin/bash
# check if the directory $1/VCDEVEL exist
if [ -d "$1/VCDEVEL" -a -f "$1/VCDEVEL/include/Vc/Vc" ]; then
echo "VCDEVEL already installed"
exit 0
fi
wget http://ppmcore.mpi-cbg.de/upload/Vc-1.4.1.tar.gz
#rm -rf Vc
tar -xf Vc-1.4.1.tar.gz
cd Vc-1.4.1
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=$1/VCDEVEL -DCMAKE_C_COMPILER=$3 -DCMAKE_CXX_COMPILER=$4 ..
make
make install
......@@ -2,14 +2,18 @@ cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
########################### Executables
if (CUDA_ON_CPU)
add_definitions(-DCUDA_ON_CPU)
endif()
add_executable(io main.cpp
MetaParser/MetaParser_unit_test.cpp
HDF5_wr/HDF5_writer_cuda.cu
ObjReader/ObjReader_unit_test.cpp
../../openfpm_vcluster/src/VCluster/VCluster.cpp
../../openfpm_devices/src/memory/CudaMemory.cu
../../openfpm_devices/src/memory/HeapMemory.cpp
../../openfpm_devices/src/memory/PtrMemory.cpp)
ObjReader/ObjReader_unit_test.cpp)
add_dependencies(io ofpmmemory)
add_dependencies(io vcluster)
if ( CMAKE_COMPILER_IS_GNUCC )
target_compile_options(io PRIVATE "-Wno-deprecated-declarations")
......@@ -18,10 +22,13 @@ if ( CMAKE_COMPILER_IS_GNUCC )
endif()
endif()
if (CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
add_definitions(-D__STRICT_ANSI__)
endif()
###########################
if (CUDA_FOUND)
target_compile_options(io PUBLIC $<$<COMPILE_LANGUAGE:CUDA>: ${WARNING_SUPPRESSION_AND_OPTION_NVCC} >)
target_include_directories (io PUBLIC ${MPI_C_INCLUDE_DIRS})
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 )
......@@ -44,6 +51,7 @@ target_include_directories (io PUBLIC ${HDF5_ROOT}/include)
target_include_directories (io PUBLIC ${TINYOBJLOADER_INCLUDE_DIRS} )
target_include_directories (io PUBLIC ${Boost_INCLUDE_DIRS})
target_include_directories (io PUBLIC ${OPENFPM_PDATA_DIR}/src)
target_include_directories (io PUBLIC ${ALPAKA_ROOT}/include)
if (PETSC_FOUND)
target_include_directories(io PUBLIC ${PETSC_INCLUDES})
......@@ -52,6 +60,8 @@ endif()
target_link_libraries(io ${Boost_LIBRARIES})
target_link_libraries(io ${HDF5_LIBRARIES})
target_link_libraries(io ${TINYOBJLOADER_LIBRARIES} )
target_link_libraries(io vcluster)
target_link_libraries(io ofpmmemory)
if (PETSC_FOUND)
target_link_libraries(io ${PETSC_LIBRARIES})
endif()
......@@ -68,18 +78,22 @@ endif()
install(FILES RawReader/RawReader.hpp
RawReader/RawReader_unit_tests.hpp
DESTINATION openfpm_io/include/RawReader )
DESTINATION openfpm_io/include/RawReader
COMPONENT OpenFPM)
install(FILES CSVWriter/csv_multiarray.hpp
CSVWriter/CSVWriter.hpp
CSVWriter/is_csv_writable.hpp
DESTINATION openfpm_io/include/CSVWriter/ )
DESTINATION openfpm_io/include/CSVWriter/
COMPONENT OpenFPM)
install(FILES GraphMLWriter/GraphMLWriter.hpp
DESTINATION openfpm_io/include/GraphMLWriter )
DESTINATION openfpm_io/include/GraphMLWriter
COMPONENT OpenFPM)
install(FILES util/util.hpp util/GBoxes.hpp
DESTINATION openfpm_io/include/util )
DESTINATION openfpm_io/include/util
COMPONENT OpenFPM)
install(FILES VTKWriter/VTKWriter.hpp
VTKWriter/byteswap_portable.hpp
......@@ -91,10 +105,12 @@ install(FILES VTKWriter/VTKWriter.hpp
VTKWriter/VTKWriter_grids_util.hpp
VTKWriter/VTKWriter_vector_box.hpp
VTKWriter/is_vtk_writable.hpp
DESTINATION openfpm_io/include/VTKWriter/ )
DESTINATION openfpm_io/include/VTKWriter/
COMPONENT OpenFPM)
install(FILES MetaParser/MetaParser.hpp
DESTINATION openfpm_io/include/MetaParser/ )
DESTINATION openfpm_io/include/MetaParser/
COMPONENT OpenFPM)
install(FILES HDF5_wr/HDF5_wr.hpp
HDF5_wr/HDF5_writer.hpp
......@@ -103,16 +119,20 @@ install(FILES HDF5_wr/HDF5_wr.hpp
HDF5_wr/HDF5_reader_gd.hpp
HDF5_wr/HDF5_reader.hpp
HDF5_wr/HDF5_reader_vd.hpp
DESTINATION openfpm_io/include/HDF5_wr)
DESTINATION openfpm_io/include/HDF5_wr
COMPONENT OpenFPM)
install(FILES RawReader/InitGridWithPixel.hpp
DESTINATION openfpm_io/include/RawReader/)
DESTINATION openfpm_io/include/RawReader/
COMPONENT OpenFPM)
install(FILES util/PathsAndFiles.hpp
DESTINATION openfpm_io/include/util)
DESTINATION openfpm_io/include/util
COMPONENT OpenFPM)
install(FILES Plot/GoogleChart.hpp Plot/util.hpp
DESTINATION openfpm_io/include/Plot )
DESTINATION openfpm_io/include/Plot
COMPONENT OpenFPM)
#if(BUILD_TESTING)
......
......@@ -14,7 +14,7 @@
#include <string>
#include <vector>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <boost/program_options.hpp>
#include <boost/tokenizer.hpp>
......
......@@ -129,7 +129,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 = 1; d < grid_type::dims; d++)
for (size_t d = 0; d < grid_type::dims; d++)
{
gkey.set_d(d, std::round(gkey.get(d) / refinement[d]));
}
......
......@@ -611,6 +611,7 @@ public:
template<typename Graph, unsigned int i>
class prop_output<false, Graph, i>
{
public:
/*! \brief Return the point data section for a graph g
*
* \param g graph
......@@ -774,7 +775,7 @@ class prop_output<false, Graph, i>
*/
static std::string get_attributes_vertex()
{
return Graph::V_type::attributes::name[i];
return std::string("attr" + std::to_string(i));
}
/*! \brief Get the attributes name for edge
......@@ -784,7 +785,7 @@ class prop_output<false, Graph, i>
*/
static std::string get_attributes_edge()
{
return Graph::E_type::attributes::name[i];
return std::string("attr" + std::to_string(i));
}
};
......
......@@ -257,14 +257,13 @@ class VTKWriter<pair,VECTOR_POINTS>
return v_out;
}
/*! \brief It get the vertex properties list
/*! \brief It get the point position header string
*
* It get the vertex properties list of the vertex defined as a VTK header
* It get the vertex position header of the vertex defined as a VTK header
*
* \return a string that define the vertex properties in graphML format
* \return a string that define the vertex position format
*
*/
std::string get_point_properties_list(file_type ft)
{
//! vertex property output string
......@@ -272,7 +271,7 @@ class VTKWriter<pair,VECTOR_POINTS>
// write the number of vertex
v_out += " <Piece NumberOfPoints=\"" + std::to_string(get_total()) + "\" " +"NumberOfVerts=\"" + std::to_string(get_total()) + "\">\n";// + getType<typename pair::first::value_type::coord_type>() + "\n";
v_out += " <Piece NumberOfPoints=\"" + std::to_string(get_total()) + "\" " +"NumberOfVerts=\"" + std::to_string(get_total()) + "\">\n";
// return the vertex properties string
return v_out;
......
......@@ -1118,6 +1118,54 @@ BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_properties )
}
}
BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_check_out_precision )
{
Vcluster<> & v_cl = create_vcluster();
if (v_cl.getProcessUnitID() != 0)
return;
{
// Create 3 vectors with random particles
openfpm::vector<Point<3,double>> v1ps;
openfpm::vector<aggregate<float,double[3]>> v1pp;
// fill the vector with random data
v1ps.resize(100);
v1pp.resize(100);
for (size_t i = 0 ; i < v1ps.size(); i++)
{
v1ps.template get<0>(i)[0] = std::numeric_limits<double>::max();
v1ps.template get<0>(i)[1] = std::numeric_limits<double>::max();
v1ps.template get<0>(i)[2] = std::numeric_limits<double>::max();
v1pp.template get<0>(i) = std::numeric_limits<float>::max();
v1pp.template get<1>(i)[0] = std::numeric_limits<double>::max();
v1pp.template get<1>(i)[1] = std::numeric_limits<double>::max();
v1pp.template get<1>(i)[2] = std::numeric_limits<double>::max();
}
openfpm::vector<std::string> prop_names;
// Create a writer and write adding names to the properties
VTKWriter<boost::mpl::pair<openfpm::vector<Point<3,double>>,openfpm::vector<aggregate<float,double[3]>>>,VECTOR_POINTS> vtk_v;
vtk_v.add(v1ps,v1pp,75);
openfpm::vector<std::string> prp_names({"scalar","vector"});
vtk_v.write("vtk_points_with_prp_names_prec_check.vtk",prp_names);
#ifndef SE_CLASS3
// Check that match
bool test = compare("vtk_points_with_prp_names_prec_check.vtk","test_data/vtk_points_with_prp_names_prec_check_test.vtk");
BOOST_REQUIRE_EQUAL(test,true);
#endif
}
}
BOOST_AUTO_TEST_CASE( vtk_writer_use_point_set_binary )
{
Vcluster<> & v_cl = create_vcluster();
......
......@@ -16,6 +16,7 @@
#include <iostream>
#include <fstream>
#include <boost/filesystem.hpp>
#include "VCluster/VCluster.hpp"
/**@brief Gets the current working directory and returns path as string.
*
* @return Std::string of path to current working directory.
......
This diff is collapsed.
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