Пример #1
0
 private void getTrueLbExtent() throws MPIException {
   MPI.check();
   int lbExt[] = new int[2];
   getTrueLbExtent(handle, lbExt);
   trueLb = lbExt[0] / baseSize;
   trueExtent = lbExt[1] / baseSize;
 }
Пример #2
0
 /**
  * Stores attribute value associated with a key.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_SET_ATTR}.
  *
  * @param keyval attribute key
  * @param value attribute value
  * @throws MPIException
  */
 public void setAttr(int keyval, Object value) throws MPIException {
   MPI.check();
   setAttr(handle, keyval, MPI.attrSet(value));
 }
Пример #3
0
 /**
  * Frees an attribute key.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_FREE_KEYVAL}.
  *
  * @param keyval attribute key
  * @throws MPIException
  */
 public static void freeKeyval(int keyval) throws MPIException {
   MPI.check();
   freeKeyval_jni(keyval);
 }
Пример #4
0
 /**
  * Create a new attribute key.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_CREATE_KEYVAL}.
  *
  * @return attribute key for future access
  * @throws MPIException
  */
 public static int createKeyval() throws MPIException {
   MPI.check();
   return createKeyval_jni();
 }
Пример #5
0
 /**
  * Return the print name from the datatype.
  *
  * @return name of the datatype
  * @throws MPIException
  */
 public String getName() throws MPIException {
   MPI.check();
   return getName(handle);
 }
Пример #6
0
 /**
  * Sets the print name for the datatype.
  *
  * @param name name for the datatype
  * @throws MPIException
  */
 public void setName(String name) throws MPIException {
   MPI.check();
   setName(handle, name);
 }
Пример #7
0
 /**
  * Create a datatype with a new lower bound and extent from an existing datatype.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_CREATE_RESIZED}.
  *
  * @param oldType input datatype
  * @param lb new lower bound of datatype (address integer)
  * @param extent new extent of datatype (address integer)
  * @return new datatype
  * @throws MPIException
  */
 public static Datatype createResized(Datatype oldType, int lb, int extent) throws MPIException {
   MPI.check();
   long handle = getResized(oldType.handle, lb, extent);
   return new Datatype(oldType, handle);
 }
Пример #8
0
 /**
  * Returns the total size of a datatype - the number of buffer elements it represents.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_SIZE}.
  *
  * @return datatype size
  * @throws MPIException
  */
 public int getSize() throws MPIException {
   MPI.check();
   return getSize(handle) / baseSize;
 }
Пример #9
0
 /**
  * Identical to {@code createIndexed} except that the displacements are expressed directly in
  * terms of the buffer index, rather than the units of the old type.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_HINDEXED}.
  *
  * @param blockLengths number of elements per block
  * @param displacements byte displacement in buffer for each block
  * @param oldType old datatype
  * @return new datatype
  * @throws MPIException
  */
 public static Datatype createHIndexed(int[] blockLengths, int[] displacements, Datatype oldType)
     throws MPIException {
   MPI.check();
   long handle = getHIndexed(blockLengths, displacements, oldType.handle);
   return new Datatype(oldType, handle);
 }
Пример #10
0
 /**
  * Identical to {@code createVector} except that the stride is expressed directly in terms of the
  * buffer index, rather than the units of the old type.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_HVECTOR}.
  *
  * @param count number of blocks
  * @param blockLength number of elements in each
  * @param stride number of bytes between start of each block
  * @param oldType old datatype
  * @return new datatype
  * @throws MPIException
  */
 public static Datatype createHVector(int count, int blockLength, int stride, Datatype oldType)
     throws MPIException {
   MPI.check();
   long handle = getHVector(count, blockLength, stride, oldType.handle);
   return new Datatype(oldType, handle);
 }
Пример #11
0
 /**
  * Construct new datatype representing replication of old datatype into contiguous locations.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_CONTIGUOUS}.
  *
  * <p>The base type of the new datatype is the same as the base type of {@code oldType}.
  *
  * @param count replication count
  * @param oldType old datatype
  * @return new datatype
  * @throws MPIException
  */
 public static Datatype createContiguous(int count, Datatype oldType) throws MPIException {
   MPI.check();
   return new Datatype(oldType, getContiguous(count, oldType.handle));
 }
Пример #12
0
 /**
  * Java binding of {@code MPI_TYPE_DUP}.
  *
  * @return new datatype
  * @throws MPIException
  */
 public Datatype dup() throws MPIException {
   MPI.check();
   return new Datatype(this, dup(handle));
 }
Пример #13
0
 /**
  * Frees the datatype.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_FREE}.
  *
  * @throws MPIException
  */
 @Override
 public void free() throws MPIException {
   MPI.check();
   handle = free(handle);
 }
Пример #14
0
 /**
  * Commits a derived datatype. Java binding of the MPI operation {@code MPI_TYPE_COMMIT}.
  *
  * @throws MPIException
  */
 public void commit() throws MPIException {
   MPI.check();
   commit(handle);
 }
Пример #15
0
 /**
  * Retrieves attribute value by key.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_GET_ATTR}.
  *
  * @param keyval attribute key
  * @return attribute value or null if no attribute is associated with the key.
  * @throws MPIException
  */
 public Object getAttr(int keyval) throws MPIException {
   MPI.check();
   Object obj = getAttr(handle, keyval);
   return obj instanceof byte[] ? MPI.attrGet((byte[]) obj) : obj;
 }
Пример #16
0
 /**
  * Deletes an attribute value associated with a key.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_DELETE_ATTR}.
  *
  * @param keyval attribute key
  * @throws MPIException
  */
 public void deleteAttr(int keyval) throws MPIException {
   MPI.check();
   deleteAttr(handle, keyval);
 }
Пример #17
0
 /**
  * The most general type constructor.
  *
  * <p>Java binding of the MPI operation {@code MPI_TYPE_STRUCT}.
  *
  * <p>The number of blocks is taken to be size of the {@code blockLengths} argument. The second
  * and third arguments, {@code displacements}, and {@code types}, should be the same size.
  *
  * @param blockLengths number of elements in each block
  * @param displacements byte displacement of each block
  * @param types type of elements in each block
  * @return new datatype
  * @throws MPIException
  */
 public static Datatype createStruct(int[] blockLengths, int[] displacements, Datatype[] types)
     throws MPIException {
   MPI.check();
   long handle = getStruct(blockLengths, displacements, types);
   return new Datatype(MPI.BYTE, handle);
 }