From adf98a01bf1d05ebbb40ffde6d0957f8e7bb0036 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Krup=C4=8D=C3=ADk?= <lukas.krupcik@vsb.cz>
Date: Mon, 16 Oct 2017 13:35:52 +0200
Subject: [PATCH] Update java.md

---
 docs.it4i/software/lang/java.md | 61 +++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/docs.it4i/software/lang/java.md b/docs.it4i/software/lang/java.md
index 83c3738c0..495644556 100644
--- a/docs.it4i/software/lang/java.md
+++ b/docs.it4i/software/lang/java.md
@@ -23,3 +23,64 @@ $ which javac
 ```
 
 Java applications may use MPI for inter-process communication, in conjunction with Open MPI. Read more on <http://www.open-mpi.org/faq/?category=java>. This functionality is currently not supported on Anselm cluster. In case you require the java interface to MPI, please contact [cluster support](https://support.it4i.cz/rt/).
+
+## Java with OpenMPI
+
+Because there is an increasing interest in using Java for HPC. Also, MPI can benefit from Java because its widespread use makes it likely to find new uses beyond traditional HPC applications.
+
+The Java bindings are integrated into Open MPI starting from the v1.7 series. Beginning with the v2.0 series, the Java bindings include coverage of MPI-3.1.
+
+### Example (Hello.java)
+
+```java
+import mpi.*;
+
+class Hello {
+    static public void main(String[] args) throws MPIException {
+
+
+        MPI.Init(args);
+
+        int myrank = MPI.COMM_WORLD.getRank();
+        int size = MPI.COMM_WORLD.getSize() ;
+        System.out.println("Hello world from rank " + myrank + " of " + size);
+
+        MPI.Finalize();
+    }
+}
+```
+
+```console
+$ ml Java/1.8.0_144
+$ ml OpenMPI/1.8.0_144
+$ mpijavac Hello.java
+$ mpirun java Hello
+Hello world from rank 23 of 28
+Hello world from rank 25 of 28
+Hello world from rank 0 of 28
+Hello world from rank 4 of 28
+Hello world from rank 7 of 28
+Hello world from rank 8 of 28
+Hello world from rank 11 of 28
+Hello world from rank 12 of 28
+Hello world from rank 13 of 28
+Hello world from rank 18 of 28
+Hello world from rank 17 of 28
+Hello world from rank 24 of 28
+Hello world from rank 27 of 28
+Hello world from rank 2 of 28
+Hello world from rank 3 of 28
+Hello world from rank 1 of 28
+Hello world from rank 10 of 28
+Hello world from rank 14 of 28
+Hello world from rank 16 of 28
+Hello world from rank 19 of 28
+Hello world from rank 26 of 28
+Hello world from rank 6 of 28
+Hello world from rank 9 of 28
+Hello world from rank 15 of 28
+Hello world from rank 20 of 28
+Hello world from rank 5 of 28
+Hello world from rank 21 of 28
+Hello world from rank 22 of 28
+```
\ No newline at end of file
-- 
GitLab