Jeff thanks for the clarification,
What I am trying to do is run N concurrent copies of a 1 to N data movement program to affect an N to N solution.Â The actual mechanism I am using is to spawn N copies of mpirun from PVM across the cluster. So each 1 to N MPI application starts at the same time with a different node as root.
Yes I know this is a bit oddâ¦Â It was an attempt to be lazy and not re-write the code (again) and this appears to be a potential log N solution.
My thoughts are that the problem must be either:
1)Â Â Â Some bug in my code that does not occur normally (this seems unlikely because it halts in Bcast and runs in the normal 1 to N manner)
2)Â Â Â Something in MPI is fouling the bcast call
3)Â Â Â Something in PVM is fouling the bcast call
Obviously, this is not the PVM forum, but have I missed anything?
Iâm not a network expert and I had assumed broadcasts must be implemented withÂ multicasts to prevent broadcasts colliding between concurrent applications and thus conforming to the MPI safety/isolation dictum (this appears to be how PVM isolates broadcasts between applications).Â I can see now that a series of point to point send/receives should not be affected in this way.
This is what I would describe as âimplementing Bcast with point to point transfersâÂ as opposed to âimplementing Bcast with broadcastsâ
BTW: Implementing Bcast with Multicast or a combination of both multicasts and p2p transfers is another option and described by Hoefler et. al. in their paper âA practically constant-time MPI Broadcast Algorithm for large-scale Inï¬niBand Clusters with Multicastâ.
I guess I was eluding that if MPI used actual broadcast calls to transmit or syncronise, then a broadcast collision may be possible.Â I did not know that only p2p transfers where used in Bcast calls.
>From here I need to decide to:
1)Â Â Â Generate a minimal example but given that this will require PVM, it is unlikely to see much use.
2)Â Â Â Write a N to N transfer system in MPI using inter-communicators, however this may not scale with only p2p transfers and is probably N Log N at best.
3)Â Â Â Write the N to N transfer system in PVM, Open Fabric calls or something that supports broadcast/multicast calls.
My application must transfer a large (potentially huge) amount of tuples from a table distributed across the cluster to a table replicated on each node.Â The similar (1 to N) system compresses tuples into 64k pages and sends these.Â The same method would be used and the page size could be varied for efficiency.
What are your thoughts?Â Can OpenMPI do this in under N log N time?
--- On Wed, 11/8/10, Jeff Squyres <jsquyres_at_[hidden]> wrote:
From: Jeff Squyres <jsquyres_at_[hidden]>
Subject: Re: [OMPI users] MPI_Bcast issue
To: "Open MPI Users" <users_at_[hidden]>
Received: Wednesday, 11 August, 2010, 6:24 AM
+1 on Eugene's comment that I don't fully understand what you are trying to do.Â Can you send a short example code?
Some random points:
- Edgar already chimed in about how MPI-2 allows the use of intercommunicators with bcast. Open MPI is MPI-2.1 complaint, so you can use intercommunicators with MPI_Bcast.
- I'm not sure what you mean by "implement broadcast with broadcast" -- that seems like a recursive definition...?
- Keep in mind that there are MPI standard-imposed limitations of how MPI_Bcast can function.Â What you *may* be running afoul of is MPI specifications and definitions -- not a bug in OMPI.Â But that's not entirely clear to me because I don't quite understand what you're trying to do.
- For example, remember that MPI 2.x defines that you can only have one ongoing collective on a communicator at a time.Â So if you're starting multiple bcasts on the same communicator simultaneously (effectively by using different root values in different processes on the same communicator), this is Bad.Â Dick intoned that you probably aren't doing that, but again, I'm not entirely sure what you're doing.
- Also, by the MPI spec, MPI_Bcast may or may not synchronize.Â In practice, if you're broadcasting a large message, most implementations will likely synchronize (where "large" is defined differently by each implementation).
- Open MPI has many different algorithms to implement the MPI_Bcast functionality.Â Which to use is chosen on the fly behind the scenes at run time depending on lots of things, such as number of peers in the communicator, size of the message, etc.
- All of Open MPI's network-based collectives use point-to-point communications underneath (shared memory may not, but that's not the issue here).Â One of the implementations is linear, meaning that the root sends the message to comm rank 1, then comm rank 2, ..etc.Â But this algorithm is only used when the message is small, the number of peers is small, etc.Â All the other algorithms are parallel in nature, meaning that after an iteration or two, multiple processes have the data and can start pipelining sends to other processes, etc.
- We don't have a multicast-based broadcast for a variety of reasons.Â MPI_Bcast needs to be reliable.Â Multicast is not reliable.Â There have been many good algorithms published over the years to make unreliable multicast be reliable, but no one has implemented those in a robust, production-quality manner for Open MPI.Â Part of the reason for that is the non-uniform support of robust multicast implementations by network vendors, the lack of spanning multicast across multiple subnets, etc.Â In practice, the log(n) algorithms that Open MPI uses have generally been "fast enough" such that there hasn't been a clamor for a multicast-based broadcast.Â To be fair: every once in a (great) while, someone says they need it, but to be totally blunt, a) we haven't received enough requests to implement it ourselves, or b) no one has contributed a patch / plugin that implements it.Â That sounds snobby, but I don't mean it that way: what I mean is that most of
the features in Open MPI are customer-driven.Â All I'm saying is that we have a lot of other higher-priority customer-requested features that we're working on.Â Multicast-bcast support is not high enough in priority because not enough people have asked for it.
I hope that helps...
On Aug 9, 2010, at 10:43 PM, Randolph Pullen wrote:
> The install was completly vanilla - no extras a plain .configure command line (on FC10 x8x_64 linux)
> Are you saying that all broadcast calls are actually implemented as serial point to point calls?
> --- On Tue, 10/8/10, Ralph Castain <rhc_at_[hidden]> wrote:
> From: Ralph Castain <rhc_at_[hidden]>
> Subject: Re: [OMPI users] MPI_Bcast issue
> To: "Open MPI Users" <users_at_[hidden]>
> Received: Tuesday, 10 August, 2010, 12:33 AM
> No idea what is going on here. No MPI call is implemented as a multicast - it all flows over the MPI pt-2-pt system via one of the various algorithms.
> Best guess I can offer is that there is a race condition in your program that you are tripping when other procs that share the node change the timing.
> How did you configure OMPI when you built it?
> On Aug 8, 2010, at 11:02 PM, Randolph Pullen wrote:
>> The only MPI calls I am using are these (grep-ed from my code):
>> MPI_Abort(MPI_COMM_WORLD, 1);
>> MPI_Bcast(&bufarray.hdr, sizeof(BD_CHDR), MPI_CHAR, 0, MPI_COMM_WORLD);
>> MPI_Init(&argc, &argv);
>> MPI_Recv(buff, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD, &stat);
>> MPI_Send(buff, BUFSIZE, MPI_CHAR, 0, TAG, MPI_COMM_WORLD);
>> MPI_Test(&request, &complete, &status);
>> MPI_Wait(&request, &status);Â
>> The big wait happens on receipt of a bcast call that would otherwise work.
>> Its a bit mysterious really...
>> I presume that bcast is implemented with multicast calls but does it use any actual broadcast calls at all?Â
>> I know I'm scraping the edges here looking for something but I just cant get my head around why it should fail where it has.
>> --- On Mon, 9/8/10, Ralph Castain <rhc_at_[hidden]> wrote:
>> From: Ralph Castain <rhc_at_[hidden]>
>> Subject: Re: [OMPI users] MPI_Bcast issue
>> To: "Open MPI Users" <users_at_[hidden]>
>> Received: Monday, 9 August, 2010, 1:32 PM
>> Hi Randolph
>> Unless your code is doing a connect/accept between the copies, there is no way they can cross-communicate. As you note, mpirun instances are completely isolated from each other - no process in one instance can possibly receive information from a process in another instance because it lacks all knowledge of it -unless- they wireup into a greater communicator by performing connect/accept calls between them.
>> I suspect you are inadvertently doing just that - perhaps by doing connect/accept in a tree-like manner, not realizing that the end result is one giant communicator that now links together all the N servers.
>> Otherwise, there is no possible way an MPI_Bcast in one mpirun can collide or otherwise communicate with an MPI_Bcast between processes started by another mpirun.
>> On Aug 8, 2010, at 7:13 PM, Randolph Pullen wrote:
>>> Thanks,Â although âAn intercommunicator cannot be used for collective communication.â i.e ,Â bcast calls., I can see how the MPI_Group_xx calls can be used to produce a useful group and then communicator;Â - thanks again but this is really the side issue to my main question about MPI_Bcast.
>>> I seem to have duplicate concurrent processes interfering with each other.Â This would appear to be a breach of the MPI safety dictum, ie MPI_COMM_WORD is supposed to only include the processes started by a single mpirun command and isolate these processes from other similar groups of processes safely.
>>> So, it would appear to be a bug.Â If so this has significant implications for environments such as mine, where it may often occur that the same program is run by different users simultaneously.Â
>>> It is really this issue that it concerning me, I can rewrite the code but if it can crash when 2 copies run at the same time, I have a much bigger problem.
>>> My suspicion is that a within the MPI_Bcast handshaking, a syncronising broadcast call may be colliding across the environments.Â My only evidence is an otherwise working program waits on broadcast reception forever when two or more copies are run at [exactly] the same time.
>>> Has anyone else seen similar behavior in concurrently running programs that perform lots of broadcasts perhaps?
>>> --- On Sun, 8/8/10, David Zhang <solarbikedz_at_[hidden]> wrote:
>>> From: David Zhang <solarbikedz_at_[hidden]>
>>> Subject: Re: [OMPI users] MPI_Bcast issue
>>> To: "Open MPI Users" <users_at_[hidden]>
>>> Received: Sunday, 8 August, 2010, 12:34 PM
>>> In particular, intercommunicators
>>> On 8/7/10, AurÃ©lien Bouteiller <bouteill_at_[hidden]> wrote:
>>> > You should consider reading about communicators in MPI.
>>> > Aurelien
>>> > --
>>> > Aurelien Bouteiller, Ph.D.
>>> > Innovative Computing Laboratory, The University of Tennessee.
>>> > EnvoyÃ© de mon iPad
>>> > Le Aug 7, 2010 Ã 1:05, Randolph Pullen <randolph_pullen_at_[hidden]> a
>>> > Ã©crit :
>>> >> I seem to be having a problem with MPI_Bcast.
>>> >> My massive I/O intensive data movement program must broadcast from n to n
>>> >> nodes. My problem starts because I require 2 processes per node, a sender
>>> >> and a receiver and I have implemented these using MPI processes rather
>>> >> than tackle the complexities of threads on MPI.
>>> >> Consequently, broadcast and calls like alltoall are not completely
>>> >> helpful.Â The dataset is huge and each node must end up with a complete
>>> >> copy built by the large number of contributing broadcasts from the sending
>>> >> nodes.Â Network efficiency and run time are paramount.
>>> >> As I donât want to needlessly broadcast all this data to the sending nodes
>>> >> and I have a perfectly good MPI program that distributes globally from a
>>> >> single node (1 to N), I took the unusual decision to start N copies of
>>> >> this program by spawning the MPI system from the PVM system in an effort
>>> >> to get my N to N concurrent transfers.
>>> >> It seems that the broadcasts running on concurrent MPI environments
>>> >> collide and cause all but the first process to hang waiting for their
>>> >> broadcasts.Â This theory seems to be confirmed by introducing a sleep of
>>> >> n-1 seconds before the first MPI_BcastÂ call on each node, which results
>>> >> in the code working perfectly.Â (total run time 55 seconds, 3 nodes,
>>> >> standard TCP stack)
>>> >> My guess is that unlike PVM, OpenMPI implements broadcasts with broadcasts
>>> >> rather than multicasts.Â Can someone confirm this?Â Is this a bug?
>>> >> Is there any multicast or N to N broadcast where sender processes can
>>> >> avoid participating when they donât need to?
>>> >> Thanks in advance
>>> >> Randolph
>>> >> _______________________________________________
>>> >> users mailing list
>>> >> users_at_[hidden]
>>> >> http://www.open-mpi.org/mailman/listinfo.cgi/users
>>> Sent from my mobile device
>>> David Zhang
>>> University of California, San Diego
>>> users mailing list
>>> users mailing list
>> -----Inline Attachment Follows-----
>> users mailing list
>> users mailing list
> -----Inline Attachment Follows-----
> users mailing list
> users mailing list
For corporate legal information go to:
users mailing list