Tutorial 2

Introduction to Parallel Computing with the HPJPC Threading and Communication Libraries
Instructors: 

George K. Thiruvathukal 
Thomas W. Christopher
Who Should Attend: 
This audience will be knowledgeable in the fundamental Java classes to support concurrency and networking and will be more interested in patterns and techniques that can be repeated in practical applications. This tutorial also features real, working programming examples and is based largely on a Book published in the Sun Java Series, written by the two authors. The level of difficulty ranges from introductory (for the parallel computing part only) to advanced.
Prerequisites
Prerequisites:
Familiarity with Java's java.thread, java.net, and java.io packages is assumed. Familiarity with the basic principles of concurrency is also assumed.

 

Benefits:
  1. A proper introduction to concurrency helps the student to learn the pitfalls and how to avoid them. 
  2. Many of the topics related to concurrency are often presented at a very abstract level in operating systems textbooks. Seeing real examples will help the student to illuminate his/her understanding of these abstract principles.
  3. Parallel programs are often written with the idea of being "reused", often at the expense of significant, non-trivial modifications. As our approach is pattern-oriented, this course will be valuable even to those who may not use Java initially. The advanced course in particular will benefit those who want techniques for writing codes that are easily maintained and can be understood sufficiently well to tune performance.
  4. All participants will benefit by gaining access to a valuable programming library that is freely available to all but having a unique opportunity to meet with the authors and to understand the design philosophy.

 

Outline:
1/2 Day
  1. Background
  2. Shared memory
    • Parallel subroutines
      • Creating and joining
      • Example: trapezoidal numeric integration
      • Reducing costs of thread creation: RunQueue
      • RunQueue implementation
    • Awaiting termination of subprograms:
      • Future
      • Accumulator
      • TerminationGroup
      • Example: trapezoidal numeric integration with accumulator
    • Parallelizing loops
      • Concepts
      • Chore graphs as a model
      • Barriers
      • Example: Warshall's algorithm
      • Chores
        • Programming techniques:
        • Job jars, chore graphs, and macrodataflow
        • Example: Warshall's algorithm
        • FutureTable
      • Factories
        • reusing chores: pools, or factories with recycling
        • FutureFactory
        • BarrierFactory
        • AccumulatorFactory
        • SharedTableOfQueues
      • Distributed Memory (Time will only permit to introduce this, hence the short outline.)
        • GMI - A Multithreaded and Lightweight RMI for Java
        • Memo - Tuple Spaces for Java
        • Distributed Trapezoidal Integration (simple example)
        • Distributed Warshall (more complex)
      • Application clustering and Computational Neighborhood
Abstract:

This advanced course is designed for those who want a more advanced primer on working with Java threads and communication with a specific emphasis on making the transition into a parallel computing environment. The topics for this course have been selected from a book recently written by the presenters entitled High Performance Java Platform Computing: Threads and Networking (HPJPC). This book is part of the reputable Sun Microsystems Press Java Series™, published by Prentice Hall PTR.

In this course, we will explore patterns and techniques for writing concurrent applications (specifically, those that can benefit from parallel execution) using the Java threads and networking classes and the HPJPC programming library. Techniques for managing threads performance in parallel applications will be presented. Two typical environments will be considered: shared memory and distributed (or clustered) computing. The HPJPC library will be used in all of the examples presented to show first how shared memory parallel applications can be written using Java, followed by a discussion of how the transition from shared memory to distributed memory can be achieved.  There will be a discussion of performance issues encountered in our early experiments and a summary of where Java does surprisingly well and where there remains a need for improvement.