Skip to content

Commit 7c052f7

Browse files
committed
a few lil fixes
1 parent 33dbc7d commit 7c052f7

5 files changed

Lines changed: 48 additions & 10 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This is the top-level CMake file for PEST++
22
cmake_minimum_required(VERSION 3.15)
3-
3+
set(CMAKE_VERBOSE_MAKEFILE,ON)
44
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
55
add_compile_definitions(_DEBUG)
66
endif()

benchmarks/ies_test_part4.py

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5031,11 +5031,48 @@ def large_invest():
50315031
pyemu.os_utils.run("{0} pest.pst /e".format(exe_path),cwd=t_d)
50325032

50335033

5034+
def tenpar_xsec_combined_autoadaloc_mm_stress_test():
5035+
"""testing combined matrix + autoadaloc"""
5036+
model_d = "ies_10par_xsec"
5037+
test_d = os.path.join(model_d, "master_comb_aal_test1")
5038+
template_d = os.path.join(model_d, "test_template")
5039+
5040+
if not os.path.exists(template_d):
5041+
raise Exception("template_d {0} not found".format(template_d))
5042+
pst_name = os.path.join(template_d, "pest.pst")
5043+
pst = pyemu.Pst(pst_name)
5044+
5045+
if os.path.exists(test_d):
5046+
shutil.rmtree(test_d)
5047+
shutil.copytree(template_d, test_d)
5048+
pst.pestpp_options = {}
5049+
pst.pestpp_options["ies_num_reals"] = 30
5050+
5051+
mat = pyemu.Matrix.from_names(pst.nnz_obs_names, pst.adj_par_names).to_dataframe()
5052+
mat.loc[:, :] = 1
5053+
mat.loc[:, pst.adj_par_names[::2]] = 0
5054+
pyemu.Matrix.from_dataframe(mat).to_ascii(os.path.join(template_d, "loc.mat"))
50345055

5056+
pst.pestpp_options["ies_localizer"] = "loc.mat"
5057+
pst.pestpp_options["ies_autoadaloc"] = True
5058+
pst.pestpp_options["ies_verbose_level"] = 3
5059+
pst.pestpp_options["ies_debug_fail_remainder"] = True
5060+
pst.pestpp_options["ies_debug_fail_subset"] = True
5061+
pst.pestpp_options["ies_debug_bad_phi"] = True
5062+
pst.pestpp_options["ies_multimodal_alpha"] = 0.99
5063+
5064+
pst.control_data.noptmax = 3
50355065

5066+
pst.write(os.path.join(template_d, "pest_aal_restart.pst"))
5067+
pyemu.os_utils.start_workers(template_d, exe_path, "pest_aal_restart.pst", num_workers=10,
5068+
master_dir=test_d, verbose=True, worker_root=model_d,
5069+
port=port)
5070+
50365071

50375072
if __name__ == "__main__":
5038-
tenpar_adjust_weights_test()
5073+
tenpar_xsec_combined_autoadaloc_mm_stress_test()
5074+
5075+
#tenpar_adjust_weights_test()
50395076
#large_invest()
50405077
#tenpar_fixed_transform_test()
50415078
#tenpar_reg_factor_test()

scripts/build_pestpp_mac_arm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cd "$script_path"/..
1111
rm -rfd build
1212
mkdir build
1313
cd build
14-
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -DFORCE_STATIC=OFF ..
14+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-fsanitize=address -fno-omit-frame-pointer" -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address" -DCMAKE_CXX_COMPILER=g++ -DFORCE_STATIC=OFF ..
1515
make -j
1616
cpack -G TGZ
1717
cp *.tar.gz ../

src/libs/pestpp_common/EnsembleMethodUtils.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ void EnsembleSolver::update_multimodal_components(const double mm_alpha) {
297297
}
298298
performance_log->log_event("getting phi vectors for all weights");
299299
map<string,map<string,double>> weight_phi_map = ph.get_meas_phi_weight_ensemble(oe,weights);
300-
//int verbose_level = pest_scenario.get_pestpp_options().get_ies_verbose_level();
300+
//int verbose_level = pest_scenario.get_loading par ensemble from binary filepestpp_options().get_ies_verbose_level();
301301
if (num_threads > 1)
302302
{
303303
performance_log->log_event("starting multithreaded MM neighbor calcs");
@@ -321,7 +321,7 @@ void EnsembleSolver::update_multimodal_components(const double mm_alpha) {
321321
exception_ptrs.push_back(exception_ptr());
322322
}
323323
for (int i = 0; i < num_threads; i++) {
324-
threads.push_back(thread(mm_neighbor_thread_function, i, verbose_level, mm_alpha, weight_phi_map,preal_names,
324+
threads.push_back(thread(mm_neighbor_thread_function, i, verbose_level, mm_alpha, weight_phi_map,preal_names,
325325
oreal_names, parcov_inv, real_map, std::ref(*ut_ptr), std::ref(exception_ptrs[i])));
326326
}
327327

@@ -1101,6 +1101,7 @@ void EnsembleSolver::solve(int num_threads, double cur_lam, bool use_glm_form, P
11011101
{
11021102
//worker.work(0, iter, cur_lam, use_glm_form, act_par_names, act_obs_names);
11031103
ut_ptr->work(0, iter, cur_lam, use_glm_form, act_par_names, act_obs_names);
1104+
delete ut_ptr;
11041105
}
11051106
else
11061107
{
@@ -8087,7 +8088,7 @@ void EnsembleMethod::message(int level, const string& _message, string extra, bo
80878088
stringstream ss;
80888089
ss << _message << " " << extra;
80898090
string s = ss.str();
8090-
message(level, s, echo);
8091+
message(level, s, vector<string>(),echo);
80918092
}
80928093

80938094
void EnsembleMethod::message(int level, const string& _message, int extra)
@@ -8205,12 +8206,12 @@ bool EnsembleMethod::initialize_pe(Covariance& cov)
82058206
}
82068207
catch (const exception& e)
82078208
{
8208-
ss << "error processing par jcb: " << e.what();
8209+
ss << "error processing par binary file: " << e.what();
82098210
throw_em_error(ss.str());
82108211
}
82118212
catch (...)
82128213
{
8213-
throw_em_error(string("error processing par jcb"));
8214+
throw_em_error(string("error processing par binary file"));
82148215
}
82158216
}
82168217
else

src/libs/pestpp_common/EnsembleMethodUtils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class MmUpgradeThread
291291
unordered_map<string, Eigen::VectorXd>& weight_map;
292292

293293
unordered_map<string, Eigen::VectorXd>& par_resid_map, & par_diff_map;
294-
unordered_map<string, Eigen::VectorXd>& obs_resid_map, & obs_diff_map, obs_err_map;
294+
unordered_map<string, Eigen::VectorXd>& obs_resid_map, & obs_diff_map, & obs_err_map;
295295

296296
mutex ctrl_lock, weight_lock, loc_lock, parcov_lock;
297297
mutex obs_resid_lock, obs_diff_lock, par_resid_lock;
@@ -334,7 +334,7 @@ class UpgradeThread
334334
unordered_map<string, double>& weight_map;
335335

336336
unordered_map<string, Eigen::VectorXd>& par_resid_map, & par_diff_map, & Am_map;
337-
unordered_map<string, Eigen::VectorXd>& obs_resid_map, & obs_diff_map, obs_err_map;
337+
unordered_map<string, Eigen::VectorXd>& obs_resid_map, & obs_diff_map, &obs_err_map;
338338

339339
mutex ctrl_lock, weight_lock, loc_lock, parcov_lock;
340340
mutex obs_resid_lock, obs_diff_lock, par_resid_lock;

0 commit comments

Comments
 (0)