Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:57

0001 // Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>.
0002 
0003 // Use, modification and distribution is subject to the Boost Software
0004 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // Skeleton and content support for communicators
0008 
0009 // This header should be included only after both communicator.hpp and
0010 // skeleton_and_content.hpp have been included.
0011 #ifndef BOOST_MPI_COMMUNICATOR_SC_HPP
0012 #define BOOST_MPI_COMMUNICATOR_SC_HPP
0013 
0014 namespace boost { namespace mpi {
0015 
0016 template<typename T>
0017 void
0018 communicator::send(int dest, int tag, const skeleton_proxy<T>& proxy) const
0019 {
0020   packed_skeleton_oarchive ar(*this);
0021   ar << proxy.object;
0022   send(dest, tag, ar);
0023 }
0024 
0025 template<typename T>
0026 status
0027 communicator::recv(int source, int tag, const skeleton_proxy<T>& proxy) const
0028 {
0029   packed_skeleton_iarchive ar(*this);
0030   status result = recv(source, tag, ar);
0031   ar >> proxy.object;
0032   return result;
0033 }
0034 
0035 template<typename T>
0036 status communicator::recv(int source, int tag, skeleton_proxy<T>& proxy) const
0037 {
0038   packed_skeleton_iarchive ar(*this);
0039   status result = recv(source, tag, ar);
0040   ar >> proxy.object;
0041   return result;
0042 }
0043 
0044 template<typename T>
0045 request
0046 communicator::isend(int dest, int tag, const skeleton_proxy<T>& proxy) const
0047 {
0048   shared_ptr<packed_skeleton_oarchive> 
0049     archive(new packed_skeleton_oarchive(*this));
0050 
0051   *archive << proxy.object;
0052   request result = isend(dest, tag, *archive);
0053   result.preserve(archive);
0054   return result;
0055 }
0056 
0057 } } // end namespace boost::mpi
0058 
0059 #endif // BOOST_MPI_COMMUNICATOR_SC_HPP
0060