File size: 1,706 Bytes
748dd7d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash 
set -ex
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
cd "${ROOT_DIR}"
mkdir -p ./logs

# make sure your Python scripts are executable
chmod u+r+x ./code/lib/optional/get_images/GetImageRun_3y.py ./code/lib/optional/get_images/GetImageRun_annual.py

# show your resources
ulimit -a
parallel --number-of-cpus
parallel --number-of-cores
parallel --number-of-threads
parallel --number-of-sockets

# decide how many parallel jobs to run
export nParallelJobs=1

# —————————————————————————————————————————
# 1) run 3-year image export
#    script: Analysis/GetImages/GetImageRun_3y.py
# —————————————————————————————————————————
if false; then
nohup parallel --jobs ${nParallelJobs} \
         --joblog ./logs/GetImageRun_3y_log.log \
         'python3 ./code/lib/optional/get_images/GetImageRun_3y.py {}' ::: 1 \
	 > ./logs/GetImagesRun_3y_out.out \
	 2> ./logs/GetImagesRun_3y_err.err &
fi

# —————————————————————————————————————————
# 2) run annual image export
#    script: Analysis/GetImages/GetImageRun_annual.py
# —————————————————————————————————————————
if true; then
nohup parallel --jobs ${nParallelJobs} \
         --joblog ./logs/GetImageRun_annual_log.log \
         'python3 ./code/lib/optional/get_images/GetImageRun_annual.py {}' ::: 1 \
	 > ./logs/GetImagesRun_annual_out.out \
	 2> ./logs/GetImagesRun_annual_err.err &
fi