[barrier] Make the bench use perf instead of PAPI

- Convert barrier bench from papi+PapiHighLevel to perf framework
- Remove papihighlevel submodule
- Simplify Makefile (include moving some of the code in a separate
  script)
This commit is contained in:
Thomas Preud'homme 2011-01-29 17:51:45 +01:00
parent ff7c38da55
commit ee71568981
5 changed files with 33 additions and 39 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "papihighlevel"]
path = papihighlevel
url = ../papihighlevel.git

View File

@ -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:

View File

@ -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 "----------------------------------------"

View File

@ -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()

@ -1 +0,0 @@
Subproject commit 16449c571f7363d0a6dc8293df8f0aaec40b492a