Skip to content

Commit 74c8bcc

Browse files
authored
Added bash orca script
1 parent 7b9f7e8 commit 74c8bcc

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

Diff for: orcabatch.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
echo 'Batch Orca Runner, Rac Mukkamala'
3+
echo $'Please acknowledge use of this script as follows:\n'
4+
echo 'Mukkamala, R (2020) Batch ORCA Script (Version 1.0) [Source code].'
5+
echo 'https://github.com/RackS103/Batch-ORCA-Script'
6+
echo $'\nStarting batch job....\n'
7+
cd $1
8+
Errors=[]
9+
10+
orca_path=$(cat batch_orca_params.txt | head -1 | sed 's/PATH: //')
11+
inp_header=$(cat batch_orca_params.txt | head -2 | tail -1 | sed 's/HEADER: //')
12+
13+
for input in *.inp
14+
do
15+
filename=$(echo $input | sed 's/\.inp//')
16+
17+
if grep -q "$inp_header" "$filename.inp";
18+
then
19+
mkdir "$filename"
20+
mv "$filename.inp" $filename
21+
echo "$filename: Correct input parameters, Starting ORCA..."
22+
"$orca_path" "$filename/$filename.inp" > "$filename/$filename.output" &
23+
process_id=$!
24+
wait $process_id
25+
26+
if grep -q 'ORCA TERMINATED NORMALLY' "$filename/$filename.output";
27+
then
28+
echo "$filename: Success! ORCA terminated normally!"
29+
else
30+
echo "$filename: ERROR! ORCA had an runtime issue."
31+
Errors+="$filename"
32+
fi
33+
34+
else
35+
echo "$filename: ERROR! Incorrect ORCA input file parameters."
36+
echo "The proper input header is $inp_header"
37+
Errors+="$filename"
38+
fi
39+
echo $'Moving on to the next file...\n'
40+
done
41+
42+
echo 'Batch ORCA job finished'
43+
echo 'The following files had errors:'
44+
echo ${Errors[*]}

0 commit comments

Comments
 (0)