blob: e8d5ce5c43e4f671fc6a43e186f632dfdd3ddd8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/bash
# cnr - compile and run
path=$(realpath $1)
out="$path.out"
shift
args="$@"
# compile
echo "===> COMPILING..."
nvcc -g -G -gencode arch=compute_70,code=sm_70 "$path" -o "$out"
if [[ $? -ne 0 ]]; then
exit 1
fi
echo "Success"
# get node
node=$(getactivenode)
if [[ -z "$node" || "$node" == "(Priority)" || "$node" == "(Resources)" ]]; then
echo "No active nodes to run on, exiting."
exit 1
fi
# run
echo "===> EXECUTING ON NODE $node ..."
ssh $node "$out $args"
|