ex6: automate running cuda remotely

This commit is contained in:
2025-10-25 16:17:12 +02:00
parent a39a420086
commit 919e9ce992

View File

@@ -1,9 +1,23 @@
PATH+=:/usr/local/cuda/bin
all: mandel_c mandel
USERNAME=frero
REMOTE=snotra.idi.ntnu.no
BASTION=login.stud.ntnu.no
.PHONY: all clean remote_run
all: remote_compile remote_copy_image show
mandel:
nvcc -o mandel mandel.cu -O3 -lm
mandel_c:
gcc -o mandel_c mandel_c.c -O3 -Wall -std=c99 -lm
clean:
-rm -f mandel_c mandel
show: mandel1.bmp
feh $<
remote_stop:
@ssh -J $(USERNAME)@$(BASTION) $(USERNAME)@$(REMOTE) "stop-jobs -f" || true
remote_copy_src:
@scp -J $(USERNAME)@$(BASTION) mandel.cu $(USERNAME)@$(REMOTE):~/ntnuhome/jobs
remote_compile: remote_stop remote_copy_src
@ssh -J $(USERNAME)@$(BASTION) $(USERNAME)@$(REMOTE) 'cd ntnuhome/jobs/ && ./run_mandel.sh'
remote_copy_image:
@scp -J $(USERNAME)@$(BASTION) $(USERNAME)@$(REMOTE):~/ntnuhome/jobs/mandel1.bmp .