Muster
 All Classes Namespaces Files Functions Variables Typedefs Macros
mpi_bindings.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2010, Lawrence Livermore National Security, LLC.
3 // Produced at the Lawrence Livermore National Laboratory
4 // LLNL-CODE-433662
5 // All rights reserved.
6 //
7 // This file is part of Muster. For details, see http://github.com/tgamblin/muster.
8 // Please also read the LICENSE file for further information.
9 //
10 // Redistribution and use in source and binary forms, with or without modification, are
11 // permitted provided that the following conditions are met:
12 //
13 // * Redistributions of source code must retain the above copyright notice, this list of
14 // conditions and the disclaimer below.
15 // * Redistributions in binary form must reproduce the above copyright notice, this list of
16 // conditions and the disclaimer (as noted below) in the documentation and/or other materials
17 // provided with the distribution.
18 // * Neither the name of the LLNS/LLNL nor the names of its contributors may be used to endorse
19 // or promote products derived from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
22 // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
24 // LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR CONTRIBUTORS BE
25 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 //////////////////////////////////////////////////////////////////////////////////////////////////
31 
32 ///
33 /// @file mpi_bindings.h
34 /// @author Todd Gamblin tgamblin@llnl.gov
35 /// @brief <code>\#defines</code> for switching between MPI and PMPI bindings.
36 ///
37 /// User of the API can <code>\#define</code> <code>MUSTER_USE_PMPI</code> to use the
38 /// PMPI bindings instead of the plain MPI bindings. Useful
39 /// for including this algorithm in tools.
40 ///
41 /// This file should contain <code>\#defines</code> for all MPI calls used in
42 /// the cluster library, and needs to be kept current.
43 ///
44 #ifndef MUSTER_MPI_BINDINGS_H
45 #define MUSTER_MPI_BINDINGS_H
46 
47 #include "muster-config.h"
48 
49 // External header for MPI type information
50 #include "mpi_utils.h"
51 
52 #ifdef MUSTER_USE_PMPI
53 
54 #define CMPI_Allreduce PMPI_Allreduce
55 #define CMPI_Bcast PMPI_Bcast
56 #define CMPI_Comm_rank PMPI_Comm_rank
57 #define CMPI_Comm_size PMPI_Comm_size
58 #define CMPI_Gather PMPI_Gather
59 #define CMPI_Scatter PMPI_Scatter
60 #define CMPI_Recv PMPI_Recv
61 #define CMPI_Send PMPI_Send
62 #define CMPI_Irecv PMPI_Irecv
63 #define CMPI_Isend PMPI_Isend
64 #define CMPI_Pack PMPI_Pack
65 #define CMPI_Pack_size PMPI_Pack_size
66 #define CMPI_Reduce PMPI_Reduce
67 #define CMPI_Unpack PMPI_Unpack
68 #define CMPI_Waitsome PMPI_Waitsome
69 #define CMPI_Comm_free PMPI_Comm_free
70 #define CMPI_Comm_group PMPI_Comm_group
71 #define CMPI_Comm_create PMPI_Comm_create
72 #define CMPI_Group_incl PMPI_Group_incl
73 #define CMPI_Group_free PMPI_Group_free
74 
75 #define cmpi_packed_size pmpi_packed_size
76 
77 #else // MUSTER_USE_PMPI
78 
79 #define CMPI_Allreduce MPI_Allreduce
80 #define CMPI_Bcast MPI_Bcast
81 #define CMPI_Comm_rank MPI_Comm_rank
82 #define CMPI_Comm_size MPI_Comm_size
83 #define CMPI_Gather MPI_Gather
84 #define CMPI_Scatter MPI_Scatter
85 #define CMPI_Recv MPI_Recv
86 #define CMPI_Send MPI_Send
87 #define CMPI_Irecv MPI_Irecv
88 #define CMPI_Isend MPI_Isend
89 #define CMPI_Pack MPI_Pack
90 #define CMPI_Pack_size MPI_Pack_size
91 #define CMPI_Reduce MPI_Reduce
92 #define CMPI_Unpack MPI_Unpack
93 #define CMPI_Waitsome MPI_Waitsome
94 #define CMPI_Comm_free MPI_Comm_free
95 #define CMPI_Comm_group MPI_Comm_group
96 #define CMPI_Comm_create MPI_Comm_create
97 #define CMPI_Group_incl MPI_Group_incl
98 #define CMPI_Group_free MPI_Group_free
99 
100 #define cmpi_packed_size mpi_packed_size
101 
102 #endif // MUSTER_USE_PMPI
103 
104 
105 
106 #endif // MUSTER_MPI_BINDINGS_H
Overloaded utility functions to convert between arbitrary C/C++ types and MPI types, custom typedefs for cstdlib types like size_t, and a wrapper for MPI_Pack_Size.
Muster. Copyright © 2010, Lawrence Livermore National Laboratory, LLNL-CODE-433662.
Distribution of Muster and its documentation is subject to terms of the Muster LICENSE.
Generated on Thu Sep 1 2016 using Doxygen 1.8.5