1 /*
2 * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights
13 * reserved.
14 * $COPYRIGHT$
15 *
16 * Additional copyrights may follow
17 *
18 * $HEADER$
19 *
20 *
21 * This file is almost a complete re-write for Open MPI compared to the
22 * original mpiJava package. Its license and copyright are listed below.
23 * See <path to ompi/mpi/java/README> for more information.
24 *
25 *
26 * Licensed under the Apache License, Version 2.0 (the "License");
27 * you may not use this file except in compliance with the License.
28 * You may obtain a copy of the License at
29 *
30 * http://www.apache.org/licenses/LICENSE-2.0
31 *
32 * Unless required by applicable law or agreed to in writing, software
33 * distributed under the License is distributed on an "AS IS" BASIS,
34 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35 * See the License for the specific language governing permissions and
36 * limitations under the License.
37 *
38 *
39 * File : Prequest.java
40 * Author : Sang Lim, Xinying Li, Bryan Carpenter
41 * Created : Thu Apr 9 12:22:15 1998
42 * Revision : $Revision: 1.11 $
43 * Updated : $Date: 2001/10/22 21:07:55 $
44 * Copyright: Northeast Parallel Architectures Center
45 * at Syracuse University 1998
46 */
47
48 package mpi;
49
50 /**
51 * Persistent request object.
52 */
53 public final class Prequest extends Request
54 {
55 /**
56 * Constructor used by {@code sendInit}, etc.
57 * @param handle Handle for the Prequest object
58 */
59 protected Prequest(long handle)
60 {
61 super(handle);
62 }
63
64 /**
65 * Activate a persistent communication request.
66 * <p>Java binding of the MPI operation {@code MPI_START}.
67 * The communication is completed by using the request in
68 * one of the {@code wait} or {@code test} operations.
69 * On successful completion the request becomes inactive again.
70 * It can be reactivated by a further call to {@code Start}.
71 * @throws MPIException Signals that an MPI exception of some sort has occurred.
72 */
73 public void start() throws MPIException
74 {
75 handle = start(handle);
76 }
77
78 private native long start(long request) throws MPIException;
79
80 /**
81 * Activate a list of communication requests.
82 * <p>Java binding of the MPI operation {@code MPI_STARTALL}.
83 * @param requests array of requests
84 * @throws MPIException Signals that an MPI exception of some sort has occurred.
85 */
86 public static void startAll(Prequest[] requests) throws MPIException
87 {
88 MPI.check();
89 long[] r = getHandles(requests);
90 startAll(r);
91 setHandles(requests, r);
92 }
93
94 private native static void startAll(long[] requests) throws MPIException;
95
96 } // Prequest