MADRE_HOME = ../..
include $(MADRE_HOME)/local.mk
LIBS = -L$(MADRE_HOME)/lib -lmadre $(LIBRARIES)
UTIL_DIR = $(MADRE_HOME)/src/util
INC_DIR =  $(MADRE_HOME)/include
COMPILE = $(COMPILER) -c -I$(INC_DIR)
LINK = $(LINKER)



exp1: exp1.o
	$(LINK) -o exp1 exp1.o $(LIBS)

exp1.o: exp1.c $(INC_DIR)/madre.h $(INC_DIR)/util.h
	$(COMPILE) exp1.c

run: exp1
	$(SHORT_RUN) 4 ./exp1 phBred 25 20 8 1


run_unitBred: exp1
	cqsub -q short -t 30 -n 256 ./exp1 unitBred 25000 20000 16000 1 100 100 200

run_unitBred_small: exp1
	$(SHORT_RUN) 8 ./exp1 unitBred 25 20 16 1 5 5 10

run_unitCyclicBred_small: exp1
	$(SHORT_RUN) 8 ./exp1 unitCyclicBred 25 20 16 1 10 1 1
	$(SHORT_RUN) 8 ./exp1 unitCyclicBred 25 25 16 1 10 2 2
	$(SHORT_RUN) 8 ./exp1 unitCyclicBred 25 24 16 1 10 5 5
	$(SHORT_RUN) 8 ./exp1 unitCyclicBred 25  5 16 1 10 2 4

run_unitCyclicReadyBred_small: exp1
	$(SHORT_RUN) 8 ./exp1 unitCyclicReadyBred 25 20 16 1 10 1 1
	$(SHORT_RUN) 8 ./exp1 unitCyclicReadyBred 25 25 16 1 10 2 2
	$(SHORT_RUN) 8 ./exp1 unitCyclicReadyBred 25 24 16 1 10 5 5
	$(SHORT_RUN) 8 ./exp1 unitCyclicReadyBred 25  5 16 1 10 2 4

run_phaseBred_small: exp1
	$(SHORT_RUN) 8 ./exp1 phaseBred 25 20 16 1
	$(SHORT_RUN) 8 ./exp1 phaseBred 25 25 16 1
	$(SHORT_RUN) 8 ./exp1 phaseBred 25 24 16 1
	$(SHORT_RUN) 8 ./exp1 phaseBred 25  5 16 1

run_cycleShiftBred: exp1
	$(LONG_RUN) 32 ./exp1 cycleShiftBred 25000 20000 16000 1

run_cyclicSchedulerBred: exp1
	$(LONG_RUN) 32 ./exp1 cyclicSchedulerBred 25000 20000 16000 1

run_fail: exp1
	$(SHORT_RUN) 2 ./exp1 cyclicSchedulerBred 25000 20000 16000 1

run_small: exp1
	$(SHORT_RUN) 4 ./exp1 unitBred 100 90 2048 10
	$(SHORT_RUN) 4 ./exp1 cycleShiftBred 100 90 2048 10
	$(SHORT_RUN) 4 ./exp1 cyclicSchedulerBred 100 90 2048 10
	$(SHORT_RUN) 4 ./exp1 cyclicSchedulerBred 100 99 2048 10
	$(SHORT_RUN) 4 ./exp1 cyclicSchedulerBred 100 100 2048 10
	$(SHORT_RUN) 4 ./exp1 cyclicSchedulerBred 100 50 2048 10
	$(SHORT_RUN) 10 ./exp1 cyclicSchedulerBred 100 90 2048 10
	$(SHORT_RUN) 10 ./exp1 cyclicSchedulerBred 1000 900 2048 10
	$(SHORT_RUN) 20 ./exp1 cyclicSchedulerBred 1000 900 2048 10

run_med: exp1
	$(SHORT_RUN) 40 ./exp1 unitBred 1000 900 2048 10
	$(SHORT_RUN) 40 ./exp1 cycleShiftBred 1000 900 2048 10
	$(SHORT_RUN) 40 ./exp1 cyclicSchedulerBred 1000 900 2048 10

run_tiny: exp1
	$(SHORT_RUN) 2 ./exp1 cyclicSchedulerBred 8 7 8 1

run_test: exp1
	$(SHORT_RUN) 3 ./exp1 cyclicSchedulerBred 6 5 8 1
	$(SHORT_RUN) 4 ./exp1 cyclicSchedulerBred 100 90 2048 10
	$(SHORT_RUN) 2 ./exp1 cyclicSchedulerBred 10 9 8 1
	$(SHORT_RUN) 3 ./exp1 cyclicSchedulerBred 10 9 8 1
	$(SHORT_RUN) 2 ./exp1 cyclicSchedulerBred 8 7 8 1


run_testUnitBred: exp1
	$(SHORT_RUN) 3 ./exp1 unitBred 6 5 8 1
	$(SHORT_RUN) 4 ./exp1 unitBred 100 90 2048 10
	$(SHORT_RUN) 2 ./exp1 unitBred 10 9 8 1
	$(SHORT_RUN) 3 ./exp1 unitBred 10 9 8 1
	$(SHORT_RUN) 2 ./exp1 unitBred 8 7 8 1


clean:
	rm -f *.o exp1 *~
