Data transmission method, cluster system, computing device and computer program product
By selecting non-blocking or blocking communication mode according to the data size, the problem of increased inter-process communication time in high-performance computing is solved, more efficient data transmission and resource utilization are achieved, and the latency of data synchronization notification operations is reduced.
Patent Information
- Application Number
- CN202410298262.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2025-09-16
AI Technical Summary
In high-performance computing scenarios, the existing MPI communication method uses a single blocking or non-blocking communication method, which increases the communication time between processes, wastes resources or overlaps communication tasks, and increases the latency of data synchronization notification operations.
Determine whether the data size can be sent in one message, and use non-blocking communication or blocking communication for data transmission to ensure the adaptability of the communication method to the data size. Send small data using non-blocking communication and large data using blocking communication to avoid resource waste and overlapping communication tasks.
It reduces the latency of data synchronization notification operations and improves communication efficiency, especially significantly reduces communication time when transmitting large data, and improves the flexibility and applicability of inter-process communication.
Smart Images

Figure CN120658734A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and more specifically to a data transmission method, a cluster system, a computing device, and a computer program product. Background Art
[0002] Currently, in high-performance computing scenarios, clusters consisting of multiple compute nodes run multiple communicating processes. Communication between these processes typically occurs via message passing interface (MPI), with the source process sending control messages to the destination process, instructing it to transfer data. The source process then transfers data to the destination process via service messages. To increase data transfer rates, Remote Direct Memory Access (RDMA) technology can be used to transfer data between compute nodes.
[0003] Currently, message-passing collective communication primarily utilizes either blocking or non-blocking communication. This is because different processes require different data sizes to be transmitted. When the data to be transferred is small, the control message size is similar to the data size to be transferred. When the data to be transferred is large, multiple data transfers are required. In blocking communication scenarios, when the data to be transferred is small, the source process's network interface card (NIC) is idle during the control message transmission, resulting in wasted resources. In non-blocking communication scenarios, when the data to be transferred is large, multiple service messages are required to transfer the data. Since NICs typically use a balanced round-robin method to send messages, this increases process communication time. Therefore, message-passing collective communication utilizes a single communication method, which increases inter-process communication time. Summary of the Invention
[0004] Embodiments of the present application provide a data transmission method, a cluster system, a computing device, and a computer program product to reduce data synchronization time and reduce the latency of data synchronization notification operations.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a cluster system. The cluster system includes at least two computing nodes running multiple processes communicating with each other. When a first process running in a first computing node among the at least two computing nodes sends first data to a second process running in a second computing node, the first computing node obtains the size of the first data and determines whether the first data can be sent in one message based on the size of the first data. When the first data can be sent in one message, the first computing node sends the first data to the second process in a non-blocking communication mode. When the first data cannot be sent in one message, the first computing node sends the first data to the second process in a blocking communication mode.
[0006] Compared to a single communication mode, the embodiment of the present application determines whether it can be sent through a message according to the size of the data to be transmitted. When the data can be sent through a message, the data is sent through a non-blocking communication mode, which can make full use of the network card resources and reduce the data synchronization notification operation delay. When the data cannot be sent through a message, the data is sent through a blocking communication mode. While ensuring that the data is received by the second process, the increase in the delay of the data synchronization notification operation caused by the overlap of the message sending time under the non-blocking communication mode is avoided. In this way, by improving the adaptability between the communication mode and the data size, and by selecting a communication mode that is more suitable for the data size for data transmission, the delay of the data synchronization notification operation is reduced and the communication efficiency is improved.
[0007] In one possible implementation, the first computing node determines whether the first data can be completely sent in one message based on the size of the first data. Specifically, the first computing node compares the size of the first data with a message length threshold. When the size of the first data is less than or equal to the message length threshold, it is determined that the first data can be completely sent in one message. When the size of the first data is greater than the message length threshold, it is determined that the first data cannot be completely sent in one message.
[0008] In this way, the message length threshold is used to simply and conveniently quantitatively assess whether the first data can be completely sent through one message, thereby improving judgment efficiency and accuracy, thereby ensuring the reliability of the first data and the corresponding communication method.
[0009] In a possible implementation, the first computing node determines the message length threshold according to the network bandwidth between the first computing node and the second computing node and the delay of transmitting a data packet.
[0010] Because the maximum length of data carried in messages transmitted between computing nodes is affected by the bandwidth between computing nodes and the data transmission latency, this possible implementation method determines the message length threshold by calculating the network bandwidth and latency between computing nodes. This can improve the reliability of the message length threshold and thus the accuracy of the selected communication method.
[0011] In one possible implementation, the specific implementation is: the first computing node obtains the transmission time of a data packet between the first computing node and the second computing node; the data size corresponding to the transmission time is obtained by fitting a parallel computing model, and the data size corresponding to the transmission time is determined as the message length threshold.
[0012] Based on this possible implementation, the message length threshold is obtained by fitting a parallel computing model, which can improve the accuracy of the message length threshold and thus improve the accuracy of the selected communication method.
[0013] In one possible implementation, the specific implementation is: storing the size of the first data and its corresponding communication mode; when the size of the second data sent by the first computing node is the same as the size of the first data, obtaining the communication mode corresponding to the size of the first data; and sending the second data using the obtained communication mode.
[0014] Based on this possible implementation, by storing the size of the first data and its corresponding communication mode, communication mode reuse can be achieved, thereby avoiding repeated determination of the communication mode, thereby reducing communication time and improving inter-process communication efficiency.
[0015] In a second aspect, embodiments of the present application provide a cluster system comprising at least two computing nodes running multiple processes communicating with each other. A first computing node of the at least two computing nodes is configured to execute the first aspect or any possible implementation of the first aspect, and send first data to a second computing node of the at least two computing nodes.
[0016] In one possible implementation, when the first computing node determines whether the first data can be sent completely through one message based on the size of the first data, the specific implementation is: comparing the size of the first data with the message length threshold; when the size of the first data is less than or equal to the message length threshold, determining that the first data can be sent completely through one message; when the size of the first data is greater than the message length threshold, determining that the first data cannot be sent completely through one message.
[0017] In a possible implementation, the first computing node is further configured to determine a message length threshold according to a network bandwidth between the first computing node and the second computing node and a delay in transmitting a data packet.
[0018] In one possible implementation, the specific implementation is: the first computing node is also used to obtain the transmission time of a data packet between the first computing node and the second computing node; the data size corresponding to the transmission time is obtained by fitting a parallel computing model, and the data size corresponding to the transmission time is determined as the message length threshold.
[0019] In one possible implementation, the first computing node is further used to store the size of the first data and its corresponding communication mode. When the size of the second data sent by the first computing node is the same as the size of the first data, the communication mode corresponding to the size of the first data is obtained, and the second data is sent using the obtained communication mode.
[0020] In a third aspect, embodiments of the present application further provide a computing device comprising a processor and a memory. The memory is configured to store computer-executable instructions and data necessary for the computing device. The processor is configured to execute the computer-executable instructions and data necessary for the computing device stored in the memory, so that the computing device performs the method described in the first aspect or any possible implementation of the first aspect.
[0021] In a fourth aspect, an embodiment of the present application provides a computer program product, which, when the instructions are executed by a computing device, enables the computing device to execute the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0022] The technical effects brought about by any implementation of the second to fourth aspects can refer to the technical effects brought about by the first aspect or different implementations of the first aspect, and will not be described in detail here.
[0023] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the structure of the cluster system provided in an embodiment of the present application;
[0025] Figure 2 This is a diagram of polling scheduling for RDMA network cards;
[0026] Figure 3 This is a schematic diagram of blocking communication in a one-to-many communication mode;
[0027] Figure 4 This is a schematic diagram of non-blocking communication in one-to-many communication mode;
[0028] Figure 5 This is a schematic diagram of inter-process communication delay under non-blocking communication mode;
[0029] Figure 6 A flowchart of a data transmission method in a one-to-many communication mode provided by an embodiment of the present application;
[0030] Figure 7 A flowchart of a data transmission method in a many-to-one communication mode provided by an embodiment of the present application;
[0031] Figure 8 A schematic diagram of the broadcast process of the data transmission method provided in an embodiment of the present application;
[0032] Figure 9 A schematic diagram of the structure of a data transmission device 11 provided in an embodiment of the present application;
[0033] Figure 10A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0034] Figure 11 A schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0035] Figure 12 A schematic diagram of the connections between computing devices in a computing device cluster provided in an embodiment of the present application. Specific embodiments
[0036] like Figure 1 As shown, Figure 1 FIG2 is a schematic diagram of the cluster system structure provided by an embodiment of the present application. The cluster system includes computing nodes S0, S1, S2, and S3. Computing nodes S0, S1, S2, and S3 run multiple processes that communicate with each other. The communication between the multiple processes is implemented using a message passing interface (MPI).
[0037] It should be noted that the above Figure 1 The cluster system provided is only an example and is not enough to limit the application scenarios of the data transmission method provided in the embodiment of the present application. In actual applications, the cluster system may include Figure 1 More or fewer compute nodes.
[0038] like Figure 1 As shown, both computing node S0 and computing node S1 run n processes that communicate with each other.
[0039] An RDMA network interface controller (RNIC) is deployed in the compute node. When a first process running on compute node S0 sends data to a second process running on compute node S1, the RDMA device in compute node S0 uses remote direct memory access (RDMA) technology to send the data to the second process. The RDMA device is a device that uses RDMA technology to assemble, send, and receive messages. An RDMA device can also be called a network card (NIC) or an RDMA network card.
[0040] The computing node includes a physical machine, or the computing node includes a virtual machine. It is understandable that when the computing node includes a physical machine, the computing node is allocated a physical network card. When the computing node includes a virtual machine, the computing node is allocated a virtual network card.
[0041] In collective communication, when the data to be transmitted in a communication task is large, the data to be transmitted is divided into multiple messages and sent. The RDMA device in the computing node adopts a balanced polling resource scheduling method to handle the messages in the concurrent communication tasks.
[0042] Take one-to-many collective communication as an example, Figure 2 As shown, Figure 2 The following is a diagram of the polling scheduling of an RDMA network card. Compute node S0 runs the first process, compute node S1 runs the second process, compute node S2 runs the third process, and compute node S3 runs the fourth process. The first process sends data 1, data 2, and data 3 to the second, third, and fourth processes, respectively. Data 1, data 2, and data 3 are each split into four packets and sent. The RDMA network card sequentially retrieves packets addressed to the second, third, and fourth processes from the memory of compute node S0, forming a send queue. The packets in the send queue addressed to the second, third, and fourth processes are then sent to the network cards of compute nodes S1, S2, and S3 in a first-in, first-out order.
[0043] In the related art, the computing node S0 sends data 1, data 2, and data 3 to the second process, the third process, and the fourth process respectively according to a preset communication mode of blocking communication and non-blocking communication.
[0044] When collective communication is performed through blocking communication, such as Figure 3 As shown, compute node S0, running the first process, sends a control message to compute node S1, running the second process, instructing it to transfer data. Compute node S0 encapsulates the data destined for the second process into a service message and sends it to the second process. When the second process completes the data transfer, it returns a completion response to the first process, concluding the communication task between compute nodes S0 and S1. Compute node S0 then initiates a communication task with compute node S2, running the third process, sending a control message to it.
[0045] from Figure 3 As can be seen, compute node S0 needs to initiate a new communication task after completing the communication task with compute node S1. When transmitting medium-sized or small packets, the control message size is the same or similar to the service message size. During the control message transmission, the network card in compute node S0 is idle, resulting in a waste of network card resources.
[0046] The small packet data and the medium packet data may refer to data whose data length is less than the maximum message length. The medium packet data has a data length greater than the data length of the small packet data.
[0047] When collective communication is performed through non-blocking communication, such as Figure 4 As shown, after computing node S0, running the first process, sends a control message to computing node S1, running the second process, the computing node then sends a control message to computing node S2, running the third process, and establishes a wait interface. When the wait interface in the first process detects that computing node S1 and computing node S2 have completed receiving their respective service messages, the communication task with computing node S1 and the communication task with computing node S2 are terminated.
[0048] from Figure 4 As can be seen, compute node S0 is concurrently communicating with compute node S1 and compute node S2, and the two communication tasks overlap. When the data to be sent in both communication tasks is large packets, multiple service messages need to be sent in both communication tasks. The number of service messages that compute node S0's network interface card needs to handle during the overlap increases. Because the network interface card uses a balanced round-robin resource scheduling method to handle messages in concurrent communication tasks, this increases the time it takes for compute node S0 to communicate with compute node S1 and with compute node S2.
[0049] The large packet data may refer to data whose length is greater than the maximum message length.
[0050] For example, take the inter-process broadcast of large data packets as an example. In the first phase, computing node S0 transmits data to computing node S2. In the second phase, computing node S0 transmits data to computing node S1, and computing node S2 transmits data to computing node S3. Through the two data transmission phases, it is ensured that Figure 1 Each computing node in the cluster system shown receives data.
[0051] Taking the data transmission completion time of 2t as an example, in the blocking communication mode, if Figure 5 As shown in Figure (a), after computing node S0 completes the data transmission from computing node S2, it transmits data to computing node S1. The data transmission completion time between computing nodes is 2t.
[0052] In non-blocking communication mode, such as Figure 5 As shown in Figure (b), compute node S0 concurrently sends data to compute nodes S2 and S1. Compute node S0's network card polls data destined for compute nodes S2 and S1, increasing the time it takes for compute node S2 to complete data reception by 2t. This increased data reception time for compute node S2 increases the time it takes for data transmission between compute nodes S2 and S1 by 3t.
[0053] Since the data size of inter-process communication tasks is diverse, and currently a single communication method is used for collective communication, Figures 3 to 5 It can be seen that there is a mismatch between the communication mode of the communication task and the data size of the communication task, which will increase the latency of the data synchronization notification operation.
[0054] Based on this, to reduce the latency of data synchronization notification operations, shorten data synchronization time, and improve communication efficiency, an embodiment of the present application provides a data transmission method. This method determines the communication mode based on the data size of inter-process communication. Different communication modes are adapted for data of different sizes, enabling flexible selection and dynamic switching of communication modes, thereby improving the applicability and flexibility of collective communication. Furthermore, compared to a single communication mode, the embodiment of the present application determines whether the data to be transmitted can be fully transmitted in a single message based on the size of the data to be transmitted. When the data can be fully transmitted in a single message, the data is sent using a non-blocking communication mode, which fully utilizes network card resources and reduces the latency of the data synchronization notification operation. When the data cannot be fully transmitted in a single message, the data is sent using a blocking communication mode. This ensures that the data is received by the second process while avoiding the increase in data synchronization notification latency caused by overlapping message transmission times in the non-blocking communication mode. Thus, by improving the compatibility between the communication mode and the data size, the embodiment of the present application selects a communication mode that is more suitable for the data size for data transmission, thereby reducing the latency of the data synchronization notification operation and improving communication efficiency.
[0055] It should be noted that the data transmission method provided in the embodiments of this application can be applied in high-performance computing scenarios to implement process communication involving multiple processes. When MPI is applied in high-performance computing scenarios, the collective communication involved mainly includes one-to-many communication mode and many-to-one communication mode. Therefore, the embodiments of this application mainly introduce the data transmission method provided in the embodiments of this application from the perspectives of collective communication in the many-to-one communication mode and collective communication in the one-to-many communication mode.
[0056] It is understandable that the data transmission method provided in the embodiment of the present application can also be applied in other parallel computing scenarios, which is not limited in the embodiment of the present application.
[0057] In order to better illustrate the data transmission method provided in the embodiment of the present application, the embodiment of the present application is based on Figure 1 The provided cluster system provides a data transmission method. The data transmission method can be applied to Figure 1 The cluster system shown in FIG. can also be applied to other computing devices with data processing capabilities. This embodiment of the present application is not limited to this.
[0058] Take the one-to-many communication mode as an example, Figure 6 As shown, Figure 6: is a flowchart of a data transmission method provided in an embodiment of the present application. The data transmission method shown includes steps S210 to S240:
[0059] Step S210 : A first computing node among the at least two computing nodes obtains a size of first data sent by a first process running in the first computing node to a second process in a second computing node.
[0060] In the embodiments of the present application, the first computing node may be any computing node in the cluster system. Alternatively, the first computing node may be a master node in the cluster system. Alternatively, the first computing node may be a computing node that initiates an inter-process communication task in the cluster system. The second computing node may be at least one computing node in the cluster system other than the first computing node. Alternatively, the second computing node may be the computing node corresponding to the communication task initiated by the first computing node in the cluster system.
[0061] The first data indicates data that the first computing node needs to send, such as business data, broadcast messages, processing results, image data, etc.
[0062] In an embodiment of the present application, when the first computing node detects that the first process running in the first computing node initiates a communication task, the first computing node obtains the size of the first data to be sent by the communication task.
[0063] In one example, the first computing node counts the number of bytes in the first data to be sent to obtain the size of the first data.
[0064] In step S220 , the first computing node determines whether the first data can be completely sent through one message based on the size of the first data.
[0065] Due to the message size defined in the transmission protocol or the influence of network bandwidth, when transmitting large packets of data, the large packets of data are usually segmented, and the data to be transmitted is divided into multiple messages for sending.
[0066] Because blocking communication and non-blocking communication are adapted to different data sizes, and when the network card polls and sends messages, the time it takes for blocking communication to transmit data divided into multiple messages is shorter than the time it takes for non-blocking communication to transmit data divided into multiple messages. Therefore, in the embodiments of the present application, to ensure the degree of adaptability between data size and communication mode and improve communication efficiency, the data size is used to determine whether the first data can be sent in a single message, and the corresponding communication mode is selected accordingly.
[0067] Step S230: When the first data can be sent completely through one message, the first computing node sends the first data to the second process through a non-blocking communication method.
[0068] Step S240: When the first data cannot be sent completely through one message, the first computing node sends the first data to the second process through a blocking communication method.
[0069] In a possible implementation, when the first computing node sends the first message to the first receiving end in a blocking communication manner, as shown in FIG. Figure 3 As shown, the first computing node sends first data to the second process. The second process receives the first data and returns a response message to the first process. After receiving the response message, the first computing node sends second data to the third computing node running the third process.
[0070] In one example, the third computing node may be a computing node other than the first computing node and the second computing node in the cluster system. Alternatively, the third computing node may be a computing node other than the first computing node in the cluster system. For example, when multiple processes are running on computing nodes in the cluster system, the third computing node may be the second computing node, and the third process may be a process other than the second process running on the second computing node.
[0071] based on Figure 6 The provided embodiment determines the communication mode according to the data size of the inter-process communication in a one-to-many communication mode. Different communication modes are adapted for data of different sizes, enabling flexible selection and dynamic switching of communication modes, thereby improving the applicability and flexibility of collective communication. At the same time, compared with a single communication mode, the embodiment of the present application determines whether the data to be transmitted can be sent in one message according to the size of the data to be transmitted. When the data can be sent in one message, the data is sent in a non-blocking communication mode, which can fully utilize the network card resources and reduce the data synchronization notification operation delay. When the data cannot be sent in one message, the data is sent in a blocking communication mode. While ensuring that the data is received by the second process, the increase in the delay of the data synchronization notification operation caused by the overlap of the message sending time in the non-blocking communication mode is avoided. In this way, the embodiment of the present application improves the adaptability between the communication mode and the data size, and selects a communication mode that is more adapted to the data size for data transmission, thereby reducing the delay of the data synchronization notification operation and improving communication efficiency.
[0072] Taking a cluster system consisting of eight computing nodes, each using a quad-core processor, as an example, in a one-to-many communication mode, statistics are collected for the latency of data synchronization notification operations for inter-process communication using the data transmission method provided in the embodiments of the present application, and the latency of data synchronization notification operations for inter-process communication using a non-blocking communication method. As shown in Table 1, Table 1 provides a comparison of the latency of data synchronization notification operations using the data transmission method provided in the embodiments of the present application and the non-blocking communication method.
[0073] Table 1. Comparison of the latency of data synchronization notification operations between the data transmission method and the non-blocking communication method
[0074] The size of the data Data transmission method latency (microseconds) Non-blocking communication latency (microseconds) Improved efficiency 65536 44.11 51.1 15.85% 131072 65.28 88.34 35.32% 262144 107.81 162.61 50.83% 524288 192.9 311.45 61.46% 1048576 362.85 609.34 67.93%
[0075] As shown in Table 1, when the size of the first data is 65536 bytes, the delays of the data synchronization notification operation of the data transmission method provided by the present application and the non-blocking communication method are 44.11 microseconds and 51.1 microseconds, respectively. When the size of the first data is 131072 bytes, the delays of the data synchronization notification operation of the data transmission method provided by the present application and the non-blocking communication method are 65.28 microseconds and 88.34 microseconds, respectively. When the size of the first data is 262144 bytes, the delays of the data synchronization notification operation of the data transmission method provided by the present application and the non-blocking communication method are 107.81 microseconds and 162.61 microseconds, respectively. When the size of the first data is 524288 bytes, the delays of the data synchronization notification operation of the data transmission method provided by the present application and the non-blocking communication method are 192.9 microseconds and 311.45 microseconds, respectively. When the size of the first data is 1048576 bytes, the delays of the data synchronization notification operation of the data transmission method provided by the present application and the non-blocking communication method are 362.85 microseconds and 609.34 microseconds, respectively.
[0076] As can be seen from Table 1, the larger the size of the first data, the greater the delay increased by the non-blocking communication method due to the time overlap of at least two communication tasks. Relative to the non-blocking communication method, the data transmission method provided in the embodiment of the present application can obtain a shorter delay, and the communication efficiency is further improved. For example, for a message with a size of 1048576 bytes of the first data, the delay of the data synchronization notification operation of the data transmission method provided in the embodiment of the present application is 366.85 microseconds, while the delay of the data synchronization notification operation of the non-blocking communication method is 609.34 microseconds. Relative to the non-blocking communication method, the data transmission method provided in the embodiment of the present application improves the communication efficiency by 67.93% when the size of the first data is 1048576 bytes.
[0077] As can be seen from Table 1, compared to fixed communication methods, determining the communication method based on the size of the first data improves the adaptability between the communication method and the data size. By selecting a communication method that best matches the data size for data transmission, blocking communication is used when the data size is large, avoiding the overlap of multiple communication tasks. This reduces data synchronization latency and improves communication efficiency.
[0078] In order to better understand the data transmission method provided in the embodiment of the present application, the implementation method of determining whether the first data can be sent through one message in the above step S220 is introduced below.
[0079] In an embodiment of the present application, the first computing node may predict, based on the size of the first data, the probability that the first data can be completely sent in one message. When the probability that the first data can be completely sent in one message is greater than or equal to a probability threshold, it is determined that the first data can be completely sent in one message. When the probability that the first data can be completely sent in one message is less than the probability threshold, it is determined that the first data cannot be completely sent in one message.
[0080] In one example, a probability prediction model can be used to perform probability prediction based on the size of the first data. The probability prediction model can be a probability distribution model or a logistic regression model.
[0081] In an embodiment of the present application, the first computing node may also compare the size of the first data with a message length threshold to determine whether the first data can be sent completely through one message.
[0082] The message length threshold is used to indicate the maximum length of data carried in a message sent by the first computing node to the second computing node.
[0083] For example, when the size of the first data is less than or equal to the message length threshold, it is determined that the first data can be sent in one message. When the size of the first data is greater than the message length threshold, it is determined that the first data cannot be sent in one message and needs to be divided into multiple messages for sending.
[0084] Next, a method for determining the message length threshold is introduced.
[0085] In a first possible implementation, the message length threshold may be defined in a transmission protocol, including but not limited to transmission control protocol / internet protocol (TCP / IP), user datagram protocol (UDP), RDMA over converged Ethernet (RoCE), wireless broadband protocol (InfiniBand), and Internet Wide Area RDMA Protocol (iWARP).
[0086] In a second possible implementation manner, the message length threshold may be preset by a user.
[0087] In the third possible implementation, the maximum length of data carried by a message transmitted between computing nodes is affected by the bandwidth between computing nodes and the transmission delay of the data. If the message length threshold or the message length threshold defined in the transmission protocol is directly obtained, the message length threshold may be inconsistent with the maximum length of data carried by the message actually transmitted by the network card. As a result, the accuracy of the communication method selected based on the message length threshold and the size of the first data is not high. Therefore, in order to improve the accuracy of the selected communication method, the first computing node determines the message length threshold based on the network bandwidth between the first computing node and the second computing node and the delay in transmitting a data packet. In this way, by improving the accuracy of the message length threshold, the accuracy of the selected communication method is improved.
[0088] The latency of transmitting a data packet indicates the time required for transmitting the data packet from the first computing node to the second computing node. The network bandwidth indicates the maximum data rate from the first computing node to the second computing node per unit time.
[0089] In a first example, the first computing node may obtain the message length threshold according to the product of the network bandwidth between the first computing node and the second computing node and the delay of transmitting a data packet.
[0090] In a second example, the first computing node may obtain a data transmission rate based on a network bandwidth between the first computing node and the second computing node, and obtain a message length threshold based on the data transmission rate and the delay.
[0091] For example, the network bandwidth between the first computing node and the second computing node is multiplied by 2 to determine the data transmission rate. The message length threshold is obtained by multiplying the data transmission rate by the delay.
[0092] In the third example, the first computing node uses the network bandwidth between the first computing node and the second computing node and the delay for transmitting a data packet as inputs of the prediction model, and determines the message length output by the prediction model as the message length threshold.
[0093] The prediction model can be a machine learning-based model or a neural network-based model.
[0094] In a fourth possible implementation, the message length threshold may be determined by counting data synchronization durations of data of different sizes communicated in a blocking communication mode and a non-blocking communication mode.
[0095] The data synchronization duration indicates the duration from when the first process sends a control message to when the second process returns a response message.
[0096] For example, consider data of different sizes. For each data size, inter-process communication is performed using both blocking and non-blocking communication modes. The shortest data synchronization duration for each data size, under both blocking and non-blocking communication modes, and the corresponding communication mode are counted to obtain a sequence of transmission durations for data of different sizes. The data size and the corresponding communication mode in the transmission duration sequence for data of different sizes are analyzed to obtain a message length threshold.
[0097] In one example, the data size and the communication mode corresponding to the shortest transmission duration in a sequence of data of different sizes can be analyzed to obtain the data size corresponding to the transition from blocking communication to non-blocking communication corresponding to the shortest transmission duration. A message length threshold can be obtained based on the data size corresponding to the transition from blocking communication to non-blocking communication corresponding to the shortest transmission duration.
[0098] For example, the message length threshold may be an average, maximum, or minimum value of the data size corresponding to the shortest duration for the communication mode to change from blocking communication to non-blocking communication and the adjacent data sizes.
[0099] For example, consider data sizes X1, X2, X3, X4, X5, and X6. X1, X2, X3, X4, X5, and X6 satisfy the following: X1 > X2 > X3 > X4 > X5 > X6. When the transmission duration sequence for data of different sizes is {X1 (blocking communication), X2 (blocking communication), X3 (blocking communication), X4 (non-blocking communication), X5 (non-blocking communication), X6 (blocking communication)}, the average, maximum, or minimum value of X3 and X4 is determined as the message length threshold.
[0100] For another example, the message length threshold is the data size corresponding to the shortest duration when the communication mode changes from blocking communication to non-blocking communication.
[0101] In another example, the data sizes and the communication modes corresponding to the shortest durations in a sequence of transmission durations for data of different sizes can be analyzed to obtain the data sizes corresponding to blocking communication and non-blocking communication for the communication modes corresponding to the shortest durations. A message length threshold can be obtained based on the data sizes corresponding to blocking communication and non-blocking communication for the communication modes corresponding to the shortest durations.
[0102] For example, when the communication mode corresponding to the shortest duration includes blocking communication and non-blocking communication, and the data size corresponding to the communication mode corresponding to the shortest duration includes multiple, the average value, maximum value or minimum value of the data size corresponding to the blocking communication and non-blocking communication is determined as the message length threshold.
[0103] For example, consider data sizes X1, X2, X3, X4, X5, and X6. X1, X2, X3, X4, X5, and X6 satisfy the following: X1 > X2 > X3 > X4 > X5 > X6. When the transmission duration sequence for data of different sizes is {X1 (blocking communication), X2 (blocking communication), X3 (blocking communication, non-blocking communication), X4 (blocking communication, non-blocking communication), X5 (non-blocking communication), X6 (blocking communication)}, the average, maximum, or minimum value of X3 and X4 is determined as the message length threshold.
[0104] For another example, when the communication mode corresponding to the shortest duration includes blocking communication and non-blocking communication and the data size corresponding to the communication mode corresponding to the shortest duration includes one, the data size corresponding to the communication mode corresponding to the shortest duration including blocking communication and non-blocking communication is determined as the message length threshold.
[0105] Taking the transmission time sequence of data of different data sizes as {X1 (blocking communication), X2 (blocking communication), X3 (blocking communication, non-blocking communication), X4 (non-blocking communication), X5 (non-blocking communication), X6 (blocking communication)} as an example, X3 is determined as the message length threshold.
[0106] In a fifth possible implementation, the message length threshold may also be obtained through modeling.
[0107] In one example, a first computing node obtains a transmission time of a data packet transmitted between the first computing node and a second computing node, obtains a data size corresponding to the transmission time through parallel computing model fitting, and determines the data size corresponding to the transmission time as a packet length threshold.
[0108] The transmission time of a data packet transmitted between the first computing node and the second computing node is used to indicate the transmission time of a small packet data between the first computing node and the second computing node.
[0109] The parallel computing models include, but are not limited to, a shared memory model (parallel random access machine, PRAM), a block synchronous parallel model (bulk synchronous parallel model, BSP), and a Logp model.
[0110] For example, the Logp model is used. The Logp model performs data fitting based on the communication overhead time of inter-process communication, the maximum communication delay time, and the number of processors or memory modules in a computing node to obtain a fitting relationship between data size and transmission time. The fitting relationship can be a fitting coefficient between data size and transmission time.
[0111] The communication overhead time and the maximum communication delay time of the inter-process communication are pre-set parameters.
[0112] In an embodiment of the present application, the first computing node inputs the transmission time of a data packet between the first computing node and the second computing node, the communication overhead time of inter-process communication, the maximum communication delay time, and the number of processors or memory modules in the computing node into the Logp model to obtain the data size corresponding to the transmission time output by the Logp model.
[0113] For example, when the transmission time of a data packet between the first computing node and the second computing node is 0.380 s, the data size obtained by fitting the Logp model is 512 KB, and the message length threshold is determined to be 512 KB.
[0114] It should be noted that the above five methods for determining the message length threshold are merely exemplary and do not limit the data transmission method provided in the embodiments of the present application. In practical applications, at least two of the above five examples may be combined to determine the message length threshold.
[0115] For example, when there is a user-preset message length threshold, the first computing node directly obtains the user-preset message length threshold. When there is no user-preset message length threshold, the first computing node determines the message length threshold based on the network bandwidth between the first computing node and the second computing node and the delay of transmitting a data packet.
[0116] In an embodiment of the present application, when communicating between different processes, data of the same or similar size may be transmitted. Alternatively, when broadcasting repeatedly to multiple processes, the data broadcast each time is identical. If, during each communication, a computing node determines the communication mode based on the size of the data to be sent to determine whether the data can be fully transmitted in a single message, duplicate calculations may occur. This will increase the duration of data synchronization operations. Based on this, after obtaining the first data to be sent, an embodiment of the present application determines whether a communication mode matching the size of the first data exists among the stored communication modes corresponding to multiple different data sizes. If a communication mode matching the size of the first data exists, the first computing node uses the communication mode matching the size of the first data to send the first data. If a communication mode matching the size of the first data does not exist, the first computing node executes S220 to S240 above to send the first data and stores the size of the first data and the corresponding communication mode. In this way, by reusing the communication mode, duplicate determination of the communication mode is avoided. This reduces communication time and improves inter-process communication efficiency.
[0117] The size of the first data may be compared with a plurality of stored different data sizes. When data of the same size as the first data exists among the plurality of stored different data sizes, it is determined that a communication method matching the size of the first data exists. When data of the same size as the first data does not exist among the plurality of stored different data sizes, it is determined that a communication method matching the size of the first data does not exist.
[0118] In one possible implementation, when the first computing node sends the second data, when the size of the second data sent by the first computing node is the same as the size of the first data, the communication mode corresponding to the size of the first data is obtained, and the second data is sent using the obtained communication mode.
[0119] The second data may be data sent by the first process running on the first computing node to the third process, or the second data may be data sent by the first process running on the first computing node to the second process.
[0120] The above mainly introduces the solution provided by the embodiment of the present application by taking the one-to-many communication mode as an example. It should be noted that the data transmission method provided by the embodiment of the present application can not only realize inter-process communication in the one-to-many communication mode, but also realize inter-process communication in the many-to-one communication mode. In the many-to-one communication mode, multiple source processes send data to one destination process, and the destination process receives the data according to the above data transmission method embodiment. Figure 7 As shown, Figure 7 : is a flowchart of a data transmission method provided by an embodiment of the present application in a many-to-one communication mode. The data transmission method shown includes steps S710 to S740:
[0121] Step S710: The first computing node obtains the size of first data to be received by a first process running in the first computing node.
[0122] In the embodiment of the present application, the size of the first data to be received may be obtained according to the above step S210, which will not be described in detail in the embodiment of the present application.
[0123] Step S720: The first computing node determines whether the first data to be received can be completely received through one message according to the size of the first data to be received.
[0124] Step S730: When the first data to be received can be completely received through one message, the first computing node processes the first data to be received through a non-blocking communication method.
[0125] In an embodiment of the present application, when a non-blocking communication method is used to process the first data to be received, the first computing node polls the first data to be received and the second data to be received. Upon determining that processing of the first data to be received is complete, the first computing node returns a response message to the computing node that sent the first data to be received. Upon determining that processing of the second data to be received is complete, the first computing node returns a response message to the computing node that sent the second data to be received.
[0126] Step S740: When the first data to be received cannot be completely received through one message, the first computing node processes the first data to be received through a blocking communication method.
[0127] In an embodiment of the present application, when a blocking communication method is used to process the first data to be received, the first data to be received is received. After the first data to be received is received, a response message is returned to the computing node that sent the first data to be received, and the second data to be received is received.
[0128] based on Figure 7 In the provided embodiment, in a many-to-one communication mode, the data communication mode is determined based on the data size. Different communication modes are adapted for data of different sizes, enabling flexible selection and dynamic switching of communication modes, improving the applicability and flexibility of collective communication. Furthermore, by improving the adaptability between the communication mode and the data size, data synchronization latency is reduced, thereby improving communication efficiency.
[0129] To better illustrate the data transmission method provided in the embodiment of the present application, taking broadcast as an example, a broadcast process of the data transmission method is provided, such as Figure 8 As shown, Figure 8 The present invention is a schematic diagram of a broadcast process of a data transmission method provided by an embodiment of the present invention. In the broadcast process of the data transmission method shown, the root node MPI (0) sends data to the first child node MPI (1) and the second child node MPI (2). After receiving the data, the first child node MPI (1) sends the data to the second child node MPI (2).
[0130] like Figure 8As shown, by modeling to obtain the message length threshold, a threshold judgment step is added to the node's data sending process and data receiving process. The root node obtains the size of the data to be broadcast. According to the comparison between the size of the data to be broadcast and the message length threshold, it is determined whether the data to be broadcast can be sent through the first message. When the data to be broadcast can be sent through one message, the root node has two asynchronous communication interfaces MPI_Isend() and wait interfaces. The root node sends the data to be broadcast to the first child node and the second child node concurrently in a non-blocking communication manner through the two asynchronous communication interfaces. When the data to be broadcast cannot be sent through one message, the root node creates a synchronous communication interface MPI_send() and sends the data to be broadcast to the first child node in a blocking communication manner. After receiving the response information returned by the first child node, the root node creates a synchronous communication interface again and sends the data to be broadcast to the second child node in a blocking communication manner.
[0131] When the first child node receives data, it determines the size of the data to be received. It compares the size of the data to be received with the message length threshold to determine whether the data to be received can be received in one message. If the data to be received can be received in one message, the first child node creates an asynchronous communication interface MPI_Ireceive() to receive the data, sends the data to the second child node, and creates a wait interface to receive the response information of the second child node. If the data to be received cannot be received in the first message, the first child node creates a synchronous communication interface MPI_Return() to receive the message and returns the response information to the root node.
[0132] The second child node also uses the size of the data to be received and the message length threshold to determine whether the data to be received can be fully received in the first message. If the data to be received can be fully received in a single message, the second child node concurrently receives the data sent by the root node and the data sent by the first child node using non-blocking communication. If the data to be received cannot be fully received in a single message, the second child node receives the data sent by the root node, returns a response to the root node, and then receives the data sent by the first child node.
[0133] The communication interface send() is used to send data, the communication interface receive() is used to receive data, and the communication interface return() is used to return response information.
[0134] based on Figure 8 The provided embodiment, the data transmission method provided in the embodiment of the present application, when receiving and sending data, selects a communication method adapted to the data size according to the data size and message length threshold, thereby reducing data synchronization delay and improving communication efficiency.
[0135] In order to better implement the data transmission method provided in the embodiment of the present application, a data transmission device 11 is provided based on the data transmission method. Figure 9 As shown, Figure 9 FIG. 1 is a result diagram of a data transmission device 11 provided in an embodiment of the present application. The data transmission device 11 shown includes a communication module 111 and a decision module 112 .
[0136] The communication module 111 is used to obtain the size of the first data sent by the first process running in the first computing node of at least two computing nodes to the second process in the second computing node. Figure 6 Step S210 in .
[0137] The decision module 112 is configured to determine whether the first data can be sent in one message according to the size of the first data. Figure 6 Step S220 in .
[0138] The communication module 111 is further configured to send the first data to the second process in a non-blocking communication manner when the first data can be sent in one message. And to send the first data to the second process in a blocking communication manner when the first data cannot be sent in one message. For example, the communication module 111 executes the above Figure 6 Step S230 or step S240 in .
[0139] The communication module 111 and the decision module 112 can be implemented by software or hardware. For example, the implementation of the communication module 111 will be described below using the communication module 111 as an example. Similarly, the implementation of the decision module 112 can refer to the implementation of the communication module 111.
[0140] As an example of a software functional unit, the communication module 111 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the communication module 111 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0141] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0142] As an example of a hardware functional unit, the communication module 111 may include at least one computing device, such as a server. Alternatively, the communication module 111 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a general purpose array logic (GAL), or any combination thereof.
[0143] The multiple computing devices included in the communication module 111 can be distributed in the same region or in different regions. The multiple computing devices included in the communication module 111 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the communication module 111 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0144] It should be noted that the naming and grouping of devices and modules in the embodiments of this application are illustrative and represent only one logical functional grouping. Actual implementations may employ alternative grouping schemes. For example, data transmission device 11 may be named a data transmission system or another name, without limitation. Furthermore, data transmission device 11 may be divided not only into communication module 111 and decision module 112, but also into communication module 111, decision module 112, a first transmission module, and a second transmission module.
[0145] The first sending module is configured to send the first data to the second process via a non-blocking communication mode when the first data can be sent in one message, and the second sending module is configured to send the first data to the second process via a blocking communication mode when the first data cannot be sent in one message.
[0146] It should be noted that, in other embodiments, the communication module 111 can be used to execute any steps applicable to the data transmission method, and the decision module 112 can be used to execute any steps applicable to the data transmission method. The steps that the decision module 112 and the communication module 111 are responsible for implementing can be specified as needed. The full functionality of the data transmission device 11 is achieved by having the decision module 112 and the communication module 111 respectively implement different steps applicable to the data transmission method.
[0147] An embodiment of the present application provides a computing device 12 for executing the above-mentioned data transmission method.
[0148] In one example, the computing device 12 may include: Figure 9 The data transmission device 11 shown includes a communication module 111 and a decision module 112 .
[0149] In another example, Figure 10 As shown, computing device 12 includes bus 122, processor 124, memory 126, and communication interface 128. Processor 124, memory 126, and communication interface 128 communicate with each other via bus 122. Computing device 12 can be a server or a terminal device. It should be understood that this application does not limit the number of processors 124 and memory 126 in computing device 12.
[0150] The bus 122 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 10 The bus 122 may include a path for transmitting information between various components of the computing device 12 (eg, the memory 126, the processor 124, and the communication interface 128).
[0151] The processor 124 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0152] In the embodiment of the present application, the processor 124 executes the above Figure 6 For example, the size of first data sent by a first process running on a first computing node to a second process running on a second computing node is obtained, and based on the size of the first data, it is determined whether the first data can be sent in one message. If the first data can be sent in one message, the first computing node sends the first data to the second process using a non-blocking communication method. If the first data cannot be sent in one message, the first computing node sends the first data to the second process using a blocking communication method.
[0153] The memory 126 may include volatile memory, such as random access memory (RAM). The processor 124 may also include non-volatile memory, such as read-only memory (ROM), flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0154] The memory 126 stores executable program codes, and the processor 124 executes the executable program codes to implement the functions of the communication module 111 and the decision module 112, thereby implementing the data transmission method. That is, the memory 126 stores instructions for executing the data transmission method.
[0155] The communication interface 128 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 12 and other devices or a communication network.
[0156] The data transmission method disclosed in the above method embodiment can be applied to the processor 124, or implemented by the processor 124. The processor 124 can be an integrated circuit chip with signal processing capabilities.
[0157] During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in processor 124. The above-mentioned processor 124 can be a general-purpose processor, including a CPU, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete electron tube or transistor logic device, or a discrete hardware component. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 126, and processor 124 reads the information in memory 126 and, in conjunction with its hardware, completes the steps of the above method.
[0158] In one possible implementation, the processor 124 may also be used to execute a data transmission method. For specific implementation, reference may be made to the embodiments provided by the above-mentioned data transmission method, and the embodiments of the present application will not be described in detail here.
[0159] In the embodiment of the present application, the chip system can be composed of chips, or can include chips and other discrete devices.
[0160] The embodiment of the present application also provides a computing device cluster 14 for executing the above-mentioned data transmission method.
[0161] In one example, the computing device cluster 14 may include: Figure 9 The data transmission device 11 shown includes a communication module 111 and a decision module 112 .
[0162] In another example, Figure 11 As shown, the computing device cluster 14 includes at least one Figure 10 The computing device 12 shown includes a bus 122, a processor 124, a memory 126, and a communication interface 128. The processor 124, the memory 126, and the communication interface 128 communicate with each other via the bus 122. The computing device 12 may be a server or a terminal device.
[0163] In a possible implementation, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 12A possible implementation is shown. Figure 12 As shown, two computing devices 12A and 14B are connected via a network. Specifically, the connection to the network is achieved through a communication interface within each computing device. In this possible implementation, the memory 126 within computing device 12A stores instructions for executing the functions of communication module 111. Simultaneously, the memory 126 within computing device 12B stores instructions for executing the functions of decision module 112.
[0164] Figure 12 The connection method between the computing device clusters shown can be based on the data transmission method provided by the present application. It is necessary to obtain the size of the data when communicating between multiple processes, and to determine whether the data can be sent in one message, which involves a large amount of calculation. And when the first data can be sent in one message, the first computing node sends the first data to the second process in a non-blocking communication mode. When the first data cannot be sent in one message, the first computing node sends the first data to the second process in a blocking communication mode, setting a large amount of data transmission. Therefore, it is considered that the functions implemented by the communication module 111 are performed by the computing device 12A, and the functions of the communication mode decision model are performed by the computing device 12B.
[0165] It should be understood that Figure 12 The functionality of computing device 12A shown in FIG. 1 may also be performed by multiple computing devices 12 . Similarly, the functionality of computing device 12B may also be performed by multiple computing devices 12 .
[0166] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be executed on a computing device or stored on any available medium. When the computer program product is executed on at least one computing device, the at least one computing device executes the aforementioned data transmission method.
[0167] For example, when the computer program product is run on at least one computing device, it causes the at least one computing device to execute Figure 6 The data transmission method shown.
[0168] For another example, when the computer program product is run on at least one computing device, the at least one computing device is caused to execute Figure 7 The data transmission method shown.
[0169] The embodiment of the present application also provides a computer-readable storage medium. All or part of the processes in the above-mentioned method embodiments can be completed by a computer program to instruct the relevant hardware, and the program can be stored in the above-mentioned computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The computer-readable storage medium can be a terminal in any of the above-mentioned embodiments, such as: an internal storage unit including a data transmission end and / or a data receiving end, such as a hard disk or memory of the terminal. The above-mentioned computer-readable storage medium can also be an external storage device of the above-mentioned terminal, such as a plug-in hard disk equipped on the above-mentioned terminal, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. Further, the above-mentioned computer-readable storage medium can also include both the internal storage unit of the above-mentioned terminal and an external storage device. The above-mentioned computer-readable storage medium is used to store the above-mentioned computer program and other programs and data required by the above-mentioned terminal. The above-mentioned computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0170] It should be understood that the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution of this application complies with relevant laws and regulations and does not violate public order and good morals. For example, in the technical solution of this application, the processing of user personal information is carried out with the user's authorization, and the same description is not repeated here.
[0171] It should be noted that the terms "first" and "second" in the specification, claims, and drawings of this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products, or devices.
[0172] It should be understood that in the present application, "at least one (item)" refers to one or more, "more than one" refers to two or more, "at least two (items)" refers to two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0173] It should be understood that in the embodiments of the present application, "B corresponding to A" means that B is associated with A. For example, B can be determined based on A. It should also be understood that determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information. In addition, the "connection" in the embodiments of the present application refers to various connection methods, such as direct connection and indirect connection, to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.
[0174] Unless otherwise specified, the "transmission" (transmit / transmission) appearing in the embodiments of the present application refers to bidirectional transmission, including the actions of sending and / or receiving. Specifically, the "transmission" in the embodiments of the present application includes the sending of data, the receiving of data, or the sending of data and the receiving of data. In other words, the data transmission here includes uplink and / or downlink data transmission. Data may include channels and / or signals, uplink data transmission is uplink channel and / or uplink signal transmission, and downlink data transmission is downlink channel and / or downlink signal transmission. The "network" and "system" appearing in the embodiments of the present application express the same concept, and an all-optical network is an all-optical system.
[0175] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the grouping of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be grouped into different functional modules to complete all or part of the functions described above.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed communication devices and methods can be implemented in other ways. For example, the communication device embodiments described above are merely illustrative. For example, the grouping of modules or units is merely a logical functional grouping. In actual implementation, there may be other grouping methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0177] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0178] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0179] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device, such as a single-chip microcomputer, a chip, etc., or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media for storing program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0180] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A data transmission method, applied to a cluster system, characterized in that: The cluster system includes at least two computing nodes, wherein multiple processes communicating with each other are running in the at least two computing nodes, and the method includes: A first computing node among the at least two computing nodes obtains a size of first data sent by a first process running in the first computing node to a second process in a second computing node; The first computing node determines, based on the size of the first data, whether the first data can be completely sent through one message; When the first data can be sent completely through one message, the first computing node sends the first data to the second process through a non-blocking communication mode; When the first data cannot be completely sent through one message, the first computing node sends the first data to the second process through a blocking communication method.
2. The method according to claim 1, characterized in that The first computing node determines, according to the size of the first data, whether the first data can be completely sent through one message, including: The first computing node compares the size of the first data with a message length threshold; When the size of the first data is less than or equal to the message length threshold, determining that the first data can be completely sent through one message; When the size of the first data is greater than the message length threshold, it is determined that the first data cannot be completely sent through one message.
3. The method according to claim 2, characterized in that The method further comprises: The first computing node determines the message length threshold according to the network bandwidth between the first computing node and the second computing node and the delay of transmitting a data packet.
4. The method according to claim 2, characterized in that The method further comprises: The first computing node obtains a transmission time of a data packet transmitted between the first computing node and the second computing node; The data size corresponding to the transmission time is obtained by fitting a parallel computing model, and the data size corresponding to the transmission time is determined as a message length threshold.
5. The method according to any one of claims 1 to 4, characterized in that Also includes: storing the size of the first data and its corresponding communication mode; When the size of the second data sent by the first computing node is the same as the size of the first data, obtaining a communication mode corresponding to the size of the first data; The second data is sent using the acquired communication method.
6. A cluster system comprising at least two computing nodes, wherein the at least two computing nodes run a plurality of processes communicating with each other, characterized in that: The first computing node among the at least two computing nodes is configured to execute the data transmission method according to any one of claims 1 to 5, and send the first data to the second computing node among the at least two computing nodes.
7. The system according to claim 6, characterized in that The first computing node is used to compare the size of the first data with a message length threshold. When the size of the first data is less than or equal to the message length threshold, it is determined that the first data can be sent completely through one message. When the size of the first data is greater than the message length threshold, it is determined that the first data cannot be sent completely through one message.
8. The system according to claim 7, characterized in that The first computing node is also used to obtain the transmission time of a data packet between the first computing node and the second computing node, obtain the data size corresponding to the transmission time through parallel computing model fitting, and determine the data size corresponding to the transmission time as the message length threshold.
9. A computing device, characterized in that The computer comprises a processor and a memory; the processor is configured to execute instructions stored in the memory, so that the computing device executes the method according to any one of claims 1 to 5.
10. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device, the computing device is caused to perform the method according to any one of claims 1 to 5.