Commit d6bd7df2 authored by Praetorius, Simon's avatar Praetorius, Simon

small corrections in various files

parent 66ece375
...@@ -115,7 +115,7 @@ namespace AMDiS { ...@@ -115,7 +115,7 @@ namespace AMDiS {
Parameters::init(initFileName); Parameters::init(initFileName);
} }
#if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_OPENMP) #if defined(HAVE_PARALLEL_DOMAIN_AMDIS) || defined(HAVE_OPENMP) || defined(HAVE_MPI)
Parameters::get("parallel->log main rank", Msg::outputMainRank); Parameters::get("parallel->log main rank", Msg::outputMainRank);
#endif #endif
......
...@@ -143,7 +143,9 @@ namespace AMDiS { ...@@ -143,7 +143,9 @@ namespace AMDiS {
Parallel::MeshDistributor::globalMeshDistributor->removeInterchangeVector(this); Parallel::MeshDistributor::globalMeshDistributor->removeInterchangeVector(this);
#endif #endif
#ifdef _OPENMP
#pragma omp critical #pragma omp critical
#endif
if (this->feSpace && this->feSpace->getAdmin()) if (this->feSpace && this->feSpace->getAdmin())
(this->feSpace->getAdmin())->removeDOFIndexed(this); (this->feSpace->getAdmin())->removeDOFIndexed(this);
......
...@@ -131,7 +131,7 @@ namespace AMDiS { ...@@ -131,7 +131,7 @@ namespace AMDiS {
/// convert string to string /// convert string to string
inline void convert(const std::string valStr, std::string& value) inline void convert(const std::string& valStr, std::string& value)
{ {
value = trim(valStr); value = trim(valStr);
} }
...@@ -145,7 +145,7 @@ namespace AMDiS { ...@@ -145,7 +145,7 @@ namespace AMDiS {
boost::mpl::not_< boost::is_enum<T> > >, boost::mpl::not_< boost::is_enum<T> > >,
void void
>::type >::type
convert(const std::string valStr, T& value) convert(const std::string& valStr, T& value)
{ {
using boost::lexical_cast; using boost::lexical_cast;
using boost::numeric_cast; using boost::numeric_cast;
...@@ -166,7 +166,7 @@ namespace AMDiS { ...@@ -166,7 +166,7 @@ namespace AMDiS {
< boost::is_enum<T>, < boost::is_enum<T>,
void void
>::type >::type
convert(const std::string valStr, T& value) convert(const std::string& valStr, T& value)
{ {
int swap = 0; int swap = 0;
// try { // try {
...@@ -179,7 +179,7 @@ namespace AMDiS { ...@@ -179,7 +179,7 @@ namespace AMDiS {
/// convert special enums /// convert special enums
inline void convert(const std::string valStr, Norm& value) inline void convert(const std::string& valStr, Norm& value)
{ {
std::string swapStr = boost::to_upper_copy(valStr); std::string swapStr = boost::to_upper_copy(valStr);
...@@ -200,7 +200,7 @@ namespace AMDiS { ...@@ -200,7 +200,7 @@ namespace AMDiS {
/// convert value of arbitrary type to string using stringstream and /// convert value of arbitrary type to string using stringstream and
/// operator<< for type /// operator<< for type
template<typename T> template<typename T>
inline void convert(const T value, std::string& valStr) inline void convert(const T& value, std::string& valStr)
{ {
std::stringstream ss; std::stringstream ss;
ss.precision(6); ss.precision(6);
...@@ -223,20 +223,20 @@ namespace AMDiS { ...@@ -223,20 +223,20 @@ namespace AMDiS {
// forward declarations // forward declarations
template< typename T > template< typename T >
inline void convert(const std::string valStr, WorldVector<T>& c); inline void convert(const std::string& valStr, WorldVector<T>& c);
template<typename T> template<typename T>
inline void convert(const std::string valStr, std::list<T>& value); inline void convert(const std::string& valStr, std::list<T>& value);
template<typename T> template<typename T>
inline void convert(const std::string valStr, std::vector<T>& value); inline void convert(const std::string& valStr, std::vector<T>& value);
/** parse an container from tag tag. The Container must have the properties: /** parse an container from tag tag. The Container must have the properties:
* - type value_type * - type value_type
* - member function push_back * - member function push_back
*/ */
template< typename Container > template< typename Container >
inline void getContainer(const std::string val_, Container& c) inline void getContainer(const std::string& val_, Container& c)
{ {
// accepted brackets and delimiters for vector input // accepted brackets and delimiters for vector input
std::string begBrackets= "{[("; std::string begBrackets= "{[(";
...@@ -286,7 +286,7 @@ namespace AMDiS { ...@@ -286,7 +286,7 @@ namespace AMDiS {
/// convert string to WorldVector /// convert string to WorldVector
template< typename T > template< typename T >
inline void convert(const std::string valStr, WorldVector<T>& c) inline void convert(const std::string& valStr, WorldVector<T>& c)
{ {
std::vector<T> temp_vec; std::vector<T> temp_vec;
getContainer(valStr, temp_vec); getContainer(valStr, temp_vec);
...@@ -299,7 +299,7 @@ namespace AMDiS { ...@@ -299,7 +299,7 @@ namespace AMDiS {
/// convert string to std::list using begBrackets, endBrackets and delims /// convert string to std::list using begBrackets, endBrackets and delims
template<typename T> template<typename T>
inline void convert(const std::string valStr, std::list<T>& value) inline void convert(const std::string& valStr, std::list<T>& value)
{ {
getContainer(valStr, value); getContainer(valStr, value);
} }
...@@ -307,7 +307,7 @@ namespace AMDiS { ...@@ -307,7 +307,7 @@ namespace AMDiS {
/// convert string to std::vector using begBrackets, endBrackets and delims /// convert string to std::vector using begBrackets, endBrackets and delims
template<typename T> template<typename T>
inline void convert(const std::string valStr, std::vector<T>& value) inline void convert(const std::string& valStr, std::vector<T>& value)
{ {
getContainer(valStr, value); getContainer(valStr, value);
} }
...@@ -525,7 +525,7 @@ else if(error_code == TAG_NOT_FOUND_BREAK) ...@@ -525,7 +525,7 @@ else if(error_code == TAG_NOT_FOUND_BREAK)
/// update map tag->value_old to tag->value in singleton /// update map tag->value_old to tag->value in singleton
template<typename T> template<typename T>
static void set(const std::string tag, T& value, int debugInfo= -1) static void set(const std::string tag, T const& value, int debugInfo= -1)
{ {
// boost::unique_lock<boost::shared_mutex> lock(singlett().mutex_); // boost::unique_lock<boost::shared_mutex> lock(singlett().mutex_);
...@@ -545,7 +545,7 @@ else if(error_code == TAG_NOT_FOUND_BREAK) ...@@ -545,7 +545,7 @@ else if(error_code == TAG_NOT_FOUND_BREAK)
/// add map tag->value to data in singleton /// add map tag->value to data in singleton
template< typename T > template< typename T >
static void add(const std::string tag, T& value, int debugInfo = -1) static void add(const std::string tag, T const& value, int debugInfo = -1)
{ {
set(tag, value, debugInfo); set(tag, value, debugInfo);
} }
......
...@@ -192,7 +192,7 @@ namespace AMDiS { namespace io { ...@@ -192,7 +192,7 @@ namespace AMDiS { namespace io {
//boost::iostreams seems not to truncate the file //boost::iostreams seems not to truncate the file
ofstream swapfile(filename.c_str(), ios::out | ios::trunc); ofstream swapfile(filename.c_str(), ios::out | ios::trunc);
TEST_EXIT(swapfile.is_open()) TEST_EXIT(swapfile.is_open())
("Cannot open file %s for writing!\n", name.c_str()); ("Cannot open file %s for writing!\n", filename.c_str());
swapfile.close(); swapfile.close();
} }
file.push(boost::iostreams::file_descriptor_sink(filename, ios::trunc)); file.push(boost::iostreams::file_descriptor_sink(filename, ios::trunc));
...@@ -311,7 +311,7 @@ namespace AMDiS { namespace io { ...@@ -311,7 +311,7 @@ namespace AMDiS { namespace io {
//boost::iostreams seems not to truncate the file //boost::iostreams seems not to truncate the file
ofstream swapfile(filename.c_str(), ios::out | ios::trunc); ofstream swapfile(filename.c_str(), ios::out | ios::trunc);
TEST_EXIT(swapfile.is_open()) TEST_EXIT(swapfile.is_open())
("Cannot open file %s for writing!\n", name.c_str()); ("Cannot open file %s for writing!\n", filename.c_str());
swapfile.close(); swapfile.close();
} }
file.push(boost::iostreams::file_descriptor_sink(filename, ios::trunc)); file.push(boost::iostreams::file_descriptor_sink(filename, ios::trunc));
......
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