#!/bin/bash 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