Skip to content

Commit

Permalink
Use new method of finding summary path in both Evaluate implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
einar90 committed Dec 10, 2018
1 parent 4579fba commit a754dfc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions FieldOpt/Simulation/simulator_interfaces/ix_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ void IXSimulator::Evaluate() {
QString::fromStdString(paths_.GetPath(Paths::SIM_EXEC_SCRIPT_FILE)),
script_args_
);
if (VERB_SIM >= 1) { Printer::info("Unmonitored simulation done. Reading results."); }
results_->ReadResults(QString::fromStdString(paths_.GetPath(Paths::SIM_WORK_DIR)) + "/SECTOR_ICV_OPTIMIZATION_20181205_SUMMARYVECS.SMSPEC");
results_->DumpResults();
if (result_path_.size() == 0) {
setResultPath();
}
if (VERB_SIM >= 1) { Printer::info("Unmonitored simulation done. Reading results from " + result_path_.toStdString()); }
results_->ReadResults(result_path_);
updateResultsInModel();
}
bool IXSimulator::Evaluate(int timeout, int threads) {
Expand Down Expand Up @@ -136,17 +140,19 @@ void IXSimulator::copyDriverFiles() {
void IXSimulator::setResultPath() {
QString result_dir = QString::fromStdString(paths_.GetPath(Paths::SIM_WORK_DIR));
QString result_name;
if (VERB_SIM >= 2) Printer::ext_info("Setting simulator result path.", "Simulation", "IXSimulator");
if (FileExists(result_dir + "/SUMMARYVECS.SMSPEC")) {
result_name = "/SUMMARYVECS.SMSPEC";
}
else if ( FileExists(result_dir + "/" + deck_name_ + "_SUMMARYVECS.SMSPEC")) {
else if (FileExists(result_dir + "/" + deck_name_ + "_SUMMARYVECS.SMSPEC")) {
result_name = "/" + deck_name_ + "_SUMMARYVECS.SMSPEC";
}
else {
Printer::error("Unable to find summary file. Aborting.");
exit(1);
}
result_path_ = result_dir + result_name;
if (VERB_SIM >= 2) Printer::ext_info("Set simulator result path to " + result_path_.toStdString(), "Simulation", "IXSimulator");
}

}

0 comments on commit a754dfc

Please sign in to comment.