summaryrefslogtreecommitdiff
path: root/scripts/aimos/cnr
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2026-05-05 21:53:16 -0400
committerJack Jamison <jackqjamison@gmail.com>2026-05-05 21:53:16 -0400
commitbe8c956b0e819f2db0c6ae3598b6590b62982a83 (patch)
tree9de8204882f8894776bd34f83af2800130bb87b5 /scripts/aimos/cnr
parent6ad4d3dfd32b569f9485d24f80a768ed3ca19e46 (diff)
been a while
Diffstat (limited to 'scripts/aimos/cnr')
-rwxr-xr-xscripts/aimos/cnr28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/aimos/cnr b/scripts/aimos/cnr
new file mode 100755
index 0000000..e8d5ce5
--- /dev/null
+++ b/scripts/aimos/cnr
@@ -0,0 +1,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"