Browse Source

[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)
rebased_bqv2_avoid_if
Thomas Preud'homme 10 years ago
parent
commit
ee71568981
5 changed files with 33 additions and 39 deletions
  1. +0
    -3
      .gitmodules
  2. +9
    -17
      jikes_write_barrier/Makefile
  3. +22
    -0
      jikes_write_barrier/scripts/launch_java_bench
  4. +2
    -18
      jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java
  5. +0
    -1
      papihighlevel

+ 0
- 3
.gitmodules View File

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

+ 9
- 17
jikes_write_barrier/Makefile 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:


+ 22
- 0
jikes_write_barrier/scripts/launch_java_bench 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 "----------------------------------------"

+ 2
- 18
jikes_write_barrier/src/lip6/jikesrvm/bench/Main.java 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()


+ 0
- 1
papihighlevel

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

Loading…
Cancel
Save