| 1 | /*BHEADER**********************************************************************
|
|---|
| 2 | * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
|---|
| 3 | * Produced at the Lawrence Livermore National Laboratory.
|
|---|
| 4 | * This file is part of HYPRE. See file COPYRIGHT for details.
|
|---|
| 5 | *
|
|---|
| 6 | * HYPRE is free software; you can redistribute it and/or modify it under the
|
|---|
| 7 | * terms of the GNU Lesser General Public License (as published by the Free
|
|---|
| 8 | * Software Foundation) version 2.1 dated February 1999.
|
|---|
| 9 | *
|
|---|
| 10 | * $Revision: 2.4 $
|
|---|
| 11 | ***********************************************************************EHEADER*/
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | #ifndef HYPRE_PAR_CSR_COMMUNICATION_HEADER
|
|---|
| 16 | #define HYPRE_PAR_CSR_COMMUNICATION_HEADER
|
|---|
| 17 |
|
|---|
| 18 | /*--------------------------------------------------------------------------
|
|---|
| 19 | * hypre_ParCSRCommPkg:
|
|---|
| 20 | * Structure containing information for doing communications
|
|---|
| 21 | *--------------------------------------------------------------------------*/
|
|---|
| 22 |
|
|---|
| 23 | typedef struct
|
|---|
| 24 | {
|
|---|
| 25 | MPI_Comm comm;
|
|---|
| 26 |
|
|---|
| 27 | int num_sends;
|
|---|
| 28 | int *send_procs;
|
|---|
| 29 | int *send_map_starts;
|
|---|
| 30 | int *send_map_elmts;
|
|---|
| 31 |
|
|---|
| 32 | int num_recvs;
|
|---|
| 33 | int *recv_procs;
|
|---|
| 34 | int *recv_vec_starts;
|
|---|
| 35 |
|
|---|
| 36 | /* remote communication information */
|
|---|
| 37 | MPI_Datatype *send_mpi_types;
|
|---|
| 38 | MPI_Datatype *recv_mpi_types;
|
|---|
| 39 |
|
|---|
| 40 | } hypre_ParCSRCommPkg;
|
|---|
| 41 |
|
|---|
| 42 | /*--------------------------------------------------------------------------
|
|---|
| 43 | * hypre_ParCSRCommHandle:
|
|---|
| 44 | *--------------------------------------------------------------------------*/
|
|---|
| 45 |
|
|---|
| 46 | typedef struct
|
|---|
| 47 | {
|
|---|
| 48 | hypre_ParCSRCommPkg *comm_pkg;
|
|---|
| 49 | void *send_data;
|
|---|
| 50 | void *recv_data;
|
|---|
| 51 |
|
|---|
| 52 | int num_requests;
|
|---|
| 53 | MPI_Request *requests;
|
|---|
| 54 |
|
|---|
| 55 | } hypre_ParCSRCommHandle;
|
|---|
| 56 |
|
|---|
| 57 | /*--------------------------------------------------------------------------
|
|---|
| 58 | * Accessor macros: hypre_ParCSRCommPkg
|
|---|
| 59 | *--------------------------------------------------------------------------*/
|
|---|
| 60 |
|
|---|
| 61 | #define hypre_ParCSRCommPkgComm(comm_pkg) (comm_pkg -> comm)
|
|---|
| 62 |
|
|---|
| 63 | #define hypre_ParCSRCommPkgNumSends(comm_pkg) (comm_pkg -> num_sends)
|
|---|
| 64 | #define hypre_ParCSRCommPkgSendProcs(comm_pkg) (comm_pkg -> send_procs)
|
|---|
| 65 | #define hypre_ParCSRCommPkgSendProc(comm_pkg, i) (comm_pkg -> send_procs[i])
|
|---|
| 66 | #define hypre_ParCSRCommPkgSendMapStarts(comm_pkg) (comm_pkg -> send_map_starts)
|
|---|
| 67 | #define hypre_ParCSRCommPkgSendMapStart(comm_pkg,i)(comm_pkg -> send_map_starts[i])
|
|---|
| 68 | #define hypre_ParCSRCommPkgSendMapElmts(comm_pkg) (comm_pkg -> send_map_elmts)
|
|---|
| 69 | #define hypre_ParCSRCommPkgSendMapElmt(comm_pkg,i) (comm_pkg -> send_map_elmts[i])
|
|---|
| 70 |
|
|---|
| 71 | #define hypre_ParCSRCommPkgNumRecvs(comm_pkg) (comm_pkg -> num_recvs)
|
|---|
| 72 | #define hypre_ParCSRCommPkgRecvProcs(comm_pkg) (comm_pkg -> recv_procs)
|
|---|
| 73 | #define hypre_ParCSRCommPkgRecvProc(comm_pkg, i) (comm_pkg -> recv_procs[i])
|
|---|
| 74 | #define hypre_ParCSRCommPkgRecvVecStarts(comm_pkg) (comm_pkg -> recv_vec_starts)
|
|---|
| 75 | #define hypre_ParCSRCommPkgRecvVecStart(comm_pkg,i)(comm_pkg -> recv_vec_starts[i])
|
|---|
| 76 |
|
|---|
| 77 | #define hypre_ParCSRCommPkgSendMPITypes(comm_pkg) (comm_pkg -> send_mpi_types)
|
|---|
| 78 | #define hypre_ParCSRCommPkgSendMPIType(comm_pkg,i) (comm_pkg -> send_mpi_types[i])
|
|---|
| 79 |
|
|---|
| 80 | #define hypre_ParCSRCommPkgRecvMPITypes(comm_pkg) (comm_pkg -> recv_mpi_types)
|
|---|
| 81 | #define hypre_ParCSRCommPkgRecvMPIType(comm_pkg,i) (comm_pkg -> recv_mpi_types[i])
|
|---|
| 82 |
|
|---|
| 83 | /*--------------------------------------------------------------------------
|
|---|
| 84 | * Accessor macros: hypre_ParCSRCommHandle
|
|---|
| 85 | *--------------------------------------------------------------------------*/
|
|---|
| 86 |
|
|---|
| 87 | #define hypre_ParCSRCommHandleCommPkg(comm_handle) (comm_handle -> comm_pkg)
|
|---|
| 88 | #define hypre_ParCSRCommHandleSendData(comm_handle) (comm_handle -> send_data)
|
|---|
| 89 | #define hypre_ParCSRCommHandleRecvData(comm_handle) (comm_handle -> recv_data)
|
|---|
| 90 | #define hypre_ParCSRCommHandleNumRequests(comm_handle) (comm_handle -> num_requests)
|
|---|
| 91 | #define hypre_ParCSRCommHandleRequests(comm_handle) (comm_handle -> requests)
|
|---|
| 92 | #define hypre_ParCSRCommHandleRequest(comm_handle, i) (comm_handle -> requests[i])
|
|---|
| 93 |
|
|---|
| 94 | #endif /* HYPRE_PAR_CSR_COMMUNICATION_HEADER */
|
|---|