1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
package mpi.dtyp;
import mpi.*;
import java.util.Arrays;
/**
* This example application, is to check and demonstrate the functonality of
* contiguous datatypes. I'm writing an MPJ program by coverting a C program by
* Forest Hoffman at following URL
* http://www.linux-mag.com/2003-04/extreme_01.html
*
*/
public class DtypTest {
public static void main(String args[]) throws Exception {
try {
DtypTest c = new DtypTest(args);
}
catch (Exception e) {
}
}
public DtypTest() {
}
public DtypTest(String[] args) throws Exception {
MPI.Init(args);
int i, j, k, rank, size, dest, src, tag;
rank = MPI.COMM_WORLD.Rank();
size = MPI.COMM_WORLD.Size();
src = 0;
dest = 1;
tag = 10;
if (rank == 1) {
} else if (rank == 0) {
System.out.println(" Checking out, extent, lb, ub of basic datatypes ");
System.out.println(" Byte***** ");
System.out.println(" ext " + MPI.BYTE.Extent());
System.out.println(" lb " + MPI.BYTE.Lb());
System.out.println(" ub " + MPI.BYTE.Ub());
System.out.println(" Boolean***** ");
System.out.println(" ext " + MPI.BOOLEAN.Extent());
System.out.println(" lb " + MPI.BOOLEAN.Lb());
System.out.println(" ub " + MPI.BOOLEAN.Ub());
System.out.println(" char***** ");
System.out.println(" ext " + MPI.CHAR.Extent());
System.out.println(" lb " + MPI.CHAR.Lb());
System.out.println(" ub " + MPI.CHAR.Ub());
System.out.println(" short***** ");
System.out.println(" ext " + MPI.SHORT.Extent());
System.out.println(" lb " + MPI.SHORT.Lb());
System.out.println(" ub " + MPI.SHORT.Ub());
System.out.println(" int ***** ");
System.out.println(" ext " + MPI.INT.Extent());
System.out.println(" lb " + MPI.INT.Lb());
System.out.println(" ub " + MPI.INT.Ub());
System.out.println(" float***** ");
System.out.println(" ext " + MPI.FLOAT.Extent());
System.out.println(" lb " + MPI.FLOAT.Lb());
System.out.println(" ub " + MPI.FLOAT.Ub());
System.out.println(" long***** ");
System.out.println(" ext " + MPI.LONG.Extent());
System.out.println(" lb " + MPI.LONG.Lb());
System.out.println(" ub " + MPI.LONG.Ub());
System.out.println(" double***** ");
System.out.println(" ext " + MPI.DOUBLE.Extent());
System.out.println(" lb " + MPI.DOUBLE.Lb());
System.out.println(" ub " + MPI.DOUBLE.Ub());
System.out.println(" Upper Bound (UB)***** ");
System.out.println(" ext " + MPI.UB.Extent());
System.out.println(" lb " + MPI.UB.Lb());
System.out.println(" ub " + MPI.UB.Ub());
System.out.println(" Lower Bound (LB)***** ");
System.out.println(" ext " + MPI.LB.Extent());
System.out.println(" lb " + MPI.LB.Lb());
System.out.println(" ub " + MPI.LB.Ub());
}
try {
Thread.currentThread().sleep(1000);
}
catch (Exception e) {
}
MPI.COMM_WORLD.Barrier();
MPI.Finalize();
}
}
|