PCJ is a library for Java language that helps to perform parallel and distributed calculations. The current version is able to work on the multicore systems connected with the typical interconnect such as ethernet or infiniband providing users with the uniform view across nodes.

Download PCJ library (jar file of 29.04.2017 ver. 5.0.6)  Latest (bug fixing release)!

Download PCJ manual (pdf) for PCJ 5 New!

The PCJ library can be used with no cost at BSD license. It requires Java 8 and no additional tools or comilers.  The PCJ library for Java 7 is available in the dowload section.

The source code is available at GitHub: https://github.com/hpdcj/pcj

Version 5 introduces asyncPut() and asyncGet() methods; put() and get() methods are now synchronous. There is new handling of shared variables. The code developed for PCJ 4 hast to be modified. For details please reffer to the JavaDoc file.

The usage should be acknowledged by reference to the PCJ web site and/or reference to the papers:

Full paper list can be found here: http://pcj.icm.edu.pl/pcj-papers

Contact: bala@icm.edu.pl faramir@icm.edu.pl

PCJ5 presented at Supercomputing 2018

PCJ comparison with Spark and APGAS has been presented during Parallel Applications Workshop (Alternatives To MPI) at Supercomputing 2018:

J. Posner, L. Reitz, C. Fohry Comparison of the HPC and Big Data Java Libraries Spark, PCJ and APGAS Parallel Applications Workshop - Alternatives to MPI, SC'18, Dallas 2018

This paper compares the big data library Spark, and the HPC libraries PCJ and APGAS, regarding productivity and performance. Authors refer to Java versions of all libraries. For APGAS, paper includes both the original version and an own ex-tension by locality-flexible tasks. Authors consider three benchmarks:Calculation of π from HPC, Unbalanced Tree Search (UTS) from HPC, and WordCount from the big data domain.

Reference paper for PCJ5

Our invited tutorial paper from HPCS Conference in Orleans is now available:

M. Nowicki, Ł. Górski, P. Bała PCJ – Java Library for Highly Scalable HPC and Big Data Processing 2018 International Conference on High Performance Computing \& Simulation (HPCS), pp:12-20 IEEE, 2018

In this paper ypu can find examples and performance data for recent PCJ version (5.0.6).

PhD degree of Magda Ryczkowska

Magda Ryczkowska has defended PhD thesis titled Coverage of selected, parallel graph algorithms in PGAS model and their implementation in Java language. The thesis has been defended at Institute of Computer Science Polish Academy of Sciences, Warszawa, Poland on 5th November 2018. 

The results shown in the dissertation, prove that parallel and distributed computations on graphs carried out using PGAS model and the Java language, allow to gain good performance and scalability. However, the crucial part is to provide fast link between cluster nodes and sufficient amount of available memory on nodes. The solutions and the results that have been worked out show that PGAS model together with the Java language can be used in effective processing of graphs in data analysis, based on high-level programming languages.In the dissertation PCJ library has been used.

PCJ 5 scales up to 196 608 cores

The PCJ application was successfuly run on more than 100 000 cores of Cray XC40 at HLRS. This achievement was possible due to the Marek Nowicki visit to HLRS sponsored by EuroLab-4-HPC (visit) and PRACE (CPU time). The PCJ benchamrks were executed together with the 2D stencil code based on the Game of Life example. The code shows excellent scalability for all cores used (4096 nodes = 196608 cores) The parallel efficiency achieved in weak scalling regime was 99.74%.

Obtaining PCJ

In order to use PCJ library you have to dowload PCJ.jar file from the PCJ web site:pcj.icm.edu.pl. The PCJ.jar should be located in the directory accessible by java compiler and java runtime, for example in the lib directory of your IDE. File you dowlnoad from website has to be renamed to PCJ.jar otherwise you have to use in the examples full name.

The PCJ.jar should be placed in your project directory (usually in the folder libs) and added to the project.

 

PCJ is now registerred in Maven repository. To use it simple add to your maven dependencies:

<dependency>
   <groupId>pl.edu.icm.pcj</groupId>
   <artifactId>pcj</groupId>
   <version>5.0.6</version>
 </dependency>

You can use PCJ with gradle:

 implementation 'pl.edu.icm.pcj:pcj:5.0.6'

Starting PCJ application - Hello World

Starting PCJ application is simple. It can be built in the form of a single class which extends Storage class and implements StartPoint interface. The Storage class can be used to define shared variables. StartPoint interface provides necessary functionality to start required threads, enumerate them and performs initial synchronization of tasks.

 

PCJ.deploy() method initializes application using list of nodes provided as third argument. List of nodes contains internet address of the computers (cluster nodes) used in the simulations.

 

import java.io.IOException;
import org.pcj.*;

public class HelloWorld implements StartPoint {

    public static void main(String[] args) throws IOException {
        String nodesFile  = "nodes.txt";
       
        PCJ.deploy(HelloWorld.classnew NodesDescription("nodes.txt"));
    }

    @Override
    public void main() throws Throwable {
                System.out.println("Hello World from PCJ Thread " + PCJ.myId()
                                     + " out of " + PCJ.threadCount() );
            }
}

The compilation and execution requires PCJ.jar in the path:

javac -cp .:PCJ.jar HelloWorld.java
java -cp .:PCJ.jar HelloWorld

 

The expected output is presented below:

wrz 23, 2016 2:00:22 AM org.pcj.internal.InternalPCJ start
INFO: PCJ version 5.0.0.SNAPSHOT-a728f5f built on 2016-09-13 00:58:48.180 CEST.
wrz 23, 2016 2:00:22 AM org.pcj.internal.InternalPCJ start
INFO: Starting HelloWorld with 4 threads (on 1 node)...
Hello World from PCJ Thread 2 out of 4
Hello World from PCJ Thread 0 out of 4
Hello World from PCJ Thread 1 out of 4
Hello World from PCJ Thread 3 out of 4
wrz 23, 2016 2:00:22 AM org.pcj.internal.InternalPCJ start
INFO: Completed HelloWorld with 4 threads (on 1 node) after 0h 0m 0s.
BUILD SUCCESSFUL (total time: 0 seconds)

 

The above scenario allows to run PCJ application within single Java Virtual Machine. The same code can be run using multiple JVM's.