mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 12:54:50 +01:00
feat(control): dynamic prototype, penalty_iteration, error while disabling surrogate fixed
This commit is contained in:
parent
f33dcb99f1
commit
2d5def9a7f
@ -28,12 +28,12 @@ if (POET_PREPROCESS_BENCHS)
|
||||
endif()
|
||||
|
||||
# as tug will also pull in doctest as a dependency
|
||||
set(TUG_ENABLE_TESTING ON CACHE BOOL "" FORCE)
|
||||
set(TUG_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
|
||||
|
||||
add_subdirectory(ext/tug EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(ext/iphreeqc EXCLUDE_FROM_ALL)
|
||||
|
||||
option(POET_ENABLE_TESTING "Build test suite for POET" ON)
|
||||
option(POET_ENABLE_TESTING "Build test suite for POET" OFF)
|
||||
|
||||
if (POET_ENABLE_TESTING)
|
||||
add_subdirectory(test)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bin/dolo/timings.qs2
Normal file
BIN
bin/dolo/timings.qs2
Normal file
Binary file not shown.
@ -1,13 +1,17 @@
|
||||
iterations <- 500
|
||||
dt <- 200
|
||||
dt <- 100
|
||||
control_iteration <- 20
|
||||
species_epsilon <- c(.0, 1e-12, 1e-1, 1e-1, 1e-2, 1e-2, 1e+1, 1e+1, 1e-3, 0, 1e-1, .0, 1e-1, .0)
|
||||
species_epsilon <- c(.0, 1e-12, 1e-1, 1e-1, 1e-2, 1e-2, 1e+1, 1e+1, 1e-3, 0, 1e-1, .0, 0.12, .0)
|
||||
out_save <- seq(50, iterations, by = 50)
|
||||
penalty_iteration <- 40
|
||||
max_penalty_iteration <- 80
|
||||
|
||||
list(
|
||||
timesteps = rep(dt, iterations),
|
||||
store_result = TRUE,
|
||||
out_save = out_save,
|
||||
control_iteration = control_iteration,
|
||||
species_epsilon = species_epsilon
|
||||
species_epsilon = species_epsilon,
|
||||
penalty_iteration = penalty_iteration,
|
||||
max_penalty_iteration = max_penalty_iteration
|
||||
)
|
||||
|
||||
@ -1,121 +1,376 @@
|
||||
Iteration, Species, MAPE, RRSME
|
||||
20, ID, 0, 0
|
||||
20, H, 1.94487e-14, 3.25056e-16
|
||||
20, O, 0.0528344, 0.00055045
|
||||
20, Charge, 0.0232427, 0.000242925
|
||||
20, C, 0.000542246, 6.49017e-05
|
||||
20, Ca, 0.000542337, 6.48991e-05
|
||||
20, Cl, 6.90514, 0.172115
|
||||
20, Mg, 7.0869, 0.189878
|
||||
20, Calcite, 0.000326491, 3.92374e-05
|
||||
20, H, 1.41445e-14, 2.35911e-16
|
||||
20, O, 0.0553419, 0.000567653
|
||||
20, Charge, 0.0182496, 0.000187253
|
||||
20, C, 9.41889e-05, 1.47295e-05
|
||||
20, Ca, 9.42715e-05, 1.47294e-05
|
||||
20, Cl, 6.0345, 0.0869993
|
||||
20, Mg, 6.09838, 0.0882693
|
||||
20, Calcite, 5.63369e-05, 8.82505e-06
|
||||
20, Calcite_p1, 0, 0
|
||||
20, Dolomite, 9.272e-06, 1.12903e-05
|
||||
20, Dolomite, 4.13256e-09, 1.16886e-08
|
||||
20, Dolomite_p1, 0, 0
|
||||
20, O2g_eq, 0.138625, 0.00144473
|
||||
20, O2g_eq, 0.145118, 0.0014895
|
||||
20, O2g_si, 0, 0
|
||||
|
||||
40, ID, 0, 0
|
||||
40, H, 2.29246e-14, 4.17955e-16
|
||||
40, O, 0.0517847, 0.000555411
|
||||
40, Charge, 0.0217087, 0.000234719
|
||||
40, C, 0.000766768, 6.66735e-05
|
||||
40, Ca, 0.000766918, 6.66873e-05
|
||||
40, Cl, 3.46466, 0.11824
|
||||
40, Mg, 3.68055, 0.142815
|
||||
40, Calcite, 0.000466118, 4.0896e-05
|
||||
40, H, 3.88971e-14, 4.87626e-16
|
||||
40, O, 0.056556, 0.000586363
|
||||
40, Charge, 0.0175789, 0.000183408
|
||||
40, C, 0.000325979, 3.81983e-05
|
||||
40, Ca, 0.000326053, 3.8197e-05
|
||||
40, Cl, 3.04641, 0.058268
|
||||
40, Mg, 3.09965, 0.0603568
|
||||
40, Calcite, 0.000196233, 2.30896e-05
|
||||
40, Calcite_p1, 0, 0
|
||||
40, Dolomite, 0.00272905, 0.00235336
|
||||
40, Dolomite, 8.48003e-06, 8.69316e-06
|
||||
40, Dolomite_p1, 0, 0
|
||||
40, O2g_eq, 0.136023, 0.00145884
|
||||
40, O2g_eq, 0.148463, 0.00154008
|
||||
40, O2g_si, 0, 0
|
||||
|
||||
60, ID, 0, 0
|
||||
60, H, 2.74641e-14, 4.7951e-16
|
||||
60, O, 0.0486809, 0.000533318
|
||||
60, Charge, 0.0201468, 0.000226065
|
||||
60, C, 0.000891453, 6.49626e-05
|
||||
60, Ca, 0.000892045, 6.503e-05
|
||||
60, Cl, 2.08155, 0.0862112
|
||||
60, Mg, 2.24499, 0.111759
|
||||
60, Calcite, 0.000548445, 4.07929e-05
|
||||
60, H, 0, 0
|
||||
60, O, 0, 0
|
||||
60, Charge, 0, 0
|
||||
60, C, 0, 0
|
||||
60, Ca, 0, 0
|
||||
60, Cl, 0, 0
|
||||
60, Mg, 0, 0
|
||||
60, Calcite, 0, 0
|
||||
60, Calcite_p1, 0, 0
|
||||
60, Dolomite, 0.00501748, 0.00466921
|
||||
60, Dolomite, 0, 0
|
||||
60, Dolomite_p1, 0, 0
|
||||
60, O2g_eq, 0.127509, 0.00139778
|
||||
60, O2g_eq, 0, 0
|
||||
60, O2g_si, 0, 0
|
||||
|
||||
80, ID, 0, 0
|
||||
80, H, 4.18117e-14, 6.18699e-16
|
||||
80, O, 0.0456397, 0.000511564
|
||||
80, Charge, 0.0186293, 0.000217503
|
||||
80, C, 0.000902581, 5.51404e-05
|
||||
80, Ca, 0.000903436, 5.52293e-05
|
||||
80, Cl, 1.46119, 0.0709428
|
||||
80, Mg, 1.59876, 0.0991399
|
||||
80, Calcite, 0.000555002, 3.46365e-05
|
||||
80, H, 0, 0
|
||||
80, O, 0, 0
|
||||
80, Charge, 0, 0
|
||||
80, C, 0, 0
|
||||
80, Ca, 0, 0
|
||||
80, Cl, 0, 0
|
||||
80, Mg, 0, 0
|
||||
80, Calcite, 0, 0
|
||||
80, Calcite_p1, 0, 0
|
||||
80, Dolomite, 0.00232338, 0.000711624
|
||||
80, Dolomite, 0, 0
|
||||
80, Dolomite_p1, 0, 0
|
||||
80, O2g_eq, 0.119228, 0.00133794
|
||||
80, O2g_eq, 0, 0
|
||||
80, O2g_si, 0, 0
|
||||
|
||||
100, ID, 0, 0
|
||||
100, H, 3.65551e-14, 5.95887e-16
|
||||
100, O, 0.0427519, 0.000490935
|
||||
100, Charge, 0.0170819, 0.000208342
|
||||
100, C, 0.000953495, 5.18182e-05
|
||||
100, Ca, 0.000954977, 5.19698e-05
|
||||
100, Cl, 1.08948, 0.0602524
|
||||
100, Mg, 1.21451, 0.0897367
|
||||
100, Calcite, 0.000592906, 3.32084e-05
|
||||
100, H, 2.52054e-14, 4.54572e-16
|
||||
100, O, 0.0499718, 0.000533381
|
||||
100, Charge, 0.0157197, 0.000172845
|
||||
100, C, 0.000521522, 3.64097e-05
|
||||
100, Ca, 0.000521537, 3.64034e-05
|
||||
100, Cl, 1.79663, 0.0479452
|
||||
100, Mg, 1.89434, 0.050751
|
||||
100, Calcite, 0.000314689, 2.20679e-05
|
||||
100, Calcite_p1, 0, 0
|
||||
100, Dolomite, 0.0030105, 0.000956423
|
||||
100, Dolomite, 0.000611171, 0.000558382
|
||||
100, Dolomite_p1, 0, 0
|
||||
100, O2g_eq, 0.111391, 0.00128101
|
||||
100, O2g_eq, 0.130299, 0.0013932
|
||||
100, O2g_si, 0, 0
|
||||
|
||||
120, ID, 0, 0
|
||||
120, H, 3.50261e-14, 6.3007e-16
|
||||
120, O, 0.0402783, 0.000474447
|
||||
120, Charge, 0.0155968, 0.000199072
|
||||
120, C, 0.00106331, 5.708e-05
|
||||
120, Ca, 0.00106484, 5.72572e-05
|
||||
120, Cl, 0.840976, 0.0523175
|
||||
120, Mg, 0.960964, 0.0851715
|
||||
120, Calcite, 0.000662119, 3.72101e-05
|
||||
120, H, 2.45742e-14, 4.82097e-16
|
||||
120, O, 0.0511434, 0.000552565
|
||||
120, Charge, 0.0151224, 0.000169403
|
||||
120, C, 0.00055729, 3.68181e-05
|
||||
120, Ca, 0.000557564, 3.68497e-05
|
||||
120, Cl, 1.26629, 0.0384465
|
||||
120, Mg, 1.33603, 0.0414565
|
||||
120, Calcite, 0.000344085, 2.33848e-05
|
||||
120, Calcite_p1, 0, 0
|
||||
120, Dolomite, 0.0267412, 0.0144917
|
||||
120, Dolomite, 0.00565502, 0.0070734
|
||||
120, Dolomite_p1, 0, 0
|
||||
120, O2g_eq, 0.104765, 0.00123562
|
||||
120, O2g_eq, 0.133569, 0.00144506
|
||||
120, O2g_si, 0, 0
|
||||
|
||||
140, ID, 0, 0
|
||||
140, H, 4.14022e-14, 6.85264e-16
|
||||
140, O, 0.0379425, 0.000458507
|
||||
140, Charge, 0.0143378, 0.000190886
|
||||
140, C, 0.00103922, 5.03887e-05
|
||||
140, Ca, 0.00104158, 5.0623e-05
|
||||
140, Cl, 0.663446, 0.046461
|
||||
140, Mg, 0.776981, 0.0796788
|
||||
140, Calcite, 0.000647302, 3.25312e-05
|
||||
140, H, 0, 0
|
||||
140, O, 0, 0
|
||||
140, Charge, 0, 0
|
||||
140, C, 0, 0
|
||||
140, Ca, 0, 0
|
||||
140, Cl, 0, 0
|
||||
140, Mg, 0, 0
|
||||
140, Calcite, 0, 0
|
||||
140, Calcite_p1, 0, 0
|
||||
140, Dolomite, 0.0240131, 0.0137403
|
||||
140, Dolomite, 0, 0
|
||||
140, Dolomite_p1, 0, 0
|
||||
140, O2g_eq, 0.0985411, 0.00119191
|
||||
140, O2g_eq, 0, 0
|
||||
140, O2g_si, 0, 0
|
||||
|
||||
160, ID, 0, 0
|
||||
160, H, 3.71028e-14, 6.90547e-16
|
||||
160, O, 0.0354217, 0.000441511
|
||||
160, Charge, 0.0132313, 0.000183316
|
||||
160, C, 0.00108786, 5.02857e-05
|
||||
160, Ca, 0.00109084, 5.06277e-05
|
||||
160, Cl, 0.525261, 0.0418011
|
||||
160, Mg, 0.638517, 0.0765625
|
||||
160, Calcite, 0.000679934, 3.27925e-05
|
||||
160, H, 0, 0
|
||||
160, O, 0, 0
|
||||
160, Charge, 0, 0
|
||||
160, C, 0, 0
|
||||
160, Ca, 0, 0
|
||||
160, Cl, 0, 0
|
||||
160, Mg, 0, 0
|
||||
160, Calcite, 0, 0
|
||||
160, Calcite_p1, 0, 0
|
||||
160, Dolomite, 0.0124243, 0.00966693
|
||||
160, Dolomite, 0, 0
|
||||
160, Dolomite_p1, 0, 0
|
||||
160, O2g_eq, 0.091823, 0.00114555
|
||||
160, O2g_eq, 0, 0
|
||||
160, O2g_si, 0, 0
|
||||
|
||||
180, ID, 0, 0
|
||||
180, H, 4.21264e-14, 6.43691e-16
|
||||
180, O, 0.0451131, 0.000507232
|
||||
180, Charge, 0.0133282, 0.000158663
|
||||
180, C, 0.000689696, 3.58042e-05
|
||||
180, Ca, 0.000689595, 3.57904e-05
|
||||
180, Cl, 0.920225, 0.0359217
|
||||
180, Mg, 0.986528, 0.0403564
|
||||
180, Calcite, 0.000420255, 2.2125e-05
|
||||
180, Calcite_p1, 0, 0
|
||||
180, Dolomite, 0.0148754, 0.00869066
|
||||
180, Dolomite_p1, 0, 0
|
||||
180, O2g_eq, 0.117169, 0.00131922
|
||||
180, O2g_si, 0, 0
|
||||
|
||||
200, ID, 0, 0
|
||||
200, H, 3.09518e-14, 5.96967e-16
|
||||
200, O, 0.0460042, 0.000524667
|
||||
200, Charge, 0.0127803, 0.000155455
|
||||
200, C, 0.000624372, 3.16039e-05
|
||||
200, Ca, 0.000624798, 3.16382e-05
|
||||
200, Cl, 0.711112, 0.0301469
|
||||
200, Mg, 0.766742, 0.0335527
|
||||
200, Calcite, 0.000388114, 2.04472e-05
|
||||
200, Calcite_p1, 0, 0
|
||||
200, Dolomite, 0.00418652, 0.00305248
|
||||
200, Dolomite_p1, 0, 0
|
||||
200, O2g_eq, 0.119619, 0.00136598
|
||||
200, O2g_si, 0, 0
|
||||
|
||||
220, ID, 0, 0
|
||||
220, H, 3.38653e-14, 6.03322e-16
|
||||
220, O, 0.0448395, 0.000519484
|
||||
220, Charge, 0.0122, 0.000151847
|
||||
220, C, 0.000602414, 3.03438e-05
|
||||
220, Ca, 0.000602795, 3.0383e-05
|
||||
220, Cl, 0.57974, 0.026681
|
||||
220, Mg, 0.630163, 0.0304884
|
||||
220, Calcite, 0.000371929, 1.92166e-05
|
||||
220, Calcite_p1, 0, 0
|
||||
220, Dolomite, 0.027979, 0.0156879
|
||||
220, Dolomite_p1, 0, 0
|
||||
220, O2g_eq, 0.116433, 0.00135073
|
||||
220, O2g_si, 0, 0
|
||||
|
||||
240, ID, 0, 0
|
||||
240, H, 4.01928e-14, 6.63038e-16
|
||||
240, O, 0.0437732, 0.00051452
|
||||
240, Charge, 0.0116593, 0.000148471
|
||||
240, C, 0.000622541, 3.15577e-05
|
||||
240, Ca, 0.000623301, 3.1637e-05
|
||||
240, Cl, 0.486397, 0.0242533
|
||||
240, Mg, 0.532535, 0.0278207
|
||||
240, Calcite, 0.000388216, 2.05683e-05
|
||||
240, Calcite_p1, 0, 0
|
||||
240, Dolomite, 0.0318458, 0.0173306
|
||||
240, Dolomite_p1, 0, 0
|
||||
240, O2g_eq, 0.113552, 0.00133602
|
||||
240, O2g_si, 0, 0
|
||||
|
||||
260, ID, 0, 0
|
||||
260, H, 3.49348e-14, 6.34319e-16
|
||||
260, O, 0.0426325, 0.000508416
|
||||
260, Charge, 0.011194, 0.000145704
|
||||
260, C, 0.000560489, 2.68571e-05
|
||||
260, Ca, 0.000561128, 2.69044e-05
|
||||
260, Cl, 0.416622, 0.023058
|
||||
260, Mg, 0.459164, 0.026071
|
||||
260, Calcite, 0.000347105, 1.71572e-05
|
||||
260, Calcite_p1, 0, 0
|
||||
260, Dolomite, 0.0209413, 0.012389
|
||||
260, Dolomite_p1, 0, 0
|
||||
260, O2g_eq, 0.110485, 0.00131874
|
||||
260, O2g_si, 0, 0
|
||||
|
||||
280, ID, 0, 0
|
||||
280, H, 3.60996e-14, 6.6192e-16
|
||||
280, O, 0.0413622, 0.000500831
|
||||
280, Charge, 0.0107693, 0.000142997
|
||||
280, C, 0.000577356, 2.6604e-05
|
||||
280, Ca, 0.000578462, 2.6685e-05
|
||||
280, Cl, 0.360292, 0.0214539
|
||||
280, Mg, 0.401591, 0.0253684
|
||||
280, Calcite, 0.000364216, 1.81639e-05
|
||||
280, Calcite_p1, 0, 0
|
||||
280, Dolomite, 0.0221824, 0.0141538
|
||||
280, Dolomite_p1, 0, 0
|
||||
280, O2g_eq, 0.107019, 0.00129705
|
||||
280, O2g_si, 0, 0
|
||||
|
||||
300, ID, 0, 0
|
||||
300, H, 3.56994e-14, 6.52017e-16
|
||||
300, O, 0.0399861, 0.000491851
|
||||
300, Charge, 0.0103422, 0.000140284
|
||||
300, C, 0.000604904, 2.83669e-05
|
||||
300, Ca, 0.000605783, 2.84371e-05
|
||||
300, Cl, 0.313853, 0.0201635
|
||||
300, Mg, 0.353232, 0.0235415
|
||||
300, Calcite, 0.000386924, 2.08332e-05
|
||||
300, Calcite_p1, 0, 0
|
||||
300, Dolomite, 0.0226333, 0.0141679
|
||||
300, Dolomite_p1, 0, 0
|
||||
300, O2g_eq, 0.103311, 0.00127183
|
||||
300, O2g_si, 0, 0
|
||||
|
||||
320, ID, 0, 0
|
||||
320, H, 3.40886e-14, 6.62584e-16
|
||||
320, O, 0.0387726, 0.000484965
|
||||
320, Charge, 0.00993204, 0.000137438
|
||||
320, C, 0.000604705, 2.84329e-05
|
||||
320, Ca, 0.000605988, 2.85747e-05
|
||||
320, Cl, 0.274623, 0.0191566
|
||||
320, Mg, 0.313395, 0.0223996
|
||||
320, Calcite, 0.000376625, 1.86093e-05
|
||||
320, Calcite_p1, 0, 0
|
||||
320, Dolomite, 0.0134875, 0.0101849
|
||||
320, Dolomite_p1, 0, 0
|
||||
320, O2g_eq, 0.100005, 0.00125156
|
||||
320, O2g_si, 0, 0
|
||||
|
||||
340, ID, 0, 0
|
||||
340, H, 3.70111e-14, 6.80177e-16
|
||||
340, O, 0.0376343, 0.00047866
|
||||
340, Charge, 0.00956443, 0.000134982
|
||||
340, C, 0.000601699, 2.71597e-05
|
||||
340, Ca, 0.000603066, 2.72861e-05
|
||||
340, Cl, 0.238462, 0.018479
|
||||
340, Mg, 0.280258, 0.0219955
|
||||
340, Calcite, 0.000385246, 1.94428e-05
|
||||
340, Calcite_p1, 0, 0
|
||||
340, Dolomite, 0.0318, 0.0161574
|
||||
340, Dolomite_p1, 0, 0
|
||||
340, O2g_eq, 0.0969628, 0.00123385
|
||||
340, O2g_si, 0, 0
|
||||
|
||||
360, ID, 0, 0
|
||||
360, H, 3.60799e-14, 6.63514e-16
|
||||
360, O, 0.0365169, 0.000472697
|
||||
360, Charge, 0.00920089, 0.000132444
|
||||
360, C, 0.000589346, 2.56004e-05
|
||||
360, Ca, 0.000590568, 2.56932e-05
|
||||
360, Cl, 0.193642, 0.0171236
|
||||
360, Mg, 0.248585, 0.0212179
|
||||
360, Calcite, 0.000377203, 1.84335e-05
|
||||
360, Calcite_p1, 0, 0
|
||||
360, Dolomite, 0.0218774, 0.0141493
|
||||
360, Dolomite_p1, 0, 0
|
||||
360, O2g_eq, 0.0939613, 0.00121694
|
||||
360, O2g_si, 0, 0
|
||||
|
||||
380, ID, 0, 0
|
||||
380, H, 3.55796e-14, 6.8648e-16
|
||||
380, O, 0.0354729, 0.000466356
|
||||
380, Charge, 0.0088669, 0.000130032
|
||||
380, C, 0.00063697, 2.96211e-05
|
||||
380, Ca, 0.000638083, 2.97091e-05
|
||||
380, Cl, 0.140909, 0.0150374
|
||||
380, Mg, 0.216507, 0.0225187
|
||||
380, Calcite, 0.000406558, 2.07877e-05
|
||||
380, Calcite_p1, 0, 0
|
||||
380, Dolomite, 0.047141, 0.021219
|
||||
380, Dolomite_p1, 0, 0
|
||||
380, O2g_eq, 0.0911081, 0.00119849
|
||||
380, O2g_si, 0, 0
|
||||
|
||||
400, ID, 0, 0
|
||||
400, H, 3.6232e-14, 7.02432e-16
|
||||
400, O, 0.0345795, 0.0004623
|
||||
400, Charge, 0.00852493, 0.000127455
|
||||
400, C, 0.000603678, 2.58639e-05
|
||||
400, Ca, 0.000605169, 2.59922e-05
|
||||
400, Cl, 0.10123, 0.014209
|
||||
400, Mg, 0.175309, 0.020241
|
||||
400, Calcite, 0.000381044, 1.74899e-05
|
||||
400, Calcite_p1, 0, 0
|
||||
400, Dolomite, 0.0368562, 0.018712
|
||||
400, Dolomite_p1, 0, 0
|
||||
400, O2g_eq, 0.0887188, 0.0011865
|
||||
400, O2g_si, 0, 0
|
||||
|
||||
420, ID, 0, 0
|
||||
420, H, 3.83382e-14, 6.68783e-16
|
||||
420, O, 0.0335484, 0.000455385
|
||||
420, Charge, 0.00817171, 0.000124832
|
||||
420, C, 0.000603529, 2.54134e-05
|
||||
420, Ca, 0.000605869, 2.56068e-05
|
||||
420, Cl, 0.067397, 0.0126332
|
||||
420, Mg, 0.132868, 0.0190658
|
||||
420, Calcite, 0.000382948, 1.74596e-05
|
||||
420, Calcite_p1, 0, 0
|
||||
420, Dolomite, 0.0226142, 0.0141506
|
||||
420, Dolomite_p1, 0, 0
|
||||
420, O2g_eq, 0.0859497, 0.00116688
|
||||
420, O2g_si, 0, 0
|
||||
|
||||
440, ID, 0, 0
|
||||
440, H, 3.67274e-14, 6.59047e-16
|
||||
440, O, 0.0326937, 0.000451041
|
||||
440, Charge, 0.0078609, 0.000122411
|
||||
440, C, 0.0006084, 2.44131e-05
|
||||
440, Ca, 0.000610448, 2.45656e-05
|
||||
440, Cl, 0.03675, 0.0100792
|
||||
440, Mg, 0.0979748, 0.0177069
|
||||
440, Calcite, 0.000390181, 1.72703e-05
|
||||
440, Calcite_p1, 0, 0
|
||||
440, Dolomite, 0.0246411, 0.0142021
|
||||
440, Dolomite_p1, 0, 0
|
||||
440, O2g_eq, 0.0836881, 0.0011549
|
||||
440, O2g_si, 0, 0
|
||||
|
||||
460, ID, 0, 0
|
||||
460, H, 3.51522e-14, 6.28657e-16
|
||||
460, O, 0.0317917, 0.000445065
|
||||
460, Charge, 0.00753923, 0.000119952
|
||||
460, C, 0.000598644, 2.42974e-05
|
||||
460, Ca, 0.000600299, 2.44311e-05
|
||||
460, Cl, 0.0143973, 0.00637336
|
||||
460, Mg, 0.0677921, 0.0158669
|
||||
460, Calcite, 0.0003902, 1.9257e-05
|
||||
460, Calcite_p1, 0, 0
|
||||
460, Dolomite, 0.0128875, 0.0100163
|
||||
460, Dolomite_p1, 0, 0
|
||||
460, O2g_eq, 0.0812584, 0.00113768
|
||||
460, O2g_si, 0, 0
|
||||
|
||||
480, ID, 0, 0
|
||||
480, H, 3.58576e-14, 6.04745e-16
|
||||
480, O, 0.0309867, 0.000441054
|
||||
480, Charge, 0.00722698, 0.000117467
|
||||
480, C, 0.000607134, 2.35285e-05
|
||||
480, Ca, 0.00060929, 2.37256e-05
|
||||
480, Cl, 0.00374346, 0.00196574
|
||||
480, Mg, 0.04042, 0.0134234
|
||||
480, Calcite, 0.000388391, 1.64682e-05
|
||||
480, Calcite_p1, 0, 0
|
||||
480, Dolomite, 0.00312571, 0.000640164
|
||||
480, Dolomite_p1, 0, 0
|
||||
480, O2g_eq, 0.0791289, 0.00112619
|
||||
480, O2g_si, 0, 0
|
||||
|
||||
500, ID, 0, 0
|
||||
500, H, 3.64637e-14, 6.36339e-16
|
||||
500, O, 0.0302192, 0.000436687
|
||||
500, Charge, 0.00693139, 0.000114918
|
||||
500, C, 0.000609576, 2.32842e-05
|
||||
500, Ca, 0.000612185, 2.34914e-05
|
||||
500, Cl, 0.000865377, 0.000464931
|
||||
500, Mg, 0.017595, 0.00765859
|
||||
500, Calcite, 0.000387095, 1.60962e-05
|
||||
500, Calcite_p1, 0, 0
|
||||
500, Dolomite, 0.00378159, 0.000835746
|
||||
500, Dolomite_p1, 0, 0
|
||||
500, O2g_eq, 0.0770378, 0.00111302
|
||||
500, O2g_si, 0, 0
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -299,6 +299,7 @@ namespace poet
|
||||
CHEM_DHT_SIGNIF_VEC,
|
||||
CHEM_DHT_SNAPS,
|
||||
CHEM_DHT_READ_FILE,
|
||||
CHEM_INTERP,
|
||||
CHEM_IP_ENABLE,
|
||||
CHEM_IP_MIN_ENTRIES,
|
||||
CHEM_IP_SIGNIF_VEC,
|
||||
|
||||
@ -448,6 +448,19 @@ void poet::ChemistryModule::MasterRunParallel(double dt) {
|
||||
ftype = CHEM_WORK_LOOP;
|
||||
PropagateFunctionType(ftype);
|
||||
|
||||
ftype = CHEM_INTERP;
|
||||
PropagateFunctionType(ftype);
|
||||
|
||||
if(this->runtime_params->rollback_simulation){
|
||||
this->interp_enabled = false;
|
||||
int interp_flag = 0;
|
||||
ChemBCast(&interp_flag, 1, MPI_INT);
|
||||
} else {
|
||||
this->interp_enabled = true;
|
||||
int interp_flag = 1;
|
||||
ChemBCast(&interp_flag, 1, MPI_INT);
|
||||
}
|
||||
|
||||
MPI_Barrier(this->group_comm);
|
||||
|
||||
static uint32_t iteration = 0;
|
||||
|
||||
@ -34,105 +34,112 @@ namespace poet
|
||||
return ret_str;
|
||||
}
|
||||
|
||||
void poet::ChemistryModule::WorkerLoop()
|
||||
{
|
||||
struct worker_s timings;
|
||||
|
||||
// HACK: defining the worker iteration count here, which will increment after
|
||||
// each CHEM_ITER_END message
|
||||
uint32_t iteration = 1;
|
||||
bool loop = true;
|
||||
|
||||
while (loop)
|
||||
void poet::ChemistryModule::WorkerLoop()
|
||||
{
|
||||
int func_type;
|
||||
PropagateFunctionType(func_type);
|
||||
struct worker_s timings;
|
||||
|
||||
switch (func_type)
|
||||
// HACK: defining the worker iteration count here, which will increment after
|
||||
// each CHEM_ITER_END message
|
||||
uint32_t iteration = 1;
|
||||
bool loop = true;
|
||||
|
||||
while (loop)
|
||||
{
|
||||
case CHEM_FIELD_INIT:
|
||||
{
|
||||
ChemBCast(&this->prop_count, 1, MPI_UINT32_T);
|
||||
if (this->ai_surrogate_enabled)
|
||||
int func_type;
|
||||
PropagateFunctionType(func_type);
|
||||
|
||||
switch (func_type)
|
||||
{
|
||||
this->ai_surrogate_validity_vector.resize(
|
||||
this->n_cells); // resize statt reserve?
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CHEM_AI_BCAST_VALIDITY:
|
||||
{
|
||||
// Receive the index vector of valid ai surrogate predictions
|
||||
MPI_Bcast(&this->ai_surrogate_validity_vector.front(), this->n_cells,
|
||||
MPI_INT, 0, this->group_comm);
|
||||
break;
|
||||
}
|
||||
case CHEM_WORK_LOOP:
|
||||
{
|
||||
WorkerProcessPkgs(timings, iteration);
|
||||
break;
|
||||
}
|
||||
case CHEM_PERF:
|
||||
{
|
||||
int type;
|
||||
ChemBCast(&type, 1, MPI_INT);
|
||||
if (type < WORKER_DHT_HITS)
|
||||
case CHEM_FIELD_INIT:
|
||||
{
|
||||
WorkerPerfToMaster(type, timings);
|
||||
ChemBCast(&this->prop_count, 1, MPI_UINT32_T);
|
||||
if (this->ai_surrogate_enabled)
|
||||
{
|
||||
this->ai_surrogate_validity_vector.resize(
|
||||
this->n_cells); // resize statt reserve?
|
||||
}
|
||||
break;
|
||||
}
|
||||
WorkerMetricsToMaster(type);
|
||||
break;
|
||||
}
|
||||
case CHEM_BREAK_MAIN_LOOP:
|
||||
{
|
||||
WorkerPostSim(iteration);
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw std::runtime_error("Worker received unknown tag from master.");
|
||||
}
|
||||
case CHEM_AI_BCAST_VALIDITY:
|
||||
{
|
||||
// Receive the index vector of valid ai surrogate predictions
|
||||
MPI_Bcast(&this->ai_surrogate_validity_vector.front(), this->n_cells,
|
||||
MPI_INT, 0, this->group_comm);
|
||||
break;
|
||||
}
|
||||
case CHEM_INTERP:
|
||||
{
|
||||
int interp_flag;
|
||||
ChemBCast(&interp_flag, 1, MPI_INT);
|
||||
this->interp_enabled = (interp_flag == 1);
|
||||
break;
|
||||
}
|
||||
case CHEM_WORK_LOOP:
|
||||
{
|
||||
WorkerProcessPkgs(timings, iteration);
|
||||
break;
|
||||
}
|
||||
case CHEM_PERF:
|
||||
{
|
||||
int type;
|
||||
ChemBCast(&type, 1, MPI_INT);
|
||||
if (type < WORKER_DHT_HITS)
|
||||
{
|
||||
WorkerPerfToMaster(type, timings);
|
||||
break;
|
||||
}
|
||||
WorkerMetricsToMaster(type);
|
||||
break;
|
||||
}
|
||||
case CHEM_BREAK_MAIN_LOOP:
|
||||
{
|
||||
WorkerPostSim(iteration);
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
throw std::runtime_error("Worker received unknown tag from master.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void poet::ChemistryModule::WorkerProcessPkgs(struct worker_s &timings,
|
||||
uint32_t &iteration)
|
||||
{
|
||||
MPI_Status probe_status;
|
||||
bool loop = true;
|
||||
|
||||
MPI_Barrier(this->group_comm);
|
||||
|
||||
while (loop)
|
||||
void poet::ChemistryModule::WorkerProcessPkgs(struct worker_s &timings,
|
||||
uint32_t &iteration)
|
||||
{
|
||||
double idle_a = MPI_Wtime();
|
||||
MPI_Probe(0, MPI_ANY_TAG, this->group_comm, &probe_status);
|
||||
double idle_b = MPI_Wtime();
|
||||
MPI_Status probe_status;
|
||||
bool loop = true;
|
||||
|
||||
switch (probe_status.MPI_TAG)
|
||||
{
|
||||
case LOOP_WORK:
|
||||
{
|
||||
timings.idle_t += idle_b - idle_a;
|
||||
int count;
|
||||
MPI_Get_count(&probe_status, MPI_DOUBLE, &count);
|
||||
MPI_Barrier(this->group_comm);
|
||||
|
||||
WorkerDoWork(probe_status, count, timings);
|
||||
break;
|
||||
}
|
||||
case LOOP_END:
|
||||
while (loop)
|
||||
{
|
||||
WorkerPostIter(probe_status, iteration);
|
||||
iteration++;
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
double idle_a = MPI_Wtime();
|
||||
MPI_Probe(0, MPI_ANY_TAG, this->group_comm, &probe_status);
|
||||
double idle_b = MPI_Wtime();
|
||||
|
||||
switch (probe_status.MPI_TAG)
|
||||
{
|
||||
case LOOP_WORK:
|
||||
{
|
||||
timings.idle_t += idle_b - idle_a;
|
||||
int count;
|
||||
MPI_Get_count(&probe_status, MPI_DOUBLE, &count);
|
||||
|
||||
WorkerDoWork(probe_status, count, timings);
|
||||
break;
|
||||
}
|
||||
case LOOP_END:
|
||||
{
|
||||
WorkerPostIter(probe_status, iteration);
|
||||
iteration++;
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void poet::ChemistryModule::WorkerDoWork(MPI_Status &probe_status,
|
||||
int double_count,
|
||||
@ -254,7 +261,7 @@ namespace poet
|
||||
|
||||
for (std::size_t wp_i = 0; wp_i < s_curr_wp.size; wp_i++)
|
||||
{
|
||||
if (!s_curr_wp.mapping[wp_i] == CHEM_PQC) // only copy if surrogate was used
|
||||
if (s_curr_wp.mapping[wp_i] != CHEM_PQC) // only copy if surrogate was used
|
||||
{
|
||||
std::copy(s_curr_wp.output[wp_i].begin(), s_curr_wp.output[wp_i].end(),
|
||||
mpi_buffer.begin() + sur_wp_offset + this->prop_count * wp_i);
|
||||
|
||||
87
src/poet.cpp
87
src/poet.cpp
@ -270,6 +270,10 @@ int parseInitValues(int argc, char **argv, RuntimeParameters ¶ms)
|
||||
Rcpp::as<uint32_t>(global_rt_setup->operator[]("control_iteration"));
|
||||
params.species_epsilon =
|
||||
Rcpp::as<std::vector<double>>(global_rt_setup->operator[]("species_epsilon"));
|
||||
params.penalty_iteration =
|
||||
Rcpp::as<uint32_t>(global_rt_setup->operator[]("penalty_iteration"));
|
||||
params.max_penalty_iteration =
|
||||
Rcpp::as<uint32_t>(global_rt_setup->operator[]("max_penalty_iteration"));
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
@ -302,31 +306,50 @@ void call_master_iter_end(RInside &R, const Field &trans, const Field &chem)
|
||||
|
||||
bool checkAndRollback(ChemistryModule &chem, RuntimeParameters ¶ms, uint32_t &iter)
|
||||
{
|
||||
for (uint32_t i = 0; i < chem.error_stats_history.size(); i++)
|
||||
const std::vector<double> &latest_mape = chem.error_stats_history.back().mape;
|
||||
|
||||
for (uint32_t j = 0; j < params.species_epsilon.size(); j++)
|
||||
{
|
||||
if (iter == chem.error_stats_history[i].iteration)
|
||||
if (params.species_epsilon[j] < latest_mape[j] && latest_mape[j] != 0)
|
||||
{
|
||||
for (uint32_t j = 0; j < params.species_epsilon.size(); j++)
|
||||
{
|
||||
if (params.species_epsilon[j] < chem.error_stats_history[i].mape[j] && chem.error_stats_history[i].mape[j] != 0 && chem.control_iteration_counter > 1)
|
||||
{
|
||||
uint32_t rollback_iter = iter - params.control_iteration;
|
||||
uint32_t rollback_iter = iter - (iter % params.control_iteration);
|
||||
|
||||
std::cout << chem.getField().GetProps()[j] << " with a MAPE value of " << chem.error_stats_history[i].mape[j] << " exceeds epsilon of "
|
||||
<< params.species_epsilon[j] << "! " << std::endl;
|
||||
std::cout << chem.getField().GetProps()[j] << " with a MAPE value of " << latest_mape[j] << " exceeds epsilon of "
|
||||
<< params.species_epsilon[j] << "! " << std::endl;
|
||||
|
||||
Checkpoint_s checkpoint_read{.field = chem.getField()};
|
||||
read_checkpoint("checkpoint" + std::to_string(rollback_iter) + ".hdf5", checkpoint_read);
|
||||
iter = checkpoint_read.iteration;
|
||||
Checkpoint_s checkpoint_read{.field = chem.getField()};
|
||||
read_checkpoint("checkpoint" + std::to_string(rollback_iter) + ".hdf5", checkpoint_read);
|
||||
iter = checkpoint_read.iteration;
|
||||
|
||||
chem.control_iteration_counter--;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
MSG("All spezies are below their threshold values");
|
||||
return false;
|
||||
}
|
||||
|
||||
void updatePenaltyLogic(RuntimeParameters ¶ms, bool roolback_happend)
|
||||
{
|
||||
if (roolback_happend)
|
||||
{
|
||||
params.rollback_simulation = true;
|
||||
params.penalty_counter = params.penalty_iteration;
|
||||
std::cout << "Penalty counter reset to: " << params.penalty_counter << std::endl;
|
||||
MSG("Rollback! Penalty phase started for " + std::to_string(params.penalty_iteration) + " iterations.");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (params.rollback_simulation && params.penalty_counter == 0)
|
||||
{
|
||||
params.rollback_simulation = false;
|
||||
MSG("Penalty phase ended. Interpolation re-enabled.");
|
||||
}
|
||||
else if (!params.rollback_simulation)
|
||||
{
|
||||
params.penalty_iteration = std::min(params.penalty_iteration *= 2, params.max_penalty_iteration);
|
||||
MSG("Stable surrogate phase detected. Penalty iteration doubled to " + std::to_string(params.penalty_iteration) + " iterations.");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static Rcpp::List RunMasterLoop(RInsidePOET &R, RuntimeParameters ¶ms,
|
||||
@ -344,13 +367,21 @@ static Rcpp::List RunMasterLoop(RInsidePOET &R, RuntimeParameters ¶ms,
|
||||
}
|
||||
R["TMP_PROPS"] = Rcpp::wrap(chem.getField().GetProps());
|
||||
|
||||
params.next_penalty_check = params.penalty_iteration;
|
||||
|
||||
/* SIMULATION LOOP */
|
||||
|
||||
double dSimTime{0};
|
||||
for (uint32_t iter = 1; iter < maxiter + 1; iter++)
|
||||
{
|
||||
// Penalty countdown
|
||||
if (params.rollback_simulation && params.penalty_counter > 0)
|
||||
{
|
||||
params.penalty_counter--;
|
||||
std::cout << "Penalty counter: " << params.penalty_counter << std::endl;
|
||||
}
|
||||
|
||||
params.control_iteration_active = (iter % params.control_iteration == 0 && iter != 0);
|
||||
params.control_iteration_active = (iter % params.control_iteration == 0 /* && iter != 0 */);
|
||||
|
||||
double start_t = MPI_Wtime();
|
||||
|
||||
@ -459,12 +490,6 @@ static Rcpp::List RunMasterLoop(RInsidePOET &R, RuntimeParameters ¶ms,
|
||||
// TODO: write checkpoint
|
||||
// checkpoint struct --> field and iteration
|
||||
|
||||
/*else if (iter == 2) {
|
||||
Checkpoint_s checkpoint_read{.field = chem.getField()};
|
||||
read_checkpoint("checkpoint1.hdf5", checkpoint_read);
|
||||
iter = checkpoint_read.iteration;
|
||||
}*/
|
||||
|
||||
diffusion.getField().update(chem.getField());
|
||||
|
||||
MSG("End of *coupling* iteration " + std::to_string(iter) + "/" +
|
||||
@ -473,12 +498,18 @@ static Rcpp::List RunMasterLoop(RInsidePOET &R, RuntimeParameters ¶ms,
|
||||
if (iter % params.control_iteration == 0)
|
||||
{
|
||||
writeStatsToCSV(chem.error_stats_history, chem.getField().GetProps(), "stats_overview");
|
||||
|
||||
write_checkpoint("checkpoint" + std::to_string(iter) + ".hdf5",
|
||||
{.field = chem.getField(), .iteration = iter});
|
||||
checkAndRollback(chem, params, iter);
|
||||
|
||||
}
|
||||
|
||||
if (iter == params.next_penalty_check)
|
||||
{
|
||||
bool roolback_happend = checkAndRollback(chem, params, iter);
|
||||
updatePenaltyLogic(params, roolback_happend);
|
||||
|
||||
params.next_penalty_check = iter + params.penalty_iteration;
|
||||
}
|
||||
|
||||
// MSG();
|
||||
} // END SIMULATION LOOP
|
||||
|
||||
|
||||
@ -52,6 +52,11 @@ struct RuntimeParameters {
|
||||
|
||||
bool print_progress = false;
|
||||
|
||||
std::uint32_t penalty_iteration = 0;
|
||||
std::uint32_t max_penalty_iteration = 0;
|
||||
std::uint32_t penalty_counter = 0;
|
||||
std::uint32_t next_penalty_check = 0;
|
||||
bool rollback_simulation = false;
|
||||
bool control_iteration_active = false;
|
||||
std::uint32_t control_iteration = 1;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user