mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 12:54:50 +01:00
Compare commits
3 Commits
72775432fe
...
6b36bdbc7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b36bdbc7e | ||
|
|
2f86fb6f30 | ||
|
|
7d459769fd |
@ -1,123 +0,0 @@
|
||||
## Time-stamp: "Last modified 2024-12-11 16:08:11 delucia"
|
||||
|
||||
cols <- 1000
|
||||
rows <- 1000
|
||||
|
||||
dim_cols <- 50
|
||||
dim_rows <- 50
|
||||
|
||||
ncirc <- 20 ## number of crystals
|
||||
rmax <- cols / 10 ## max radius (in nodes)
|
||||
|
||||
set.seed(22933)
|
||||
|
||||
centers <- cbind(sample(seq_len(cols), ncirc), sample(seq_len(rows), ncirc))
|
||||
radii <- sample(seq_len(rmax), ncirc, replace = TRUE)
|
||||
mi <- matrix(rep(seq_len(cols), rows), byrow = TRUE, nrow = rows)
|
||||
mj <- matrix(rep(seq_len(cols), each = rows), byrow = TRUE, nrow = rows)
|
||||
|
||||
tmpl <- lapply(seq_len(ncirc), function(x) which((mi - centers[x, 1])^2 + (mj - centers[x, 2])^2 < radii[x]^2, arr.ind = TRUE))
|
||||
|
||||
inds <- do.call(rbind, tmpl)
|
||||
grid <- matrix(1, nrow = rows, ncol = cols)
|
||||
grid[inds] <- 2
|
||||
|
||||
alpha <- matrix(1e-5, ncol = cols, nrow = rows)
|
||||
alpha[inds] <- 1e-7
|
||||
|
||||
## image(grid, asp=1)
|
||||
|
||||
## Define grid configuration for POET model
|
||||
grid_setup <- list(
|
||||
pqc_in_file = "./barite_fgcs_2.pqi",
|
||||
pqc_db_file = "../barite/db_barite.dat", ## database file
|
||||
grid_def = grid, ## grid definition, IDs according to the Phreeqc input
|
||||
grid_size = c(dim_cols, dim_rows), ## grid size in meters
|
||||
constant_cells = c() ## IDs of cells with constant concentration
|
||||
)
|
||||
|
||||
bound_length <- cols / 10
|
||||
|
||||
bound_N <- list(
|
||||
"type" = rep("constant", bound_length),
|
||||
"sol_id" = rep(3, bound_length),
|
||||
"cell" = seq(1, bound_length)
|
||||
)
|
||||
|
||||
bound_W <- list(
|
||||
"type" = rep("constant", bound_length),
|
||||
"sol_id" = rep(3, bound_length),
|
||||
"cell" = seq(1, bound_length)
|
||||
)
|
||||
bound_E <- list(
|
||||
"type" = rep("constant", bound_length),
|
||||
"sol_id" = rep(4, bound_length),
|
||||
"cell" = seq(rows - bound_length + 1, rows)
|
||||
)
|
||||
|
||||
bound_S <- list(
|
||||
"type" = rep("constant", bound_length),
|
||||
"sol_id" = rep(4, bound_length),
|
||||
"cell" = seq(cols - bound_length + 1, cols)
|
||||
)
|
||||
|
||||
diffusion_setup <- list(
|
||||
boundaries = list(
|
||||
"W" = bound_W,
|
||||
"N" = bound_N,
|
||||
"E" = bound_E,
|
||||
"S" = bound_S
|
||||
),
|
||||
alpha_x = alpha,
|
||||
alpha_y = alpha
|
||||
)
|
||||
|
||||
dht_species <- c(
|
||||
"H" = 7,
|
||||
"O" = 7,
|
||||
"Ba" = 7,
|
||||
"Cl" = 7,
|
||||
"S" = 7,
|
||||
"Sr" = 7,
|
||||
"Barite" = 4,
|
||||
"Celestite" = 4
|
||||
)
|
||||
|
||||
pht_species <- c(
|
||||
"Ba" = 4,
|
||||
"Cl" = 3,
|
||||
"S" = 3,
|
||||
"Sr" = 3,
|
||||
"Barite" = 0,
|
||||
"Celestite" = 0
|
||||
)
|
||||
|
||||
chemistry_setup <- list(
|
||||
dht_species = dht_species,
|
||||
pht_species = pht_species
|
||||
)
|
||||
|
||||
## Define a setup list for simulation configuration
|
||||
setup <- list(
|
||||
Grid = grid_setup, ## Parameters related to the grid structure
|
||||
Diffusion = diffusion_setup, ## Parameters related to the diffusion process
|
||||
Chemistry = chemistry_setup
|
||||
)
|
||||
|
||||
|
||||
iterations <- 100
|
||||
dt <- 200
|
||||
checkpoint_interval <- 20
|
||||
control_interval <- 20
|
||||
mape_threshold <- rep(3.5e-3, 13)
|
||||
#out_save <- seq(50, iterations, by = 50)
|
||||
|
||||
|
||||
list(
|
||||
timesteps = rep(dt, iterations),
|
||||
store_result = FALSE,
|
||||
#out_save = out_save,
|
||||
checkpoint_interval = checkpoint_interval,
|
||||
control_interval = control_interval,
|
||||
mape_threshold = mape_threshold
|
||||
)
|
||||
@ -1,49 +0,0 @@
|
||||
SOLUTION 1
|
||||
units mol/kgw
|
||||
water 1
|
||||
temperature 25
|
||||
pH 7.008
|
||||
pe 10.798
|
||||
S 6.205e-04
|
||||
Sr 6.205e-04
|
||||
END
|
||||
|
||||
SOLUTION 2
|
||||
units mol/kgw
|
||||
water 1
|
||||
temperature 25
|
||||
pH 7.008
|
||||
pe 10.798
|
||||
S 6.205e-04
|
||||
Sr 6.205e-04
|
||||
KINETICS 2
|
||||
Barite
|
||||
-m 0.00
|
||||
-parms 50. # reactive surface area
|
||||
-tol 1e-9
|
||||
Celestite
|
||||
-m 1
|
||||
-parms 10.0 # reactive surface area
|
||||
-tol 1e-9
|
||||
END
|
||||
|
||||
SOLUTION 3
|
||||
units mol/kgw
|
||||
water 1
|
||||
temperature 25
|
||||
Ba 0.1
|
||||
Cl 0.2
|
||||
END
|
||||
|
||||
SOLUTION 4
|
||||
units mol/kgw
|
||||
water 1
|
||||
temperature 25
|
||||
Ba 0.2
|
||||
Cl 0.4
|
||||
END
|
||||
|
||||
|
||||
RUN_CELLS
|
||||
-cells 1 2 3 4
|
||||
END
|
||||
Binary file not shown.
@ -115,19 +115,19 @@ setup <- list(
|
||||
Chemistry = chemistry_setup # Parameters related to the chemistry process
|
||||
)
|
||||
|
||||
iterations <- 5000
|
||||
iterations <- 15000
|
||||
dt <- 200
|
||||
checkpoint_interval <- 100
|
||||
control_interval <- 100
|
||||
mape_threshold <- rep(3.5e-3, 13)
|
||||
mape_threshold <- rep(0.1, 13)
|
||||
mape_threshold[5] <- 1 #Charge
|
||||
out_save <- seq(1000, iterations, by = 1000)
|
||||
out_save = c(seq(1, 10), seq(10, 100, by= 10), seq(200, iterations, by=100))
|
||||
#out_save = c(seq(1, 10), seq(10, 100, by= 10), seq(200, iterations, by=100))
|
||||
|
||||
|
||||
list(
|
||||
timesteps = rep(dt, iterations),
|
||||
store_result = FALSE,
|
||||
store_result = TRUE,
|
||||
out_save = out_save,
|
||||
checkpoint_interval = checkpoint_interval,
|
||||
control_interval = control_interval,
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
#!/bin/bash
|
||||
#SBATCH --job-name=dolo_5000_no_charge
|
||||
#SBATCH --output=dolo_5000_no_charge_%j.out
|
||||
#SBATCH --error=dolo_5000_no_charge_%j.err
|
||||
#SBATCH --job-name=dolo_proto1_eps01
|
||||
#SBATCH --output=dolo_proto1_eps01_%j.out
|
||||
#SBATCH --error=dolo_proto1_eps01_%j.err
|
||||
#SBATCH --partition=long
|
||||
#SBATCH --nodes=6
|
||||
#SBATCH --ntasks-per-node=24
|
||||
#SBATCH --ntasks=144
|
||||
#SBATCH --exclusive
|
||||
#SBATCH --time=12:00:00
|
||||
#SBATCH --time=3-00:00:00
|
||||
|
||||
|
||||
source /etc/profile.d/modules.sh
|
||||
module purge
|
||||
module load cmake gcc openmpi
|
||||
|
||||
mpirun -n 144 ./poet --interp dolo_fgcs_3.R dolo_fgcs_3.qs2 dolo_5000_no_charge
|
||||
##mpirun -n 96 ./poet --interp barite_fgcs_2.R barite_fgcs_2.qs2 bar_warmup
|
||||
#mpirun -n 144 ./poet dolo_fgcs_3.R dolo_fgcs_3.qs2 dolo_only_pqc
|
||||
mpirun -n 144 ./poet --interp dolo_fgcs_3.R dolo_fgcs_3.qs2 dolo_proto1_eps01
|
||||
#mpirun -n 144 ./poet --interp barite_fgcs_4_new/barite_fgcs_4_new_rt.R barite_fgcs_4_new/barite_fgcs_4_new.qs2 barite
|
||||
@ -39,13 +39,13 @@ void poet::ControlModule::initiateWarmupPhase(bool dht_enabled,
|
||||
chem->SetWarmupEnabled(true);
|
||||
chem->SetDhtEnabled(false);
|
||||
chem->SetInterpEnabled(false);
|
||||
// MSG("Warmup enabled until next control interval at iteration " +
|
||||
// std::to_string(control_interval) + ".");
|
||||
MSG("Warmup enabled until next control interval at iteration " +
|
||||
std::to_string(control_interval) + ".");
|
||||
|
||||
if (rollback_enabled) {
|
||||
if (sur_disabled_counter > 0) {
|
||||
--sur_disabled_counter;
|
||||
//MSG("Rollback counter: " + std::to_string(sur_disabled_counter));
|
||||
MSG("Rollback counter: " + std::to_string(sur_disabled_counter));
|
||||
} else {
|
||||
rollback_enabled = false;
|
||||
}
|
||||
@ -65,15 +65,16 @@ void poet::ControlModule::applyControlLogic(ChemistryModule &chem,
|
||||
}
|
||||
writeCheckpointAndMetrics(chem, iter);
|
||||
|
||||
if (checkAndRollback(chem, iter) /* && rollback_count < 4*/) {
|
||||
if (checkAndRollback(chem, iter) && rollback_count < 3) {
|
||||
rollback_enabled = true;
|
||||
rollback_count++;
|
||||
sur_disabled_counter = control_interval;
|
||||
/*
|
||||
|
||||
MSG("Interpolation disabled for the next " +
|
||||
std::to_string(control_interval) + ".");
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void poet::ControlModule::writeCheckpointAndMetrics(ChemistryModule &chem,
|
||||
|
||||
@ -439,13 +439,13 @@ static Rcpp::List RunMasterLoop(RInsidePOET &R, RuntimeParameters ¶ms,
|
||||
Rcpp::wrap(chem.GetWorkerControlTimings());
|
||||
|
||||
|
||||
if (params.use_dht) {
|
||||
//if (params.use_dht) {
|
||||
chem_profiling["dht_hits"] = Rcpp::wrap(chem.GetWorkerDHTHits());
|
||||
chem_profiling["dht_evictions"] = Rcpp::wrap(chem.GetWorkerDHTEvictions());
|
||||
chem_profiling["dht_get_time"] = Rcpp::wrap(chem.GetWorkerDHTGetTimings());
|
||||
chem_profiling["dht_fill_time"] =
|
||||
Rcpp::wrap(chem.GetWorkerDHTFillTimings());
|
||||
}
|
||||
//}
|
||||
|
||||
if (params.use_interp) {
|
||||
chem_profiling["interp_w"] =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user