[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:
parent
ff7c38da55
commit
ee71568981
|
@ -1,3 +0,0 @@
|
||||||
[submodule "papihighlevel"]
|
|
||||||
path = papihighlevel
|
|
||||||
url = ../papihighlevel.git
|
|
|
@ -4,27 +4,19 @@ INCDIR=include
|
||||||
LIBDIR=lib
|
LIBDIR=lib
|
||||||
SRCDIR=src
|
SRCDIR=src
|
||||||
BINDIR=bin
|
BINDIR=bin
|
||||||
PAPILIBDIR=lib
|
SCRIPTDIR=scripts
|
||||||
PAPIINCDIR=include
|
|
||||||
LOCALDIR=$(HOME)/local
|
|
||||||
|
|
||||||
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)
|
default: $(BINS)
|
||||||
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
|
|
||||||
|
|
||||||
# TODO: Verify libpapihighlevel.so is uptodate (need a git module)
|
runbarrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class
|
||||||
barrier: $(BINDIR)/lip6/jikesrvm/bench/Main.class
|
$(SCRIPTDIR)/launch_java_bench $(BINDIR) $<
|
||||||
|
|
||||||
$(BINDIR)/lip6/jikesrvm/bench/Main.class: $(SRCDIR)/lip6/jikesrvm/bench/Main.java \
|
$(BINDIR)/%.class: $(SRCDIR)/%.java
|
||||||
$(SRCDIR)/lip6/jikesrvm/bench/Cell.java
|
mkdir -p $(BINDIR)
|
||||||
if [ ! -d $(BINDIR) ] ; then mkdir $(BINDIR) ; fi
|
javac -d $(BINDIR) -sourcepath $(SRCDIR) $<
|
||||||
javac -d $(BINDIR) -sourcepath $(SRCDIR) -classpath $(LOCALDIR)/$(PAPILIBDIR) \
|
|
||||||
$(SRCDIR)/lip6/jikesrvm/bench/Main.java
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
||||||
|
|
|
@ -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 "----------------------------------------"
|
|
@ -2,7 +2,6 @@ package lip6.jikesrvm.bench;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import lip6.jikesrvm.bench.Cell;
|
import lip6.jikesrvm.bench.Cell;
|
||||||
import lip6.microbenchs.PapiHighLevel;
|
|
||||||
|
|
||||||
public class Main
|
public class Main
|
||||||
{
|
{
|
||||||
|
@ -10,11 +9,6 @@ public class Main
|
||||||
private static Random randomInt; // random int to put into the cells
|
private static Random randomInt; // random int to put into the cells
|
||||||
private static Cell head;
|
private static Cell head;
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
System.loadLibrary("papihighlevel");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void main(String args[])
|
public static void main(String args[])
|
||||||
{
|
{
|
||||||
randomInt = new Random(424242424242L);
|
randomInt = new Random(424242424242L);
|
||||||
|
@ -36,20 +30,10 @@ public class Main
|
||||||
newCell.setNext(head);
|
newCell.setNext(head);
|
||||||
head.setPrev(newCell);
|
head.setPrev(newCell);
|
||||||
}
|
}
|
||||||
if (PapiHighLevel.initialize_papi() != 0)
|
|
||||||
{
|
|
||||||
System.err.println("Error while inizializing PAPI");
|
|
||||||
java.lang.System.exit(1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bubbleSort();
|
bubbleSort();
|
||||||
/* Only the 6 store in the if of the bubbleSort call the write barrier */
|
/* Only the 6 store in the if of the bubbleSort call the write barrier */
|
||||||
if (PapiHighLevel.print_results(6, NB_ELEM) != 0)
|
System.out.println("Number of loop: "+ NB_ELEM);
|
||||||
{
|
System.out.println("Number of writes per loop: 6");
|
||||||
System.err.println("Error while getting results");
|
|
||||||
java.lang.System.exit(2);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void bubbleSort()
|
private static void bubbleSort()
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 16449c571f7363d0a6dc8293df8f0aaec40b492a
|
|
Loading…
Reference in New Issue