Lunchbox  1.12.0
Multi-threaded C++ toolbox library for all application developers creating high-performance multi-threaded programs.
mpi.h
1 
2 /* Copyright (c) 2014, Carlos Duelo <cduelo@cesvima.upm.es>
3  * Stefan.Eilemann@epfl.ch
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef LUNCHBOX_MPI_H
20 #define LUNCHBOX_MPI_H
21 
22 #include <lunchbox/api.h>
23 #include <boost/shared_ptr.hpp>
24 
25 namespace lunchbox
26 {
27 namespace detail { class MPI; }
28 
30 class MPI
31 {
32 public:
48  LUNCHBOX_API MPI( int argc, char** argv );
49 
55  LUNCHBOX_API MPI();
56 
65  LUNCHBOX_API ~MPI();
66 
67  /* @return true if the MPI library has multithread
68  * support, otherwise return false.
69  * @version 1.1.1
70  */
71  LUNCHBOX_API bool supportsThreads() const;
72 
74  LUNCHBOX_API int getRank() const;
75 
77  LUNCHBOX_API int getSize() const;
78 
79 private:
80  boost::shared_ptr< detail::MPI > _impl;
81 };
82 
83 }
84 
85 #endif // LUNCHBOX_MPI_H
Defines export visibility macros for library Lunchbox.
LUNCHBOX_API int getSize() const
LUNCHBOX_API int getRank() const
Abstraction layer and common utilities for multi-threaded programming.
Definition: algorithm.h:32
MPI functionality wrapper.
Definition: mpi.h:30
LUNCHBOX_API MPI()
Construct a new MPI handler.
LUNCHBOX_API ~MPI()
Destruct this handler instance.