source: tests/Calculations/change.sh@ 854a1e

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 854a1e was c2f543, checked in by Frederik Heber <heber@…>, 8 years ago

Target extracheck now uses Server/PoolWorker when JobMarket is available.

  • FIX: anthracene has two possible energies depending on how bond degrees are set.
  • check of energy is performed after server and poolworker have been shut down as the kill inside the negative action statement would not work.
  • extracheck is running through without error.
  • Property mode set to 100755
File size: 2.8 KB
Line 
1#!/bin/bash
2
3read -d '' CHANGEME << "EOF"
4
5# start service in background
6${AUTOTEST_PATH}/molecuilder_server --signal 2 --workerport $WORKERPORT --controllerport $CONTROLLERPORT &
7server_pid=$!
8AT_CHECK([sleep 2], 0, [ignore], [ignore], [kill $server_pid])
9AT_CHECK([kill -s 0 $server_pid], 0, [ignore], [ignore], [kill $server_pid])
10
11# enlist a worker to work on jobs
12../../molecuilder_mpqc +v 5 ++signal 2 ++server 127.0.0.1:${WORKERPORT} ++hostname 127.0.0.1 ++listen $WORKERLISTENPORT &
13worker_pid=$!
14AT_CHECK([sleep 2], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
15AT_CHECK([kill -s 0 $worker_pid], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
16EOF
17
18read -d '' CHANGETOO << "EOF"
19
20# send removeall to server such that all workers shutdown
21AT_CHECK([${AUTOTEST_PATH}/molecuilder_controller --server 127.0.0.1:$CONTROLLERPORT --command removeall], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
22
23# shutdown controller socket
24AT_CHECK([${AUTOTEST_PATH}/molecuilder_controller --server 127.0.0.1:$CONTROLLERPORT --command shutdown], 0, [stdout], [ignore], [kill $server_pid $worker_pid])
25
26# check that worker is truly down
27AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
28AT_CHECK([kill $worker_pid], 1, [ignore], [ignore], [kill $server_pid])
29
30# check that server is truly down
31AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
32AT_CHECK([kill $server_pid], 1, [ignore], [ignore])
33
34# check calculated energy
35AT_CHECK([cat energy_stdout | awk -v energy=$ENERGY 'function abs(x){return ((x < 0.0) ? -x : x)} {if (abs(($1 - energy)/energy) > 1e-5) exit(1)}'], 0, [stdout], [stderr])
36EOF
37
38wport=3000
39for file in `find . -name 'testsuite-calculations-*.at'`; do
40
41newfilename=`echo "$file" | sed -e "s#-calculations-#-calculations-jobmarket-#"`
42
43
44let cport=$wport+1
45let lport=$cport+1
46
47firstline=` grep -n AT_SKIP $file | awk -F":" '{print $1}'`
48secondline=` grep -n "AT_CHECK(\[cat stdout" $file | awk -F":" '{print $1}'`
49
50sed -e "${firstline},1000d" $file >$newfilename
51echo -e "\n# check that ports are unique over all tests such that they may run in parallel\nWORKERPORT=${wport}\nCONTROLLERPORT=${cport}\nWORKERLISTENPORT=${lport}\n" >>$newfilename
52echo "$CHANGEME" >>$newfilename
53sed -e "${secondline},1000d" -e "1,${firstline}d" -e "s#fragment-automation\(.*\)#fragment-automation --server-address 127.0.0.1 --server-port \$CONTROLLERPORT --DoLongrange 0 \1#" -e "/^.*--fragment-executable.*$/d" -e "/^.*--save-fragment-results.*$/d" -e "s#\(fragment-prefix .*\) \\\#\1],#" -e "s#\(exit(1)}'\], 0\)#\1, [stdout], [stderr]#" -e "s#\(0, \[stdout\], \[stderr\]\))#\1, [kill \$server_pid \$worker_pid])#" -e "s#awk '{print \$2}'#awk '{print \$2}' >energy_stdout#" $file >>$newfilename
54echo -e "\n$CHANGETOO" >>$newfilename
55sed -e "1,${secondline}d" $file >>$newfilename
56
57let wport=$wport+10
58
59done
Note: See TracBrowser for help on using the repository browser.