skeleton_and_content.hpp 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // (C) Copyright 2005 Matthias Troyer
  2. // (C) Copyright 2006 Douglas Gregor <doug.gregor -at gmail.com>
  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. // Authors: Matthias Troyer
  7. // Douglas Gregor
  8. /** @file skeleton_and_content.hpp
  9. *
  10. * This header provides facilities that allow the structure of data
  11. * types (called the "skeleton") to be transmitted and received
  12. * separately from the content stored in those data types. These
  13. * facilities are useful when the data in a stable data structure
  14. * (e.g., a mesh or a graph) will need to be transmitted
  15. * repeatedly. In this case, transmitting the skeleton only once
  16. * saves both communication effort (it need not be sent again) and
  17. * local computation (serialization need only be performed once for
  18. * the content).
  19. */
  20. #ifndef BOOST_MPI_SKELETON_AND_CONTENT_HPP
  21. #define BOOST_MPI_SKELETON_AND_CONTENT_HPP
  22. #include <boost/mpi/config.hpp>
  23. #include <boost/archive/detail/auto_link_archive.hpp>
  24. #include <boost/mpi/skeleton_and_content_types.hpp>
  25. namespace boost { namespace mpi {
  26. namespace detail {
  27. typedef boost::mpi::detail::forward_skeleton_oarchive<boost::mpi::packed_skeleton_oarchive,boost::mpi::packed_oarchive> type1;
  28. typedef boost::mpi::detail::forward_skeleton_iarchive<boost::mpi::packed_skeleton_iarchive,boost::mpi::packed_iarchive> type2;
  29. }
  30. } } // end namespace boost::mpi
  31. #include <boost/mpi/detail/content_oarchive.hpp>
  32. // For any headers that have provided declarations based on forward
  33. // declarations of the contents of this header, include definitions
  34. // for those declarations. This means that the inclusion of
  35. // skeleton_and_content.hpp enables the use of skeleton/content
  36. // transmission throughout the library.
  37. #ifdef BOOST_MPI_BROADCAST_HPP
  38. # include <boost/mpi/detail/broadcast_sc.hpp>
  39. #endif
  40. #ifdef BOOST_MPI_COMMUNICATOR_HPP
  41. # include <boost/mpi/detail/communicator_sc.hpp>
  42. #endif
  43. // required by export
  44. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_skeleton_oarchive)
  45. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_skeleton_iarchive)
  46. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::type1)
  47. BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::type2)
  48. BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::packed_skeleton_oarchive)
  49. BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::packed_skeleton_iarchive)
  50. #endif // BOOST_MPI_SKELETON_AND_CONTENT_HPP