# HG changeset patch # User siwaa # Date 1698398125 0 # Node ID 65c00476f417ee1388ed6d91cc02f394ff2f5b16 # Parent 52877f7c9d6b8e3513bc769d319735638aa1d0c4 "planemo upload for repository https://forgemia.inra.fr/redelac/redelac-toolbox/-/tree/4a2264991516b494ed11d1a7d5260ba543696a04/tools/REDELACSticsSimulator commit 4a2264991516b494ed11d1a7d5260ba543696a04-dirty" diff -r 52877f7c9d6b -r 65c00476f417 redelacSticsSimulator.R --- a/redelacSticsSimulator.R Tue Oct 17 11:21:34 2023 +0000 +++ b/redelacSticsSimulator.R Fri Oct 27 09:15:25 2023 +0000 @@ -9,6 +9,7 @@ library(dplyr) library(stringr) library(readr) +library(doFuture) sessionInfo() @@ -50,11 +51,9 @@ rotation <- successRef$rotation[1] if (parallel) { - cl <- makeCluster(nbSlots) - print("Inside R, info on the cluster:") - print(cl) - registerDoParallel(cl) - `%dordopar%` <- `%dopar%` + doFuture::registerDoFuture() + future::plan(multisession, workers = nbSlots) + `%dordopar%` <- `%dofuture%` } else { `%dordopar%` <- `%do%` } @@ -75,10 +74,9 @@ result <- foreach(j = 1:length(casesUpcSol)) %:% foreach( i = 1:nrow(successive_usms_tab_split[[j]]), - .packages = c("foreach", "SticsRFiles", "SticsOnR") + .options.future = list(packages =c("foreach", "SticsRFiles", "SticsOnR")) + ) %dordopar% { - if (parallel) - sink("./logPaRedelac.txt", append = TRUE) nusms <- as.numeric(successive_usms_tab_split[[j]][i, 2]) @@ -97,18 +95,12 @@ list_usms <- vec - cat(paste0("-->", successive_usms_tab_split[[j]][i, 1], "launched\n")) + cat(paste0("--> succession : ", successive_usms_tab_split[[j]][i, 1], " launched\n")) return(stics_wrapper(model_options = sim_options, situation = list_usms)) } -if (parallel) { - stopCluster(cl) - sink() - cat(read_file("./logPaRedelac.txt")) -} - for (j in 1:length(casesUpcSol)) { splited <- strsplit(casesUpcSol[j], split = "-")[[1]] diff -r 52877f7c9d6b -r 65c00476f417 redelacSticsSimulator.bash --- a/redelacSticsSimulator.bash Tue Oct 17 11:21:34 2023 +0000 +++ b/redelacSticsSimulator.bash Fri Oct 27 09:15:25 2023 +0000 @@ -14,7 +14,7 @@ cat ./bashlog && echo "=================================" && cd WS && -/usr/bin/time -p -o ./bashlog zip -qq -r analyse_simulations_STICS analyse_simulations_STICS && +/usr/bin/time -p -o ./bashlog zip $9 -qq -r analyse_simulations_STICS analyse_simulations_STICS && echo "Step 2, time to zip the results:" && echo "================================" && cat ./bashlog && @@ -23,7 +23,7 @@ rm -rf analyse_simulations_STICS && cd .. && mv WS $WSname && -/usr/bin/time -p -o ./bashlog zip -qq -r $WSname $WSname && +/usr/bin/time -p -o ./bashlog zip $9 -qq -r $WSname $WSname && echo "Step 3, time to zip the Workspace:" && echo "==================================" && cat ./bashlog && diff -r 52877f7c9d6b -r 65c00476f417 redelacSticsSimulator.xml --- a/redelacSticsSimulator.xml Tue Oct 17 11:21:34 2023 +0000 +++ b/redelacSticsSimulator.xml Fri Oct 27 09:15:25 2023 +0000 @@ -1,11 +1,11 @@ - + to run sequences paralelly [Stics-10.0.0] - docker://registry.forgemia.inra.fr/redelac/redelac-toolbox/sticsrpacks:b0f76897e1ece4a91ecfc71617fec5ebd04e2bd4 + docker://registry.forgemia.inra.fr/redelac/redelac-toolbox/sticsrpacks:0faa63e7838a2b86369026bf2e628842d7af9863 @@ -13,6 +13,7 @@ + + + + + + + + + + + + + +