summaryrefslogtreecommitdiff
path: root/run_sweeps.sh
blob: ebb229b5f5d069fa933ed97e533c775a21a47a10 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash


#N_MATRIX="1024 2048 4096 8192 16384"
N_MATRIX="1024 2048 4096"
N_DATAPTS="64 128 256 512 1024 2048"

GREEN='\033[0;32m'
RESET='\033[0m'

mkdir -p results/logs
touch results/wtable


for N in $N_MATRIX; do
	# Change the manager file to use the correct matrix size
	echo -e "${GREEN}Updating matrix size to $N...${RESET}"
	sed "s/n=[0-9]\+/n=$N/" manager.f90 -i
	for L in $N_DATAPTS; do
		# Change the worker file to use the correct number of datapts
		echo -e "Setting data size to $L!"
		sed "s/ndat=[0-9]\+/ndat=$L/" manager.f90 -i

		# Print to double check
		cat manager.f90 | grep "n="
		cat manager.f90 | grep "ndat="

		# And compile the new binary + run
		LOGFILE=results/logs/$N\_$L.log
		make > $LOGFILE

		WTIME=$(cat $LOGFILE | grep "wtime=" | cut -d "=" -f 2 | cut -d "(" -f 1)
		echo -e "Wall time was $WTIME\n"

		# Append to wall time file
		echo $N $L $WTIME >> results/wtable


		# Move the results to the proper file
		mv eigs results/eigs_$N\_$L.out

	done
done