Software deployment method of heterogeneous multi-core coprocessor, multi-level distributed system and electronic equipment
By compiling independent programs for coprocessors in a multi-level distributed system and storing them on the disk of the main control CPU, the problem of insufficient deployment flexibility and scalability of coprocessor software in the prior art is solved, and efficient System management and computing capabilities.
Patent Information
- Application Number
- CN202411074613.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art solutions store coprocessor software in nonvolatile memory externally connected to the main processor, limiting the flexibility and scalability of the system and being unable to effectively adapt to rapidly changing computing needs and complex system environments.
In a multi-level distributed system, the compiler compiles independent programs for each coprocessor, generates configuration files corresponding to the chip logic identifier, copy the program to a folder, compresses and packages, and stores it on the disk of the main control CPU. At present, the software deployment of heterogeneous multi-core coprocessors is realized to improve the flexibility and maintainability of the system.
It improves the flexibility and maintainability of multi-level distributed systems, reduces dependence on non-volatile memory, reduces hardware costs and maintenance costs, adapts to different computing needs, and enhances the scalability and computing efficiency of the system.
Smart Images

Figure CN119002940A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a software deployment method for a heterogeneous multi-core coprocessor, a multi-level distributed system, and an electronic device. Background Art
[0002] With the development of multi-level distributed systems, higher requirements are placed on the deployment and distribution of coprocessor software to adapt to the rapidly changing computing requirements and complex system environment.
[0003] In the prior art, the coprocessor software is usually stored in a non-volatile memory external to the main processor, which limits the flexibility and scalability of the system. Summary of the invention
[0004] In order to solve one of the above-mentioned technical defects, the present application provides a software deployment method for a heterogeneous multi-core coprocessor, a multi-level distributed system, and an electronic device.
[0005] In a first aspect of the present application, a method for deploying software for a heterogeneous multi-core coprocessor is provided, wherein the heterogeneous multi-core coprocessor is located in a multi-level distributed system;
[0006] The multi-level distributed system includes a main control central processing unit CPU and multiple control CPUs controlled by the main control CPU;
[0007] The main control CPU is used to coordinate and control multi-level distributed systems;
[0008] Any control CPU manages multiple chips, and any control CPU is used to forward instructions and messages of the main control CPU to the managed chips, and feed back messages of the managed chips to the main control CPU;
[0009] Any chip includes a main processor and multiple coprocessors;
[0010] All chips in the multi-level distributed system are in a three-dimensional network structure, and each chip has a unique logical identifier in the three-dimensional network;
[0011] The method includes:
[0012] Use the compiler to compile independent programs for each coprocessor on the chip;
[0013] Generate a configuration file related to molecular dynamics calculation, which corresponds to the logical identifier of the chip; store the configuration file in a folder that matches the corresponding logical identifier;
[0014] Copy all coprocessor programs to each folder;
[0015] Compress and pack each folder to obtain the corresponding compressed package;
[0016] Store all compressed packages on the disk of the main control CPU.
[0017] Optionally, the code base of each coprocessor is completely independent;
[0018] The compiler compiles independent programs for each coprocessor on the chip, including:
[0019] Create an independent code base for each coprocessor;
[0020] Compile the program for each coprocessor through the compiler;
[0021] Generates a standalone coprocessor executable file;
[0022] Use the executable file as the program for this coprocessor.
[0023] Optionally, the code base of each coprocessor is not completely independent;
[0024] The compiler compiles independent programs for each coprocessor on the chip, including:
[0025] Grouping coprocessors that share the same code base into one group to form multiple coprocessor groups;
[0026] Establish independent code base for each coprocessor group;
[0027] Compile the program for each coprocessor group through the compiler;
[0028] generating a coprocessor executable file for each coprocessor group;
[0029] The executable file of each group is used as the program of each coprocessor in the group.
[0030] Optionally, generate configuration files related to molecular dynamics calculations, including:
[0031] Obtain the initial structure file of the molecular system;
[0032] Automatically assign force field parameters to molecular systems;
[0033] Generate topology files and coordinate files for the molecular system.
[0034] Create a configuration file template;
[0035] Select and install the mathematical library for the simulation software;
[0036] Generate a configuration file based on the configuration file template;
[0037] According to the three-dimensional space network and coprocessor allocation scheme, the configuration file is bound to the corresponding logical identifier.
[0038] Optionally, after generating the configuration file according to the configuration file template, the following is further included:
[0039] Integrate configuration files and math libraries into simulation software.
[0040] Optionally, after storing all compressed packages on the disk of the main control CPU, it also includes:
[0041] After receiving the computing task, distribute the compressed package.
[0042] Optionally, after receiving the computing task, a compressed package is distributed, including:
[0043] The main control CPU determines the target compressed package to be distributed according to the received computing task;
[0044] The main control CPU distributes the target compressed package to the corresponding control CPU according to the three-dimensional space network;
[0045] The corresponding control CPU distributes the target compressed package to the corresponding chip; the logic identifier of the corresponding chip is the same as the logic identifier corresponding to the target compressed package;
[0046] The main processor of the corresponding chip receives the target compression, decompresses and verifies it;
[0047] After the verification is passed, the main processor of the corresponding chip loads the decompressed configuration file into the corresponding memory, and loads the coprocessor program into the memory of the coprocessor according to the format parsing.
[0048] Optionally, each grid point in the grid represents a chip;
[0049] The method also includes:
[0050] Define the size of the grid, where the size includes the number of rows, columns, and layers;
[0051] The three-dimensional coordinates [0,0,0] of the origin are generated according to the size, wherein the logical identifier of the chip represented by the origin is 0.
[0052] Generate the edges of the grid according to the origin connection rule, where each edge consists of two grid points;
[0053] Generate mesh faces based on edges, where each face consists of four edges;
[0054] Generates volume elements of a mesh based on faces, where each volume element is composed of six faces.
[0055] In a second aspect of the present application, a multi-level distributed system is provided, the multi-level distributed system comprising a main control central processing unit CPU and a plurality of control CPUs controlled by the main control CPU;
[0056] The main control CPU is used to coordinate and control the multi-level distributed system by executing the steps of the main control CPU in the first aspect above;
[0057] Any control CPU manages multiple chips, and any control CPU is used to forward instructions and messages of the main control CPU to the managed chips by executing the steps of the control CPU in the first aspect above, and feed back messages of the managed chips to the main control CPU;
[0058] Any chip includes a main processor and a plurality of coprocessors; the main processor is used to execute the steps of the main processor of the chip in the first aspect above;
[0059] All chips in the multi-level distributed system present a three-dimensional spatial network structure, and each chip has a unique logical identifier in the three-dimensional spatial network.
[0060] A third aspect of the present application provides an electronic device, characterized in that the electronic device is configured with a multi-level distributed system as described in the second aspect above.
[0061] The present application provides a software deployment method for a heterogeneous multi-core coprocessor, a multi-level distributed system, and an electronic device, wherein the heterogeneous multi-core coprocessor is located in the multi-level distributed system; the multi-level distributed system includes a main control CPU and multiple control CPUs; any control CPU manages multiple chips, and any chip includes a main processor and multiple coprocessors; all chips in the multi-level distributed system are in a three-dimensional network structure, and each chip has a unique logical identifier in the three-dimensional network; the method compiles an independent program for each coprocessor on the chip through a compiler; generates a configuration file related to molecular dynamics calculation, and the configuration file corresponds to the logical identifier of the chip; stores the configuration file in a folder matching the corresponding logical identifier; copies the programs of all coprocessors to each folder; compresses and packages each folder to obtain a corresponding compressed package; stores all compressed packages on the disk of the main control CPU, thereby realizing the software deployment of the heterogeneous multi-core coprocessor in the multi-level distributed system and improving the flexibility and maintainability of the multi-level distributed system. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0063] Figure 1 A schematic diagram of the structure of a multi-level distributed system provided in an embodiment of the present application.
[0064] Figure 2 A schematic diagram of the structure of a chip provided in an embodiment of the present application.
[0065] Figure 3 A flowchart of a software deployment method for a heterogeneous multi-core coprocessor provided in an embodiment of the present application;
[0066] Figure 4 A flowchart of a method of using a compiler to compile independent programs for each coprocessor on a chip when the code bases of each coprocessor are completely independent provided in an embodiment of the present application;
[0067] Figure 5 A flowchart of a method of using a compiler to compile independent programs for each coprocessor on a chip when the code bases of each coprocessor are not completely independent provided in an embodiment of the present application;
[0068] Figure 6 A flowchart of another method for deploying software for a heterogeneous multi-core coprocessor provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0070] In the process of implementing this application, the inventors found that with the development of multi-level distributed systems, higher requirements are placed on the deployment and distribution of coprocessor software to adapt to rapidly changing computing needs and complex system environments. The existing technical solutions usually store the coprocessor software in a non-volatile memory external to the main processor, which limits the flexibility and scalability of the system.
[0071] In response to the above problems, the present application provides a software deployment method for a heterogeneous multi-core coprocessor, a multi-level distributed system, and an electronic device, wherein the heterogeneous multi-core coprocessor is located in the multi-level distributed system; the multi-level distributed system includes a main control CPU and multiple control CPUs; any control CPU manages multiple chips, and any chip includes a main processor and multiple coprocessors; all chips in the multi-level distributed system are in a three-dimensional network structure, and each chip has a unique logical identifier in the three-dimensional network; the method compiles an independent program for each coprocessor on the chip through a compiler; generates a configuration file related to molecular dynamics calculations, and the configuration file corresponds to the logical identifier of the chip; stores the configuration file in a folder matching the corresponding logical identifier; copies the programs of all coprocessors to each folder; compresses and packages each folder to obtain a corresponding compressed package; stores all compressed packages on the disk of the main control CPU, thereby realizing the software deployment of the heterogeneous multi-core coprocessor in the multi-level distributed system and improving the flexibility and maintainability of the multi-level distributed system.
[0072] This embodiment provides a method for deploying software for a heterogeneous multi-core coprocessor, wherein the heterogeneous multi-core coprocessor involved in the method is located in a multi-level distributed system.
[0073] See also Figure 1 The multi-level distributed system includes a main control CPU (Central Processing Unit) and multiple control CPUs controlled by the main control CPU.
[0074] The main control CPU is used to coordinate and control multi-level distributed systems.
[0075] Any control CPU manages multiple chips, and any control CPU is used to forward instructions and messages of the main control CPU to the managed chips, and feed back messages of the managed chips to the main control CPU.
[0076] See also Figure 2 , any chip includes a main processor and multiple coprocessors.
[0077] The main processor is used to execute the internal ecological initialization program of the coprocessor and load the calculation program.
[0078] In addition, data and instructions can be transmitted between the main control CPU, the control CPU and the chip through the network communication module.
[0079] In addition, all chips in the multi-level distributed system present a three-dimensional spatial network structure, and each chip has a unique logical identifier in the three-dimensional spatial network.
[0080] Each grid point in the grid represents a chip.
[0081] The generation process of the three-dimensional space network is:
[0082] 1. Define the grid size.
[0083] Defines the size of the grid, where the size includes the number of rows, columns, and layers.
[0084] For example, the number of rows is 8, the number of columns is 8, and the number of levels is 8.
[0085] 2. Generate the origin
[0086] Generate the three-dimensional coordinates of the origin [0,0,0] according to the size.
[0087] The logic identification of the chip represented by the origin is 0, such as ID0.
[0088] 3. Generate edges
[0089] Generate the edges of the mesh according to the origin connection rule.
[0090] Among them, each edge consists of two grid points.
[0091] That is, in the step of generating edges, the edges of the mesh are generated according to the origin connection rule, connecting each vertex to its adjacent vertices.
[0092] 4. Generate surface.
[0093] Generates faces of a mesh based on its edges.
[0094] Among them, each face consists of four edges.
[0095] 5. Generate body units.
[0096] Generates volume elements from a mesh based on a surface.
[0097] Each volume element consists of six faces.
[0098] For example, the entire grid is composed of 8*8*8 chips, and each grid point represents the position of each chip in the three-dimensional space grid structure. For example, the three-dimensional coordinate [0,0,0] corresponds to the chip's logical ID 0, [1,0,0] corresponds to the chip's logical ID 1, ..., [7,0,0] corresponds to the chip's logical ID 7, [0,1,0] corresponds to the chip's logical ID 8, [0,2,0] corresponds to the chip's logical ID 9, and so on. The 512 grid points correspond to 512 chip logical IDs respectively.
[0099] The chips of the multi-level distributed system are organized into a three-dimensional spatial grid structure, which allows the system to distribute computing resources in three dimensions, improving the parallel processing capability and data transmission efficiency of the multi-level distributed system. Each chip has a unique logical ID in the grid to identify its position in the system.
[0100] Through this device configuration, the multi-level distributed system can effectively manage and utilize distributed computing resources to achieve efficient task distribution and data processing. This configuration is particularly suitable for application scenarios that require large-scale parallel computing and high scalability, such as scientific simulation, big data analysis, and cloud computing services.
[0101] See also Figure 3 This embodiment provides a software deployment method for a heterogeneous multi-core coprocessor, and the implementation process of the method is as follows:
[0102] 301 , using a compiler to compile independent programs for each coprocessor on the chip.
[0103] In step 301, the coprocessor program is compiled. For example, a compiler is used to compile independent programs for each coprocessor on the chip. These programs are designed for specific computing tasks to ensure efficient execution. The independence of each coprocessor program also makes the coprocessor code more flexible and lightweight.
[0104] Depending on the computing tasks, the code bases of multiple coprocessors may be completely independent, or some coprocessor code bases may be shared. Depending on whether the coprocessor codes can be shared, step 301 is implemented using two different solutions to maintain uniformity when deploying the coprocessor program.
[0105] Therefore, the compilation implementation varies depending on whether the coprocessor code base is independent or not.
[0106] If the code bases of the coprocessors are completely independent, the implementation process of step 301 is:
[0107] 1-1, establish an independent code base for each coprocessor.
[0108] 1-2, compile the program for each coprocessor through the compiler.
[0109] 1-3, Generate an independent coprocessor executable file.
[0110] 1-4, use the executable file as the program for the coprocessor.
[0111] like Figure 4As shown, if there are N coprocessors on a chip, when the code bases of the N coprocessors are completely independent, each coprocessor will have its unique functions and computing tasks. In this case, each coprocessor program needs to be compiled separately.
[0112] In some cases, multiple coprocessors may perform similar tasks or functions, so that they can share a code base. If the code bases of the coprocessors are not completely independent, the implementation process of step 301 is:
[0113] 2-1, the coprocessors that share the same code base are grouped together to form multiple coprocessor groups.
[0114] 2-2, establish an independent code base for each coprocessor group.
[0115] 2-3, compile the program for each coprocessor group through the compiler.
[0116] 2-4, Generate a coprocessor executable file for each coprocessor group.
[0117] 2-5, the executable file of each group is used as the program of each coprocessor in the group.
[0118] For example, if a group has x coprocessors, then the executable file of the group is copied x times, and each copy serves as a program for a coprocessor.
[0119] like Figure 5 As shown, if there are N coprocessors on a chip, coprocessors 1 and 2 perform similar computing tasks and can share a code base, while coprocessors 3 to N perform another type of task and can share another code base. For the coprocessor groups that share the code base (such as coprocessors 1 and 2, and coprocessors 3 to N), they are compiled separately to generate dedicated programs for each group.
[0120] 302 , generating a configuration file related to molecular dynamics calculation, where the configuration file corresponds to the logic identifier of the chip.
[0121] Step 302 may generate configuration files, for example, configuration files related to molecular dynamics calculations, which are strongly bound to the logical identifiers of the chip in the three-dimensional grid structure (ie, the configuration files correspond to the logical identifiers of the chip).
[0122] The configuration files include but are not limited to: calculation parameters, data structure definitions, and algorithm settings.
[0123] In a specific implementation, the implementation process of step 302 may be:
[0124] 3-1, obtain the initial structure file of the molecular system.
[0125] Step 3-1 can realize the preparation of input files, such as obtaining the initial structure file of the molecular system and preprocessing it using molecular modeling software.
[0126] 3-2, automatically assign force field parameters to molecular systems.
[0127] Step 3-2 can realize the force field parameter allocation, such as selecting a suitable force field and using corresponding tools to automatically allocate force field parameters for the molecular system.
[0128] 3-3. Generate topology file and coordinate file of the molecular system.
[0129] Step 3-3 can realize parameter file generation, such as generating topology files and coordinate files required for the molecular system.
[0130] 3-4, Create a configuration file template.
[0131] Steps 3-4 can configure a configuration file template, such as creating a configuration file template, including simulation parameter settings (time step, simulation temperature, pressure control, boundary conditions, etc.).
[0132] 3-5. Select and install the mathematical library for the simulation software.
[0133] Steps 3-5 can prepare the third-party mathematical library required for molecular dynamics calculations, such as selecting and installing the required mathematical library according to the requirements of the simulation software.
[0134] 3-6. Generate a configuration file based on the configuration file template.
[0135] Steps 3-6 can generate the final configuration file by an automated script, such as using an automated script to combine the configuration file template and the preprocessing result to generate the final configuration file.
[0136] 3-7, bind the configuration file with the corresponding logical identifier according to the three-dimensional space network and coprocessor allocation scheme.
[0137] For example, third-party software is used to bind the configuration file with the corresponding logical identifier according to the three-dimensional space network and the coprocessor allocation scheme.
[0138] In addition, a specific configuration file can be generated according to the chip architecture and coprocessor allocation scheme to ensure that the computing tasks and logical identifiers of each coprocessor are correctly bound.
[0139] In addition, after generating the configuration file according to the configuration file template, the configuration file and the mathematical library will be integrated into the simulation software. For example, the generated configuration file and the mathematical library are integrated into the third-party molecular dynamics simulation software as input parameters.
[0140] 303, store the configuration file in a folder that matches the corresponding logical identifier.
[0141] The folders can be organized through step 303. For example, the configuration files are stored in X folders respectively, each folder is named after the logic identifier of the chip, such as id_1, id_2, etc., and each folder contains configuration files related to the logic identifier of a specific chip.
[0142] 304, copy all the coprocessor programs to each folder.
[0143] The coprocessor program can be copied through step 303. For example, if there are N coprocessors and X chips, then in step 303, the programs of the N coprocessors will be copied to X copies and placed in corresponding folders, so that each folder contains the coprocessor program related to the specific chip logic identifier.
[0144] After executing steps 303 and 304, each folder contains the coprocessor program and configuration file associated with the specific chip logic identifier.
[0145] 305, compress and package each folder to obtain a corresponding compressed package.
[0146] Compression and packaging can be achieved through step 305. For example, each folder is compressed and packaged into a .tar.gz format to generate compressed packages such as id_1.tar.gz, id_2.tar.gz, etc.
[0147] 306, store all compressed packages on the disk of the main control CPU.
[0148] The compressed packages can be stored through step 306. For example, all compressed packages are stored on the disk of the main control CPU. This centralized storage method reduces the use of non-volatile memory on each chip board and reduces hardware costs.
[0149] After executing step 306, the compressed package will be distributed after receiving the computing task.
[0150] The distribution process is:
[0151] 4-1, the main control CPU determines the target compressed package to be distributed according to the received computing task.
[0152] For example, the main control CPU distributes the corresponding id_x.tar.gz compressed package to the corresponding control CPU node according to the topological structure based on the received computing task.
[0153] 4-2, the main control CPU distributes the target compressed package to the corresponding control CPU according to the three-dimensional space network.
[0154] For example, the control CPU further distributes the compressed packets to the chips corresponding to the logical identifiers in the three-dimensional space grid.
[0155] The compressed package can be distributed through steps 4-1 and 4-2.
[0156] 4-3, the corresponding control CPU distributes the target compressed package to the corresponding chip.
[0157] The logic identifier of the corresponding chip is the same as the logic identifier corresponding to the target compressed package.
[0158] The CPU distribution can be controlled through step 4-3.
[0159] 4-4, the main processor of the corresponding chip receives the target compression and then decompresses and verifies it.
[0160] Decompression and verification can be achieved through step 4-4. For example, the main processor on the chip receives the compressed package, decompresses and verifies it to ensure the integrity and correctness of the software package.
[0161] 4-5. After the verification is passed, the main processor of the corresponding chip loads the decompressed configuration file into the corresponding memory, and loads the coprocessor program into the memory of the coprocessor according to the format parsing.
[0162] The file can be loaded through steps 4-5. For example, the main processor of the chip loads the decompressed file into the corresponding memory, and loads the coprocessor program into the memory of the coprocessor according to the format parsing, thereby completing the deployment and distribution of the software.
[0163] Based on the software deployment method and distribution process of the heterogeneous multi-core coprocessor provided in this embodiment, as shown in FIG. Figure 6 As shown:
[0164] Deployment process:
[0165] 1. Compile the coprocessor program;
[0166] 2. Generate configuration files;
[0167] 3. Organize folders;
[0168] 4. Copy the coprocessor program;
[0169] 5. Compression and packaging;
[0170] 6. Store the compressed package.
[0171] Distribution process:
[0172] 1. Distribute compressed packages;
[0173] 2. Control CPU distribution;
[0174] 3. Decompression and verification;
[0175] 4. Load the file.
[0176] The software deployment method for heterogeneous multi-core coprocessors provided in this embodiment not only improves the flexibility and maintainability of the system, but also facilitates debugging and use by customers and developers. Developers can only update the coprocessor program without redeploying the configuration file, and customers can modify the computing system by regenerating the configuration file without redeploying the entire software package, which significantly improves the efficiency of the system and the user experience.
[0177] The software deployment method for a heterogeneous multi-core coprocessor provided in this embodiment improves the startup efficiency and computing efficiency of a multi-level distributed system by optimizing the deployment and distribution of coprocessor software.
[0178] The software deployment method for the heterogeneous multi-core coprocessor provided in this embodiment reduces the dependence on non-volatile memory and reduces hardware cost and maintenance cost.
[0179] The software deployment method for the heterogeneous multi-core coprocessor provided in this embodiment realizes the centralized management and distribution of software, makes the system more adaptable to different computing requirements, and enhances the flexibility and scalability of the system.
[0180] In addition, before executing the software deployment method of the heterogeneous multi-core coprocessor provided in this embodiment, the heterogeneous multi-core coprocessor will be synchronously started, and the synchronous startup implementation process is as follows:
[0181] 701, the main control CPU queries the startup status of the main processors of all chips through the control CPU.
[0182] The query process of step 701 is:
[0183] 701-1, the main control CPU sends a first message to all control CPUs.
[0184] The first message is used to query the startup status of the main processor of the chip.
[0185] 701-2, the control CPU forwards the first message to each chip it manages.
[0186] 701-3, after receiving the first message, the main processor of the chip checks its own startup status.
[0187] 701-4, the main processor of the chip generates a first response message.
[0188] The first response message includes a startup status.
[0189] The startup status is started or not started.
[0190] 701-5, the main processor of the chip feeds back the first response message to the control CPU and initializes the external hardware of the coprocessor.
[0191] 701-6, the control CPU forwards the first response message to the main control CPU.
[0192] In a specific implementation, step 701 can be repeatedly executed within a period of time to obtain an accurate startup state. For example, the CPU is controlled to start timer T0. If timer T0 does not reach the preset duration, steps 701-1 to 701-6 are repeatedly executed, and the first response message obtained last time when timer T0 reaches the preset duration is used as the final first response message. For another example, the CPU is controlled to start timer T0. After the first execution of step 701-1, if the first response message is not obtained, step 701-1 is repeatedly executed before timer T0 reaches the preset duration until the first response message is obtained.
[0193] 702 , after the main control CPU determines that all main processors are started based on the startup status, the main control CPU queries the external hardware initialization status of the coprocessors of all chips through the control CPU.
[0194] The query process of step 702 is:
[0195] 702-1, the main control CPU sends a second message to all control CPUs.
[0196] The second message is used to query the initialization state of the external hardware of the coprocessor.
[0197] 702-2, the control CPU forwards the second message to each chip managed by it.
[0198] 702-3, after receiving the second message, the main processor of the chip checks the initialization state of the external hardware of the coprocessor.
[0199] 702-4, the main processor of the chip generates a second response message.
[0200] The second response message includes the initialization status of the external hardware of all coprocessors.
[0201] The initialization status of the external hardware is initialization completed or initialization not completed.
[0202] 702-5, the main processor of the chip feeds back the second response message to the control CPU.
[0203] 702-6, the control CPU forwards the second response message to the main control CPU.
[0204] In a specific implementation, step 702 can be repeatedly executed within a period of time to obtain an accurate external hardware initialization state. For example, the CPU is controlled to start timer T1. If timer T1 does not reach a preset duration, steps 702-1 to 702-6 are repeatedly executed, and the second response message obtained last time when timer T1 reaches the preset duration is used as the final second response message. For another example, the CPU is controlled to start timer T1. After executing step 702-1 for the first time, if the second response message is not obtained, step 702-1 is repeatedly executed before timer T1 reaches the preset duration until the second response message is obtained.
[0205] 703, the main control CPU determines that all external hardware has completed initialization based on the external hardware initialization state, and then loads the internal ecological initialization program and the calculation program through the coprocessors of all chips controlled by the control CPU.
[0206] The loading process of step 703 is:
[0207] 703-1, the main control CPU sends a first instruction to all control CPUs.
[0208] The first instruction is used to load the internal ecological initialization program of the coprocessor.
[0209] 703-2, the control CPU forwards the first instruction to each chip it manages.
[0210] 703-3, after receiving the first instruction, the main processor of the chip loads the internal ecological initialization program of all coprocessors.
[0211] The implementation process of step 703-3 is as follows Figure 4 As shown:
[0212] 401, the main processor of the chip reads the internal ecological initialization programs of all coprocessors from the memory to the preset memory location in sequence.
[0213] 402 , the main processor of the chip sequentially moves the internal ecological initialization programs of all coprocessors from the memory locations to the preset internal storage areas of the coprocessors through direct memory access (DMA).
[0214] 403, the main processor of the chip writes the preset registers inside the chip and runs all the coprocessors.
[0215] 404 , if the main processor of the chip receives the internal ecosystem initialization completion message of all the coprocessors, it determines that the internal ecosystem initialization program is loaded completely.
[0216] After executing step 703-1, the main control CPU sends the first instruction to all control CPUs, the main control CPU determines that all internal ecological initialization programs have been loaded. The determination process is as follows:
[0217] 501. The main control CPU sends a third message to all control CPUs.
[0218] Among them, the third message is used to query the loading status of the internal ecological initialization program.
[0219] 502. Control the CPU to forward the third message to each chip managed by it.
[0220] 503. The main processor of the chip receives the third message and determines that the internal ecological initialization program has been loaded and completed.
[0221] 504. The main processor of the chip generates a third response message.
[0222] Among them, the third response message includes the internal ecological initialization program loading completion status.
[0223] Among them, the internal ecological initialization program loading completion status is loading completed, or not loaded.
[0224] 505 , the main processor of the chip feeds back the third response message to the control CPU.
[0225] 506. The control CPU forwards the third response message to the main control CPU.
[0226] In a specific implementation, steps 501 to 506 can be repeatedly executed within a period of time to obtain an accurate internal ecological initialization program loading completion status. For example, the CPU is controlled to start timer T2. If timer T2 does not reach the preset duration, steps 501 to 506 are repeated, and the third response message obtained for the last time when timer T2 reaches the preset duration is used as the final third response message. For another example, the CPU is controlled to start timer T2. After executing step 501 for the first time, if the third response message is not obtained, step 501 is repeated before timer T2 reaches the preset duration until the third response message is obtained.
[0227] 703-4, after the main control CPU determines that all internal ecological initialization programs have been loaded, it sends a second instruction to all control CPUs.
[0228] The second instruction is used to load the computing program of the coprocessor.
[0229] 703-5, after receiving the second instruction, the main processor of the chip loads the computing programs of all coprocessors.
[0230] In addition, after executing step 703-4 in which the main control CPU sends the second instruction to all control CPUs, the main control CPU determines that all computing programs have been loaded. The determination process is as follows:
[0231] 601. The main control CPU sends a fourth message to all control CPUs.
[0232] The fourth message is used to query the loading status of the computing program.
[0233] 602. Control the CPU to forward the fourth message to each chip managed by the CPU.
[0234] 603. The main processor of the chip receives the fourth message and determines whether the loading of the computing program is completed.
[0235] 604. The main processor of the chip generates a fourth response message.
[0236] The fourth response message includes the computing program loading completion status.
[0237] The calculation program loading completion status is loading completed, or not loading completed.
[0238] 605 , the main processor of the chip feeds back the fourth response message to the control CPU.
[0239] 606. The control CPU forwards the fourth response message to the main control CPU.
[0240] In a specific implementation, steps 601 to 606 can be repeatedly executed within a period of time to obtain an accurate status of the completion of the loading of the computing program. For example, the CPU is controlled to start timer T3. If timer T3 does not reach the preset duration, steps 601 to 606 are repeatedly executed, and the fourth response message obtained for the last time when timer T3 reaches the preset duration is used as the final fourth response message. For another example, the CPU is controlled to start timer T3. After executing step 601 for the first time, if the fourth response message is not obtained, step 601 is repeatedly executed before timer T3 reaches the preset duration until the fourth response message is obtained.
[0241] In addition, after receiving the fourth response message, the main control CPU will also confirm, based on the fourth response message, that all internal ecological initialization programs and calculation programs have been loaded.
[0242] Because the second instruction is sent only after the control CPU determines that all internal ecological initialization programs have been loaded, if it is determined according to the fourth response message that all computing programs have been loaded, it is confirmed that all internal ecological initialization programs and computing programs have been loaded.
[0243] 704. After confirming that all internal ecological initialization programs and calculation programs have been loaded, the main control CPU confirms that the synchronous startup is completed.
[0244] Once all internal ecosystem initialization programs and calculation programs have been loaded, it is considered that the chip coprocessor is ready for calculation.
[0245] It should be noted that the preset durations of the timers may be the same or different, and this embodiment does not limit this.
[0246] The above startup process can ensure that the initialization of all coprocessors in the multi-level distributed system is completed synchronously, thereby realizing the synchronous startup of the coprocessors and ensuring the consistency of the starting state of the ecosystem.
[0247] The following is an explanation of the synchronous startup process of the heterogeneous multi-core coprocessor:
[0248] 1. The main control CPU starts the timer T1 and sends the first message to all control CPUs through the network communication module to check whether the main processors of all chips have been started;
[0249] 2. After receiving the first message, the control CPU transfers it to each chip it manages;
[0250] 3. After receiving the first message, the main processor of the chip checks its own startup status;
[0251] 4. The main processor of the chip generates a first response message;
[0252] 5. The main processor of the chip feeds back the first response message to the control CPU and initializes the external hardware of the coprocessor;
[0253] 6. The control CPU forwards the first response message to the main control CPU;
[0254] 7. After the control CPU determines that all main processors are started, it starts the timer T1 and sends a second message to check the initialization status of the external hardware of the coprocessors of all chips;
[0255] 8. Control the CPU to forward the second message to each chip it manages;
[0256] 9. After receiving the second message, the main processor of the chip checks the initialization status of the external hardware of the coprocessor;
[0257] 10. The main processor of the chip generates a second response message;
[0258] 11. The main processor of the chip feeds back the second response message to the control CPU;
[0259] 12. The control CPU forwards the second response message to the main control CPU;
[0260] 13. After the main control CPU determines that all external hardware has completed initialization, it sends the first instruction to all control CPUs;
[0261] 14. Control the CPU to forward the first instruction to each chip it manages;
[0262] 15. After receiving the first instruction, the main processor of the chip loads the internal ecological initialization program of all coprocessors;
[0263] 16. After the main control CPU sends the first instruction to all control CPUs, it starts the timer T2 and sends the third message to all control CPUs;
[0264] 17. Control the CPU to forward the third message to each chip managed by it;
[0265] 18. The main processor of the chip receives the third message and determines that the internal ecological initialization program has been loaded;
[0266] 19. The main processor of the chip generates a third response message;
[0267] 20. The main processor of the chip feeds back the third response message to the control CPU;
[0268] 21. The control CPU forwards the third response message to the main control CPU;
[0269] 22. After the main control CPU determines that all internal ecological initialization programs have been loaded, it sends a second instruction to all control CPUs;
[0270] 23. After receiving the second instruction, the main processor of the chip loads the calculation programs of all coprocessors;
[0271] 24. After the main control CPU sends the second instruction to all control CPUs, it starts the timer T3 and sends a fourth message to all control CPUs;
[0272] 25. Control the CPU to forward the fourth message to each chip managed by it;
[0273] 27. The main processor of the chip receives the fourth message and determines that the loading of the computing program is complete;
[0274] 28. The main processor of the chip generates a fourth response message;
[0275] 29. The main processor of the chip feeds back the fourth response message to the control CPU;
[0276] 30. The control CPU forwards the fourth response message to the main control CPU;
[0277] 31. After confirming that all internal ecological initialization programs and calculation programs have been loaded, the main control CPU confirms that the synchronous startup is completed.
[0278] The above-mentioned synchronous startup process can solve the technical problem of synchronous startup of heterogeneous multi-core coprocessors in a multi-level distributed system, and can ensure that all coprocessors in the system complete initialization synchronously, thereby achieving synchronous startup of the ecosystem.
[0279] The software deployment method for a heterogeneous multi-core coprocessor provided in this embodiment reduces the use of non-volatile memory, reduces costs, and improves the flexibility and maintainability of the system by centrally storing and distributing coprocessor software.
[0280] The present embodiment provides a software deployment method for a heterogeneous multi-core coprocessor, which is located in a multi-level distributed system; the multi-level distributed system includes a main control CPU and multiple control CPUs controlled by the main control CPU; the main control CPU is used to coordinate and control the multi-level distributed system; any control CPU manages multiple chips, and any control CPU is used to forward instructions and messages of the main control CPU to the managed chip, and to feed back messages of the managed chip to the main control CPU; any chip includes a main processor and multiple coprocessors; all chips in the multi-level distributed system are in a three-dimensional spatial network structure, and each chip has a unique logical identifier in the three-dimensional spatial network; the method compiles independent programs for each coprocessor on the chip through a compiler; generates a configuration file related to molecular dynamics calculation, and the configuration file corresponds to the logical identifier of the chip; stores the configuration file in a folder matching the corresponding logical identifier; copies all programs of all coprocessors to each folder; compresses and packages each folder to obtain a corresponding compressed package; stores all compressed packages on the disk of the main control CPU, thereby realizing software deployment of heterogeneous multi-core coprocessors in the multi-level distributed system and improving the flexibility and maintainability of the multi-level distributed system.
[0281] Based on the same inventive concept of the software deployment method for heterogeneous multi-core coprocessors, this embodiment provides a multi-level distributed system, which includes a main control central processing unit CPU and multiple control CPUs controlled by the main control CPU.
[0282] The main control CPU is used to coordinate and control the multi-level distributed system by executing the steps of the main control CPU in the software deployment method of the heterogeneous multi-core coprocessor.
[0283] Any control CPU manages multiple chips. Any control CPU is used to forward instructions and messages of the main control CPU to the managed chips by executing the steps of controlling the CPU in the software deployment method of the heterogeneous multi-core coprocessor, and to feed back the messages of the managed chips to the main control CPU.
[0284] Any chip includes a main processor and multiple coprocessors. The main processor is used to execute the steps of the main processor of the chip in the software deployment method of the heterogeneous multi-core coprocessor.
[0285] For example, the software deployment method for heterogeneous multi-core coprocessors is Figure 3 The method described in the illustrated embodiment.
[0286] The multi-level distributed system provided in this embodiment compiles an independent program for each coprocessor on the chip through a compiler; generates a configuration file related to molecular dynamics calculations, and the configuration file corresponds to the logical identifier of the chip; stores the configuration file in a folder matching the corresponding logical identifier; copies the programs of all coprocessors to each folder; compresses and packages each folder to obtain a corresponding compressed package; stores all compressed packages on the disk of the main control CPU, thereby realizing the software deployment of heterogeneous multi-core coprocessors in the multi-level distributed system and improving the flexibility and maintainability of the multi-level distributed system.
[0287] Based on the same inventive concept of the software deployment method for a heterogeneous multi-core coprocessor, this embodiment provides an electronic device configured with a multi-level distributed system.
[0288] The multi-level distributed system includes a main control central processing unit (CPU) and a plurality of control CPUs controlled by the main control CPU.
[0289] The main control CPU is used to coordinate and control the multi-level distributed system by executing the steps of the main control CPU in the software deployment method of the heterogeneous multi-core coprocessor.
[0290] Any control CPU manages multiple chips. Any control CPU is used to forward instructions and messages of the main control CPU to the managed chips by executing the steps of controlling the CPU in the software deployment method of the heterogeneous multi-core coprocessor, and to feed back the messages of the managed chips to the main control CPU.
[0291] Any chip includes a main processor and multiple coprocessors. The main processor is used to execute the steps of the main processor of the chip in the software deployment method of the heterogeneous multi-core coprocessor.
[0292] All chips in the multi-level distributed system present a three-dimensional spatial network structure, and each chip has a unique logical identifier in the three-dimensional spatial network.
[0293] For example, the software deployment method for heterogeneous multi-core coprocessors is Figure 3 The method described in the illustrated embodiment.
[0294] In the electronic device provided in this embodiment, a compiler is used to compile independent programs for each coprocessor on the chip; a configuration file related to molecular dynamics calculation is generated, and the configuration file corresponds to the logical identifier of the chip; the configuration file is stored in a folder matching the corresponding logical identifier; the programs of all coprocessors are copied to each folder; each folder is compressed and packaged to obtain a corresponding compressed package; all compressed packages are stored on the disk of the main control CPU, thereby realizing the software deployment of heterogeneous multi-core coprocessors in a multi-level distributed system, and improving the flexibility and maintainability of the multi-level distributed system.
[0295] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0296] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0297] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0298] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0299] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0300] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0301] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A software deployment method for a heterogeneous multi-core coprocessor, characterized in that: The heterogeneous multi-core coprocessor is located in a multi-level distributed system; The multi-level distributed system includes a main control central processing unit (CPU) and a plurality of control CPUs controlled by the main control CPU; The main control CPU is used to coordinate and control the multi-level distributed system; Any control CPU manages multiple chips, and any control CPU is used to forward instructions and messages of the main control CPU to the managed chips, and feed back messages of the managed chips to the main control CPU; Any chip includes a main processor and multiple coprocessors; All chips in the multi-level distributed system are in a three-dimensional spatial network structure, and each chip has a unique logical identifier in the three-dimensional spatial network; The method comprises: Use the compiler to compile independent programs for each coprocessor on the chip; Generate a configuration file related to molecular dynamics calculation, where the configuration file corresponds to a logical identifier of the chip; Storing the configuration file in a folder that matches the corresponding logical identifier; Copy all coprocessor programs to each folder; Compress and pack each folder to obtain the corresponding compressed package; Store all compressed packages on the disk of the main control CPU.
2. The method according to claim 1, characterized in that The code base of each coprocessor is completely independent; The compiler is used to compile independent programs for each coprocessor on the chip, including: Create an independent code base for each coprocessor; Compile the program for each coprocessor through the compiler; Generates a standalone coprocessor executable file; Use the executable file as the program for this coprocessor.
3. The method according to claim 1, characterized in that The code base of each coprocessor is not completely independent; The compiler is used to compile independent programs for each coprocessor on the chip, including: Grouping coprocessors that share the same code base into one group to form multiple coprocessor groups; Establish independent code base for each coprocessor group; Compile the program for each coprocessor group through the compiler; generating a coprocessor executable file for each coprocessor group; The executable file of each group is used as the program of each coprocessor in the group.
4. The method according to claim 1, characterized in that: Generate configuration files related to molecular dynamics calculations, including: Obtain the initial structure file of the molecular system; Automatically assign force field parameters to molecular systems; Generate topology files and coordinate files of molecular systems; Create a configuration file template; Select and install the mathematical library for the simulation software; Generate a configuration file according to the configuration file template; According to the three-dimensional space network and coprocessor allocation scheme, the configuration file is bound to the corresponding logical identifier.
5. The method according to claim 4, characterized in that After generating the configuration file according to the configuration file template, the method further includes: Integrate configuration files and math libraries into simulation software.
6. The method according to claim 1, characterized in that After storing all compressed packages on the disk of the main control CPU, the method further includes: After receiving the computing task, the compressed package is distributed.
7. The method according to claim 6, characterized in that After receiving the computing task, distributing the compressed package includes: The main control CPU determines the target compressed package to be distributed according to the received computing task; The main control CPU distributes the target compressed package to the corresponding control CPU according to the three-dimensional space network; The corresponding control CPU distributes the target compressed package to the corresponding chip; the logic identifier of the corresponding chip is the same as the logic identifier corresponding to the target compressed package; The main processor of the corresponding chip receives the target compression, decompresses and verifies it; After the verification is passed, the main processor of the corresponding chip loads the decompressed configuration file into the corresponding memory, and loads the coprocessor program into the memory of the coprocessor according to the format parsing.
8. The method according to claim 1, characterized in that: Each grid point in the grid represents a chip; The method further comprises: Defining the size of the grid, wherein the size includes the number of rows, columns, and layers; Generate a three-dimensional coordinate [0,0,0] of the origin according to the size, wherein the logic identifier of the chip represented by the origin is 0; Generate the edges of the grid according to the origin connection rule, where each edge consists of two grid points; Generate mesh faces based on edges, where each face consists of four edges; Generates volume elements of a mesh based on faces, where each volume element is composed of six faces.
9. A multi-level distributed system, characterized in that: The multi-level distributed system includes a main control central processing unit (CPU) and a plurality of control CPUs controlled by the main control CPU; The main control CPU is used to coordinate and control the multi-level distributed system by executing the steps of the main control CPU in the method according to any one of claims 1 to 8; Any control CPU manages multiple chips, and any control CPU is used to forward instructions and messages of the main control CPU to the managed chips by executing the steps of controlling the CPU in the method according to any one of claims 1 to 8, and feed back messages of the managed chips to the main control CPU; Any chip includes a main processor and multiple coprocessors; the main processor is used to execute the steps of the main processor of the chip in any one of the methods described in claims 1-8; All chips in the multi-level distributed system are in a three-dimensional spatial network structure, and each chip has a unique logical identifier in the three-dimensional spatial network.
10. An electronic device, characterized in that: The electronic device is provided with the multi-level distributed system as claimed in claim 9.
