Commit 9f9893bc authored by Taddeüs Kroes's avatar Taddeüs Kroes

ModSim ass4 taddeus: Added comparison script.

parent 1fb6835e
...@@ -5,4 +5,4 @@ report.pdf: report.tex ...@@ -5,4 +5,4 @@ report.pdf: report.tex
pdflatex $^ pdflatex $^
clean: clean:
rm *.pdf *.log *.aux rm report.pdf *.log *.aux
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: bash $0 NUM_PROCESSES"
exit 1
fi
REPEAT=4
FILE=compare.txt
# Clear results file
echo "" > $FILE
# Execute parallel program for different numbers of nodes
for (( i = 900; i <= 900000; i += 10000 )); do
dx=`echo "1/$i" | bc -l`
args="sinus 10000 1 $dx 1 2"
for j in `seq $REPEAT`; do
echo $i >> $FILE
/usr/bin/time -f "%e" -ao $FILE ./seq $args
/usr/bin/time -f "%e" -ao $FILE ./par.sh $1 $args
done
done
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <math.h> #include <math.h>
#include <mpi.h> #include <mpi.h>
#define VERBOSE //#define VERBOSE
double **y = NULL; double **y = NULL;
int tasks, rank, steps, start; int tasks, rank, steps, start;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#define VERBOSE //#define VERBOSE
double **y = NULL, dx; double **y = NULL, dx;
int steps, time; int steps, time;
...@@ -60,7 +60,6 @@ void print(int state) { ...@@ -60,7 +60,6 @@ void print(int state) {
* time steps. * time steps.
*/ */
void calculate_steps(int time, double tau) { void calculate_steps(int time, double tau) {
double x;
int i, t, prev = 0, current = 1, next = 2; int i, t, prev = 0, current = 1, next = 2;
// Calculate the position over the entire string at time dt using the // Calculate the position over the entire string at time dt using the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment