Skip to content

Commit

Permalink
fix for rogue cout in ineq obs processing
Browse files Browse the repository at this point in the history
  • Loading branch information
jtwhite79 committed Nov 26, 2024
1 parent 80d250e commit 2dae20c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 7 additions & 4 deletions benchmarks/basic_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,14 +1049,16 @@ def mf6_v5_sen_test():

t_d = os.path.join(model_d,"template")
m_d = os.path.join(model_d,"master_sen")
#if os.path.exists(m_d):
# shutil.rmtree(m_d)
if os.path.exists(m_d):
shutil.rmtree(m_d)
pst = pyemu.Pst(os.path.join(t_d,"freyberg6_run_sen.pst"))
pst.pestpp_options["gsa_morris_p"] = 4
pst.pestpp_options["gsa_morris_r"] = 4
pst.pestpp_options["panther_transfer_on_finish"] = ["freyberg6_freyberg.cbc","freyberg6.lst","ies_prior.jcb"]
pst.write(os.path.join(t_d,"freyberg6_run_sen_trn.pst"))
m_d = os.path.join(model_d,"master_sen")
pyemu.os_utils.start_workers(t_d, exe_path.replace("-ies","-sen"), "freyberg6_run_sen_trn.pst",
num_workers=15, worker_root=model_d,
num_workers=50, worker_root=model_d,
port=4004,verbose=True,master_dir=m_d)

pst = pyemu.Pst(os.path.join(m_d,"freyberg6_run_sen_trn.pst"))
Expand Down Expand Up @@ -1798,7 +1800,8 @@ def tenpar_uniform_invest():


if __name__ == "__main__":
tenpar_uniform_invest()
mf6_v5_sen_test()
#tenpar_uniform_invest()
#tenpar_collapse_invest()
#plot_collapse_invest()

Expand Down
12 changes: 7 additions & 5 deletions src/libs/pestpp_common/EnsembleMethodUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,6 @@ void MmUpgradeThread::work(int thread_id, int iter, double cur_lam, bool use_glm

if (verbose_level < 3)
return;
//cout << "thread: " << tid << ", " << t_count << ", " << prefix << " rows:cols" << mat.rows() << ":" << mat.cols() << endl;
stringstream ss;

ss << "thread_" << tid << ".count_ " << t_count << ".iter_" << iter << "." << prefix << ".dat";
Expand Down Expand Up @@ -3686,7 +3685,7 @@ void L2PhiHandler::apply_ineq_constraints(Eigen::MatrixXd &resid, Eigen::MatrixX
for (int i = 0; i < resid.rows(); i++)
col(i) = ((scol(i) > val) && (scol(i) < val2)) ? 0.0 : col(i);
//cout << resid.col(idx) << endl;
cout << col << endl << endl;
//cout << col << endl << endl;
resid.col(idx) = col;
//cout << resid.col(idx) << endl;
}
Expand Down Expand Up @@ -3715,7 +3714,7 @@ void L2PhiHandler::apply_ineq_constraints(Eigen::MatrixXd &resid, Eigen::MatrixX
for (int i = 0; i < resid.rows(); i++)
col(i) = (scol(i) < val) ? 0.0 : col(i);
//cout << resid.col(idx) << endl;
cout << col << endl << endl;
//cout << col << endl << endl;
resid.col(idx) = col;
//cout << resid.col(idx) << endl;
}
Expand Down Expand Up @@ -4319,7 +4318,7 @@ vector<int> run_ensemble_util(PerformanceLog* performance_log, ofstream& frec,Pa
}
if (failing_reals.size() > 0)
{
cout << "parameter ensemble consisteny check failed for " << failing_reals.size() << ", see .rec file for listing" << endl;
cout << "parameter ensemble consistency check failed for " << failing_reals.size() << ", see .rec file for listing" << endl;
frec << "ERROR: the following realizations failed consistency check:" << endl;
for (auto fr : failing_reals)
frec << fr << ",";
Expand Down Expand Up @@ -5042,14 +5041,17 @@ void EnsembleMethod::initialize(int cycle, bool run, bool use_existing)
map<string,pair<double,double>> tt = ph.get_double_obs_bounds();
if (!tt.empty())
{
ss.str("");
ss << "double inequality defined through 'greater_than' and 'less_than' data for " << tt.size() << " observations" << endl;
ss.str("");
ss << "double inequality defined through 'greater_than' and 'less_than' data for observations:" << endl;
for (const auto it : tt)
{
ss << it.first << "," << it.second.first << " to " << it.second.second << endl;
}
ss << endl;
message(1,ss.str());
message(1,ss.str(),false);

}


Expand Down

0 comments on commit 2dae20c

Please sign in to comment.