<p>In one of the answers to <a href="https://stackoverflow.com/questions/31572/broadcast-like-udp-with-the-reliability-of-tcp#31629">Broadcast like UDP with the Reliability of TCP</a>, a user mentions the <a href="http://spread.org" rel="noreferrer">Spread</a> messaging API.  I've also run across one called <a href="http://zeromq.org" rel="noreferrer">ØMQ</a>.  I also have some familiarity with <a href="http://www-unix.mcs.anl.gov/mpi/" rel="noreferrer">MPI</a>.  </p>

<p>So, my main question is: why would I choose one over the other?  More specifically, why would I choose to use Spread or ØMQ when there are mature implementations of MPI to be had?</p>

[{'answer_id': 36698, 'author': 'Eugene Yokota', 'author_id': 3827, 'author_profile': 'https://Stackoverflow.com/users/3827', 'pm_score': 4, 'selected': False, 'text': '<p>I have not used any of these libraries, but I may be able to give some hints.</p>\n\n<ol>\n<li>MPI is a communication protocol while Spread and ØMQ are actual implementation.</li>\n<li>MPI comes from "parallel" programming while Spread comes from "distributed" programming.</li>\n</ol>\n\n<p>So, it really depends on whether you are trying to build a parallel system or distributed system. They are related to each other, but the implied connotations/goals are different. Parallel programming deals with increasing computational power by using multiple computers simultaneously. Distributed programming deals with reliable (consistent, fault-tolerant and highly available) group of computers.</p>\n\n<p>The concept of "reliability" is slightly different from that of TCP. TCP\'s reliability is "give this packet to the end program no matter what." The distributed programming\'s reliability is "even if some machines die, the system as a whole continues to work in consistent manner." To really guarantee that all participants got the message, one would need something like <a href="http://en.wikipedia.org/wiki/Two-phase_commit_protocol" rel="noreferrer">2 phase commit</a> or one of faster alternatives.</p>\n'}, {'answer_id': 65385, 'author': 'Todd Gamblin', 'author_id': 9122, 'author_profile': 'https://Stackoverflow.com/users/9122', 'pm_score': 7, 'selected': True, 'text': "<p>MPI was deisgned tightly-coupled compute clusters with fast, reliable networks.  Spread and ØMQ are designed for large distributed systems.  If you're designing a parallel scientific application, go with MPI, but if you are designing a persistent distributed system that needs to be resilient to faults and network instability, use one of the others.</p>\n\n<p>MPI has very limited facilities for fault tolerance; the default error handling behavior in most implementations is a system-wide fail.  Also, the semantics of MPI require that all messages sent eventually be consumed.  This makes a lot of sense for simulations on a  cluster, but not for a distributed application.</p>\n"}, {'answer_id': 11109839, 'author': 'Fabien Ninoles', 'author_id': 1467561, 'author_profile': 'https://Stackoverflow.com/users/1467561', 'pm_score': 2, 'selected': False, 'text': "<p>You're addressing very different APIs here, with different notions about the kind of services provided and infrastructure for each of them.  I don't know enough about MPI and Spread to answer for them, but I can help a little more with ZeroMQ.</p>\n\n<p>ZeroMQ is a simple messaging communication library.  It does nothing else than send a message to different peers (including local ones) based on a restricted set of common messaging patterns (PUSH/PULL, REQUEST/REPLY, PUB/SUB, etc.). It handles client connection, retrieval, and basic congestion strictly based on those patterns and you have to do the rest yourself.  </p>\n\n<p>Although appearing very restricted, this simple behavior is mostly what you would need for the communication layer of your application.  It lets you scale very quickly from a simple prototype, all in memory, to more complex distributed applications in various environments, using simple proxies and gateways between nodes. However, don't expect it to do node deployment, network discovery, or server monitoring; You will have to do it yourself.</p>\n\n<p>Briefly, use zeromq if you have an application that you want to scale from the simple multithread process to a distributed and variable environment, or that you want to experiment and prototype quickly and that no solutions seems to fit with your model.  Expect however to have to put some effort on the deployment and monitoring of your network if you want to scale to a very large cluster.</p>\n"}]
['https://Stackoverflow.com/questions/35490', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3279/']