• 2019 Update 7
  • 03/31/2020
Contents

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
    mpivars.sh
    from the Intel® MPI Library package to set up all required environment variables, including
    LIBRARY_PATH
    and
    CLASSPATH
    .
  2. Build your Java MPI application as usual.
  3. Update
    CLASSPATH
    with the path to the
    jar
     application or pass it explicitly with the
    –cp
    option of the
    java
    command.
  4. Run your Java MPI application using the following command:
    $ mpirun <options> java <app>
    where:
    • <options>
      is a list of
      mpirun
      options
    • <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
<install_dir>
/test
folder.

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
    Group
    ,
    Comm
    ,
    Datatype
    , 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
      entity
      Java object, which can be an instance of
      Comm
      ,
      Group
      , etc.
    • AllocablePool.remove(entity)
      : frees the memory backing the
      entity
      Java object, which can be an instance of
      Comm
      ,
      Group
      , 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

1

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