Differences b / w MPI, TCP / IP

I am confused about MPI, sockets, and TCP / IP. Are these three communication protocols that can use different interconnects like Infiniband, ethernet, or is it something else? Sorry to bother you if the question sounds naive, but I really got confused in these three terms.

+4
source share
2 answers

TCP / IP is a family of network protocols. IP is a lower-level protocol that is responsible for receiving data packets from place to place over the Internet. TCP sits on top of IP and adds the semantics of the virtual circuit / connection. Only with IP can you send and receive only independent data packets that are not organized into a stream or connection. You can use almost any physical transport mechanism to move IP packets. For LANs, this is usually Ethernet, but you can use anything. There, even the RFC indicates a way to send IP packets using a carrier pigeon.

Sockets is a semi-standard API for accessing the network functions of the operating system. Your program can call various functions called a socket, bind, listen, connect, etc., send / receive data, connect to other computers and listen to connections from other computers. Theoretically, you can use any family of network protocols through the socket API - the protocol family is the parameter that you pass, but these days you almost always specify TCP / IP. (Another option that is used in conjunction with local Unix sockets.)

MPI is an API for transferring messages between processes running on a server cluster. MPI is higher than TCP / IP and sockets. It can theoretically use any family of network protocols, and if it uses TCP / IP or another family supported by the socket API, then it probably uses the socket API to communicate with the operating system.

+6
source

If the goal of your question is to decide how you should write a parallel programming application, you probably shouldn't look at TCP / IP or sockets, as these things will be much lower than you want. You will probably want to take a look at something like MPI or any of the PGAS languages ​​such as UPC, Co-array Fortran, Global Arrays, Chapel, etc. They will be much easier to use than basically writing your own network layer.

When you use one of these higher-level libraries, you get many nice abstractions, such as collective operations, access to remote memory, and other functions that make it easy to just write your parallel code instead of dealing with all the OS material under it, It also makes your code portable between different machines / architectures.

+1
source

Source: https://habr.com/ru/post/1497128/


All Articles