[a98afb] | 1 | ### test mpqc jobs
|
---|
| 2 |
|
---|
| 3 | # perform test with PoolWorkers using stastand-inn mpqc
|
---|
| 4 | AT_SETUP([Fragmentation - Automation: mpqc jobs])
|
---|
| 5 | AT_KEYWORDS([fragmentation automation server poolworker mpqc])
|
---|
| 6 |
|
---|
| 7 | # check that ports are unique over all tests such that they may run in parallel
|
---|
| 8 | WORKERPORT=1060
|
---|
| 9 | CONTROLLERPORT=1061
|
---|
| 10 | WORKERLISTENPORT=1062
|
---|
| 11 |
|
---|
[bc1625] | 12 | # create job files for stand-in mpqc
|
---|
| 13 | i=0
|
---|
| 14 | while test -e ${abs_top_srcdir}/tests/regression/Fragmentation/Automation/pre/BondFragment`printf %02d $i`.out; do
|
---|
| 15 | nr=`printf %02d $i`
|
---|
| 16 | echo "Creating Job${nr}.in"
|
---|
| 17 | echo "${abs_top_srcdir}/tests/regression/Fragmentation/Automation/pre/BondFragment${nr}.out" >Job${nr}.in
|
---|
| 18 | ((i+=1))
|
---|
| 19 | done
|
---|
| 20 |
|
---|
[a98afb] | 21 | # start service in background
|
---|
[cc5db5] | 22 | ${AUTOTEST_PATH}/Server --workerport $WORKERPORT --controllerport $CONTROLLERPORT &
|
---|
[a98afb] | 23 | server_pid=$!
|
---|
| 24 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 25 |
|
---|
[bc1625] | 26 | # add jobs
|
---|
[cc5db5] | 27 | AT_CHECK([${AUTOTEST_PATH}/Controller --server 127.0.0.1:$CONTROLLERPORT --command addjobs --executable "../../mpqc" --jobfiles Job??.in], 0, [ignore], [ignore], [kill $server_pid])
|
---|
[a98afb] | 28 |
|
---|
| 29 | # enlist a worker to work on jobs
|
---|
[cc5db5] | 30 | ${AUTOTEST_PATH}/PoolWorker -v 5 --signal 2 --server 127.0.0.1:${WORKERPORT} --hostname 127.0.0.1 --listen $WORKERLISTENPORT &
|
---|
[a98afb] | 31 | worker_pid=$!
|
---|
[bc1625] | 32 | AT_CHECK([sleep 5], 0, [ignore], [ignore], [kill $server_pid $worker_pid])
|
---|
[a98afb] | 33 |
|
---|
[af9b9ff] | 34 | # send removeall to server such that all workers shutdown
|
---|
[cc5db5] | 35 | AT_CHECK([${AUTOTEST_PATH}/Controller --server 127.0.0.1:$CONTROLLERPORT --command removeall], 0, [stdout], [ignore], [kill $server_pid $worker_pid])
|
---|
[a98afb] | 36 |
|
---|
| 37 | # check number of done jobs
|
---|
[cc5db5] | 38 | AT_CHECK([${AUTOTEST_PATH}/Controller --server 127.0.0.1:$CONTROLLERPORT --command receivempqc --fragment-path ${abs_top_srcdir}/tests/regression/Fragmentation/Automation/pre/], 0, [stdout], [ignore], [kill $server_pid])
|
---|
[bc1625] | 39 | AT_CHECK([fgrep "There are 7 fragments" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 40 | AT_CHECK([fgrep "There are 23 atoms" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 41 | AT_CHECK([fgrep "Resulting energy is -279.837" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 42 | AT_CHECK([fgrep "Resulting forces are" stdout], 0, [ignore], [ignore], [kill $server_pid])
|
---|
[a98afb] | 43 |
|
---|
| 44 | # shutdown controller socket
|
---|
[cc5db5] | 45 | AT_CHECK([${AUTOTEST_PATH}/Controller --server 127.0.0.1:$CONTROLLERPORT --command shutdown], 0, [stdout], [ignore], [kill $server_pid])
|
---|
[a98afb] | 46 |
|
---|
| 47 | # check that server is truely down
|
---|
| 48 | AT_CHECK([sleep 1], 0, [ignore], [ignore], [kill $server_pid])
|
---|
| 49 | AT_CHECK([kill $server_pid], 1, [ignore], [ignore])
|
---|
| 50 |
|
---|
| 51 | AT_CLEANUP
|
---|