-
Notifications
You must be signed in to change notification settings - Fork 3
/
parallel_complexity_harness.sh
29 lines (25 loc) · 1.34 KB
/
parallel_complexity_harness.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e
template="#!/bin/bash
#SBATCH --job-name=k_::COUNTRYCODE::
#SBATCH --partition=broadwl
#SBATCH --nodes=1
#SBATCH --mem=20G
#SBATCH --ntasks=24
#SBATCH --output=logs/k_::COUNTRYCODE::.out
#SBATCH --error=logs/k_::COUNTRYCODE::.err
#SBATCH --mail-type=ALL
#SBATCH [email protected]
#SBATCH --time=36:00:00
#SBATCH --account=pi-bettencourt
set -e
mkdir -p data/complexity/::CONTINENT::/::COUNTRYCODE::
for block in \$(ls data/blocks/::CONTINENT::/::COUNTRYCODE::/*.csv); do
python midway/midway_complexity.py --blocks \$block --buildings data/geojson/::CONTINENT::/::COUNTRYNAME::_buildings.geojson --output \${block//blocks/complexity} --parallelism 24;
done"
#grep "HTI\|NPL\|SLE\|LBR" data_processing/country_codes.csv | rev | cut -d, -f2,3,4 | rev | tr , ' ' | while read country_code country_name continent; do
grep "NPL" data_processing/country_codes.csv | rev | cut -d, -f2,3,4 | rev | tr , ' ' | while read country_code country_name continent; do
continent=$(python -c "print('${continent}'.split('/')[0].title())")
echo "${template}" | sed -e "s/::COUNTRYCODE::/${country_code}/g" -e "s/::COUNTRYNAME::/${country_name}/g" -e "s'::CONTINENT::'${continent}'g "> midway/filled_templates/k_${country_code}.sbatch
echo "$(sbatch midway/filled_templates/k_${country_code}.sbatch) (${country_code}/${country_name})"
done