Mercurial > repos > muon-spectroscopy-computational-project > pm_uep_opt
comparison run.sh @ 4:ec5f6b22417c draft
planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
author | muon-spectroscopy-computational-project |
---|---|
date | Tue, 18 Jul 2023 13:27:15 +0000 |
parents | e4097a3e3e75 |
children | eea73e1f65cb |
comparison
equal
deleted
inserted
replaced
3:523d44fcd03f | 4:ec5f6b22417c |
---|---|
1 #! /bin/bash | 1 #! /bin/bash |
2 | 2 |
3 set -o errexit | 3 set -o errexit |
4 | 4 |
5 for x in $1/*/*/*.yaml | 5 run(){ |
6 do | 6 if ! out=$(pm-uep-opt $1); then |
7 | 7 echo 1>&2 "$out"; exit 1 |
8 if ! out=$(pm-uep-opt $x) | |
9 then | |
10 echo 1>&2 "$out"; exit 1 | |
11 else | 8 else |
12 echo "$out" | 9 echo "$out" |
13 fi | 10 fi |
14 done || exit | 11 } |
15 #pm-uep-opt | 12 |
13 pids=() | |
14 for x in $1/*/*/*.yaml; do | |
15 run $x & pids+=($!) | |
16 done | |
17 | |
18 declare -i failed=0 | |
19 for pid in ${pids[@]}; do | |
20 if ! wait $pid; then | |
21 failed+=1 | |
22 fi | |
23 done | |
24 | |
25 if [ $failed -eq ${#pids[@]} ]; then | |
26 >&2 echo "ERROR: All optimisations failed" | |
27 exit 1 | |
28 elif [ $failed -eq 0 ]; then | |
29 echo "All optimisations succeeded" | |
30 exit 0 | |
31 else | |
32 echo "WARNING: $failed optimisation(s) failed" | |
33 exit 0 | |
34 fi |