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.0.6 fixes some bugs occuring with the massive communication.

Version 5.0.3 contains support for Intel KNL chips.

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

Sequencial execution Sequencial execution

n order to ensure sequential execution of code, ie. outputr from taks in given order, the  Hello World example should be modified.

We introduce loop over the thread id, and the thred which number os equal to the loop variable is executing operations.

 

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

public class SequentialExecution implements StartPoint {

    public static void main(String[] args) throws IOException {
        String nodesFile = "nodes.txt";

        PCJ.deploy(SequentialExecution.classnew NodesDescription("nodes.txt"));
    }

    @Override
    public void main() throws Throwable {
        PCJ.barrier();
        for (int p = 0; p < PCJ.threadCount(); p++) {
            if (PCJ.myId() == p) {
                System.out.println("Hello from " + PCJ.myId() + " of " + PCJ.threadCount());
            }
            PCJ.barrier();
        }
    }
}

The expected output is presented below:

wrz 23, 2016 7:20:14 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 7:20:14 AM org.pcj.internal.InternalPCJ start
INFO: Starting SequentialExecution with 4 threads (on 1 node)...
Hello from 0 of 4
Hello from 1 of 4
Hello from 2 of 4
Hello from 3 of 4
wrz 23, 2016 7:20:14 AM org.pcj.internal.InternalPCJ start
INFO: Completed SequentialExecution with 4 threads (on 1 node) after 0h 0m 0s.
BUILD SUCCESSFUL (total time: 0 seconds)