Commit 278a914a authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

VtkWriter boost::iostreams used instead of std::ofstream

parent 17738001
...@@ -51,32 +51,32 @@ build_old_libs=yes ...@@ -51,32 +51,32 @@ build_old_libs=yes
pic_mode=default pic_mode=default
# Whether or not to optimize for fast installation. # Whether or not to optimize for fast installation.
fast_install=needless fast_install=yes
# The host system. # The host system.
host_alias= host_alias=
host=x86_64-unknown-linux-gnu host=i686-redhat-linux-gnu
host_os=linux-gnu host_os=linux-gnu
# The build system. # The build system.
build_alias= build_alias=
build=x86_64-unknown-linux-gnu build=i686-redhat-linux-gnu
build_os=linux-gnu build_os=linux-gnu
# A sed program that does not truncate output. # A sed program that does not truncate output.
SED="/usr/bin/sed" SED="/bin/sed"
# Sed that helps us avoid accidentally triggering echo(1) options like -n. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="$SED -e 1s/^X//" Xsed="$SED -e 1s/^X//"
# A grep program that handles long lines. # A grep program that handles long lines.
GREP="/usr/bin/grep" GREP="/bin/grep"
# An ERE matcher. # An ERE matcher.
EGREP="/usr/bin/grep -E" EGREP="/bin/grep -E"
# A literal string matcher. # A literal string matcher.
FGREP="/usr/bin/grep -F" FGREP="/bin/grep -F"
# A BSD- or MS-compatible name lister. # A BSD- or MS-compatible name lister.
NM="/usr/bin/nm -B" NM="/usr/bin/nm -B"
...@@ -128,7 +128,7 @@ old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" ...@@ -128,7 +128,7 @@ old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
old_postuninstall_cmds="" old_postuninstall_cmds=""
# A C compiler. # A C compiler.
LTCC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc" LTCC="gcc"
# LTCC compiler flags. # LTCC compiler flags.
LTCFLAGS="-g -O2" LTCFLAGS="-g -O2"
...@@ -204,7 +204,7 @@ runpath_var=LD_RUN_PATH ...@@ -204,7 +204,7 @@ runpath_var=LD_RUN_PATH
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
# Is shlibpath searched before the hard-coded library search path? # Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=yes shlibpath_overrides_runpath=no
# Format of library name prefix. # Format of library name prefix.
libname_spec="lib\$name" libname_spec="lib\$name"
...@@ -233,10 +233,10 @@ finish_eval="" ...@@ -233,10 +233,10 @@ finish_eval=""
hardcode_into_libs=yes hardcode_into_libs=yes
# Compile-time system search path for libraries. # Compile-time system search path for libraries.
sys_lib_search_path_spec="/usr/lib64/gcc/x86_64-suse-linux/4.1.2 /usr/lib64 /lib64 /fastfs/wir/local/lib /usr/x86_64-suse-linux/lib" sys_lib_search_path_spec="/usr/lib/openmpi/1.4-gcc/lib /usr/lib /usr/lib/gcc/i386-redhat-linux/4.1.2 /lib"
# Run-time system search path for libraries. # Run-time system search path for libraries.
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib64/Xaw3d /usr/X11R6/lib64 /usr/X11R6/lib/Xaw3d /usr/X11R6/lib /usr/x86_64-suse-linux/lib /usr/local/lib64 /usr/local/lib /opt/kde3/lib64 /opt/kde3/lib /opt/gnome/lib64 /opt/gnome/lib /lib64 /lib /usr/lib64 /usr/lib /opt/cluster/intel/cce/9.1.042/lib /opt/cluster/intel/fce/9.1.036/lib /opt/cluster/Pathscale3.0/lib/2.9.99 /opt/cluster/Pathscale3.0/lib/2.9.99/32 /work/licsoft/compilers/pgi/linux86-64/6.2/lib /work/licsoft/compilers/pgi/linux86-64/6.2/libso " sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/mysql /usr/lib/octave-3.0.1 /usr/lib/qt-3.3/lib /usr/lib/qt4/lib /usr/lib/xulrunner-1.9.2 "
# Whether dlopen is supported. # Whether dlopen is supported.
dlopen_support=unknown dlopen_support=unknown
...@@ -253,13 +253,13 @@ striplib="strip --strip-unneeded" ...@@ -253,13 +253,13 @@ striplib="strip --strip-unneeded"
# The linker used to build libraries. # The linker used to build libraries.
LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64" LD="/usr/bin/ld"
# Commands used to build an old-style archive. # Commands used to build an old-style archive.
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
# A language specific compiler. # A language specific compiler.
CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicc" CC="gcc"
# Is the compiler the GNU compiler? # Is the compiler the GNU compiler?
with_gcc=yes with_gcc=yes
...@@ -274,7 +274,7 @@ wl="-Wl," ...@@ -274,7 +274,7 @@ wl="-Wl,"
pic_flag=" -fPIC -DPIC" pic_flag=" -fPIC -DPIC"
# Compiler flag to prevent dynamic linking. # Compiler flag to prevent dynamic linking.
link_static_flag="" link_static_flag="-static"
# Does compiler simultaneously support -c and -o options? # Does compiler simultaneously support -c and -o options?
compiler_c_o="yes" compiler_c_o="yes"
...@@ -8908,13 +8908,13 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ...@@ -8908,13 +8908,13 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
# ### BEGIN LIBTOOL TAG CONFIG: CXX # ### BEGIN LIBTOOL TAG CONFIG: CXX
# The linker used to build libraries. # The linker used to build libraries.
LD="/usr/x86_64-suse-linux/bin/ld -m elf_x86_64" LD="/usr/bin/ld"
# Commands used to build an old-style archive. # Commands used to build an old-style archive.
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
# A language specific compiler. # A language specific compiler.
CC="/licsoft/libraries/openmpi/1.2.6/64bit/bin/mpicxx" CC="g++"
# Is the compiler the GNU compiler? # Is the compiler the GNU compiler?
with_gcc=yes with_gcc=yes
...@@ -8929,7 +8929,7 @@ wl="-Wl," ...@@ -8929,7 +8929,7 @@ wl="-Wl,"
pic_flag=" -fPIC -DPIC" pic_flag=" -fPIC -DPIC"
# Compiler flag to prevent dynamic linking. # Compiler flag to prevent dynamic linking.
link_static_flag="" link_static_flag="-static"
# Does compiler simultaneously support -c and -o options? # Does compiler simultaneously support -c and -o options?
compiler_c_o="yes" compiler_c_o="yes"
...@@ -9039,17 +9039,17 @@ file_list_spec="" ...@@ -9039,17 +9039,17 @@ file_list_spec=""
hardcode_action=immediate hardcode_action=immediate
# The directories searched by this compiler when creating a shared library. # The directories searched by this compiler when creating a shared library.
compiler_lib_search_dirs="/usr/lib64 /licsoft/libraries/openmpi/1.2.6/64bit/lib /usr/lib64/gcc/x86_64-suse-linux/4.1.2 /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 /lib/../lib64 /usr/lib/../lib64 /fastfs/wir/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.." compiler_lib_search_dirs=". /usr/lib/openmpi/1.4-gcc/lib /usr/lib/openmpi/1.4-gcc/lib /usr/lib/gcc/i386-redhat-linux/4.1.2 /usr/lib/gcc/i386-redhat-linux/4.1.2 /usr/lib/gcc/i386-redhat-linux/4.1.2/../../.."
# Dependencies to place before and after the objects being linked to # Dependencies to place before and after the objects being linked to
# create a shared library. # create a shared library.
predep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crti.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtbeginS.o" predep_objects="/usr/lib/crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbeginS.o"
postdep_objects="/usr/lib64/gcc/x86_64-suse-linux/4.1.2/crtendS.o /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/crtn.o" postdep_objects="/usr/lib/gcc/i386-redhat-linux/4.1.2/crtendS.o /usr/lib/crtn.o"
predeps="" predeps=""
postdeps="-lmpi_cxx -lmpi -lopen-rte -lopen-pal -libverbs -lrt -lnuma -ldl -lnsl -lutil -ldl -lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s" postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
# The library search path used internally by the compiler when linking # The library search path used internally by the compiler when linking
# a shared library. # a shared library.
compiler_lib_search_path="-L/usr/lib64 -L/licsoft/libraries/openmpi/1.2.6/64bit/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2 -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/fastfs/wir/local/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/lib -L/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../.." compiler_lib_search_path="-L. -L/usr/lib/openmpi/1.4-gcc/lib -L/usr/lib/openmpi/1.4-gcc/lib -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.."
# ### END LIBTOOL TAG CONFIG: CXX # ### END LIBTOOL TAG CONFIG: CXX
...@@ -23,8 +23,6 @@ namespace AMDiS { ...@@ -23,8 +23,6 @@ namespace AMDiS {
{ {
FUNCNAME("VtkWriter::writeFile()"); FUNCNAME("VtkWriter::writeFile()");
#ifdef HAVE_BOOST
boost::iostreams::filtering_ostream file; boost::iostreams::filtering_ostream file;
switch (compress) { switch (compress) {
case GZIP: case GZIP:
...@@ -46,7 +44,7 @@ namespace AMDiS { ...@@ -46,7 +44,7 @@ namespace AMDiS {
file.push(boost::iostreams::file_descriptor_sink(name, std::ios::trunc)); file.push(boost::iostreams::file_descriptor_sink(name, std::ios::trunc));
writeFileToStream(file); writeFileToStream(file);
#else #if 0
std::ofstream file; std::ofstream file;
file.open(name.c_str()); file.open(name.c_str());
...@@ -63,8 +61,15 @@ namespace AMDiS { ...@@ -63,8 +61,15 @@ namespace AMDiS {
void VtkWriter::writeParallelFile(std::string name, int nRanks, void VtkWriter::writeParallelFile(std::string name, int nRanks,
std::string fnPrefix, std::string fnPostfix) std::string fnPrefix, std::string fnPostfix)
{ {
std::ofstream file; boost::iostreams::filtering_ostream file;
file.open(name.c_str()); {
//boost::iostreams seems not to truncate the file
std::ofstream swapfile(name.c_str(), std::ios::out | std::ios::trunc);
swapfile.close();
}
file.push(boost::iostreams::file_descriptor_sink(name, std::ios::trunc));
// std::ofstream file;
// file.open(name.c_str());
file << "<?xml version=\"1.0\"?>\n"; file << "<?xml version=\"1.0\"?>\n";
file << "<VTKFile type=\"PUnstructuredGrid\">\n"; file << "<VTKFile type=\"PUnstructuredGrid\">\n";
...@@ -98,7 +103,7 @@ namespace AMDiS { ...@@ -98,7 +103,7 @@ namespace AMDiS {
file << " </PUnstructuredGrid>\n"; file << " </PUnstructuredGrid>\n";
file << "</VTKFile>\n"; file << "</VTKFile>\n";
file.close(); // file.close();
} }
...@@ -109,8 +114,15 @@ namespace AMDiS { ...@@ -109,8 +114,15 @@ namespace AMDiS {
size_t found = valueFilename.find_last_of("/\\"); size_t found = valueFilename.find_last_of("/\\");
paraViewAnimationFrames->push_back(valueFilename.substr(found + 1)); paraViewAnimationFrames->push_back(valueFilename.substr(found + 1));
std::ofstream file; boost::iostreams::filtering_ostream file;
file.open(animationFilename.c_str()); {
//boost::iostreams seems not to truncate the file
std::ofstream swapfile(animationFilename.c_str(), std::ios::out | std::ios::trunc);
swapfile.close();
}
file.push(boost::iostreams::file_descriptor_sink(animationFilename, std::ios::trunc));
// std::ofstream file;
// file.open(animationFilename.c_str());
file << "<?xml version=\"1.0\"?>\n"; file << "<?xml version=\"1.0\"?>\n";
file << "<VTKFile type=\"Collection\" version=\"0.1\" >" << "\n"; file << "<VTKFile type=\"Collection\" version=\"0.1\" >" << "\n";
...@@ -128,7 +140,7 @@ namespace AMDiS { ...@@ -128,7 +140,7 @@ namespace AMDiS {
file << "</Collection>\n"; file << "</Collection>\n";
file << "</VTKFile>\n"; file << "</VTKFile>\n";
file.close(); // file.close();
return 0; return 0;
} }
......
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
#ifndef AMDIS_VTKWRITER_H #ifndef AMDIS_VTKWRITER_H
#define AMDIS_VTKWRITER_H #define AMDIS_VTKWRITER_H
#ifdef HAVE_BOOST
#include <boost/iostreams/filtering_stream.hpp> #include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/device/file_descriptor.hpp> #include <boost/iostreams/device/file_descriptor.hpp>
#include <boost/iostreams/filter/gzip.hpp> #include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filter/bzip2.hpp> #include <boost/iostreams/filter/bzip2.hpp>
#endif
#include <fstream> #include <fstream>
#include "BasisFunction.h" #include "BasisFunction.h"
...@@ -135,7 +133,6 @@ namespace AMDiS { ...@@ -135,7 +133,6 @@ namespace AMDiS {
template<typename T> template<typename T>
void writeConnectivity_dim2_degree4(T &file); void writeConnectivity_dim2_degree4(T &file);
#ifdef HAVE_BOOST
/// Writes a world coordinate to a given file. /// Writes a world coordinate to a given file.
inline void writeCoord(boost::iostreams::filtering_ostream &file, inline void writeCoord(boost::iostreams::filtering_ostream &file,
WorldVector<double> coord) WorldVector<double> coord)
...@@ -143,11 +140,10 @@ namespace AMDiS { ...@@ -143,11 +140,10 @@ namespace AMDiS {
for (int i = 0; i < Global::getGeo(WORLD); i++) for (int i = 0; i < Global::getGeo(WORLD); i++)
file << " " << std::scientific << coord[i]; file << " " << std::scientific << coord[i];
for (int i = Global::getGeo(WORLD); i < 3; i++) for (int i = Global::getGeo(WORLD); i < 3; i++)
file << " 0.0"; file << " "<<0.0;
file << "\n"; file << "\n";
} }
#endif
/// Writes a world coordinate to a given file. /// Writes a world coordinate to a given file.
inline void writeCoord(std::ofstream &file, WorldVector<double> coord) inline void writeCoord(std::ofstream &file, WorldVector<double> coord)
...@@ -155,7 +151,7 @@ namespace AMDiS { ...@@ -155,7 +151,7 @@ namespace AMDiS {
for (int i = 0; i < Global::getGeo(WORLD); i++) for (int i = 0; i < Global::getGeo(WORLD); i++)
file << " " << std::scientific << coord[i]; file << " " << std::scientific << coord[i];
for (int i = Global::getGeo(WORLD); i < 3; i++) for (int i = Global::getGeo(WORLD); i < 3; i++)
file << " 0.0"; file << " "<<0.0;
file << "\n"; file << "\n";
} }
......
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