Skip to content

Running JWormBenchApp

inesc-id-esw edited this page Apr 13, 2011 · 37 revisions

The JWormBenchApp application is deployed in jwormApp.jar located in dist folder, which depends on other configuration files and libraries located in config and vendor/main/lib folders respectively:

  • config – contains the configuration files for worms, world and operations.
  • vendor/main/lib - the following libraries are fundamental to run JWormBenchApp application: aopalliance.jar, guice-2.0.jar and jwormbench.jar. Inside this folder you can also find other libraries related to synchronization strategies already suported by JWormBenchApp (e.g. jvstm.jar, deuceAgent-1.3.0.jar,etc). To run JWormBenchApp with one of those synchronization strategies you must also include the corresponding library in the Java CLASSPATH.

Environment setup

Before running JWormBenchApp you must configure the Java CLASSPATH to include the essential libraries contained in vendor/main/lib folder. You can configure the CLASSPATH and run JWormBenchApp with its default parameterization as following. In this case no synchronization is provided between concurrent worm operations (for simplification instead of vendor/main/lib we are just referring to lib folder, but you should specify the correct path):

  1. ln -sf vendor/main/lib/ lib
  2. export CLASSPATH=.:lib/guice-2.0.jar:lib/aopalliance.jar:lib/jwormbench.jar:dist/jwormApp.jar
  3. java jwormbench.app.ConsoleApp

If you choose a synchronization strategy then you should also provide the corresponding library in the Java CLASSPATH. For instance if you run JWormBenchApp with -sync jvstm argument then it will require the jvstm.jar. The following example shows the use of JWormBenchApp with JVSTM:

  1. ln -sf vendor/main/lib/ lib
  2. export CLASSPATH=.:lib/guice-2.0.jar:lib/aopalliance.jar:lib/jwormbench.jar:dist/jwormApp.jar:lib/jvstm.jar
  3. java jwormbench.app.ConsoleApp -sync jvstm

If you run JWormBenchApp with Deuce then you must instrument the jwormbench.jar library as described in Deuce Documentation. We already provide an instrumented version of jwormbench.jar for each version of Deuce framework. The following example shows how do you configure and run JWormBenchApp with our optimized version of Deuce framework and TL2 STM:

  1. ln -sf vendor/main/lib/ lib
  2. export CLASSPATH=.:lib/guice-2.0.jar:lib/aopalliance.jar:lib/jwormbench-deuce-opt.jar:dist/jwormApp.jar:lib/deuceAgent-1.3.0.jar
  3. java -Dorg.deuce.transaction.contextClass=org.deuce.transaction.tl2.Context jwormbench.app.ConsoleApp -sync deuce

It may looks strange that we use a jwormbench-....jar with a distinct suffix of deuceAgent-....jar, but this is correct. The deuceAgent-....jar library has two roles:

  1. Instrumenting an application/framework to inject appropriate invocations to an STM.
  2. Provide an STM implementation.

In our example the first task was performed in offline mode to a new jwormbench-deuce-opt.jar. The second task can be provided by any of the available versions of deuceAgent-...jar because the STM algorithm is independent of the Deuce's version.

JWormBenchApp parameters

You can run JWormBenchApp with the following optional arguments:

  • threads: the number of worker threads (1 by default).
  • nrOperations: number of operations performed per iteration. This number also determines the name of the worm operations configuration file (1920 by default).
  • iterations: the size of the workload is equals to the ‘number of iterations’ times the ‘number of operations’ (1 by default).
  • world: the world’s size (512 by default).
  • head: the size of worms’ head. The number of nodes under the head of the worm is equal to the square of his head’s size.('2.16' by default, meaning the head’s size is between 2 and 16, corresponding to a number of nodes between 4 and 256 nodes).
  • wRate: label for the name of the worm operations configuration file. This file’s name has the following form: <nrOperations>_ops_<wRate>%writes.txt (21 by default, corresponding to an updates rate of 20% and configuration #1).
  • timeout: if zero the benchmark just finishes when it completes the total workload (0 by default).
  • sync: the name of a class that defines a Guice module or one of the built-in synchronization strategies: jvstm | lock | finelock | deuce | artof-free | artof-lock | tiny-free | tiny-lock (none by default).

JWormBenchApp is already built with 7 different synchronization strategies that can be specified via –sync argument and can get one of the following values:

  • none - default behavior provides no synchronization;
  • lock – uses a global lock as a unique synchronization point for all operations performed by different threads;
  • finelock - a fined-grain locking synchronization strategy;
  • jvstm – Java Versioned Software Transactional Memory;
  • deuce – DeuceSTM can be run with one of the following STM algorithms: LSA or TL2. Use the option -sync deuce in combination with one of the following VM properties to choose the correct STM algorithm:
    • Dorg.deuce.transaction.contextClass=org.deuce.transaction.tl2.Context
    • Dorg.deuce.transaction.contextClass=org.deuce.transaction.lsa.Context
  • artof-free – implementation of an obstruction-free STM as described in the book of “Art Of Multiprocessor Programming” (based on the DSTM - Dynamic Software Transactional Memory);
  • artof-lock – implementation of lock-based STM as described in the book of “Art Of Multiprocessor Programming” (based on the Transactional Locking 2 algorithm);
  • boost – transactional boosting – uses the transactions infrastructure of ArtOf STM and defines an highly-concurrent transactional version of a linearizable implementation of INode.
Clone this wiki locally