Commit c5d5dff1 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Some small changes made by Simon.

parent 38040dce
...@@ -217,6 +217,7 @@ $(SOURCE_DIR)/SolutionDataStorage.h $(SOURCE_DIR)/SolutionDataStorage.hh \ ...@@ -217,6 +217,7 @@ $(SOURCE_DIR)/SolutionDataStorage.h $(SOURCE_DIR)/SolutionDataStorage.hh \
$(SOURCE_DIR)/InteriorBoundary.h $(SOURCE_DIR)/InteriorBoundary.cc \ $(SOURCE_DIR)/InteriorBoundary.h $(SOURCE_DIR)/InteriorBoundary.cc \
$(SOURCE_DIR)/ElementDofIteartor.h $(SOURCE_DIR)/ElementDofIterator.cc \ $(SOURCE_DIR)/ElementDofIteartor.h $(SOURCE_DIR)/ElementDofIterator.cc \
$(SOURCE_DIR)/Debug.h $(SOURCE_DIR)/Debug.cc \ $(SOURCE_DIR)/Debug.h $(SOURCE_DIR)/Debug.cc \
$(SOURCE_DIR)/MpiHelper.h $(SOURCE_DIR)/MpiHelper.cc \
$(SOURCE_DIR)/parareal/ProblemBase.h \ $(SOURCE_DIR)/parareal/ProblemBase.h \
$(SOURCE_DIR)/parareal/AdaptParaReal.h $(SOURCE_DIR)/parareal/AdaptParaReal.cc $(SOURCE_DIR)/parareal/AdaptParaReal.h $(SOURCE_DIR)/parareal/AdaptParaReal.cc
......
...@@ -226,7 +226,9 @@ am__libamdis_la_SOURCES_DIST = $(PARALLEL_DIR)/ParallelDomainBase.h \ ...@@ -226,7 +226,9 @@ am__libamdis_la_SOURCES_DIST = $(PARALLEL_DIR)/ParallelDomainBase.h \
$(SOURCE_DIR)/InteriorBoundary.cc \ $(SOURCE_DIR)/InteriorBoundary.cc \
$(SOURCE_DIR)/ElementDofIteartor.h \ $(SOURCE_DIR)/ElementDofIteartor.h \
$(SOURCE_DIR)/ElementDofIterator.cc $(SOURCE_DIR)/Debug.h \ $(SOURCE_DIR)/ElementDofIterator.cc $(SOURCE_DIR)/Debug.h \
$(SOURCE_DIR)/Debug.cc $(SOURCE_DIR)/parareal/ProblemBase.h \ $(SOURCE_DIR)/Debug.cc $(SOURCE_DIR)/MpiHelper.h \
$(SOURCE_DIR)/MpiHelper.cc \
$(SOURCE_DIR)/parareal/ProblemBase.h \
$(SOURCE_DIR)/parareal/AdaptParaReal.h \ $(SOURCE_DIR)/parareal/AdaptParaReal.h \
$(SOURCE_DIR)/parareal/AdaptParaReal.cc $(SOURCE_DIR)/parareal/AdaptParaReal.cc
@USE_PARALLEL_DOMAIN_AMDIS_TRUE@am__objects_1 = libamdis_la-ParallelDomainBase.lo \ @USE_PARALLEL_DOMAIN_AMDIS_TRUE@am__objects_1 = libamdis_la-ParallelDomainBase.lo \
...@@ -291,7 +293,7 @@ am_libamdis_la_OBJECTS = $(am__objects_2) libamdis_la-DOFIndexed.lo \ ...@@ -291,7 +293,7 @@ am_libamdis_la_OBJECTS = $(am__objects_2) libamdis_la-DOFIndexed.lo \
libamdis_la-DataCollector.lo libamdis_la-ScalableQuadrature.lo \ libamdis_la-DataCollector.lo libamdis_la-ScalableQuadrature.lo \
libamdis_la-SubElInfo.lo libamdis_la-InteriorBoundary.lo \ libamdis_la-SubElInfo.lo libamdis_la-InteriorBoundary.lo \
libamdis_la-ElementDofIterator.lo libamdis_la-Debug.lo \ libamdis_la-ElementDofIterator.lo libamdis_la-Debug.lo \
libamdis_la-AdaptParaReal.lo libamdis_la-MpiHelper.lo libamdis_la-AdaptParaReal.lo
libamdis_la_OBJECTS = $(am_libamdis_la_OBJECTS) libamdis_la_OBJECTS = $(am_libamdis_la_OBJECTS)
libcompositeFEM_la_LIBADD = libcompositeFEM_la_LIBADD =
am_libcompositeFEM_la_OBJECTS = libcompositeFEM_la-CFE_Integration.lo \ am_libcompositeFEM_la_OBJECTS = libcompositeFEM_la-CFE_Integration.lo \
...@@ -631,6 +633,7 @@ $(SOURCE_DIR)/SolutionDataStorage.h $(SOURCE_DIR)/SolutionDataStorage.hh \ ...@@ -631,6 +633,7 @@ $(SOURCE_DIR)/SolutionDataStorage.h $(SOURCE_DIR)/SolutionDataStorage.hh \
$(SOURCE_DIR)/InteriorBoundary.h $(SOURCE_DIR)/InteriorBoundary.cc \ $(SOURCE_DIR)/InteriorBoundary.h $(SOURCE_DIR)/InteriorBoundary.cc \
$(SOURCE_DIR)/ElementDofIteartor.h $(SOURCE_DIR)/ElementDofIterator.cc \ $(SOURCE_DIR)/ElementDofIteartor.h $(SOURCE_DIR)/ElementDofIterator.cc \
$(SOURCE_DIR)/Debug.h $(SOURCE_DIR)/Debug.cc \ $(SOURCE_DIR)/Debug.h $(SOURCE_DIR)/Debug.cc \
$(SOURCE_DIR)/MpiHelper.h $(SOURCE_DIR)/MpiHelper.cc \
$(SOURCE_DIR)/parareal/ProblemBase.h \ $(SOURCE_DIR)/parareal/ProblemBase.h \
$(SOURCE_DIR)/parareal/AdaptParaReal.h $(SOURCE_DIR)/parareal/AdaptParaReal.cc $(SOURCE_DIR)/parareal/AdaptParaReal.h $(SOURCE_DIR)/parareal/AdaptParaReal.cc
...@@ -778,6 +781,7 @@ distclean-compile: ...@@ -778,6 +781,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Marker.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Marker.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Mesh.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Mesh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-MeshStructure.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-MeshStructure.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-MpiHelper.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-NonLinUpdater.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-NonLinUpdater.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Operator.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-Operator.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ParMetisPartitioner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libamdis_la-ParMetisPartitioner.Plo@am__quote@
...@@ -1542,6 +1546,13 @@ libamdis_la-Debug.lo: $(SOURCE_DIR)/Debug.cc ...@@ -1542,6 +1546,13 @@ libamdis_la-Debug.lo: $(SOURCE_DIR)/Debug.cc
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-Debug.lo `test -f '$(SOURCE_DIR)/Debug.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/Debug.cc @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-Debug.lo `test -f '$(SOURCE_DIR)/Debug.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/Debug.cc
libamdis_la-MpiHelper.lo: $(SOURCE_DIR)/MpiHelper.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-MpiHelper.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-MpiHelper.Tpo" -c -o libamdis_la-MpiHelper.lo `test -f '$(SOURCE_DIR)/MpiHelper.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/MpiHelper.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-MpiHelper.Tpo" "$(DEPDIR)/libamdis_la-MpiHelper.Plo"; else rm -f "$(DEPDIR)/libamdis_la-MpiHelper.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(SOURCE_DIR)/MpiHelper.cc' object='libamdis_la-MpiHelper.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -c -o libamdis_la-MpiHelper.lo `test -f '$(SOURCE_DIR)/MpiHelper.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/MpiHelper.cc
libamdis_la-AdaptParaReal.lo: $(SOURCE_DIR)/parareal/AdaptParaReal.cc libamdis_la-AdaptParaReal.lo: $(SOURCE_DIR)/parareal/AdaptParaReal.cc
@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-AdaptParaReal.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-AdaptParaReal.Tpo" -c -o libamdis_la-AdaptParaReal.lo `test -f '$(SOURCE_DIR)/parareal/AdaptParaReal.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/parareal/AdaptParaReal.cc; \ @am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libamdis_la_CXXFLAGS) $(CXXFLAGS) -MT libamdis_la-AdaptParaReal.lo -MD -MP -MF "$(DEPDIR)/libamdis_la-AdaptParaReal.Tpo" -c -o libamdis_la-AdaptParaReal.lo `test -f '$(SOURCE_DIR)/parareal/AdaptParaReal.cc' || echo '$(srcdir)/'`$(SOURCE_DIR)/parareal/AdaptParaReal.cc; \
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-AdaptParaReal.Tpo" "$(DEPDIR)/libamdis_la-AdaptParaReal.Plo"; else rm -f "$(DEPDIR)/libamdis_la-AdaptParaReal.Tpo"; exit 1; fi @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libamdis_la-AdaptParaReal.Tpo" "$(DEPDIR)/libamdis_la-AdaptParaReal.Plo"; else rm -f "$(DEPDIR)/libamdis_la-AdaptParaReal.Tpo"; exit 1; fi
......
...@@ -44,7 +44,7 @@ available_tags=" CXX F77" ...@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG # ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host p2q071: # Libtool was configured on host deimos103:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` ...@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End: # End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX # ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host p2q071: # Libtool was configured on host deimos103:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
...@@ -7065,7 +7065,7 @@ include_expsyms="" ...@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77 # ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host p2q071: # Libtool was configured on host deimos103:
# Shell to use when invoking shell scripts. # Shell to use when invoking shell scripts.
SHELL="/bin/sh" SHELL="/bin/sh"
......
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
#include "parareal/AdaptParaReal.h" #include "parareal/AdaptParaReal.h"
#if HAVE_PARALLEL_DOMAIN_AMDIS #if HAVE_PARALLEL_DOMAIN_AMDIS
#include "MpiHelper.h"
#include "ParallelDomainVec.h" #include "ParallelDomainVec.h"
#endif #endif
......
#include "MpiHelper.h"
namespace AMDiS {
namespace mpi {
void globalAdd(double &value)
{
double valCopy = value;
MPI::COMM_WORLD.Allreduce(&valCopy, &value, 1, MPI_DOUBLE, MPI_SUM);
}
void globalMin(double &value)
{
double valCopy = value;
MPI::COMM_WORLD.Allreduce(&valCopy, &value, 1, MPI_DOUBLE, MPI_MIN);
}
void globalMax(double &value)
{
double valCopy = value;
MPI::COMM_WORLD.Allreduce(&valCopy, &value, 1, MPI_DOUBLE, MPI_MAX);
}
}
}
// ============================================================================
// == ==
// == AMDiS - Adaptive multidimensional simulations ==
// == ==
// ============================================================================
// == ==
// == TU Dresden ==
// == ==
// == Institut fr Wissenschaftliches Rechnen ==
// == Zellescher Weg 12-14 ==
// == 01069 Dresden ==
// == germany ==
// == ==
// ============================================================================
// == ==
// == https://gforge.zih.tu-dresden.de/projects/amdis/ ==
// == ==
// ============================================================================
/** \file MpiHelper.h */
#ifndef AMDIS_MPIHELPER_H
#define AMDIS_MPIHELPER_H
#include <mpi.h>
namespace AMDiS {
namespace mpi {
void globalAdd(double &value);
void globalMin(double &value);
void globalMax(double &value);
}
}
#endif
...@@ -29,8 +29,8 @@ namespace AMDiS { ...@@ -29,8 +29,8 @@ namespace AMDiS {
PetscErrorCode myKSPMonitor(KSP ksp, PetscInt iter, PetscReal rnorm, void *) PetscErrorCode myKSPMonitor(KSP ksp, PetscInt iter, PetscReal rnorm, void *)
{ {
if (iter % 100 == 0 && MPI::COMM_WORLD.Get_rank() == 0) if (iter % 10 == 0 && MPI::COMM_WORLD.Get_rank() == 0)
std::cout << " Petsc-Iteration " << iter << ": " << rnorm << std::endl; std::cout << "[0] Petsc-Iteration " << iter << ": " << rnorm << std::endl;
return 0; return 0;
} }
......
...@@ -135,6 +135,28 @@ namespace AMDiS { ...@@ -135,6 +135,28 @@ namespace AMDiS {
INFO(info, 2)("%g ", *rval); INFO(info, 2)("%g ", *rval);
} }
break; break;
case 'v':
{
WorldVector<double> *vecVal = va_arg(arg, WorldVector<double> *);
std::string sstr = std::string(word);
int ind = 0;
int found = sstr.find_first_of(",; ");
std::string seperator;
seperator = sstr[found];
while (found != static_cast<int>(std::string::npos) &&
ind < static_cast<int>(vecVal->size())) {
if (found > 0) {
(*vecVal)[ind] = atof(sstr.substr(0, found).c_str());
ind++;
}
sstr = sstr.substr(found + 1);
found = sstr.find_first_of(seperator);
}
if (sstr.length() > 0 && ind < static_cast<int>(vecVal->size()))
(*vecVal)[ind] = atof(sstr.c_str());
}
break;
case '*': case '*':
break; break;
default: default:
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <boost/filesystem/convenience.hpp> #include <boost/filesystem/convenience.hpp>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include <mpi.h> #include <mpi.h>
#endif #endif
...@@ -28,11 +29,11 @@ namespace AMDiS { ...@@ -28,11 +29,11 @@ namespace AMDiS {
switch (compress) { switch (compress) {
case GZIP: case GZIP:
file.push(boost::iostreams::gzip_compressor()); file.push(boost::iostreams::gzip_compressor());
file.push(boost::iostreams::file_descriptor_sink(strcat((char*)name, ".gz"))); file.push(boost::iostreams::file_descriptor_sink(name.append(".gz")));
break; break;
case BZIP2: case BZIP2:
file.push(boost::iostreams::bzip2_compressor()); file.push(boost::iostreams::bzip2_compressor());
file.push(boost::iostreams::file_descriptor_sink(strcat((char*)name, ".bz2"))); file.push(boost::iostreams::file_descriptor_sink(name.append(".bz2")));
break; break;
default: default:
file.push(boost::iostreams::file_descriptor_sink(name)); file.push(boost::iostreams::file_descriptor_sink(name));
......
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