Patent ID: 8452888

Claim:
A method for flow control for message passing in a reliable message passing layer, comprising: responsive to receiving a request to pass a new message in a reliable message passing layer from a process, limiting, using a processor, the process from passing the new message from a source node to at least one destination node while a total number of in-flight messages for the process reaches a first level limit; responsive to the total number of in-flight messages for the process not reaching the first level limit, limiting, using the processor, the new message from passing from the source node to a particular destination node from among a plurality of destination nodes while a total number of in-flight messages to the particular destination node reaches a second level limit; responsive to the total number of in-flight messages to the particular destination node not reaching the second level limit, only sending a new packet from among at least one packet for the new message from the source node to the particular destination node while a total number of in-flight packets for the new message is less than a third level limit; responsive to sending the at least one packet from the source node to the particular destination node, tracking, using the processor, whether an acknowledgment is received from the destination node of complete receipt of the new message; responsive to the total number of in-flight messages for the process not reaching the first level limit, determining whether a pre-allocated buffer from among a plurality of pre-allocated buffers is available from a memory pool for the message; responsive to detecting the memory pool is empty, allocating a new buffer to the memory pool; responsive to detecting the memory pool with at least one available pre-allocated buffer, allocating a particular buffer from the memory pool for a send object for the new message; tracking by the send object a separate packet flow control window for each at least one packet; and tracking, for the send object, a state of the new message from among a wait state when waiting while the number of in-flight messages to the particular destination node reaches the second level limit, a sending state when sending the at least one packet, a sent state when the at least one packet is full sent and a done state when the acknowledgement is received from the destination node of complete receipt of the new message.