ex7: add remote targets

This commit is contained in:
2025-11-03 12:02:41 +01:00
parent 194138e2df
commit 9a8ff41e8c
2 changed files with 13 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
data/
data_sequential/
sequential
parallel
*.png

View File

@@ -5,7 +5,10 @@ LDLIBS+= -lm
SEQUENTIAL_SRC_FILES=wave_2d_sequential.c
PARALLEL_SRC_FILES=wave_2d_parallel.cu
IMAGES=$(shell find data -type f | sed s/\\.dat/.png/g | sed s/data/images/g )
.PHONY: all clean dirs plot movie
USERNAME=frero
REMOTE=snotra.idi.ntnu.no
BASTION=login.stud.ntnu.no
.PHONY: all clean dirs plot movie diff compare show check data
all: dirs ${TARGETS}
dirs:
mkdir -p data images
@@ -18,10 +21,11 @@ images/%.png: data/%.dat
./plot_image.sh $<
movie: ${IMAGES}
ffmpeg -y -an -i images/%5d.png -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -r 12 wave.mp4
data: dirs sequential parallel
data_sequential: dirs sequential
mkdir -p data_sequential
./sequential
cp -rf ./data/* ./data_sequential
data: dirs data_sequential parallel
./parallel
compare/%: data
python3 compare.py data_sequential/$(shell printf "%05d" $*).dat data/$(shell printf "%05d" $*).dat
@@ -33,3 +37,9 @@ check: compare/0 compare/75
clean:
-rm -fr sequential parallel data images wave.mp4
rm -rf data_sequential
remote_stop:
@ssh -J $(USERNAME)@$(BASTION) $(USERNAME)@$(REMOTE) "stop-jobs -f" || true
remote_copy_src:
@scp -J $(USERNAME)@$(BASTION) $(PARALLEL_SRC_FILES) $(USERNAME)@$(REMOTE):~/ntnuhome/jobs
remote_run: remote_stop remote_copy_src
@ssh -J $(USERNAME)@$(BASTION) $(USERNAME)@$(REMOTE) 'cd ntnuhome/jobs/ && ./connect.sh "make"'