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:
- M. Nowicki, M. Ryczkowska, Ł. Górski, M. Szynkiewicz, P. Bała PCJ - a Java library for heterogenous parallel computing In: X. Zhuang (Ed.) Recent Advances in Information Science (Recent Advances in Computer Engineering Series vol 36) WSEAS Press 2016 pp. 66-72
- M. Nowicki, Ł. Górski, P. Grabarczyk, P. Bała PCJ - Java library for high performance computing in PGAS model In: W. W. Smari and V. Zeljkovic (Eds.) 2012 International Conference on High Performance Computing and Simulation (HPCS) IEEE 2014 pp. 202-209
- M. Nowicki, P. Bała PCJ-new approach for parallel computations in java In: P. Manninen, P. Oster (Eds.) Applied Parallel and Scientific Computing, LNCS 7782, Springer, Heidelberg (2013) pp. 115-125
- M. Nowicki, P. Bała Parallel computations in Java with PCJ library In: W. W. Smari and V. Zeljkovic (Eds.) 2012 International Conference on High Performance Computing and Simulation (HPCS) IEEE 2012 pp. 381-387
Usage of the PCJ:
- M Ryczkowska, M Nowicki, P Bala Level-synchronous BFS algorithm implemented in Java using PCJ Library In: 2016 International Conference on Computational Science and Computational Intelligence (CSCI), Las Vegas, NV, USA}, 2016, pp. 596-601
- Ł Górski, F Rakowski, P Bała A case study of software load balancing policies implemented with the PGAS programming model In: W. W. Smari, V. Zejkovic (Eds) (eds.) 2016 International Conference on High Performance Computing \& Simulation (HPCS),
IEEE 2016, pp. 443 - 448
- M Ryczkowska, M Nowicki, P Bala The Performance Evaluation of the Java Implementation of Graph500 In: R. Wyrzykowski et all (eds.) Parallel Processing and Applied Mathematics, Springer 2016 pp. 221-230
- Ł Górski, F Rakowski, P Bała Parallel Differential Evolution in the PGAS Programming Model Implemented with PCJ Java Library In: R. Wyrzykowski et all (eds.) Parallel Processing and Applied Mathematics, Springer 2015, pp. 448-458
- M Nowicki, M Marchwiany, M Szpindler, P Bała On-line Service for Teaching Parallel Programming In:Euro-Par 2015: Parallel Processing Workshops, Springer 2015, pp. 78-89
- M. Ryczkowska Evaluating PCJ library for graph problems-Graph500 in PCJ In: W. W. Smari and V. Zeljkovic (Eds.) 2012 International Conference on High Performance Computing and Simulation (HPCS) IEEE 2014 pp. 1005-1007
Contact: bala@icm.edu.pl faramir@icm.edu.pl
Shared variables
The general rule is that variables are local to the tasks and cannot be accessed from another task.
PCJ offers possibility to mark some variables Shared using Java annotation mechanism. The Shared variables are accessible across tasks, eg. one task can get access to the shared variable instance stored in another task. Shared variables have to be defined as part of enum variable and have to be registered using @RegisterStorage annotation.
public class ExampleGetPut implements StartPoint {
@Storage(ExampleGetPut.class) // Define storage
enum Shared {
a, array
}
public double a = PCJ.threadCount();
public double array[] = new double[10];
The elements of Shared variable can be single variables, arrays as well as more complicated objects.
Access to a shared variables
The PCJ librrary provides methods to access shared variables, eg. to get value stored in the memory of another task ({\tt get()})or to modify variable located in the memory of another task (put()).
Both methods: get(} and put() perform one-sided communication. This means, that access to the memory of another task is performed only by task which executes get or put methods. The task which memory is contacted do not need to execute these methods.
The example code presents how to assign value of the variable a at task 3 to the variable c at task 0.
The same for assigning value of the variable array[2] at task 3 to the variable c at task 0.
Next example presents how to assign value 3.0 to the variable a available at the task 5. This operation is performed by the task 0.
Simmilar, we send value of 4.0 to the array[] stored at the thask 2. The array[1] element is updated.
The communication is performed in synchronous way. The asyncPut() and asyncGet() can be used for asynchronous communication which means that user has no guarantee that value has been changed or transferred from remote task. The use of asynchronous communication may cause some problems, especially for non experienced users. PCJ provides additional methods to solve this problem.