diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fb201bb..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "papihighlevel"] - path = papihighlevel - url = ../papihighlevel.git diff --git a/jikes_write_barrier/Makefile b/jikes_write_barrier/Makefile index a08b6a8..d27149f 100644 --- a/jikes_write_barrier/Makefile +++ b/jikes_write_barrier/Makefile @@ -4,27 +4,19 @@ INCDIR=include LIBDIR=lib SRCDIR=src BINDIR=bin -PAPILIBDIR=lib -PAPIINCDIR=include -LOCALDIR=$(HOME)/local +SCRIPTDIR=scripts -default: barrier +SRCS := $(shell find $(SRCDIR) -name \*.java | sed -r "s@^\./@@") +BINS=$(patsubst $(SRCDIR)/%.java,$(BINDIR)/%.class,$(SRCS)) -# TODO: Verify libpapihighlevel.so is uptodate (need a git module) -runbarrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class $(BINDIR)/lip6/jikesrvm/bench/Cell.class - LD_LIBRARY_PATH=$(LOCALDIR)/$(LIBDIR) \ - rvm -cp $(BINDIR):$(LOCALDIR)/$(LIBDIR) \ - -Djava.library.path=$(LOCALDIR)/$(LIBDIR) \ - -Xms2G -Xmx3G -X:processors=1 lip6.jikesrvm.bench.Main +default: $(BINS) -# TODO: Verify libpapihighlevel.so is uptodate (need a git module) -barrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class +runbarrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class + $(SCRIPTDIR)/launch_java_bench $(BINDIR) $< -$(BINDIR)/lip6/jikesrvm/bench/Main.class: $(SRCDIR)/lip6/jikesrvm/bench/Main.java \ - $(SRCDIR)/lip6/jikesrvm/bench/Cell.java - if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi - javac -d $(BINDIR) -sourcepath $(SRCDIR) -classpath $(LOCALDIR)/$(PAPILIBDIR) \ - $(SRCDIR)/lip6/jikesrvm/bench/Main.java +$(BINDIR)/%.class: $(SRCDIR)/%.java + mkdir -p $(BINDIR) + javac -d $(BINDIR) -sourcepath $(SRCDIR) $< clean: diff --git a/jikes_write_barrier/scripts/launch_java_bench b/jikes_write_barrier/scripts/launch_java_bench new file mode 100755 index 0000000..ef9e4b8 --- /dev/null +++ b/jikes_write_barrier/scripts/launch_java_bench @@ -0,0 +1,22 @@ +#!/bin/sh +# First argument: classpath +# Second argument: class file containing main + +classPath="${1%/}" +bin="${2#${classPath}/}" +bin=$(echo ${bin} | sed -r "s@\.class\$@@;s@/@.@g") + +perf stat -r 10 -e cpu-cycles -e L1-dcache-loads -e L1-dcache-stores \ + -e L1-dcache-prefetches -e L1-dcache-load-misses \ + -e L1-dcache-prefetch-misses \ + rvm -cp ${classPath} -Xms2G -Xmx3G -X:processors=1 \ + ${bin} 2>&1 # | grep -E "[[:digit:]] (cycles|L1-dcache-loads|L1-dcache-prefetches|L1-dcache-load-misses|L1-dcache-prefetch-misses)" + +#echo "*** Micro benchmark results ***\n" +#echo "Number of loop: ${nbLoop}" +#echo "Number of writes per loop: ${writesPerLoop}" + +#echo "L1 data cache hits (total / per loop / per write): ${} / ${} / ${}" +#echo "L1 data cache misses (total / per loop / per write): ${} / ${} / ${}" +#echo "Total cycles (total / per loop / per write): ${} / ${} / ${}" +#echo "----------------------------------------" diff --git a/jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java b/jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java index 1f0d7e1..8bfd855 100644 --- a/jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java +++ b/jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java @@ -2,7 +2,6 @@ package lip6.jikesrvm.bench; import java.util.Random; import lip6.jikesrvm.bench.Cell; -import lip6.microbenchs.PapiHighLevel; public class Main { @@ -10,11 +9,6 @@ public class Main private static Random randomInt; // random int to put into the cells private static Cell head; - static - { - System.loadLibrary("papihighlevel"); - } - public static void main(String args[]) { randomInt = new Random(424242424242L); @@ -36,20 +30,10 @@ public class Main newCell.setNext(head); head.setPrev(newCell); } - if (PapiHighLevel.initialize_papi() != 0) - { - System.err.println("Error while inizializing PAPI"); - java.lang.System.exit(1); - return; - } bubbleSort(); /* Only the 6 store in the if of the bubbleSort call the write barrier */ - if (PapiHighLevel.print_results(6, NB_ELEM) != 0) - { - System.err.println("Error while getting results"); - java.lang.System.exit(2); - return; - } + System.out.println("Number of loop: "+ NB_ELEM); + System.out.println("Number of writes per loop: 6"); } private static void bubbleSort() diff --git a/papihighlevel b/papihighlevel deleted file mode 160000 index 16449c5..0000000 --- a/papihighlevel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 16449c571f7363d0a6dc8293df8f0aaec40b492a