• 2019 Update 7
  • 03/31/2020

Java* MPI Applications Support

Intel® MPI Library Developer Guide for Linux* OS
Intel® MPI Library provides an experimental feature to enable support for Java MPI applications. Java bindings are available for a subset of MPI-2 routines. For a full list of supported routines, refer to the Developer Reference, section
Miscellaneous > Java* Bindings for MPI-2 Routines

Running Java* MPI applications

Follow these steps to set up the environment and run your Java* MPI application:
  1. Source
    from the Intel® MPI Library package to set up all required environment variables, including
  2. Build your Java MPI application as usual.
  3. Update
    with the path to the
     application or pass it explicitly with the
    option of the
  4. Run your Java MPI application using the following command:
    $ mpirun <options> java <app>
    • <options>
      is a list of
    • <app>
      is the main class of your Java application
    For example:
    $ mpirun -n 8 -ppn 1 –f ./hostfile java mpi.samples.Allreduce
Sample Java MPI applications are available in the

Development Recommendations

You can use the following tips when developing Java* MPI applications:
  • To reduce memory footprint, you can use Java direct buffers as buffer parameters of collective operations in addition to using Java arrays. This approach allows you to allocate the memory out of the JVM heap and avoid additional memory copying when passing the pointer to the buffer from JVM to the native layer.
  • When you create Java MPI entities such as
    , and similar, memory is allocated on the native layer and is not tracked by the garbage collector. Therefore, this memory must be released explicitly. Pointers to the allocated memory are stored in a special pool and can be deallocated using one of the following methods:
    • entity.free()
      : frees the memory backing the
      Java object, which can be an instance of
      , etc.
    • AllocablePool.remove(entity)
      : frees the memory backing the
      Java object, which can be an instance of
      , etc.
    • AllocablePool.cleanUp()
      : explicitly deallocates the memory backing all Java MPI objects created by that moment.
    • MPI.Finalize()
      : implicitly deallocates the memory backing all Java MPI objects and that has not been explicitly deallocated by that moment.

Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804