RM = /bin/rm
DATA_SIZE = 8191 # the 5th Mersenne prime
-DATA = data
+DATA = data ordered-data
# Non-MPI Environment
data : data.py
./$< $(DATA_SIZE) > $@
+ordered-data : data.py
+ ./$< --ordered $(DATA_SIZE) > $@
+
$(EXECS:%=%.o) main.o : %.o : %.c sort.h
$(CC) -c $(CFLAGS) -o $@ $<
$ make
-which also builds a random data file 'data'.
+which also builds a random data file 'data'. To build with the DEBUG
+macro defined (to enable some stderr printouts in main.c), run
+
+ $ make CFLAGS=-DDEBUG
+
+Remove auto-generated files with
+
+ $ make clean
Usage
-----
$ time ./bubble data > /dev/null
$ time ./quicksort data > /dev/null
-quicksort takes 0.075 s and bubble takes 3.994s.
+quicksort takes 0.075 s and bubble takes 3.994 s.
+
+On ordered data bubble does much better
+
+ $ time ./bubble ordered-data > /dev/null
+ $ time ./quicksort ordered-data > /dev/null
+
+quicksort takes 0.048 s and bubble takes 0.046 s.