How to submit script with qsub that compiles 2 codes in C and runs both sequentially
I would like to write and submit a script (script.sh)to a node in a cluster, using qsub such that:
1. Compiles a code A: gcc -lm A.c -o A
2. Runs the code: ./A
3. Compiles a code B: gcc -lm B.c -o B
4. Runs the code: ./B
Note. The code B should start running after code A stops running (Code B requires the output of code A). I would like to make this as automatic as possible, so I just have to type
qsub script.sh
I would appreciate any help.
I'm sorry if this is a too trivial question, but I'm really new in these stuff.
|