On Nov 1, 2012, at 9:03 PM, Roy Stogner <royst...@ices.utexas.edu> wrote:
> > On Thu, 1 Nov 2012, Kirk, Benjamin (JSC-EG311) wrote: > >> Roy - I'd like to have a default constructor for the MessageTag so I >> can create a vector of them. I have a use case where I need a >> number of tags, and this is the easiest way to store them so I can >> then loop through the tags and receive from any source but in a >> predictable order on the content. > > Definitely sounds reasonable. > >> I was thinking a static MessageTag::invalid_tag = >> std::numeric_limits<int>::min() or something like that, > > Something we can libmesh_assert() against? Yeah, that sounds good. > > I'd prefer for the default constructor to give something valid, but we > can't get a unique valid tag without a Communicator argument... > >> but wasn't sure where to initialize it with this being header-only >> now. > > I cheated and put Communicator_World (and now CommWorld) in libmesh.C, > but there's no reason other than my laziness not to just create a > parallel.C for those. Here's what I currently want to do: // on all processors for (unsigned int blk=0; blk<num_blks; blk++) { ... Parallel::MessageTag id_tag = Parallel::Communicator_World.get_unique_tag(100*num_blks + blk); // send the data for this block Parallel::send (0, ids, id_requests[blk], id_tag); } if (libMesh::processor_id() == 0) { ... for (unsigned int blk=0; blk<num_blks; blk++) for (unsigned int comm_step=0; comm_step<libMesh::n_processors(); comm_step++) { ... Parallel::MessageTag id_tag = Parallel::Communicator_World.get_unique_tag(100*num_blks + blk); // receive data for this block, imposing no particular order on processor Parallel::receive (Parallel::any_source, ids, id_tag); } } If I do this I don't need a container. But there is a problem, at least in DEBUG mode, there is a collective assertion in get_unique_tag(), preventing me from creating one inside the "if (libMesh::processor_id() == 0)" bit See the issue? What would your proposed path forward be? -Ben ------------------------------------------------------------------------------ LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel