Skip to content
Snippets Groups Projects
Commit cdafb60e authored by Pierre-Gilles Levallois's avatar Pierre-Gilles Levallois
Browse files

parallelize initGrid

parent 2211af04
No related branches found
No related tags found
No related merge requests found
Pipeline #103939 passed
......@@ -121,10 +121,17 @@ if [ $action == "init-grid" ] || [ $action == "all" ]; then
# Do InitGrid, township by town ship to avoid memory overflow
stage "init-grid"
for NOM_COMMUNE in $( echo "${!LISTE_COMMUNES[@]}" | tr ' ' '\n' | sort ); do
(
stage "Init Grid : $NOM_COMMUNE"
CODE_INSEE=${LISTE_COMMUNES[$NOM_COMMUNE]}
python3 main.py initGrid $GRID_SIZE $CODE_INSEE
check
) &
if [[ $(jobs -r -p | wc -l) -ge $MAX_PARALLEL_EXEC ]]; then
# now there are $N jobs already running, so wait here for any job
# to be finished so there is a place to start next one.
wait -n
fi;
done
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment