mpi_bsp_process_group.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
  7. <title>Parallel BGL MPI BSP Process Group</title>
  8. <link rel="stylesheet" href="../../../../rst.css" type="text/css" />
  9. </head>
  10. <body>
  11. <div class="document" id="logo-mpi-bsp-process-group">
  12. <h1 class="title"><a class="reference external" href="http://www.osl.iu.edu/research/pbgl"><img align="middle" alt="Parallel BGL" class="align-middle" src="pbgl-logo.png" /></a> MPI BSP Process Group</h1>
  13. <!-- Copyright (C) 2004-2009 The Trustees of Indiana University.
  14. Use, modification and distribution is subject to the Boost Software
  15. License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  16. http://www.boost.org/LICENSE_1_0.txt) -->
  17. <div class="contents topic" id="contents">
  18. <p class="topic-title first">Contents</p>
  19. <ul class="simple">
  20. <li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
  21. <li><a class="reference internal" href="#where-defined" id="id2">Where Defined</a></li>
  22. <li><a class="reference internal" href="#reference" id="id3">Reference</a></li>
  23. </ul>
  24. </div>
  25. <div class="section" id="introduction">
  26. <h1><a class="toc-backref" href="#id1">Introduction</a></h1>
  27. <p>The MPI <tt class="docutils literal"><span class="pre">mpi_process_group</span></tt> is an implementation of the <a class="reference external" href="process_group.html">process
  28. group</a> interface using the Message Passing Interface (MPI). It is the
  29. primary process group used in the Parallel BGL at this time.</p>
  30. </div>
  31. <div class="section" id="where-defined">
  32. <h1><a class="toc-backref" href="#id2">Where Defined</a></h1>
  33. <p>Header <tt class="docutils literal"><span class="pre">&lt;boost/graph/distributed/mpi_process_group.hpp&gt;</span></tt></p>
  34. </div>
  35. <div class="section" id="reference">
  36. <h1><a class="toc-backref" href="#id3">Reference</a></h1>
  37. <pre class="literal-block">
  38. namespace boost { namespace graph { namespace distributed {
  39. class mpi_process_group
  40. {
  41. public:
  42. typedef boost::mpi::communicator communicator_type;
  43. // Process group constructors
  44. mpi_process_group(communicator_type comm = communicator_type());
  45. mpi_process_group(std::size_t num_headers, std::size_t buffer_size,
  46. communicator_type comm = communicator_type());
  47. mpi_process_group();
  48. mpi_process_group(const mpi_process_group&amp;, boost::parallel::attach_distributed_object);
  49. // Triggers
  50. template&lt;typename Type, typename Handler&gt;
  51. void trigger(int tag, const Handler&amp; handler);
  52. template&lt;typename Type, typename Handler&gt;
  53. void trigger_with_reply(int tag, const Handler&amp; handler);
  54. trigger_receive_context trigger_context() const;
  55. // Helper operations
  56. void poll();
  57. mpi_process_group base() const;
  58. };
  59. // Process query
  60. int process_id(const mpi_process_group&amp;);
  61. int num_processes(const mpi_process_group&amp;);
  62. // Message transmission
  63. template&lt;typename T&gt;
  64. void send(const mpi_process_group&amp; pg, int dest, int tag, const T&amp; value);
  65. template&lt;typename T&gt;
  66. void receive(const mpi_process_group&amp; pg, int source, int tag, T&amp; value);
  67. optional&lt;std::pair&lt;int, int&gt; &gt; probe(const mpi_process_group&amp; pg);
  68. // Synchronization
  69. void synchronize(const mpi_process_group&amp; pg);
  70. // Out-of-band communication
  71. template&lt;typename T&gt;
  72. void send_oob(const mpi_process_group&amp; pg, int dest, int tag, const T&amp; value);
  73. template&lt;typename T, typename U&gt;
  74. void
  75. send_oob_with_reply(const mpi_process_group&amp; pg, int dest, int
  76. tag, const T&amp; send_value, U&amp; receive_value);
  77. template&lt;typename T&gt;
  78. void receive_oob(const mpi_process_group&amp; pg, int source, int tag, T&amp; value);
  79. } } }
  80. </pre>
  81. <p>Since the <tt class="docutils literal"><span class="pre">mpi_process_group</span></tt> is an implementation of the <a class="reference external" href="process_group.html">process
  82. group</a> interface, we omit the description of most of the functions in
  83. the prototype. Two constructors need special mentioning:</p>
  84. <pre class="literal-block">
  85. mpi_process_group(communicator_type comm = communicator_type());
  86. </pre>
  87. <p>The constructor can take an optional MPI communicator. As default a communicator
  88. constructed from MPI_COMM_WORLD is used.</p>
  89. <pre class="literal-block">
  90. mpi_process_group(std::size_t num_headers, std::size_t buffer_size,
  91. communicator_type comm = communicator_type());
  92. </pre>
  93. <p>For performance fine tuning the maximum number of headers in a message batch
  94. (num_headers) and the maximum combined size of batched messages (buffer_size)
  95. can be specified. The maximum message size of a batch is
  96. 16*num_headers+buffer_size. Sensible default values have been found by optimizing
  97. a typical application on a cluster with Ethernet network, and are num_header=64k
  98. and buffer_size=1MB, for a total maximum batches message size of 2MB.</p>
  99. <hr class="docutils" />
  100. <p>Copyright (C) 2007 Douglas Gregor</p>
  101. <p>Copyright (C) 2007 Matthias Troyer</p>
  102. </div>
  103. </div>
  104. <div class="footer">
  105. <hr class="footer" />
  106. Generated on: 2009-05-31 00:22 UTC.
  107. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
  108. </div>
  109. </body>
  110. </html>