Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4572 + 2433 = 7005
Home Page

Parallel Java 2 on the RIT CS Parallel Computers

Prof. Alan Kaminsky
Rochester Institute of Technology — Department of Computer Science

Introduction
No Program Development on the Parallel Computers
You Must Use JDK 1.7
Developing Programs for the Multicore Parallel Computer
Developing GPU Accelerated Programs for the Multicore Parallel Computer
Developing Programs for the Cluster Parallel Computer


Introduction

Parallel Java 2 (PJ2) is an API and middleware for parallel programming in 100% Java on shared memory multiprocessor (SMP) parallel computers, cluster parallel computers, hybrid SMP cluster parallel computers, and GPU accelerated parallel computers. PJ2 was developed by Professor Alan Kaminsky in the Department of Computer Science at the Rochester Institute of Technology. For further information about PJ2, see the "Parallel Java 2 Library."

PJ2 is installed on kraken and tardis, two of the RIT Computer Science Department's parallel computers:

  • Multicore parallel computers
    • nessie.cs.rit.edu
      • One Intel Xeon E5-2690 processor
      • Eight dual-hyperthreaded CPU cores
      • 16 threads
      • 2.9 GHz clock
      • 32 GB main memory
      • One NVIDIA Tesla K40c GPU accelerator
        • 2880 cores
        • 745 MHz clock
        • 12 GB global memory
      • Ubuntu 16.04 LTS 64-bit Linux
    • champ.cs.rit.edu
      • One Intel Xeon E5-2690 processor
      • Eight dual-hyperthreaded CPU cores
      • 16 threads
      • 2.9 GHz clock
      • 32 GB main memory
      • One NVIDIA Tesla K40c GPU accelerator
        • 2880 cores
        • 745 MHz clock
        • 12 GB global memory
      • Ubuntu 16.04 LTS 64-bit Linux
    • kraken.cs.rit.edu
      • Two Intel Xeon E5-2696 processors
      • 22 dual-hyperthreaded CPU cores per processor
      • 88 threads
      • 2.2 GHz clock
      • 128 GB main memory
      • Four NVIDIA Tesla K40c GPU accelerators, each with:
        • 2880 cores
        • 745 MHz clock
        • 12 GB global memory
      • Ubuntu 16.04 LTS 64-bit Linux
      • Parallel Java 2 Library

  • Cluster parallel computer
    • Frontend supervisory node — tardis.cs.rit.edu
      • Quad-core Intel Xeon E3-1220 processor
      • 3.0 GHz clock
      • 32 GB main memory
      • Ubuntu 16.04 LTS 64-bit Linux
      • Parallel Java 2 Library
    • Ten backend computational nodes — dr00 through dr09, each with:
      • Two Intel Xeon E5-2603 v4 processors
      • Six CPU cores per processor
      • 12 threads
      • 1.7 GHz clock
      • 64 GB main memory
      • Ubuntu 16.04 LTS 64-bit Linux
      • Parallel Java 2 Library
    • 1-Gbps switched Ethernet backend interconnection network
    • Aggregate 120 threads, 640 GB main memory


No Program Development on the Parallel Computers

When compiling, debugging, and testing PJ2 programs, please do not log into the parallel computers. Instead, log into one of CS lab machines or compute servers, and compile, debug, and test your programs there. Or, use your own computer for compiling, debugging, and testing. PJ2 programs will run just fine on a normal computer; you just might not see very big speedups or sizeups. I recommend running your PJ2 program on small-scale problems while compiling, debugging, and testing.

When your program is successfully compiled, debugged, and tested, then go ahead, log into one of the parallel computers, and run your program on full-size problems.

The parallel computers are a shared resource used by all students taking the parallel computing classes. As a courtesy to others, I ask you to use the parallel computers only for full-scale parallel program runs — not for compiling, debugging, and testing that can be done on any old computer.

There is one exception. If you are developing a PJ2 GPU program, and you do not have CUDA installed on your machine, you may log into kraken to run the CUDA C compiler (nvcc).


You Must Use JDK 1.7

PJ2 was developed using Java Development Kit (JDK) 1.7. When compiling and running Parallel Java 2 programs, you must use JDK 1.7 or higher. PJ2 uses features of the Java language and platform introduced in JDK 1.7 and will not compile with earlier JDK versions.

However, the Parallel Java 2 middleware on the kraken and tardis computers is running with JDK 1.7. Programs compiled with later JDK versions will not run on these computers.

JDK 1.7 is not the default on the CS Department computers. To compile and run Java programs with JDK 1.7 on the CS Department computers, first set your command path as follows for the bash shell:

$ export PATH=/usr/local/dcs/versions/1.7.0_51/bin:$PATH
or as follows for the csh shell:
$ setenv PATH /usr/local/dcs/versions/1.7.0_51/bin:$PATH

If you are compiling PJ2 programs on your own machine and/or using an IDE such as Eclipse, you must figure out on your own how to create JDK 1.7 compatible class files.


Developing Programs for the Multicore Parallel Computer

Before compiling or running a PJ2 program on the kraken computer, be sure to set your Java class path to include the PJ2 distribution. Here is an example of a commands for the bash shell to set the classpath to the current directory plus the PJ2 JAR file:

    $ export CLASSPATH=.:/var/tmp/parajava/pj2/pj2.jar
Here is an example of a command for the csh shell:
    $ setenv CLASSPATH .:/var/tmp/parajava/pj2/pj2.jar

PJ2 multicore programs are written as subclasses of class edu.rit.pj2.Task. Refer to the PJ2 documentation and to the textbook Big CPU, Big Data for further information.

To run a PJ2 multicore program on kraken, type this command:

    $ java pj2 MainTask ...
Replace MainTask with the class name of your PJ2 main program task.

On the kraken computer, a PJ2 Tracker is running. A PJ2 program started on one of those machines automatically goes into a queue in the Tracker. The Tracker allows the program to run when sufficient computational resources are available. Your program might have to wait a while before the Tracker lets it start running. If you get tired of waiting, you can kill your program (e.g., by typing CTRL-C). This removes your program from the Tracker's queue.

The Tracker has a web interface that lets you examine the Tracker's queue. The web interface automatically refreshes itself every 20 seconds, or you can click the "Refresh" button to refresh immediately.

  • Tracker web interface on kraken

When you run a PJ2 program on a machine that has no PJ2 Tracker, your program just runs immediately.


Developing GPU Accelerated Programs for the Multicore Parallel Computer

Before compiling or running a GPU accelerated PJ2 program on the kraken computer, be sure to set your Java class path to include the PJ2 distribution; set your command path to include the CUDA installation; and set your load library path to include the PJ2 distribution and the CUDA installation. Here is an example of commands for the bash shell to set the classpath to the current directory plus the PJ2 JAR file, to set the command path, and to set the load library path:

    $ export CLASSPATH=.:/var/tmp/parajava/pj2/pj2.jar
    $ export PATH=/usr/local/cuda/bin:$PATH
    $ export LD_LIBRARY_PATH=/usr/local/cuda/lib:/usr/local/cuda/lib64:/var/tmp/parajava/pj2:$LD_LIBRARY_PATH
Here is an example of commands for the csh shell:
    $ setenv CLASSPATH .:/var/tmp/parajava/pj2/pj2.jar
    $ setenv PATH /usr/local/cuda/bin:$PATH
    $ setenv LD_LIBRARY_PATH /usr/local/cuda/lib:/usr/local/cuda/lib64:/var/tmp/parajava/pj2:$LD_LIBRARY_PATH

GPU accelerated PJ2 programs are written in two parts. The first part is a Java main program, which is a subclass of class edu.rit.pj2.Task, using classes from package edu.rit.gpu. Compile the main program using the usual Java compiler, javac, like the command below. Replace MainTask with the name of your Java main program source file.

    $ javac MainTask.java

The second part of the GPU accelerated PJ2 program is a C kernel function written using CUDA. Compile the kernel function using the CUDA compiler, nvcc, like the command below. Replace KernelFunc with the name of your C kernel function source file. This command creates a "PTX file" named KernelFunc.ptx containing the compiled kernel module.

    $ nvcc -ptx --compiler-bindir=/usr/bin/gcc-4.8 -arch compute_20 -o KernelFunc.ptx KernelFunc.cu

Refer to the PJ2 Documentation and to the textbook Big CPU, Big Data for further information on writing GPU accelerated parallel programs with the PJ2 Library.

To run a GPU accelerated PJ2 program on kraken, type this command:

    $ java pj2 MainTask ...
Replace MainTask with the class name of your PJ2 main program task.

On the kraken computer, a PJ2 Tracker is running. A PJ2 program started on one of those machines automatically goes into a queue in the Tracker. The Tracker allows the program to run when sufficient computational resources are available. Your program might have to wait a while before the Tracker lets it start running. If you get tired of waiting, you can kill your program (e.g., by typing CTRL-C). This removes your program from the Tracker's queue.

The Tracker has a web interface that lets you examine the Tracker's queue. The web interface automatically refreshes itself every 20 seconds, or you can click the "Refresh" button to refresh immediately.

  • Tracker web interface on kraken

When you run a PJ2 program on a machine that has no PJ2 Tracker, your program just runs immediately.


Developing Programs for the Cluster Parallel Computer

Before compiling or running a PJ2 program on the tardis computer, be sure to set your Java class path to include the PJ2 distribution. Here is an example of a command for the bash shell to set the classpath to the current directory plus the PJ2 JAR file:

    $ export CLASSPATH=.:/var/tmp/parajava/pj2/pj2.jar
Here is an example of a command for the csh shell:
    $ setenv CLASSPATH .:/var/tmp/parajava/pj2/pj2.jar

PJ2 cluster programs are written as subclasses of class edu.rit.pj2.Job. You can also run a PJ2 multicore program on one node of the cluster. PJ2 multicore programs are written as subclasses of class edu.rit.pj2.Task. Refer to the PJ2 documentation and to the textbook Big CPU, Big Data for further information.

After compiling your program, you must put all the Java class files into a Java Archive (JAR) file, using a command like the one below. The JAR file name can be whatever you want. Your JAR file must not include any class files from the PJ2 Library itself.

    $ jar cf myprogram.jar *.class

To run a PJ2 multicore program on tardis, type this command:

    $ java pj2 jar=myprogram.jar MainTask ...
Replace MainTask with the class name of your PJ2 main program task. Replace myprogram.jar with the name of your JAR file.

To run a PJ2 cluster program on tardis, type this command:

    $ java pj2 jar=myprogram.jar MainJob ...
Replace MainJob with the class name of your PJ2 main program job. Replace myprogram.jar with the name of your JAR file.

A PJ2 Tracker is running on tardis. A PJ2 program started on tardis automatically goes into a queue in the Tracker. The Tracker allows the program to run when sufficient computational resources are available. Your program might have to wait a while before the Tracker lets it start running. If you get tired of waiting, you can kill your program (e.g., by typing CTRL-C). This removes your program from the Tracker's queue.

The Tracker has a web interface that lets you examine the Tracker's queue. The web interface automatically refreshes itself every 20 seconds, or you can click the "Refresh" button to refresh immediately.

  • Tracker web interface on tardis

When you run a PJ2 program on a machine that has no PJ2 Tracker, your program just runs immediately.

Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4572 + 2433 = 7005
Home Page
Copyright © 2018 Alan Kaminsky. All rights reserved. Last updated 06-Sep-2018. Please send comments to ark­@­cs.rit.edu.