| 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 | * Fake mpi stubs to generate serial codes without mpi
|
|---|
| 16 | *
|
|---|
| 17 | *****************************************************************************/
|
|---|
| 18 |
|
|---|
| 19 | #ifndef hypre_MPISTUBS
|
|---|
| 20 | #define hypre_MPISTUBS
|
|---|
| 21 |
|
|---|
| 22 | #ifdef HYPRE_SEQUENTIAL
|
|---|
| 23 |
|
|---|
| 24 | #ifdef __cplusplus
|
|---|
| 25 | extern "C" {
|
|---|
| 26 | #endif
|
|---|
| 27 |
|
|---|
| 28 | /*--------------------------------------------------------------------------
|
|---|
| 29 | * Change all MPI names to hypre_MPI names to avoid link conflicts
|
|---|
| 30 | *
|
|---|
| 31 | * NOTE: MPI_Comm is the only MPI symbol in the HYPRE user interface,
|
|---|
| 32 | * and is defined in `HYPRE_utilities.h'.
|
|---|
| 33 | *--------------------------------------------------------------------------*/
|
|---|
| 34 |
|
|---|
| 35 | #define MPI_Comm hypre_MPI_Comm
|
|---|
| 36 | #define MPI_Group hypre_MPI_Group
|
|---|
| 37 | #define MPI_Request hypre_MPI_Request
|
|---|
| 38 | #define MPI_Datatype hypre_MPI_Datatype
|
|---|
| 39 | #define MPI_Status hypre_MPI_Status
|
|---|
| 40 | #define MPI_Op hypre_MPI_Op
|
|---|
| 41 | #define MPI_Aint hypre_MPI_Aint
|
|---|
| 42 |
|
|---|
| 43 | #define MPI_COMM_WORLD hypre_MPI_COMM_WORLD
|
|---|
| 44 | #define MPI_COMM_NULL hypre_MPI_COMM_NULL
|
|---|
| 45 |
|
|---|
| 46 | #define MPI_BOTTOM hypre_MPI_BOTTOM
|
|---|
| 47 |
|
|---|
| 48 | #define MPI_DOUBLE hypre_MPI_DOUBLE
|
|---|
| 49 | #define MPI_INT hypre_MPI_INT
|
|---|
| 50 | #define MPI_CHAR hypre_MPI_CHAR
|
|---|
| 51 | #define MPI_LONG hypre_MPI_LONG
|
|---|
| 52 | #define MPI_BYTE hypre_MPI_BYTE
|
|---|
| 53 |
|
|---|
| 54 | #define MPI_SUM hypre_MPI_SUM
|
|---|
| 55 | #define MPI_MIN hypre_MPI_MIN
|
|---|
| 56 | #define MPI_MAX hypre_MPI_MAX
|
|---|
| 57 | #define MPI_LOR hypre_MPI_LOR
|
|---|
| 58 |
|
|---|
| 59 | #define MPI_UNDEFINED hypre_MPI_UNDEFINED
|
|---|
| 60 | #define MPI_REQUEST_NULL hypre_MPI_REQUEST_NULL
|
|---|
| 61 | #define MPI_ANY_SOURCE hypre_MPI_ANY_SOURCE
|
|---|
| 62 | #define MPI_ANY_TAG hypre_MPI_ANY_TAG
|
|---|
| 63 |
|
|---|
| 64 | #define MPI_Init hypre_MPI_Init
|
|---|
| 65 | #define MPI_Finalize hypre_MPI_Finalize
|
|---|
| 66 | #define MPI_Abort hypre_MPI_Abort
|
|---|
| 67 | #define MPI_Wtime hypre_MPI_Wtime
|
|---|
| 68 | #define MPI_Wtick hypre_MPI_Wtick
|
|---|
| 69 | #define MPI_Barrier hypre_MPI_Barrier
|
|---|
| 70 | #define MPI_Comm_create hypre_MPI_Comm_create
|
|---|
| 71 | #define MPI_Comm_dup hypre_MPI_Comm_dup
|
|---|
| 72 | #define MPI_Comm_group hypre_MPI_Comm_group
|
|---|
| 73 | #define MPI_Comm_size hypre_MPI_Comm_size
|
|---|
| 74 | #define MPI_Comm_rank hypre_MPI_Comm_rank
|
|---|
| 75 | #define MPI_Comm_free hypre_MPI_Comm_free
|
|---|
| 76 | #define MPI_Comm_split hypre_MPI_Comm_split
|
|---|
| 77 | #define MPI_Group_incl hypre_MPI_Group_incl
|
|---|
| 78 | #define MPI_Group_free hypre_MPI_Group_free
|
|---|
| 79 | #define MPI_Address hypre_MPI_Address
|
|---|
| 80 | #define MPI_Get_count hypre_MPI_Get_count
|
|---|
| 81 | #define MPI_Alltoall hypre_MPI_Alltoall
|
|---|
| 82 | #define MPI_Allgather hypre_MPI_Allgather
|
|---|
| 83 | #define MPI_Allgatherv hypre_MPI_Allgatherv
|
|---|
| 84 | #define MPI_Gather hypre_MPI_Gather
|
|---|
| 85 | #define MPI_Scatter hypre_MPI_Scatter
|
|---|
| 86 | #define MPI_Bcast hypre_MPI_Bcast
|
|---|
| 87 | #define MPI_Send hypre_MPI_Send
|
|---|
| 88 | #define MPI_Recv hypre_MPI_Recv
|
|---|
| 89 | #define MPI_Isend hypre_MPI_Isend
|
|---|
| 90 | #define MPI_Irecv hypre_MPI_Irecv
|
|---|
| 91 | #define MPI_Send_init hypre_MPI_Send_init
|
|---|
| 92 | #define MPI_Recv_init hypre_MPI_Recv_init
|
|---|
| 93 | #define MPI_Irsend hypre_MPI_Irsend
|
|---|
| 94 | #define MPI_Startall hypre_MPI_Startall
|
|---|
| 95 | #define MPI_Probe hypre_MPI_Probe
|
|---|
| 96 | #define MPI_Iprobe hypre_MPI_Iprobe
|
|---|
| 97 | #define MPI_Test hypre_MPI_Test
|
|---|
| 98 | #define MPI_Testall hypre_MPI_Testall
|
|---|
| 99 | #define MPI_Wait hypre_MPI_Wait
|
|---|
| 100 | #define MPI_Waitall hypre_MPI_Waitall
|
|---|
| 101 | #define MPI_Waitany hypre_MPI_Waitany
|
|---|
| 102 | #define MPI_Allreduce hypre_MPI_Allreduce
|
|---|
| 103 | #define MPI_Reduce hypre_MPI_Reduce
|
|---|
| 104 | #define MPI_Request_free hypre_MPI_Request_free
|
|---|
| 105 | #define MPI_Type_contiguous hypre_MPI_Type_contiguous
|
|---|
| 106 | #define MPI_Type_vector hypre_MPI_Type_vector
|
|---|
| 107 | #define MPI_Type_hvector hypre_MPI_Type_hvector
|
|---|
| 108 | #define MPI_Type_struct hypre_MPI_Type_struct
|
|---|
| 109 | #define MPI_Type_commit hypre_MPI_Type_commit
|
|---|
| 110 | #define MPI_Type_free hypre_MPI_Type_free
|
|---|
| 111 |
|
|---|
| 112 | /*--------------------------------------------------------------------------
|
|---|
| 113 | * Types, etc.
|
|---|
| 114 | *--------------------------------------------------------------------------*/
|
|---|
| 115 |
|
|---|
| 116 | /* These types have associated creation and destruction routines */
|
|---|
| 117 | typedef int hypre_MPI_Comm;
|
|---|
| 118 | typedef int hypre_MPI_Group;
|
|---|
| 119 | typedef int hypre_MPI_Request;
|
|---|
| 120 | typedef int hypre_MPI_Datatype;
|
|---|
| 121 |
|
|---|
| 122 | typedef struct { int MPI_SOURCE; int MPI_TAG; } hypre_MPI_Status;
|
|---|
| 123 | typedef int hypre_MPI_Op;
|
|---|
| 124 | typedef int hypre_MPI_Aint;
|
|---|
| 125 |
|
|---|
| 126 | #define hypre_MPI_COMM_WORLD 0
|
|---|
| 127 | #define hypre_MPI_COMM_NULL -1
|
|---|
| 128 |
|
|---|
| 129 | #define hypre_MPI_BOTTOM 0x0
|
|---|
| 130 |
|
|---|
| 131 | #define hypre_MPI_DOUBLE 0
|
|---|
| 132 | #define hypre_MPI_INT 1
|
|---|
| 133 | #define hypre_MPI_CHAR 2
|
|---|
| 134 | #define hypre_MPI_LONG 3
|
|---|
| 135 | #define hypre_MPI_BYTE 4
|
|---|
| 136 |
|
|---|
| 137 | #define hypre_MPI_SUM 0
|
|---|
| 138 | #define hypre_MPI_MIN 1
|
|---|
| 139 | #define hypre_MPI_MAX 2
|
|---|
| 140 | #define hypre_MPI_LOR 3
|
|---|
| 141 |
|
|---|
| 142 | #define hypre_MPI_UNDEFINED -9999
|
|---|
| 143 | #define hypre_MPI_REQUEST_NULL 0
|
|---|
| 144 | #define hypre_MPI_ANY_SOURCE 1
|
|---|
| 145 | #define hypre_MPI_ANY_TAG 1
|
|---|
| 146 |
|
|---|
| 147 | /*--------------------------------------------------------------------------
|
|---|
| 148 | * Prototypes
|
|---|
| 149 | *--------------------------------------------------------------------------*/
|
|---|
| 150 |
|
|---|
| 151 | /* mpistubs.c */
|
|---|
| 152 | int hypre_MPI_Init( int *argc , char ***argv );
|
|---|
| 153 | int hypre_MPI_Finalize( void );
|
|---|
| 154 | int hypre_MPI_Abort( hypre_MPI_Comm comm , int errorcode );
|
|---|
| 155 | double hypre_MPI_Wtime( void );
|
|---|
| 156 | double hypre_MPI_Wtick( void );
|
|---|
| 157 | int hypre_MPI_Barrier( hypre_MPI_Comm comm );
|
|---|
| 158 | int hypre_MPI_Comm_create( hypre_MPI_Comm comm , hypre_MPI_Group group , hypre_MPI_Comm *newcomm );
|
|---|
| 159 | int hypre_MPI_Comm_dup( hypre_MPI_Comm comm , hypre_MPI_Comm *newcomm );
|
|---|
| 160 | int hypre_MPI_Comm_size( hypre_MPI_Comm comm , int *size );
|
|---|
| 161 | int hypre_MPI_Comm_rank( hypre_MPI_Comm comm , int *rank );
|
|---|
| 162 | int hypre_MPI_Comm_free( hypre_MPI_Comm *comm );
|
|---|
| 163 | int hypre_MPI_Comm_group( hypre_MPI_Comm comm , hypre_MPI_Group *group );
|
|---|
| 164 | int hypre_MPI_Comm_split( hypre_MPI_Comm comm, int n, int m, hypre_MPI_Comm * comms );
|
|---|
| 165 | int hypre_MPI_Group_incl( hypre_MPI_Group group , int n , int *ranks , hypre_MPI_Group *newgroup );
|
|---|
| 166 | int hypre_MPI_Group_free( hypre_MPI_Group *group );
|
|---|
| 167 | int hypre_MPI_Address( void *location , hypre_MPI_Aint *address );
|
|---|
| 168 | int hypre_MPI_Get_count( hypre_MPI_Status *status , hypre_MPI_Datatype datatype , int *count );
|
|---|
| 169 | int hypre_MPI_Alltoall( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm );
|
|---|
| 170 | int hypre_MPI_Allgather( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm );
|
|---|
| 171 | int hypre_MPI_Allgatherv( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int *recvcounts , int *displs , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm );
|
|---|
| 172 | int hypre_MPI_Gather( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int recvcount , hypre_MPI_Datatype recvtype , int root , hypre_MPI_Comm comm );
|
|---|
| 173 | int hypre_MPI_Scatter( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int recvcount , hypre_MPI_Datatype recvtype , int root , hypre_MPI_Comm comm );
|
|---|
| 174 | int hypre_MPI_Bcast( void *buffer , int count , hypre_MPI_Datatype datatype , int root , hypre_MPI_Comm comm );
|
|---|
| 175 | int hypre_MPI_Send( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm );
|
|---|
| 176 | int hypre_MPI_Recv( void *buf , int count , hypre_MPI_Datatype datatype , int source , int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status );
|
|---|
| 177 | int hypre_MPI_Isend( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
|
|---|
| 178 | int hypre_MPI_Irecv( void *buf , int count , hypre_MPI_Datatype datatype , int source , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
|
|---|
| 179 | int hypre_MPI_Send_init( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
|
|---|
| 180 | int hypre_MPI_Recv_init( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
|
|---|
| 181 | int hypre_MPI_Irsend( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
|
|---|
| 182 | int hypre_MPI_Startall( int count , hypre_MPI_Request *array_of_requests );
|
|---|
| 183 | int hypre_MPI_Probe( int source , int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status );
|
|---|
| 184 | int hypre_MPI_Iprobe( int source , int tag , hypre_MPI_Comm comm , int *flag , hypre_MPI_Status *status );
|
|---|
| 185 | int hypre_MPI_Test( hypre_MPI_Request *request , int *flag , hypre_MPI_Status *status );
|
|---|
| 186 | int hypre_MPI_Testall( int count , hypre_MPI_Request *array_of_requests , int *flag , hypre_MPI_Status *array_of_statuses );
|
|---|
| 187 | int hypre_MPI_Wait( hypre_MPI_Request *request , hypre_MPI_Status *status );
|
|---|
| 188 | int hypre_MPI_Waitall( int count , hypre_MPI_Request *array_of_requests , hypre_MPI_Status *array_of_statuses );
|
|---|
| 189 | int hypre_MPI_Waitany( int count , hypre_MPI_Request *array_of_requests , int *index , hypre_MPI_Status *status );
|
|---|
| 190 | int hypre_MPI_Allreduce( void *sendbuf , void *recvbuf , int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , hypre_MPI_Comm comm );
|
|---|
| 191 | int hypre_MPI_Reduce( void *sendbuf , void *recvbuf , int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , int root , hypre_MPI_Comm comm );
|
|---|
| 192 | int hypre_MPI_Request_free( hypre_MPI_Request *request );
|
|---|
| 193 | int hypre_MPI_Type_contiguous( int count , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype );
|
|---|
| 194 | int hypre_MPI_Type_vector( int count , int blocklength , int stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype );
|
|---|
| 195 | int hypre_MPI_Type_hvector( int count , int blocklength , hypre_MPI_Aint stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype );
|
|---|
| 196 | int hypre_MPI_Type_struct( int count , int *array_of_blocklengths , hypre_MPI_Aint *array_of_displacements , hypre_MPI_Datatype *array_of_types , hypre_MPI_Datatype *newtype );
|
|---|
| 197 | int hypre_MPI_Type_commit( hypre_MPI_Datatype *datatype );
|
|---|
| 198 | int hypre_MPI_Type_free( hypre_MPI_Datatype *datatype );
|
|---|
| 199 |
|
|---|
| 200 | #ifdef __cplusplus
|
|---|
| 201 | }
|
|---|
| 202 | #endif
|
|---|
| 203 |
|
|---|
| 204 | #endif
|
|---|
| 205 |
|
|---|
| 206 | #endif
|
|---|