Commit 0eb158aa authored by luroth's avatar luroth
Browse files

memory tweak

parent 02f6c688
......@@ -111,7 +111,7 @@ df_temp <- read_csv('Simulation/covariate_temp.csv')
cl <- parallel::makeCluster(number_of_cpus)
doParallel::registerDoParallel(cl)
foreach(run = start_run:max_runs, .verbose = TRUE,
foreach(run = start_run:max_runs, .verbose = FALSE,
.packages = c("fs", "readr", "tidyr", "purrr", "ggplot2", "lubridate", "gridExtra", "plyr", "stringr", "SpATS", "dplyr", "scam", "MASS")
) %dopar% {
......@@ -243,6 +243,10 @@ foreach(run = start_run:max_runs, .verbose = TRUE,
df_growth_phase_predicts <- df_spline_predicts %>% ungroup() %>% group_by(plot.UID) %>%
mutate(growth_phase_params = map(spline_predicts, find_start_stop_growth_phase_posterior))
# Drop large spline objects
rm(df_spline_predicts)
gc()
file_touch(paste0(path_simulation, "/", run, "/", set, "_MILESTONE_extract_traits.txt"))
# Extract predicted values
......@@ -517,6 +521,13 @@ foreach(run = start_run:max_runs, .verbose = TRUE,
df_all_params_BLUE$set <- set
write_csv(df_all_params_BLUE, paste0(path_simulation, "/", run, "/", set, "_year_site_BLUE_predict.csv"))
rm(df_all_params)
rm(df_genotype_predicts)
rm(df_all_params_BLUE)
rm(df_growth_phase_predicts_)
rm(df_growth_phase_predicts)
gc()
} else {
print("Results present, skip")
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment