]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/mpi/detail/communicator_sc.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / mpi / detail / communicator_sc.hpp
CommitLineData
7c673cae
FG
1// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
2
3// Use, modification and distribution is subject to the Boost Software
4// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7// Skeleton and content support for communicators
8
9// This header should be included only after both communicator.hpp and
10// skeleton_and_content.hpp have been included.
11#ifndef BOOST_MPI_COMMUNICATOR_SC_HPP
12#define BOOST_MPI_COMMUNICATOR_SC_HPP
13
14namespace boost { namespace mpi {
15
16template<typename T>
17void
18communicator::send(int dest, int tag, const skeleton_proxy<T>& proxy) const
19{
20 packed_skeleton_oarchive ar(*this);
21 ar << proxy.object;
22 send(dest, tag, ar);
23}
24
25template<typename T>
26status
27communicator::recv(int source, int tag, const skeleton_proxy<T>& proxy) const
28{
29 packed_skeleton_iarchive ar(*this);
30 status result = recv(source, tag, ar);
31 ar >> proxy.object;
32 return result;
33}
34
35template<typename T>
36status communicator::recv(int source, int tag, skeleton_proxy<T>& proxy) const
37{
38 packed_skeleton_iarchive ar(*this);
39 status result = recv(source, tag, ar);
40 ar >> proxy.object;
41 return result;
42}
43
44template<typename T>
45request
46communicator::isend(int dest, int tag, const skeleton_proxy<T>& proxy) const
47{
48 shared_ptr<packed_skeleton_oarchive>
49 archive(new packed_skeleton_oarchive(*this));
50
51 *archive << proxy.object;
52 request result = isend(dest, tag, *archive);
92f5a8d4 53 result.preserve(archive);
7c673cae
FG
54 return result;
55}
56
7c673cae
FG
57} } // end namespace boost::mpi
58
59#endif // BOOST_MPI_COMMUNICATOR_SC_HPP
60