The invention relates to multiprocessor computers and, more particularly, to efficiently transferring self-defined, non-contiguous messages in a one-sided communication model.
Message Passing Interface (“MPI”) defines a standard application programming interface (“API”) for using several processes at one time to solve a single large problem, or a “job,” on a multiprocessor and often multi-node computer (i.e., commonly one process per CPU across 1 or more multi CPU nodes). Each job can include multiple processes. A process can also commonly be referred to as a task. Each process or task can compute independently except when it needs to exchange data with another task. The program passes the data from one task to another as a “message.” Examples of multiprocessor computers are, e.g., an IBM eServer Cluster 1600 available from IBM Corporation, Armonk, N.Y., and supercomputers available from Cray, Silicon Graphics, Hewlett Packard and the like.
The most commonly used portions of the MPI standard use a two sided protocol. A message transfer occurs in a two sided protocol when a task one initiates a send request and another task initiates a receive request. No data transfer occurs until both the sending and receiving tasks have made a call into the API. Often it is convenient to implement a two sided protocol with a one sided protocol. For example, IBM offers a library implementing the MPI API which in turn is implemented using the one sided LAPI (Low level API) programming model. In the one sided programming model, the sender may initiate data transfer even if the receiving task has not made a call requesting data transfer.
Data transfer in parallel programming applications can involve contiguous or non-contiguous data structures.
Transferring a message from a source 302 to a destination 304 based on a non-contiguous data structure presents significant challenges in cases where the network adapter is incapable of directly handling non-contiguous data structures. It is more difficult to transfer such a message in a one-sided model because the target data structure is provided in the original side. A one-sided communication is a communication where the receiver is not expecting or waiting to receive the data communications. U.S. Pat. No. 6,389,478, “Efficient Non-contiguous Vector and Strided Data Transfer in One-sided Communication on Multiprocessor Computers,” describes a mechanism to transfer vector type non-contiguous data in one-sided communication model, which is hereby incorporated by reference in its entirety. In that invention, as shown in
This prior art mechanism requires a whole description of the user data structure and the data contained within the structure in a non-contiguous message to be transferred from the send side to the target side. However, there are cases when a block by block description of the data is longer than data itself. For example, a four byte data block needs two values in its description (e.g. its address and its length). Thus, the total number of bytes transferred (including data and the description of the data structure) in this method could be significantly larger than the data bytes transferred.
Another commonly owned prior art invention, U.S. patent application Ser. No. 09/517,167, entitled “Data Gather/Scatter Machine,” describes a method of constructing a compact data description and packing/unpacking data from/to non-contiguous data structure to/from contiguous data structure based on the description, which is hereby incorporated by reference in its entirety. A Data Gather/Scatter Program (“DGSP”) is a message level description that potentially eliminates unnecessary individual data block descriptions. However the original DGSP and Data Gather/Scatter Machine (“DGSM”) concept does not handle any communication protocol problems. Using a DGSP description of non-contiguous data can improve the efficiency of non-contiguous message transfer by reducing overhead of transmitting the target data description. However, there are still problems in transferring data in this manner, such as:
1. Poor pipelining. Before any message data can actually be stored into target user addresses, the complete data description has to be available at the target. This is because the data description includes the target structure layout and data size, and the data packets cannot be processed into a user data address at the target without that information. One method of ensuring this is to have the description transferred in its entirety before starting to transfer data packet. However, such a scheme suffers from poor pipeline performance since the data cannot be shipped before it is known at the origin that the data description has arrived at the target. The notification to the sender that all data description packets have reached the destination is via an acknowledgement from target; therefore, the sender must wait for this acknowledgement before sending actual message data. This round-trip rendezvous to handshake with the receiver is very expensive, especially if there are only a few data packets in the message. One solution to this problem of poor pipelining is to try to send the data description and data together in a pipeline fashion. However, such a pipeline transmission leads to at least two other issues, mentioned next.
2. Data may arrive earlier than data description. Since networks can have multiple disjoint routes between any source-destination pair, it is possible that packets injected from a source end point to a destination end point could arrive at the destination out of order (based on the routes the individual packets chose). This race based out-of-order occurs with a small range and brief delays. More rare, but more substantial out-of-order arrival of packets can be caused by packet loss in the network and ensuing retransmission by the communication protocol. It is therefore possible for some data packets to arrive before all data description packets have arrived. Without knowing the layout of the data in the user address space that is contained in the message description, it is not possible to process these incoming data packets as they arrive from the network and assemble them into their final destination data structure. While out-of-order arrival is not extremely rare, discarding data packets that arrive before their description packets causes performance problems which result from unnecessary retransmissions and delays due to the time-outs that trigger retransmissions at the sending side.
3. The difficulty of deciding message completion. In this method of transferring non-contiguous data, the whole message consists of a data description and the data itself. Since the data description alone could be multiple packets, even for the same number of data bytes, the number of data description packets varies depending on the complexity of data structure layout, therefore the total packets is a variable. It is not possible to use traditional one total number of packets expected as a mechanism to decide if the message is complete, and a new mechanism must be devised instead.
4. The ability to send user header or data description across multiple packets. In previous implementations of vector or active messages, there are restrictions on how large the user header or data description can be. The user header is the portion of user data which is processed by client code, called the header handler, which returns the location of where to start unpacking the rest of the data. Basically, the description must fit within one user packet, not span multiple packets. This restriction severely limits the functionality of these API calls and the overall vector implementation.
Therefore, a need exists to overcome the problems with the prior art as described above.
Briefly, in accordance with preferred embodiments of the present invention, disclosed is a system, method, and computer program product transferring noncontiguous messages across a distributed computing environment containing a plurality of processing nodes coupled together over a network. The method, on a sending node, groups a set of data to be transferred into a series of transmission packets, packages a description of the layout of the set of data into a group of one or more description packets, and places each of the description packets into a transmit buffer while maintaining a count of the total number of description packets placed in the buffer. Each description packets in the transmit buffer is transmitted to at least one receiving node, identifies each of the transmission packets representing data packets, and forwards each of the data packets to the transmit buffer for transmission to the at least one receiving node.
An embodiment of the present invention, while packaging the description of the layout of the set of data into description packets is accomplished by packaging a destination data gather scattering program (DGSP).
An embodiment of the present invention, while packaging the description of the layout of the set of data into description packets further includes packaging a source data gather scattering program (DGSP) as well.
An embodiment of the present invention, while grouping a set of data to be transferred into a series of transmission packets includes grouping the set of data compatible with LAPI. Further the transmission packets include both LAPI active message and a LAPI passive message.
An embodiment of the present invention, while grouping a set of data to be transferred into a series of transmission packets includes transmitting the number of the data packets transmitted.
From the point of view of the receiving node, the method includes receiving a series of transmission packets representing a set of data which is transferred from at least one sending node and identifying each of the transmission packets as either a description packet or a data packet. The method assembles each description packet which represents a layout of the set of data to be received while counting the total number of description packages received. The method also places each data packet in the user data buffer only if all the description packets corresponding to the data packets have been previously assembled. An embodiment of the present invention includes assembling each description packet which represents a layout of the set of data to be received using a metadata unpacking routine using a source data gather scatter program (DGSP).
An embodiment of the present invention, includes packaging the description of the layout of the set of data into description packets into a destination data gather scattering program (DGSP) on the receiving node to transfer the data packets to the at least one target task.
An embodiment of the present invention, includes placing the data packet in a local buffer if all the description packets corresponding to the data packets are not yet assembled.
An embodiment of the present invention includes placing the data packet in a local buffer if all the description packets corresponding to the data packets are not yet assembled and then transferred to the user buffer when the destination DGSP is ready.
An embodiment of the present invention includes receiving the set of data to be compatible with LAPI.
An embodiment of the present invention includes one of a LAPI active message and a LAPI passive message.
The foregoing and other features and advantages of the invention will be apparent from the following, more particular description of an exemplary embodiment of the invention, as illustrated in the accompanying drawings, in which:
An exemplary embodiment of the invention is discussed in detail below. While specific implementations are discussed, it should be understood that this is done for illustration purposes only. A person skilled in the relevant art will recognize that other components and configurations may be used without parting from the spirit and scope of the invention.
Overview of the Invention:
An embodiment of the present invention contains a number of unique features and advantages to overcome the problems identified in the prior art to more efficiently transfer messages between non-contiguous data structures in one-sided communication models. To solve the poor pipelining problem, an embodiment of this invention uses an “eager mode sending” method. In this method, the sender starts to send data right alter sending data description and does not need to stall and wait for the acknowledgement from target side indicating the data description has arrived. Since the sender pipelines the sending of the data description and the data by not waiting for complete acknowledgment of the data description packets before sending the data, there is possibility that some data packets arrive earlier than all data description packets.
To handle data packets that arrive before all the message data description packets have been received, an exemplary embodiment of the present invention sets up an early arrival queue of scratch buffers to temporarily store the contents of these data packets. Because any data packet that arrives in the receive FIFO and is presented to the next higher layer packet must either be processed or discarded, the data packets that arrive before the corresponding description packets are copied to scratch buffers in the early arrival queue until the complete description is available (i.e., all message description packets have arrived at the target).
An embodiment of the present invention uses two values to decide if the message is complete: (i) the number of pending description packets and (ii) the number of pending data packets. The two values provide more flexibility in the system than prior art methods since one total number of packets is not sufficient to decide the completion of data description, data blocks and the whole message (which includes the data description and data blocks).
Exemplary Distributed Computing Environment
In one embodiment, the mechanisms of the present invention are incorporated and used in a distributed computing environment, such as the one depicted in
In one example, distributed computing environment 400 includes eight (8) frames, each of which includes a plurality of Systematic Multi Processor (SMP) nodes 406. Since a SMP (Symmetric Multi Processor) node normally runs all Central Processing Units (CPUs) under a single OSI (Open System Interconnect), the terms OSI and SMP can be considered interchangeable in this discussion. In one instance, each frame includes sixteen (16) processing nodes. Each processing node is, for instance, a RS/6000 (or RISC System/6000) computer running AIX, a UNIX based operating system. Each processing node within a frame is coupled to the other processing nodes of the frame via, for example, an internal LAN connection. Additionally, each frame is coupled to the other frames via LAN gates 404.
As an example, each LAN gate 404 includes either an RS/6000 computer, any computer network connection to the LAN, or a network router. However, these are only examples. It will be apparent to those skilled in the relevant art that there are other types of LAN gates, and that other mechanisms can also be used to couple the frames to one another.
In addition to the above, the distributed computing environment of
Transferring Non-Contiguous Data
It is important to note that even though the example implemention shows description and data packets as strictkly separate packets, it is within the true scope and spirit of the present to include the start of the data in the packet containing the end of the description.
Referring now to
However, if the incoming packet, at step 706, is a data packet 510 (i.e. not a description packet), the unpackaging routine 519 checks to see if the description is complete at step 730 (i.e. the destination DGSP 512 has been completely assembled and the description counter=0). If the description is complete at step 732, the unpackaging routine 519 calls the DGSM 521, which uses the destination DGSP 512 to transfer the data packet 510 received in the receiver buffer 516 to the user buffer 511 in the target task 502. The unpackaging routine 519 then decrements the data counter 524 at step 734. Next, the method checks to see if the data is complete (all data packets received and data counter =0), at step 726. If the data is incomplete, the method returns to step 704 to await the next packet. If the data is complete, the process ends.
If at step 730, the description is not complete, the unpackaging routine 519 checks to see if the temporary local buffer 532 is full at step 736, and providing there is sufficient available space, stores the data packet 510 into the temporary local buffer 532 at step 738, until such time as the destination DGSP 512 is ready to complete the transfer to the user buffer 511. The method then returns to step 704 to await the next packet. In the event that the temporary local buffer 532 is full, the data must be discarded at step 732, and it will be necessary to retransmit in order to receive the message in its entirety.
In addition to the above procedure, the receiving node sends an acknowledgement back to the transmitting node for each packet received. If the transmitting node does not receive acknowledgement of each packet within a predetermined amount of time, the message, or the missing portion of the message, is retransmitted.
One embodiment of the present invention uses a passive message model in which the target side reception, caching, interpretation and finally disposal of the message description that controls data scatter is handled by a communication library without explicit involvement of te target side application code. However, an extension of this implementation is to apply this new method to active message communication in which some application code is also run at message arrival. Any message level data layout description (a DGSP in this case but any other form of message level data description as well) does not only provide the target data layout needed by the communication library in distributing the data, it also encodes the information determined by the side that originated the message of which parts of the target data structure will be updated by the incoming message. This information is potentially useful at the target when the target does not have its own knowledge of which parts of the data structure the just arriving message will affect. The application's purpose in sending data to some target is so the data can be incorporated in the ongoing work of the target. To take advantage of the arrived data, the target requires some way of knowing the bounds of the data that has arrived. In some cases, this knowledge of message layout is built into the application code and it is enough for the target side to know data has arrived. In such cases, the passive message approach is sufficient. In other cases, the target side may not have such knowledge built in.
In general, an active message technique which runs a user header handler at the arrival of the first packet is a known technique which allows the application to capture information about the message to guide the incorporation of that message into the ongoing computation of the application or other activities. The planned extension of this invention will have the communication library cache the DGSP in more persistent storage and pass a handle for that cached DGSP to the user header handler as a parameter. The header handler of the application, in one embodiment, records the handle and instruct the communication library to preserve the target data structure description for future use by the application. When the application comes to the point of needing to discern what parts of the target data structure has been modified by the message the cached description can be accessed and analyzed by the application, using the handle to access the preserved DGSP. The information remains available to the application for as long as it is needed and then can be disposed by an application call a FREE(handle) routine advising the communication library it may now discard the DGSP.
In an example embodiment of the present invention, the platform is any computer capable of running multiple processes in which each process runs with its own address space but under a single OSI. The OSI supports mapping of address ranges between distinct address spaces, and can be run to exploit multiple processors which may not have access to a single common address space. It will be apparent to those skilled in the art that implementation is not limited to such an exemplary platform.
While various embodiments of the present invention have been described above, it should be understood that they have been presented by way of example only, and not limitation. Thus, the breadth and scope of the present invention should not be limited by any of the above-described exemplary embodiments, but should be defined only in accordance with the following claims and their equivalents.
This application is related to the commonly owned, co-pending, prior U.S. patent application Ser. No. 09/517,167, entitled “Data Gather/Scatter Machine,” filed on Mar. 02, 2000, and the commonly owned U.S. Pat. No. 6,389,478, entitled “Efficient Non-Contiguous Vector and Strided Data Transfer in One Sided Communication or Multiprocessor Computers,” both of which the entire contents are herein incorporated by reference in their entirety.