annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e4097a3e3e75 planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff changeset
1 #! /bin/bash
e4097a3e3e75 planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff changeset
2
e4097a3e3e75 planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff changeset
3 set -o errexit
e4097a3e3e75 planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff changeset
4
4
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
5 run(){
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
6 if ! out=$(pm-uep-opt $1); then
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
7 echo 1>&2 "$out"; exit 1
0
e4097a3e3e75 planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff changeset
8 else
4
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
9 echo "$out"
0
e4097a3e3e75 planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit d130cf2c46d933fa9d0214ddbd5ddf860f322dc4
muon-spectroscopy-computational-project
parents:
diff changeset
10 fi
4
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
11 }
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
12
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
13 pids=()
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
14 for x in $1/*/*/*.yaml; do
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
15 run $x & pids+=($!)
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
16 done
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
17
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
18 declare -i failed=0
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
19 for pid in ${pids[@]}; do
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
20 if ! wait $pid; then
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
21 failed+=1
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
22 fi
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
23 done
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
24
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
25 if [ $failed -eq ${#pids[@]} ]; then
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
26 >&2 echo "ERROR: All optimisations failed"
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
27 exit 1
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
28 elif [ $failed -eq 0 ]; then
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
29 echo "All optimisations succeeded"
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
30 exit 0
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
31 else
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
32 echo "WARNING: $failed optimisation(s) failed"
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
33 exit 0
ec5f6b22417c planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/pm_uep_opt commit 70a4d37ecdf5d586703cfc509922311e95d3205c
muon-spectroscopy-computational-project
parents: 0
diff changeset
34 fi