source: CIVL/examples/mpi-omp/AMG2013/utilities/mpistubs.h

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 11.0 KB
Line 
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
25extern "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 */
117typedef int hypre_MPI_Comm;
118typedef int hypre_MPI_Group;
119typedef int hypre_MPI_Request;
120typedef int hypre_MPI_Datatype;
121
122typedef struct { int MPI_SOURCE; int MPI_TAG; } hypre_MPI_Status;
123typedef int hypre_MPI_Op;
124typedef 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 */
152int hypre_MPI_Init( int *argc , char ***argv );
153int hypre_MPI_Finalize( void );
154int hypre_MPI_Abort( hypre_MPI_Comm comm , int errorcode );
155double hypre_MPI_Wtime( void );
156double hypre_MPI_Wtick( void );
157int hypre_MPI_Barrier( hypre_MPI_Comm comm );
158int hypre_MPI_Comm_create( hypre_MPI_Comm comm , hypre_MPI_Group group , hypre_MPI_Comm *newcomm );
159int hypre_MPI_Comm_dup( hypre_MPI_Comm comm , hypre_MPI_Comm *newcomm );
160int hypre_MPI_Comm_size( hypre_MPI_Comm comm , int *size );
161int hypre_MPI_Comm_rank( hypre_MPI_Comm comm , int *rank );
162int hypre_MPI_Comm_free( hypre_MPI_Comm *comm );
163int hypre_MPI_Comm_group( hypre_MPI_Comm comm , hypre_MPI_Group *group );
164int hypre_MPI_Comm_split( hypre_MPI_Comm comm, int n, int m, hypre_MPI_Comm * comms );
165int hypre_MPI_Group_incl( hypre_MPI_Group group , int n , int *ranks , hypre_MPI_Group *newgroup );
166int hypre_MPI_Group_free( hypre_MPI_Group *group );
167int hypre_MPI_Address( void *location , hypre_MPI_Aint *address );
168int hypre_MPI_Get_count( hypre_MPI_Status *status , hypre_MPI_Datatype datatype , int *count );
169int hypre_MPI_Alltoall( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm );
170int hypre_MPI_Allgather( void *sendbuf , int sendcount , hypre_MPI_Datatype sendtype , void *recvbuf , int recvcount , hypre_MPI_Datatype recvtype , hypre_MPI_Comm comm );
171int 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 );
172int 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 );
173int 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 );
174int hypre_MPI_Bcast( void *buffer , int count , hypre_MPI_Datatype datatype , int root , hypre_MPI_Comm comm );
175int hypre_MPI_Send( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm );
176int hypre_MPI_Recv( void *buf , int count , hypre_MPI_Datatype datatype , int source , int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status );
177int hypre_MPI_Isend( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
178int hypre_MPI_Irecv( void *buf , int count , hypre_MPI_Datatype datatype , int source , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
179int hypre_MPI_Send_init( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
180int hypre_MPI_Recv_init( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
181int hypre_MPI_Irsend( void *buf , int count , hypre_MPI_Datatype datatype , int dest , int tag , hypre_MPI_Comm comm , hypre_MPI_Request *request );
182int hypre_MPI_Startall( int count , hypre_MPI_Request *array_of_requests );
183int hypre_MPI_Probe( int source , int tag , hypre_MPI_Comm comm , hypre_MPI_Status *status );
184int hypre_MPI_Iprobe( int source , int tag , hypre_MPI_Comm comm , int *flag , hypre_MPI_Status *status );
185int hypre_MPI_Test( hypre_MPI_Request *request , int *flag , hypre_MPI_Status *status );
186int hypre_MPI_Testall( int count , hypre_MPI_Request *array_of_requests , int *flag , hypre_MPI_Status *array_of_statuses );
187int hypre_MPI_Wait( hypre_MPI_Request *request , hypre_MPI_Status *status );
188int hypre_MPI_Waitall( int count , hypre_MPI_Request *array_of_requests , hypre_MPI_Status *array_of_statuses );
189int hypre_MPI_Waitany( int count , hypre_MPI_Request *array_of_requests , int *index , hypre_MPI_Status *status );
190int hypre_MPI_Allreduce( void *sendbuf , void *recvbuf , int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , hypre_MPI_Comm comm );
191int hypre_MPI_Reduce( void *sendbuf , void *recvbuf , int count , hypre_MPI_Datatype datatype , hypre_MPI_Op op , int root , hypre_MPI_Comm comm );
192int hypre_MPI_Request_free( hypre_MPI_Request *request );
193int hypre_MPI_Type_contiguous( int count , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype );
194int hypre_MPI_Type_vector( int count , int blocklength , int stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype );
195int hypre_MPI_Type_hvector( int count , int blocklength , hypre_MPI_Aint stride , hypre_MPI_Datatype oldtype , hypre_MPI_Datatype *newtype );
196int 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 );
197int hypre_MPI_Type_commit( hypre_MPI_Datatype *datatype );
198int hypre_MPI_Type_free( hypre_MPI_Datatype *datatype );
199
200#ifdef __cplusplus
201}
202#endif
203
204#endif
205
206#endif
Note: See TracBrowser for help on using the repository browser.