diff --git a/documentation/pestpp4.3.19.docx b/documentation/pestpp4.3.20.docx similarity index 52% rename from documentation/pestpp4.3.19.docx rename to documentation/pestpp4.3.20.docx index 6e749ecfa..dc9edd91c 100644 Binary files a/documentation/pestpp4.3.19.docx and b/documentation/pestpp4.3.20.docx differ diff --git a/src/libs/common/config_os.h b/src/libs/common/config_os.h index d17db3b13..f304343c2 100644 --- a/src/libs/common/config_os.h +++ b/src/libs/common/config_os.h @@ -2,7 +2,7 @@ #define CONFIG_OS_H_ -#define PESTPP_VERSION "4.3.19"; +#define PESTPP_VERSION "4.3.20"; #if defined(_WIN32) || defined(_WIN64) #define OS_WIN diff --git a/src/libs/pestpp_common/OutputFileWriter.cpp b/src/libs/pestpp_common/OutputFileWriter.cpp index 89a9148b2..0aaa30fcb 100644 --- a/src/libs/pestpp_common/OutputFileWriter.cpp +++ b/src/libs/pestpp_common/OutputFileWriter.cpp @@ -231,6 +231,20 @@ void OutputFileWriter::scenario_report(std::ostream &os, bool report_mode) { mode = "regularization (with a \"z\")"; }*/ + + os << endl << " This software has been approved for release by the" << endl; + os << " U.S.Geological Survey(USGS).Although the software has " << endl; + os << " been subjected to rigorous review, the USGS reserves the" << endl; + os << " right to update the software as needed pursuant to further" << endl; + os << " analysisand review.No warranty, expressed or implied, is " << endl; + os << " made by the USGS or the U.S.Government as to the" << endl; + os << " functionality of the softwareand related material nor shall" << endl; + os << " the fact of release constitute any such warranty." << endl; + os << " Furthermore, the software is released on condition that" << endl; + os << " neither the USGS nor the U.S.Government shall be held" << endl; + os << " liable for any damages resulting from its authorized " << endl; + os << " or unauthorized use." << endl << endl; + switch (pest_scenario.get_control_info().pestmode) { case ControlInfo::PestMode::ESTIMATION: diff --git a/src/libs/run_managers/abstract_base/model_interface.cpp b/src/libs/run_managers/abstract_base/model_interface.cpp index f0ee413ea..5a47254f5 100644 --- a/src/libs/run_managers/abstract_base/model_interface.cpp +++ b/src/libs/run_managers/abstract_base/model_interface.cpp @@ -956,13 +956,13 @@ void InstructionFile::throw_ins_error(const string& message, int ins_lnum, int o { stringstream ss; if (warn) - ss << "InstructionFile warning in " << ins_filename; + ss << "InstructionFile warning in '" << ins_filename << "'"; else - ss << "InstructionFile error in file " << ins_filename; + ss << "InstructionFile error in file '" << ins_filename << "'"; if (ins_lnum != 0) - ss << " on line: " << ins_lnum; + ss << " on instruction file line: " << ins_lnum; if (out_lnum != 0) - ss << " on output file line: " << out_lnum; + ss << ", on output file line: " << out_lnum; ss << " : " << message; if (warn) cout << endl << ss.str() << endl; @@ -1069,7 +1069,7 @@ pair> InstructionFile::parse_obs_instruction(const string } catch (...) { - throw_ins_error("error casting first index '" + temp.substr(0, pos) + "' from (semi-)fixed observation instruction '" + token + "'"); + throw_ins_error("error casting first index '" + temp.substr(0, pos) + "' from (semi-)fixed observation instruction '" + token + "'", ins_line_num); } try { @@ -1078,7 +1078,7 @@ pair> InstructionFile::parse_obs_instruction(const string } catch (...) { - throw_ins_error("error casting second index '" + temp.substr(pos) + "' from observation instruction '" + token + "'"); + throw_ins_error("error casting second index '" + temp.substr(pos) + "' from (semi)-fixed observation instruction '" + token + "'"); } pair se(s-1, e-1); return pair>(name,se); @@ -1104,12 +1104,17 @@ pair InstructionFile::execute_fixed(const string& token, string& } catch (...) { - throw_ins_error("error casting fixed observation '" + token + "' from output string '" + temp + "'"); + throw_ins_error("error casting fixed observation instruction '" + token + "' from output string '" + temp + "' on line '" + line + "'",ins_line_num, out_line_num); } int pos = line.find(temp); if (pos == string::npos) throw_ins_error("internal error: string t: '"+temp+"' not found in line: '"+line+"'",ins_line_num,out_line_num); + if ((value != 0.0) && (!isnormal(value))) + { + throw_ins_error("casting '" + temp + "' to double yielded denormal value on line '" + line + "' for fixed observation instruction '" + token + "'", ins_line_num, out_line_num); + } line = line.substr(pos + temp.size()); + return pair(info.first,value); } @@ -1129,9 +1134,9 @@ pair InstructionFile::execute_semi(const string& token, string& int len = (info.second.second - info.second.first) + 1; int pos = last_out_line.find_first_not_of(", \t\n\r"+additional_delimiters, info.second.first); //include the comma here for csv files if (pos == string::npos) - throw_ins_error("EOL encountered when looking for non-whitespace char in semi-fixed instruction '" + token + "'",ins_line_num,out_line_num); + throw_ins_error("EOL encountered when looking for non-whitespace char in semi-fixed instruction '" + token + "' on line: '" + line + "'",ins_line_num,out_line_num); if (pos > info.second.second) - throw_ins_error("no non-whitespace char found before end index in semi-fixed instruction '" + token + "'", ins_line_num,out_line_num); + throw_ins_error("no non-whitespace char found before end index in semi-fixed instruction '" + token + "' on line: '" + line + "'", ins_line_num,out_line_num); pest_utils::tokenize(last_out_line.substr(pos), tokens); temp = tokens[0]; try @@ -1141,11 +1146,15 @@ pair InstructionFile::execute_semi(const string& token, string& } catch (...) { - throw_ins_error("error casting string '" + temp + "' to double for semi-fixed instruction", ins_line_num, out_line_num); + throw_ins_error("error casting string '" + temp + "' to double for semi-fixed instruction '" + token + "' on line: '" + line + "'", ins_line_num, out_line_num); } pos = line.find(temp); if (pos == string::npos) throw_ins_error("internal error: temp '" + temp + "' not found in line: '" + line + "'", ins_line_num, out_line_num); + if ((value != 0.0) && (!isnormal(value))) + { + throw_ins_error("casting '" + temp + "' to double yielded denormal value for semi-fixed instruction '" + token + "' on line: '" + line + "'", ins_line_num, out_line_num); + } line = line.substr(pos + temp.size()); return pair(info.first,value); } @@ -1155,7 +1164,7 @@ pair InstructionFile::execute_free(const string& token, string& vector tokens; pest_utils::tokenize(line, tokens,", \t\n\r" + additional_delimiters) ; //include the comma in the delimiters here if (tokens.size() == 0) - throw_ins_error("error tokenizing output line ('"+last_out_line+"') for instruction '"+token+"' on line: " +last_ins_line, ins_line_num, out_line_num); + throw_ins_error("error tokenizing output line ('"+last_out_line+"') for free instruction '"+token+"' on line: " +last_ins_line, ins_line_num, out_line_num); double value; try { @@ -1164,7 +1173,7 @@ pair InstructionFile::execute_free(const string& token, string& } catch (...) { - throw_ins_error("error converting '" + tokens[0] + "' to double on output line '" + last_out_line + "' for instruciton '"+token+"'", ins_line_num, out_line_num); + throw_ins_error("error converting '" + tokens[0] + "' to double on output line '" + last_out_line + "' for free instruciton: '"+token+"'", ins_line_num, out_line_num); } string name = token.substr(1, token.size() - 2); int pos = line.find(tokens[0]); @@ -1172,6 +1181,10 @@ pair InstructionFile::execute_free(const string& token, string& { throw_ins_error("internal error: could not find free obs token '"+tokens[0]+"'", ins_line_num, out_line_num); } + if ((value != 0.0) && (!isnormal(value))) + { + throw_ins_error("casting '" + tokens[0] + "' to double yielded denormal value for free instruction: '" + token + "' on line: '" + line + "'", ins_line_num, out_line_num); + } line = line.substr(pos + tokens[0].size()); return pair(name,value); @@ -1260,6 +1273,8 @@ void InstructionFile::execute_line_advance(const string& token, string& line, if int num; //pest_utils::convert_ip(token.substr(1), num); num = stoi(token.substr(1)); + if (num < 1) + throw_ins_error("line advance instruction error: number of lines must be greater or equal to 1, not '" + token.substr(1) + "'",ins_line_num,out_line_num); for (int i = 0; i < num; i++) { if (f_out.bad()) diff --git a/src/libs/run_managers/yamr/PantherAgent.cpp b/src/libs/run_managers/yamr/PantherAgent.cpp index d0807b17e..21e444e60 100644 --- a/src/libs/run_managers/yamr/PantherAgent.cpp +++ b/src/libs/run_managers/yamr/PantherAgent.cpp @@ -13,6 +13,7 @@ #include "Pest.h" #include "config_os.h" +#include "pest_data_structs.h" using namespace pest_utils; @@ -504,8 +505,7 @@ void PANTHERAgent::start_impl(const string &host, const string &port) if (err.first == -999) { ss.str(""); - ss << "error receiving message from master: " << err.second << " , terminating, header follows:"; - net_pack.print_header(ss); + ss << "error receiving message from master: " << err.second << " , terminating"; report(ss.str(), true); //terminate = true; net_pack.reset(NetPackage::PackType::CORRUPT_MESG, 0, 0, "recv security message error"); @@ -872,8 +872,17 @@ void PANTHERAgent::start_impl(const string &host, const string &port) report(ss.str(), true); serialized_data = Serialization::serialize(pars, par_name_vec, obs, obs_name_vec, run_time); ss.str(""); - ss << "debug loop returning ctl obs for run_id, group_id: " << run_id << "," << group_id; - net_pack.reset(NetPackage::PackType::RUN_FINISHED, group_id, run_id, ss.str()); + double rd = ((double)rand() / (double)RAND_MAX); + if (rd < 0.1) + { + ss << "debug loop returning failed run for: " << run_id << "," << group_id; + net_pack.reset(NetPackage::PackType::RUN_FAILED, group_id, run_id, ss.str()); + } + else + { + ss << "debug loop returning ctl obs for run_id, group_id: " << run_id << "," << group_id; + net_pack.reset(NetPackage::PackType::RUN_FINISHED, group_id, run_id, ss.str()); + } err = send_message(net_pack, serialized_data.data(), serialized_data.size()); if (err.first != 1) {