Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:58:06

0001 // Copyright 2004 The Trustees of Indiana University.
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 //  Authors: Douglas Gregor
0008 //           Andrew Lumsdaine
0009 #ifndef BOOST_PROPERTY_MAP_PARALLEL_PROCESS_GROUP_HPP
0010 #define BOOST_PROPERTY_MAP_PARALLEL_PROCESS_GROUP_HPP
0011 
0012 #include <cstdlib>
0013 #include <utility>
0014 
0015 namespace boost { namespace parallel {
0016 
0017 /**
0018  * A special type used as a flag to a process group constructor that
0019  * indicates that the copy of a process group will represent a new
0020  * distributed data structure.
0021  */
0022 struct attach_distributed_object { };
0023 
0024 /**
0025  * Describes the context in which a trigger is being invoked to
0026  * receive a message.
0027  */
0028 enum trigger_receive_context {
0029   /// No trigger is active at this time.
0030   trc_none,
0031   /// The trigger is being invoked during synchronization, at the end
0032   /// of a superstep.
0033   trc_in_synchronization,
0034   /// The trigger is being invoked as an "early" receive of a message
0035   /// that was sent through the normal "send" operations to be
0036   /// received by the end of the superstep, but the process group sent
0037   /// the message earlier to clear its buffers.
0038   trc_early_receive,
0039   /// The trigger is being invoked for an out-of-band message, which
0040   /// must be handled immediately.
0041   trc_out_of_band,
0042   /// The trigger is being invoked for an out-of-band message, which
0043   /// must be handled immediately and has alredy been received by 
0044   /// an MPI_IRecv call.
0045   trc_irecv_out_of_band  
0046 };
0047 
0048 // Process group tags
0049 struct process_group_tag {};
0050 struct linear_process_group_tag : virtual process_group_tag {};
0051 struct messaging_process_group_tag : virtual process_group_tag {};
0052 struct immediate_process_group_tag : virtual messaging_process_group_tag {};
0053 struct bsp_process_group_tag : virtual messaging_process_group_tag {};
0054 struct batch_process_group_tag : virtual messaging_process_group_tag {};
0055 struct locking_process_group_tag : virtual process_group_tag {};
0056 struct spawning_process_group_tag : virtual process_group_tag {};
0057 
0058 struct process_group_archetype
0059 {
0060   typedef int process_id_type;
0061 };
0062 
0063 void wait(process_group_archetype&);
0064 void synchronize(process_group_archetype&);
0065 int process_id(const process_group_archetype&);
0066 int num_processes(const process_group_archetype&);
0067 
0068 template<typename T> void send(process_group_archetype&, int, int, const T&);
0069 
0070 template<typename T>
0071 process_group_archetype::process_id_type
0072 receive(const process_group_archetype& pg,
0073         process_group_archetype::process_id_type source, int tag, T& value);
0074 
0075 template<typename T>
0076 std::pair<process_group_archetype::process_id_type, std::size_t>
0077 receive(const process_group_archetype& pg, int tag, T values[], std::size_t n);
0078 
0079 template<typename T>
0080 std::pair<process_group_archetype::process_id_type, std::size_t>
0081 receive(const process_group_archetype& pg,
0082         process_group_archetype::process_id_type source, int tag, T values[],
0083         std::size_t n);
0084 
0085 } } // end namespace boost::parallel
0086 
0087 namespace boost { namespace graph { namespace distributed {
0088   using boost::parallel::trigger_receive_context;
0089   using boost::parallel::trc_early_receive;
0090   using boost::parallel::trc_out_of_band;
0091   using boost::parallel::trc_irecv_out_of_band;
0092   using boost::parallel::trc_in_synchronization;
0093   using boost::parallel::trc_none;
0094   using boost::parallel::attach_distributed_object;
0095 } } } // end namespace boost::graph::distributed
0096 
0097 #endif // BOOST_PROPERTY_MAP_PARALLEL_PROCESS_GROUP_HPP