comparison run.sh @ 5:eea73e1f65cb draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 8e96fbcca17150ece3ee6bf15bf0969bd014a5ca
author muon-spectroscopy-computational-project
date Wed, 26 Jul 2023 17:23:11 +0000
parents ec5f6b22417c
children
comparison
equal deleted inserted replaced
4:ec5f6b22417c 5:eea73e1f65cb
1 #! /bin/bash 1 #! /bin/bash
2 2
3 set -o errexit 3 set -o errexit
4 4
5 run(){ 5 for x in $1/*/*/*.yaml
6 if ! out=$(pm-uep-opt $1); then 6 do
7 echo 1>&2 "$out"; exit 1 7
8 if ! out=$(pm-uep-opt $x)
9 then
10 echo 1>&2 "$out"; exit 1
8 else 11 else
9 echo "$out" 12 echo "$out"
10 fi 13 fi
11 } 14 done || exit
12 15 #pm-uep-opt
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