diff --git a/AMDiS/AMDiSConfig.cmake.in b/AMDiS/AMDiSConfig.cmake.in index c711d0fa47ea3964993b413803678a59030f3f0a..0a8c9ced09b05e4479a2e96688c13d8693ad4519 100644 --- a/AMDiS/AMDiSConfig.cmake.in +++ b/AMDiS/AMDiSConfig.cmake.in @@ -41,7 +41,7 @@ find_library(_AMDIS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/ if(_AMDIS_LIB) get_filename_component(AMDIS_LIBRARY_DIR ${_AMDIS_LIB} PATH CACHE) set(AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR}) - set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libcompositeFEM.so" CACHE STRING "amdis libraries") + set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libcompositeFEM.so;${AMDIS_LIBRARY_DIR}/libreinit.so" CACHE STRING "amdis libraries") else() message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDIS_LIBRARY_DIR to the directory containg the AMDiS library") endif() diff --git a/AMDiS/src/Initfile.cc b/AMDiS/src/Initfile.cc index 0c65647f8d5ff0cd40a770d3f98bcbdf2335fc0b..faf6a14b300e34748b4561b5792f8ceb787fbe23 100644 --- a/AMDiS/src/Initfile.cc +++ b/AMDiS/src/Initfile.cc @@ -98,10 +98,20 @@ void Initfile::read(istream& in) { } }; +void Initfile::readArgv(int argc, char **argv) +{ + for (int i= 0; i<argc; ++i) { + if (strcmp("-rs", argv[i]) == 0) { + std::string input(argv[i+1]); + add("argv->rs", input, 0); + } + } +} + /// read standard values for output and information of parameter-values void Initfile::getInternalParameters() { - int val= 10; + int val= 0; get("level of information", val, 0); msgInfo= val; @@ -113,6 +123,10 @@ void Initfile::getInternalParameters() get("parameter information", val, 0); paramInfo= val; + val= 0; + get("break on missing tag", val, 0); + breakOnMissingTag= val; + if (msgInfo==0) paramInfo= 0; }; diff --git a/AMDiS/src/Initfile.h b/AMDiS/src/Initfile.h index feca4c1429ebb986a358bbdc0dd888bfdfd3a52d..6347e02f303f702f5999ff8ba90026672ab05509 100644 --- a/AMDiS/src/Initfile.h +++ b/AMDiS/src/Initfile.h @@ -240,6 +240,9 @@ struct Initfile : public std::map< std::string, std::string > { struct TagNotFound : std::invalid_argument { TagNotFound(std::string m):std::invalid_argument(m) {} }; + struct TagNotFoundBreak : std::invalid_argument { // print 'tag not found' and exit + TagNotFoundBreak(std::string m):std::invalid_argument(m) {} + }; /** initialize init-file from file with filename in, read data and save it to singleton-map * @param in: filename string @@ -313,6 +316,9 @@ struct Initfile : public std::map< std::string, std::string > { set(tag, value, debug_info); } + /// rescheduling parameter + static void readArgv(int argc, char **argv); + /// Returns specified info level static int getMsgInfo() { @@ -355,7 +361,7 @@ struct Initfile : public std::map< std::string, std::string > { } protected: - Initfile() : msgInfo(10), msgWait(1), paramInfo(1) {} + Initfile() : msgInfo(0), msgWait(1), paramInfo(1), breakOnMissingTag(0) {} static void initIntern() { if (singlett == NULL) @@ -371,8 +377,12 @@ protected: /// return the value of the given tag or throws an exception if the tag does not exist std::string checkedGet(const std::string& tag) const { super::const_iterator it= find(tag); - if (it==end()) - throw TagNotFound("there is no tag '"+ tag + "'"); + if (it==end()) { + if(breakOnMissingTag==0 || msgInfo<=2) + throw TagNotFound("there is no tag '"+ tag + "'"); + else + throw TagNotFoundBreak("required tag '"+ tag + "' not found"); + } return it->second; } @@ -398,7 +408,7 @@ protected: /// read parameters for msgInfo, msgWait, paramInfo void getInternalParameters(); - int msgInfo, msgWait, paramInfo; + int msgInfo, msgWait, paramInfo, breakOnMissingTag; }; diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 4315c6b5ac24b1cf672d187c6500426491951b21..1ed9525b96e42470a68229a64249758ea6ad3b4d 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -1,6 +1,7 @@ project("amdis_demo") cmake_minimum_required(VERSION 2.8) +set(AMDIS_DIR /u/spraetor/amdis-trunk/AMDiS_seq/share/amdis) #find_package(AMDIS REQUIRED COMPONENTS umfpack ) find_package(AMDIS REQUIRED)