Skip to content

Commit

Permalink
Merge branch 'main' into fix-merge-conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
subindev-d authored Jul 16, 2024
2 parents e697018 + bb4b06f commit 0bbd84f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
5 changes: 2 additions & 3 deletions pm_uep_opt/pm_uep_opt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<description>run UEP optimisation</description>
<macros>
<!-- version of this tool wrapper (integer) -->
<token name="@WRAPPER_VERSION@">0</token>
<token name="@WRAPPER_VERSION@">1</token>
<import>muon_macros.xml</import>
</macros>
<creator>
Expand Down Expand Up @@ -171,15 +171,14 @@ uep_gw_factor: $optimisation_params.uep_gw_factor</configfile>
</assert_contents>
</output>
</test>
<!-- Expect total failure for badly formatted den_fmt -->
<!-- Expect failure for badly formatted den_fmt -->
<test expect_failure="true">
<param name="testing" value="true"/>
<param name="structure" value="Si.cell" ftype="cell"/>
<param name="castep_log" value="Si.castep" ftype="castep"/>
<param name="charge_density" value="Sifail.den_fmt" ftype="den_fmt"/>
<assert_stderr>
<has_text text="Error: FMT file has no header"/>
<has_text text="ERROR: All optimisations failed"/>
</assert_stderr>
</test>
<!-- check that file_tree filter works -->
Expand Down
37 changes: 9 additions & 28 deletions pm_uep_opt/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,14 @@

set -o errexit

run(){
if ! out=$(pm-uep-opt $1); then
echo 1>&2 "$out"; exit 1
for x in $1/*/*/*.yaml
do

if ! out=$(pm-uep-opt $x)
then
echo 1>&2 "$out"; exit 1
else
echo "$out"
echo "$out"
fi
}

pids=()
for x in $1/*/*/*.yaml; do
run $x & pids+=($!)
done

declare -i failed=0
for pid in ${pids[@]}; do
if ! wait $pid; then
failed+=1
fi
done

if [ $failed -eq ${#pids[@]} ]; then
>&2 echo "ERROR: All optimisations failed"
exit 1
elif [ $failed -eq 0 ]; then
echo "All optimisations succeeded"
exit 0
else
echo "WARNING: $failed optimisation(s) failed"
exit 0
fi
done || exit
#pm-uep-opt

0 comments on commit 0bbd84f

Please sign in to comment.