Hi,

yesterday I installed openmpi-v1.10.2-176-g9d45e07 on my "SUSE Linux
Enterprise Server 12 (x86_64)" with Sun C 5.13  and gcc-5.3.0.
Unfortunately I have a problem compiling Java programs.


loki java 124 ompi_info | grep -e "OPAL repo revision" -e "C compiler absolute"
      OPAL repo revision: v1.10.2-176-g9d45e07
     C compiler absolute: /opt/solstudio12.4/bin/cc
loki java 125 mpijavac BcastIntMain.java
BcastIntMain.java:44: error: cannot find symbol
    mytid         = MPI.COMM_WORLD.getRank ();
                       ^
  symbol:   variable COMM_WORLD
  location: class MPI
BcastIntMain.java:52: error: cannot find symbol
    MPI.COMM_WORLD.bcast (intValue, 1, MPI.INT, 0);
                                          ^
  symbol:   variable INT
  location: class MPI
BcastIntMain.java:52: error: cannot find symbol
    MPI.COMM_WORLD.bcast (intValue, 1, MPI.INT, 0);
       ^
  symbol:   variable COMM_WORLD
  location: class MPI
3 errors
loki java 126


loki java 110 dir /usr/local/openmpi-1.10.3_64_cc/lib64/*.jar
-rw-r--r-- 1 root root 60876 May 6 13:05 /usr/local/openmpi-1.10.3_64_cc/lib64/mpi.jar
loki java 111 javac -version
javac 1.8.0_66
loki java 112



I have the same problem with openmpi-v2.x-dev-1404-g74d8ea0 and with
openmpi-dev-4010-g6c9d65c and I would be grateful, if somebody can fix
the problem. Thank you very much for any help in advance.


Kind regards

Siegmar
/* Small program that distributes an integer value with a
 * broadcast operation.
 *
 * Java uses call-by-value and doesn't support call-by-reference
 * for method parameters with the only exception of object references.
 * Therefore you must use an array with just one element, if you
 * want to send/receive/broadcast/... primitive datatypes.
 *
 * "mpijavac" and Java-bindings are available in "Open MPI
 * version 1.7.4" or newer.
 *
 *
 * Class file generation:
 *   mpijavac BcastIntMain.java
 *
 * Usage:
 *   mpiexec [parameters] java [parameters] BcastIntMain
 *
 * Examples:
 *   mpiexec -np 2 java BcastIntMain
 *   mpiexec -np 2 java -cp $HOME/mpi_classfiles BcastIntMain
 *
 *
 * File: BcastIntMain.java		Author: S. Gross
 * Date: 09.09.2013
 *
 */

import mpi.*;

public class BcastIntMain
{
  static final int SLEEP_FACTOR = 200;	/* 200 ms to get ordered output	*/

  public static void main (String args[]) throws MPIException,
						 InterruptedException
  {
    int	   mytid;			/* my task id			*/
    int    intValue[] = new int[1];	/* broadcast one intValue	*/
    String processorName;		/* name of local machine	*/

    MPI.Init (args);
    processorName = MPI.getProcessorName ();
    mytid	  = MPI.COMM_WORLD.getRank ();
    intValue[0]   = -1;
    if (mytid == 0)
    {
      /* initialize data item						*/
      intValue[0] = 1234567;
    }
    /* broadcast value to all processes					*/
    MPI.COMM_WORLD.bcast (intValue, 1, MPI.INT, 0);
    /* Each process prints its received data item. The outputs
     * can intermingle on the screen so that you must use
     * "-output-filename" in Open MPI.
     */
    Thread.sleep (SLEEP_FACTOR * mytid); /* sleep to get ordered output	*/	
    System.out.printf ("\nProcess %d running on %s.\n" +
		       "  intValue: %d\n",
		       mytid, processorName, intValue[0]);
    MPI.Finalize ();
  }
}

Reply via email to