source: proiecte/hpl/openmpi_compiled/include/openmpi/ompi/mpi/cxx/functions_inln.h @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 4.4 KB
Line 
1// -*- c++ -*-
2//
3// Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4//                         University Research and Technology
5//                         Corporation.  All rights reserved.
6// Copyright (c) 2004-2005 The University of Tennessee and The University
7//                         of Tennessee Research Foundation.  All rights
8//                         reserved.
9// Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10//                         University of Stuttgart.  All rights reserved.
11// Copyright (c) 2004-2005 The Regents of the University of California.
12//                         All rights reserved.
13// Copyright (c) 2008      Cisco Systems, Inc.  All rights reserved.
14// $COPYRIGHT$
15//
16// Additional copyrights may follow
17//
18// $HEADER$
19//
20
21#include <string.h>
22
23//
24// Point-to-Point Communication
25//
26
27inline void 
28MPI::Attach_buffer(void* buffer, int size)
29{
30  (void)MPI_Buffer_attach(buffer, size);
31}
32
33inline int 
34MPI::Detach_buffer(void*& buffer)
35{
36  int size;
37  (void)MPI_Buffer_detach(&buffer, &size);
38  return size;
39}
40
41//
42// Process Topologies
43//
44
45inline void
46MPI::Compute_dims(int nnodes, int ndims, int dims[])
47{
48  (void)MPI_Dims_create(nnodes, ndims, dims);
49}
50
51
52//
53// Environmental Inquiry
54//
55
56inline void 
57MPI::Get_processor_name(char* name, int& resultlen)
58{
59  (void)MPI_Get_processor_name(name, &resultlen);
60}
61
62inline void
63MPI::Get_error_string(int errorcode, char* string, int& resultlen)
64{
65  (void)MPI_Error_string(errorcode, string, &resultlen);
66}
67
68inline int 
69MPI::Get_error_class(int errorcode) 
70{
71  int errorclass;
72  (void)MPI_Error_class(errorcode, &errorclass);
73  return errorclass;
74}
75
76inline double 
77MPI::Wtime()
78{
79  return (MPI_Wtime());
80}
81
82inline double 
83MPI::Wtick()
84{
85  return (MPI_Wtick());
86}
87
88inline void
89MPI::Real_init()
90{
91    MPI::InitializeIntercepts();
92}
93
94
95inline void
96MPI::Init(int& argc, char**& argv)
97{
98  (void)MPI_Init(&argc, &argv);
99  Real_init();
100}
101
102inline void
103MPI::Init()
104{
105  (void)MPI_Init(0, 0);
106  Real_init();
107}
108
109inline void
110MPI::Finalize()
111{
112  (void)MPI_Finalize();
113}
114
115inline bool
116MPI::Is_initialized()
117{
118  int t;
119  (void)MPI_Initialized(&t);
120  return OPAL_INT_TO_BOOL(t);
121}
122
123inline bool
124MPI::Is_finalized()
125{
126  int t;
127  (void)MPI_Finalized(&t);
128  return OPAL_INT_TO_BOOL(t);
129}
130
131
132//
133// External Interfaces
134//
135
136inline int
137MPI::Init_thread(int required)
138{
139  int provided;
140  (void) MPI_Init_thread(0, NULL, required, &provided);
141  Real_init();
142  return provided;
143}
144
145
146inline int
147MPI::Init_thread(int& argc, char**& argv, int required)
148{
149  int provided;
150  (void) MPI_Init_thread(&argc, &argv, required, &provided);
151  Real_init();
152  return provided;
153}
154
155
156inline bool
157MPI::Is_thread_main()
158{
159  int flag;
160  (void) MPI_Is_thread_main(&flag);
161  return OPAL_INT_TO_BOOL(flag == 1);
162}
163
164
165inline int
166MPI::Query_thread()
167{
168  int provided;
169  (void) MPI_Query_thread(&provided);
170  return provided;
171}
172
173
174//
175// Miscellany
176//
177
178
179inline void*
180MPI::Alloc_mem(MPI::Aint size, const MPI::Info& info) 
181{
182  void* baseptr;
183  (void) MPI_Alloc_mem(size, info, &baseptr);
184  return baseptr;
185}
186
187
188inline void
189MPI::Free_mem(void* base)
190{
191  (void) MPI_Free_mem(base);
192}
193
194
195//
196// Process Creation
197//
198
199
200inline void
201MPI::Close_port(const char* port_name) 
202{
203  (void) MPI_Close_port(const_cast<char *>(port_name));
204}
205
206
207inline void
208MPI::Lookup_name(const char * service_name, 
209                        const MPI::Info& info,
210                        char* port_name)
211{
212  (void) MPI_Lookup_name(const_cast<char *>(service_name), info, port_name);
213}
214
215
216inline void
217MPI::Open_port(const MPI::Info& info, char* port_name)
218{
219  (void) MPI_Open_port(info, port_name);
220}
221
222
223inline void
224MPI::Publish_name(const char* service_name, 
225                         const MPI::Info& info,
226                         const char* port_name)
227{
228  (void) MPI_Publish_name(const_cast<char *>(service_name), info,
229                          const_cast<char *>(port_name));
230}
231
232
233inline void
234MPI::Unpublish_name(const char* service_name, 
235                           const MPI::Info& info,
236                           const char* port_name)
237{
238  (void)MPI_Unpublish_name(const_cast<char *>(service_name), info,
239                           const_cast<char *>(port_name));
240}
241
242
243
244//
245// Profiling
246//
247
248inline void
249MPI::Pcontrol(const int level, ...)
250{
251  va_list ap;
252  va_start(ap, level);
253 
254  (void)MPI_Pcontrol(level, ap);
255  va_end(ap);
256}
257
258
259inline void
260MPI::Get_version(int& version, int& subversion)
261{
262  (void)MPI_Get_version(&version, &subversion);
263}
264
265
266inline MPI::Aint
267MPI::Get_address(void* location)
268{
269  MPI::Aint ret;
270  MPI_Get_address(location, &ret);
271  return ret;
272}
Note: See TracBrowser for help on using the repository browser.