Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4541 + 2411 = 6952
Home Page

Languages for Lunch: Parallel Java
Lecture Notes

Prof. Alan Kaminsky
Department of Computer Science
Rochester Institute of Technology
October 4, 2005


Modern Parallel Computing

  • Parallel computer architectures
    • Shared memory multiprocessor (SMP) parallel computers
    • Cluster parallel computers
    • Hybrid SMP cluster parallel computers
       
  • The RIT CS Department's parallel computers
    • SMP parallel computers
      • paradise.cs.rit.edu -- 8 processors
      • parasite.cs.rit.edu -- 8 processors
      • paradox.cs.rit.edu -- 4 processors
      • paragon.cs.rit.edu -- 4 processors
    • Cluster parallel computer
      • paranoia.cs.rit.edu -- frontend processor
      • thug01 through thug32 -- 32 backend processors
      • Backend network -- 100-Mbps switched Ethernet
    • Hybrid SMP cluster parallel computer
      • The four SMP parallel computers are also clustered
      • No separate backend network yet
         
  • Standard middleware for SMP parallel programming: OpenMP
  • Standard middleware for cluster parallel programming: Message Passing Interface (MPI)


SMP Parallel Programming in Java with OpenMP

  • Monte Carlo technique for computing an approximate value of pi


       
    • The area of the unit square is 1
    • The area of the circle quadrant is pi/4
    • Generate a large number of points at random in the unit square
    • Count how many of them fall within the circle quadrant, i.e. distance from origin <= 1
    • The fraction of the points within the circle quadrant gives an approximation for pi/4
    • 4 x this fraction gives an approximation for pi
       
  • Sequential program
  • Java version of OpenMP: JOMP
  • JOMP parallel program
  • Process for using OpenMP: Precompiler
     


Criticisms

  • OpenMP and MPI were designed for use with Fortran and C, not Java
     
  • OpenMP and MPI are not object oriented
     
  • Existing forays into parallel programming middleware in Java leave much to be desired
     
  • There is a Java version of MPI -- mpiJava -- but it is just a thin veneer on top of the non-object oriented MPI API and does not smell like a Java API
  • JOMP mimics OpenMP, but the precompiler directive approach feels unnatural to Java programmers
     
  • JOMP is alpha quality software, buggy, no longer maintained, and no source code is released
     
  • JOMP and mpiJava do not play well together
     
  • MPI and threads do not play well together
     
  • I am not aware of any middleware standard that encompasses SMP, cluster, and hybrid SMP cluster parallel programming


Parallel Java (PJ)

  • "Parallel Java (PJ) is an API and middleware for parallel programming in 100% Java on shared memory multiprocessor (SMP) parallel computers, cluster parallel computers, and hybrid SMP cluster parallel computers. PJ was developed by Professor Alan Kaminsky and his student Luke McOmber in the Department of Computer Science at the Rochester Institute of Technology."
     
  • Main PJ page: http://www.cs.rit.edu/~ark/pj.shtml
     
  • Javadoc: http://www.cs.rit.edu/~ark/pj/doc/index.html
     
  • Monte Carlo calculation of pi -- sequential program
  • Monte Carlo calculation of pi -- PJ parallel program
  • Demonstrations
     
  • Running time measurements on the parasite.cs.rit.edu machine (30-Sep-2005)
    • Running times in milliseconds
    • K = number of processors
    • K=0 stands for the sequential version; command:
        java edu.rit.smp.monte.PiSeq2 285714 1000000000
    • K>0 stands for the parallel version; command:
        java -Dpj.nt=$K edu.rit.smp.monte.PiSmp2 285714 1000000000
    K   Run 1   Run 2   Run 3   Run 4   Run 5   Aver.   Spdup   Effi.
    -   -----   -----   -----   -----   -----   -----   -----   -----
    0   71158   71158   71388   71156   71158   71204
    1   74214   74085   74098   74077   74232   74141   0.960   0.960
    2   37142   37115   37229   37149   37101   37147   1.917   0.958
    3   24852   24852   24853   24766   24851   24835   2.867   0.956
    4   18715   18740   18636   18640   18716   18689   3.810   0.952
    5   14899   14930   14932   14933   14934   14926   4.771   0.954
    6   12515   12518   12457   12501   12499   12498   5.697   0.950
    7   10696   10724   10695   10778   10694   10717   6.644   0.949
    8    9492    9419    9465    9407    9371    9431   7.550   0.944
    
  • Tests done by Luke McOmber in the Spring 2005 quarter show that Java/PJ programs' performance equals or exceeds equivalent C/OpenMP programs' performance


Next Steps

  • Submit a "work in progress" poster on PJ to SIGCSE 2006
     
  • Use PJ in my Parallel Computing I class in the Winter 2005 quarter
     
  • Add object oriented message passing to PJ (underway)
     
  • Accumulate more performance measurements
     
  • Work on solving scientific computing problems with PJ programs

Alan Kaminsky Department of Computer Science Rochester Institute of Technology 4541 + 2411 = 6952
Home Page
Copyright © 2005 Alan Kaminsky. All rights reserved. Last updated 03-Oct-2005. Please send comments to ark­@­cs.rit.edu.