1
1
openmpi/examples/oshmem_circular_shift.java
Oscar Vega-Gisbert 86a89c9324 Java-oshmem: update examples
This commit was SVN r31913.
2014-06-01 15:09:30 +00:00

25 строки
625 B
Java

import shmem.*;
public class oshmem_circular_shift
{
public static void main(String[] args) throws ShMemException
{
ShMem.startPEs(0);
int numPEs = ShMem.getNumPEs(),
myPE = ShMem.getMyPE(),
peer = (myPE + 1) % numPEs;
int[] aaa = new int[1];
Addr bbb = new Addr(4);
System.out.println("Process "+ myPE +" gets message from "+
peer +" ("+ numPEs +" processes in ring)");
bbb.getInt(aaa, peer);
ShMem.barrierAll();
bbb.free();
System.out.println("Process "+ myPE +" exiting");
}
}