WO2015066922A1 - 并行仿真方法及装置 - Google Patents

并行仿真方法及装置 Download PDF

Info

Publication number
WO2015066922A1
WO2015066922A1 PCT/CN2013/086863 CN2013086863W WO2015066922A1 WO 2015066922 A1 WO2015066922 A1 WO 2015066922A1 CN 2013086863 W CN2013086863 W CN 2013086863W WO 2015066922 A1 WO2015066922 A1 WO 2015066922A1
Authority
WO
WIPO (PCT)
Prior art keywords
event
parallel
simulation
queue
priority
Prior art date
Application number
PCT/CN2013/086863
Other languages
English (en)
French (fr)
Inventor
孔德宝
郑云航
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2013/086863 priority Critical patent/WO2015066922A1/zh
Priority to CN201380038604.9A priority patent/CN105264530A/zh
Publication of WO2015066922A1 publication Critical patent/WO2015066922A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4831Task transfer initiation or dispatching by interrupt, e.g. masked with variable priority

Definitions

  • Embodiments of the present invention relate to computer simulation technologies, and in particular, to a parallel simulation method and apparatus. Background technique
  • Embodiments of the present invention provide a parallel simulation method and apparatus for achieving consistency between parallel simulation results and serial simulation results, and improving the ease of use of parallel simulation techniques.
  • a parallel simulation method including:
  • the method further includes:
  • the second event is inserted into the serial event queue.
  • the second event is inserted in parallel according to a priority of the second event Event queue, including:
  • the second event is inserted in parallel according to a priority of the second event Event queue, including:
  • the second event is inserted into the parallel event queue based on the priority of the second event in the serial event queue.
  • the second event is generated in the process, and determining whether the second event is a parallel event further includes: if it is determined that the simulation operation is not ended, executing the first event.
  • the method further includes: The first event in the parallel event queue.
  • a second aspect of the present invention provides a parallel simulation apparatus, including:
  • a determining module configured to determine whether the second event is a parallel event if it is determined that a second event is generated during the execution of the first event
  • a processing module configured to insert the second event into the parallel event queue according to a priority of the second event, if the second event is a parallel event.
  • the processing module is further configured to: after determining whether the second event is a parallel event, if the second event is not a parallel event, The second event is inserted into the serial event queue.
  • the processing module is further configured to:
  • the second event is inserted into the parallel event queue based on the inherent priority of the simulated object that generated the second event.
  • the processing module is further configured to:
  • the second event is inserted into the parallel event queue based on the priority of the second event in the serial event queue.
  • the processing module is further configured to: if the second event is generated in the process of determining to perform the first event, determine whether the second event is Before the parallel event, if it is determined that the simulation operation is not finished, the first event is executed.
  • the processing module is further configured to perform the foregoing if the determining that the simulation operation is not completed Prior to an event, the first event in the parallel event queue is scheduled.
  • a third aspect of the present invention provides a parallel simulation apparatus, including:
  • a processor if it is determined that the second event is generated during the execution of the first event, determining whether the second event is a parallel event; if the second event is a parallel event, according to the second event The priority inserts the second event into the parallel event queue.
  • the processor is further configured to: after determining whether the second event is a parallel event, if the second event is not a parallel event, The second event is inserted into the serial event queue.
  • the processor is further configured to:
  • the second event is inserted into the parallel event queue based on the inherent priority of the simulated object that generated the second event.
  • the processor is further configured to:
  • the second event is inserted into the parallel event queue based on the priority of the second event in the serial event queue.
  • the processor is further used in If it is determined that the second event is generated during the execution of the first event, it is determined whether the second event is a parallel event, and if it is determined that the simulation operation is not completed, the first event is executed.
  • the processor is further configured to perform the foregoing if the determining that the simulation operation is not completed Prior to an event, the first event in the parallel event queue is scheduled.
  • the parallel simulation method and apparatus determines whether the second event is a parallel event by determining whether the second event is generated during the execution of the first event in the event queue, and if so, The second event is inserted into the parallel event queue according to the priority of the second event; if not, the second event is inserted into the serial event queue. It can ensure the consistency of parallel simulation event execution order and serial simulation event execution order, thus ensuring the consistency of parallel simulation results and serial simulation results, and improving the ease of use of parallel simulation technology.
  • Embodiment 1A is a flowchart of Embodiment 1 of a parallel simulation method provided by the present invention
  • Figure 1B is a schematic diagram of the inherent priority of the simulation object
  • Figure 1C is a schematic diagram of a queue of serial simulation at time T;
  • FIG. 1D is a queue diagram showing the simulation objects D1 and D2 in FIG. 1C as parallel simulation objects;
  • Embodiment 2 is a flowchart of Embodiment 2 of a parallel simulation method provided by the present invention
  • Embodiment 3 is a schematic structural diagram of Embodiment 1 of a parallel simulation device provided by the present invention.
  • FIG. 4 is a schematic structural diagram of Embodiment 2 of a parallel simulation device according to the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • FIG. 1A is a flowchart of Embodiment 1 of a parallel simulation method according to the present invention. As shown in FIG. 1A, the parallel simulation method of this embodiment includes:
  • the parallel simulation engine schedules the first event in the event list, and if the simulation has not ended, executes the first event, and if the second event occurs during the execution of the first event, determines the second event. Whether the event is a parallel event.
  • the second event is a parallel event
  • the second event is inserted into the parallel event queue according to the priority of the second event, so as to ensure the consistency of the parallel simulation event execution sequence and the serial simulation event execution order
  • the second event is placed at the end of the corresponding parallel event queue, and the parallel execution sequence execution sequence and the serial simulation event execution order are not guaranteed, and the parallel simulation cannot be guaranteed.
  • the result is consistent with the serial simulation result.
  • the second event is placed in the tail of the corresponding parallel event queue, and the parallel simulation modeler needs to be modeled. It is completely guaranteed that there is no dependency between parallel events, which increases the difficulty of parallel simulation modeling.
  • the parallel simulation modeler When the second event is inserted into the parallel event queue according to the priority of the second event when determining that the second event is a parallel event, the parallel simulation modeler does not need to ensure that there is no dependency between the parallel events, so The technical solution of the embodiment can reduce the difficulty of simulation modeling and improve the ease of use of the parallel simulation technology.
  • S102 may specifically include:
  • the second event is inserted into the parallel event queue based on the inherent priority of the simulation object that generated the second event.
  • FIG. 1B is a schematic diagram of the inherent priority of the simulation object.
  • D1, D2, and D3 are three simulation objects, wherein D1 and D3 can be parallel, and D2 is serial, and the object IDs of the three are assumed to be 1, respectively. 2, 3; El, E2, and E3 are three of the three objects at time 0, assuming that the event IDs of the three events are 1, 2, and 3 respectively; Exy: x refers to the source event ID, and y is the execution of the Exy event.
  • the object ID, for example, E11 indicates that the event is generated by event E1, and the execution object of E11 is D1; the inherent priorities of D1, D2, and D3 are D1 > D2 > D3.
  • the execution process of the simulation engine can include:
  • the scheduling policy at time T can be configured to first schedule the event queues of the simulation objects D1 and D3 in parallel, and then schedule the event queue of the simulation object D2, so that parallel events can be executed in preference to serial event execution.
  • S102 may specifically include:
  • the second event is inserted into the parallel event queue based on the priority of the second event in the serial event queue.
  • Figure 1C is a schematic diagram of the queue of serial simulation at time T, as shown in Figure 1C, where the simulation object
  • FIG. 1D is a schematic diagram of a queue in which the simulation objects D1 and D2 in FIG. 1C are set as parallel simulation objects. As shown in FIG. 1D, in the parallel event queue, the order of the events E1, E3, and E4 corresponding to the simulation object D1 should not occur. Change, the order of the events E2 and E5 corresponding to the simulation object D2 also does not change.
  • E3 can be inserted after E1 and before E4 according to the priority order of El, E3 and E4.
  • the parallel simulation method provided in this embodiment determines whether the second event is a parallel event by determining whether the second event is generated during the execution of the first event in the event queue, and if yes, according to the priority of the second event The second event is inserted into the parallel event queue; if not, the second event is inserted into the serial event queue.
  • Parallel simulation event execution order can be guaranteed to be consistent with serial simulation event execution order, thereby ensuring the consistency of parallel simulation results and serial simulation results, and improving the ease of use of parallel simulation technology.
  • FIG. 2 is a flowchart of Embodiment 2 of the parallel simulation method provided by the present invention. As shown in FIG. 2, the parallel simulation method in this embodiment includes:
  • S20K schedules the first event in the parallel event queue.
  • prioritizing the first event in the parallel event queue can achieve parallel events over serial event execution. 5202. Determine whether the simulation operation ends. If yes, end the simulation process. Otherwise, execute S203. For example, the simulation engine can determine whether the simulation operation ends according to the first event that is currently scheduled.
  • the parallel simulation method determines whether the simulation operation ends by first scheduling the first event in the parallel event queue. If yes, the simulation process ends. If not, the first event is executed, and the process of executing the first event is determined. Whether a second event is generated, and if so, whether the second event is a parallel event, and if so, the second event is inserted into the parallel event queue according to the priority of the second event. It can ensure the consistency of parallel simulation event execution order and serial simulation event execution order, thus ensuring the consistency of parallel simulation results and serial simulation results, and improving the ease of use of parallel simulation technology.
  • FIG. 3 is a schematic structural diagram of a first embodiment of a parallel emulation device according to the present invention.
  • the parallel emulation device of the present embodiment may include: a judging module 31 and a processing module 32, where the judging module 31 is used to Determining whether the second event is a parallel event during the execution of the first event, and determining whether the second event is a parallel event; the processing module 32 is configured to insert the second event according to the priority of the second event if the second event is a parallel event Parallel event queue.
  • the processing module 32 is further configured to determine whether the second event is a parallel event, and if the second event is not a parallel event, insert the second event into the serial event queue.
  • processing module 32 is further configured to:
  • the second event is inserted into the parallel event queue based on the inherent priority of the simulation object that generated the second event.
  • processing module 32 is further configured to:
  • the device in this embodiment may be used to perform the technical solution of the method embodiment shown in FIG. 1A, and the implementation principle and the technical effect are similar, and details are not described herein again.
  • the processing module 32 is further configured to: before determining whether the second event is generated in the process of executing the first event, determining whether the second event is a parallel event, and if it is determined that the simulation operation is not ended, executing the first event.
  • the processing module 32 is further configured to schedule the first event in the parallel event queue before the first event is executed if it is determined that the simulation operation is not completed.
  • the device in this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 1A or FIG. 2, and the implementation principle and technical effects are similar, and details are not described herein again.
  • the parallel emulation device of this embodiment may include: at least one bus 41, at least one processor 42 connected to the bus 41, and At least one memory 43 connected to the bus 41, wherein the processor 42 calls the code stored in the memory 43 via the bus 41 for: if it is determined that the second event is generated during the execution of the first event, determining the second Whether the event is a parallel event; if the second event is a parallel event, the second event is inserted into the parallel event queue according to the priority of the second event.
  • the processor 42 is further configured to determine whether the second event is a parallel event, and if the second event is not a parallel event, insert the second event into the serial event queue.
  • processor 42 is further configured to:
  • the second event is inserted into the parallel event queue based on the inherent priority of the simulation object that generated the second event.
  • processor 42 is further configured to:
  • the second event is inserted into the parallel event queue based on the priority of the second event in the serial event queue.
  • the processor 42 is further configured to: before determining whether the second event is in the process of executing the first event, determining whether the second event is a parallel event, and if it is determined that the simulation operation is not ended, executing the first event.
  • the processor 42 is further configured to schedule the first event in the parallel event queue before the first event is executed if it is determined that the simulation operation is not completed.
  • the device of this embodiment may be used to implement the technical solution of the method embodiment shown in FIG. 1A or FIG. 2, and the implementation principle and technical effects are similar, and details are not described herein again. It should be noted that the corresponding structural diagrams of the foregoing embodiments are merely illustrative, and the connection relationship of each part or module is not limited to the form shown in the figure, and may be subject to the actual application.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above-described integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage medium.
  • the software functional unit is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the method of various embodiments of the present invention.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明实施例提供一种并行仿真方法及装置,该方法包括:若确定在执行事件队列中的第一事件的过程中产生第二事件,则判断第二事件是否为并行事件;若是,则根据第二事件的优先级将第二事件插入并行事件队列。本发明的技术方案可以保证并行仿真事件执行顺序与串行仿真事件执行顺序的一致性,进而保证并行仿真结果和串行仿真结果的一致性,提高并行仿真技术的易用性。

Description

并行仿真方法及装置 技术领域
本发明实施例涉及计算机仿真技术,尤其涉及一种并行仿真方法及装置。 背景技术
随着计算机硬件的发展, 特别是中央处理单元 (Central Processing Unit, 简称 CPU) 和内存的不断升级, 串行仿真已无法充分利用硬件资源, 从而导 致资源浪费。 为了解决这一问题, 单机离散事件并行技术应运而生。
在并行仿真中, 可以设置仿真对象是否并行, 当仿真中既存在需要串行 执行的对象, 又存在需要并行执行的对象时, 如何管理和调度离散事件队列, 是影响并行建模的关键因素。
然而, 现有的并行仿真技术中常常出现并行仿真结果和串行仿真结果不 一致的问题, 导致并行仿真技术的易用性较低。 发明内容
本发明实施例提供一种并行仿真方法及装置, 用以实现并行仿真结果和 串行仿真结果的一致, 提高并行仿真技术的易用性。
本发明第一方面, 提供一种并行仿真方法, 包括:
若确定在执行事件队列中的第一事件的过程中产生第二事件, 则判断所 述第二事件是否为并行事件;
若是,则根据所述第二事件的优先级将所述第二事件插入并行事件队列。 在第一方面的第一种可能的实现方式中, 所述判断所述第二事件是否为 并行事件之后, 还包括:
若否, 则将所述第二事件插入串行事件队列。
结合第一方面或第一方面的第一种可能的实现方式, 在第一方面的第二 种可能的实现方式中, 所述根据所述第二事件的优先级将所述第二事件插入 并行事件队列, 包括:
根据产生所述第二事件的仿真对象的固有优先级将所述第二事件插入并 行事件队列。
结合第一方面或第一方面的第一种可能的实现方式, 在第一方面的第三 种可能的实现方式中, 所述根据所述第二事件的优先级将所述第二事件插入 并行事件队列, 包括:
根据所述第二事件在所述串行事件队列中的优先级将所述第二事件插入 并行事件队列。
结合第一方面或第一方面的第一种至第三种可能的实现方式中的任意一 种, 在第一方面的第四种可能的实现方式中, 所述若确定在执行第一事件的 过程中产生第二事件, 则判断所述第二事件是否为并行事件之前, 还包括: 若确定仿真操作未结束, 则执行所述第一事件。
根据第一方面的第四种可能的实现方式, 在第一方面的第五种可能的实 现方式中, 所述若确定仿真操作未结束, 则执行所述第一事件之前, 还包括: 调度所述并行事件队列中的所述第一事件。
本发明第二方面, 提供一种并行仿真装置, 包括:
判断模块, 用于若确定在执行第一事件的过程中产生第二事件, 则判断 所述第二事件是否为并行事件;
处理模块, 用于若所述第二事件为并行事件, 则根据所述第二事件的优 先级将所述第二事件插入并行事件队列。
在第二方面的第一种可能的实现方式中, 所述处理模块, 还用于所述判 断所述第二事件是否为并行事件之后, 若所述第二事件不是并行事件, 则将 所述第二事件插入串行事件队列。
结合第二方面或第二方面的第一种可能的实现方式, 在第二方面的第二 种可能的实现方式中, 所述处理模块, 还用于:
根据产生所述第二事件的仿真对象的固有优先级将所述第二事件插入并 行事件队列。
结合第二方面或第二方面的第一种可能的实现方式, 在第二方面的第三 种可能的实现方式中, 所述处理模块, 还用于:
根据所述第二事件在所述串行事件队列中的优先级将所述第二事件插入 并行事件队列。
结合第二方面或第二方面的第一种至第三种可能的实现方式中的任意一 种, 在第二方面的第四种可能的实现方式中, 所述处理模块, 还用于在所述 若确定在执行第一事件的过程中产生第二事件, 则判断所述第二事件是否为 并行事件之前, 若确定仿真操作未结束, 则执行所述第一事件。
根据第二方面的第四种可能的实现方式, 在第二方面的第五种可能的实 现方式中, 所述处理模块, 还用于在所述若确定仿真操作未结束, 则执行所 述第一事件之前, 调度所述并行事件队列中的所述第一事件。
本发明第三方面, 提供一种并行仿真装置, 包括:
处理器, 用于若确定在执行第一事件的过程中产生第二事件, 则判断所 述第二事件是否为并行事件; 若所述第二事件为并行事件, 则根据所述第二 事件的优先级将所述第二事件插入并行事件队列。
在第三方面的第一种可能的实现方式中, 所述处理器, 还用于所述判断 所述第二事件是否为并行事件之后, 若所述第二事件不是并行事件, 则将所 述第二事件插入串行事件队列。
结合第三方面或第三方面的第一种可能的实现方式, 在第三方面的第二 种可能的实现方式中, 所述处理器, 还用于:
根据产生所述第二事件的仿真对象的固有优先级将所述第二事件插入并 行事件队列。
结合第三方面或第三方面的第一种可能的实现方式, 在第三方面的第三 种可能的实现方式中, 所述处理器, 还用于:
根据所述第二事件在所述串行事件队列中的优先级将所述第二事件插入 并行事件队列。
结合第三方面或第三方面的第一种至第三种可能的实现方式中的任意一 种, 在第三方面的第四种可能的实现方式中, 所述处理器, 还用于在所述若 确定在执行第一事件的过程中产生第二事件, 则判断所述第二事件是否为并 行事件之前, 若确定仿真操作未结束, 则执行所述第一事件。
根据第三方面的第四种可能的实现方式, 在第三方面的第五种可能的实 现方式中, 所述处理器, 还用于在所述若确定仿真操作未结束, 则执行所述 第一事件之前, 调度所述并行事件队列中的所述第一事件。
本实施例提供的并行仿真方法及装置, 通过若确定在执行事件队列中的 第一事件的过程中产生第二事件, 则判断第二事件是否为并行事件, 若是, 则根据第二事件的优先级将第二事件插入并行事件队列; 若否, 则将第二事 件插入串行事件队列。 可以保证并行仿真事件执行顺序与串行仿真事件执行 顺序的一致性, 进而保证并行仿真结果和串行仿真结果的一致性, 提高并行 仿真技术的易用性。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见 地, 下面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的 附图。
图 1A为本发明提供的并行仿真方法实施例一的流程图;
图 1B为仿真对象的固有优先级示意图;
图 1C为串行仿真在时刻 T的队列示意图;
图 1D为将图 1C中的仿真对象 D1和 D2设置为并行仿真对象的队列示 意图;
图 2为本发明提供的并行仿真方法实施例二的流程图;
图 3为本发明提供的并行仿真装置实施例一的结构示意图;
图 4为本发明提供的并行仿真装置实施例二的结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本 发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描 述, 显然,所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提 下所获得的所有其他实施例, 都属于本发明保护的范围。
图 1A为本发明提供的并行仿真方法实施例一的流程图, 如图 1A所示, 本实施例的并行仿真方法包括:
S10K 若确定在执行事件队列中的第一事件的过程中产生第二事件, 则 判断第二事件是否为并行事件, 若是, 则执行 S102, 否则, 执行 S103。 具体来说, 在并行仿真过程中, 并行仿真引擎调度事件列表中的第一事 件, 若仿真尚未结束, 则执行第一事件, 若执行第一事件的过程中产生第二 事件, 则判断第二事件是否为并行事件。
S102、 根据第二事件的优先级将第二事件插入并行事件队列。
具体来说, 若第二事件为并行事件, 则根据第二事件的优先级将第二事 件插入并行事件队列, 这样可以保证并行仿真事件执行顺序与串行仿真事件 执行顺序的一致性, 而现有技术在判断第二事件为并行事件后, 会将第二事 件放入相应并行事件队列的尾部, 则不能保证并行仿真事件执行顺序与串行 仿真事件执行顺序的一致性, 进而不能保证并行仿真结果和串行仿真结果的 一致性, 基于现有技术在判断第二事件为并行事件后, 会将第二事件放入相 应并行事件队列的尾部的操作, 并行仿真建模者在建模时要完全保证并行事 件之间无依赖性, 这就增加了并行仿真建模的难度。
基于本实施例在确定第二事件为并行事件时根据第二事件的优先级将第 二事件插入并行事件队列, 则并行仿真建模者在建模时无需保证并行事件之 间无依赖性, 所以采用本实施例的技术方案可以降低仿真建模的难度, 提高 并行仿真技术的易用性。
以下为确定第二事件优先级的两种可能方式:
在一个实施例中, S102具体可以包括:
根据产生第二事件的仿真对象的固有优先级将第二事件插入并行事件队 列。
图 1B为仿真对象的固有优先级示意图, 如图 1B所示, Dl、 D2和 D3 为三个仿真对象, 其中 D1与 D3可并行, D2为串行, 假设三者的对象 ID分 别为 1、 2、 3; El、 E2和 E3分别为 0时刻三个对象中的三个事件, 假设三 个事件的事件 ID分别为 1、 2、 3; Exy: x指源事件 ID, y为 Exy事件执行 对象 ID, 例如, E11表示, 该事件由事件 E1产生, E11的执行对象为 D1 ; Dl、 D2和 D3的固有优先级为 D1 > D2 > D3。
仿真引擎的执行过程可以包括:
0时刻: 串行处理所有事件, 调度顺序遵循对象优先级: E1>E2>E3; T时刻对象事件队列: 以对象 D1为例, El l、 E21、 E31三个事件分别携 带了源事件执行顺序, 并作为优先级排序依据, 贝 Ij : E11>E21>E31。 举例来说, 当仿真引擎执行仿真对象 Dl的仿真事件队列中的事件 E2产 生事件 E21时, 可以按照 E11>E21>E31的优先级将 E21插入 E11之后, E31
; ^刖。
可以理解的是,可以将 T时刻的调度策略配置为先并行调度仿真对象 D1 和 D3的事件队列, 然后再调度仿真对象 D2的事件队列, 可以实现并行事件 优先于串行事件执行。
在一个实施例中, S102具体可以包括:
根据第二事件在串行事件队列中的优先级将第二事件插入并行事件队 列。
图 1C为串行仿真在时刻 T的队列示意图, 如图 1C所示, 其中仿真对象
D1有 El、 E3、 E4三个事件, 而仿真对象 D2有 E2和 E5两个事件, 且事件 在队列中的次序固定。 图 1D为将图 1C中的仿真对象 D1和 D2设置为并行 仿真对象的队列示意图, 如图 1D所示, 在并行事件队列中, 仿真对象 D1对 应的事件 El、 E3和 E4的顺序不应该发生改变, 同样仿真对象 D2对应的事 件 E2和 E5的顺序也不发生改变。
举例来说, 当仿真引擎执行仿真对象 D1 的仿真事件队列中的事件产生 新的事件 E3之后, 可以按照 El、 E3和 E4的优先级顺序, 将将 E3插入 E1 之后, E4之前。
S103、 将第二事件插入串行事件队列。
本实施例提供的并行仿真方法, 通过若确定在执行事件队列中的第一事 件的过程中产生第二事件, 则判断第二事件是否为并行事件, 若是, 则根据 第二事件的优先级将第二事件插入并行事件队列; 若否, 则将第二事件插入 串行事件队列。 可以保证并行仿真事件执行顺序与串行仿真事件执行顺序的 一致性, 进而保证并行仿真结果和串行仿真结果的一致性, 提高并行仿真技 术的易用性。
图 2为本发明提供的并行仿真方法实施例二的流程图, 如图 2所示, 本 实施例的并行仿真方法包括:
S20K 调度并行事件队列中的第一事件。
具体来说, 优先调度并行事件队列中的第一事件, 可以实现并行事件优 先于串行事件执行。 5202、判断仿真操作是否结束,若是,则结束仿真过程,否则,执行 S203。 举例来说, 仿真引擎可以根据当前调度到的第一事件判断仿真操作是否 结束。
5203、 执行第一事件。
S204、 判断执行第一事件的过程中是否产生第二事件, 若是, 则执行
S205 , 否则, 执行 S201。
5205、 判断第二事件是否为并行事件, 若是, 则执行 S206 , 否则, 执行 S207 o
5206、 根据第二事件的优先级将第二事件插入并行事件队列。
S207、 将第二事件插入串行事件队列。
本实施例提供的并行仿真方法, 通过首先调度并行事件队列中的第一事 件, 判断仿真操作是否结束, 若是, 则结束仿真过程, 若否, 则执行第一事 件, 判断执行第一事件的过程中是否产生第二事件, 若是, 则判断第二事件 是否为并行事件, 若是, 则根据第二事件的优先级将第二事件插入并行事件 队列。 可以保证并行仿真事件执行顺序与串行仿真事件执行顺序的一致性, 进而保证并行仿真结果和串行仿真结果的一致性, 提高并行仿真技术的易用 性。
图 3为本发明提供的并行仿真装置实施例一的结构示意图,如图 3所示, 本实施例的并行仿真装置, 可以包括: 判断模块 31 和处理模块 32, 其中, 判断模块 31用于若确定在执行第一事件的过程中产生第二事件,则判断第二 事件是否为并行事件; 处理模块 32用于若第二事件为并行事件, 则根据第二 事件的优先级将第二事件插入并行事件队列。
在一个实施例中, 处理模块 32 还用于判断第二事件是否为并行事件之 后, 若第二事件不是并行事件, 则将第二事件插入串行事件队列。
在一个实施例中, 处理模块 32还用于:
根据产生第二事件的仿真对象的固有优先级将第二事件插入并行事件队 列。
在一个实施例中, 处理模块 32还用于:
根据第二事件在串行事件队列中的优先级将第二事件插入并行事件队 歹 ^ 本实施例的装置, 可以用于执行图 1A所示方法实施例的技术方案, 其 实现原理和技术效果类似, 此处不再赘述。
在一个实施例中,处理模块 32还用于在若确定在执行第一事件的过程中 产生第二事件, 则判断第二事件是否为并行事件之前, 若确定仿真操作未结 束, 则执行第一事件。
在一个实施例中, 处理模块 32还用于在若确定仿真操作未结束, 则执行 第一事件之前, 调度并行事件队列中的第一事件。
本实施例的装置, 可以用于执行图 1A或图 2所示方法实施例的技术方 案, 其实现原理和技术效果类似, 此处不再赘述。
图 4为本发明提供的并行仿真装置实施例二的结构示意图,如图 4所示, 本实施例的并行仿真装置, 可以包括: 至少一个总线 41、 与总线 41相连的 至少一个处理器 42以及与总线 41相连的至少一个存储器 43, 其中, 处理器 42通过总线 41, 调用存储器 43中存储的代码, 以用于: 若确定在执行第一 事件的过程中产生第二事件, 则判断第二事件是否为并行事件; 若第二事件 为并行事件, 则根据第二事件的优先级将第二事件插入并行事件队列。
在一个实施例中, 处理器 42还用于判断第二事件是否为并行事件之后, 若第二事件不是并行事件, 则将第二事件插入串行事件队列。
在一个实施例中, 处理器 42还用于:
根据产生第二事件的仿真对象的固有优先级将第二事件插入并行事件队 列。
在一个实施例中, 处理器 42还用于:
根据第二事件在串行事件队列中的优先级将第二事件插入并行事件队 列。
在一个实施例中,处理器 42还用于在若确定在执行第一事件的过程中产 生第二事件, 则判断第二事件是否为并行事件之前, 若确定仿真操作未结束, 则执行第一事件。
在一个实施例中, 处理器 42还用于在若确定仿真操作未结束, 则执行第 一事件之前, 调度并行事件队列中的第一事件。
本实施例的装置, 可以用于执行图 1A或图 2所示方法实施例的技术方 案, 其实现原理和技术效果类似, 此处不再赘述。 需要说明的是, 上述各实施例对应的结构示意图仅为一种示意, 各部分 或模块的连接关系不限于图中示出的形式, 可以以实际应用中的情况为准。
在本发明所提供的几个实施例中, 应该理解到, 所揭露的装置和方法, 可以通过其它的方式实现。例如, 以上所描述的装置实施例仅仅是示意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可以有另外 的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个系统, 或 一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间的耦合或 直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合或通信连 接, 可以是电性, 机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的, 作 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单 元中。 上述集成的单元既可以采用硬件的形式实现, 也可以采用硬件加软件 功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元, 可以存储在一个计算机 可读取存储介质中。 上述软件功能单元存储在一个存储介质中, 包括若干指 令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等) 或处理器 (processor) 执行本发明各个实施例所述方法的部分歩骤。 而前述 的存储介质包括: U盘、移动硬盘、只读存储器(Read-Only Memory, ROM)、 随机存取存储器(Random Access Memory, RAM) 、 磁碟或者光盘等各种可 以存储程序代码的介质。
本领域技术人员可以清楚地了解到, 为描述的方便和简洁, 仅以上述各 功能模块的划分进行举例说明, 实际应用中, 可以根据需要而将上述功能分 配由不同的功能模块完成, 即将装置的内部结构划分成不同的功能模块, 以 完成以上描述的全部或者部分功能。 上述描述的装置的具体工作过程, 可以 参考前述方法实施例中的对应过程, 在此不再赘述。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并 不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求 书
1、 一种并行仿真方法, 其特征在于, 包括:
若确定在执行事件队列中的第一事件的过程中产生第二事件, 则判断所 述第二事件是否为并行事件;
若是,则根据所述第二事件的优先级将所述第二事件插入并行事件队列。
2、 根据权利要求 1所述的方法, 其特征在于, 所述判断所述第二事件是 否为并行事件之后, 还包括:
若否, 则将所述第二事件插入串行事件队列。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述根据所述第二事 件的优先级将所述第二事件插入并行事件队列, 包括:
根据产生所述第二事件的仿真对象的固有优先级将所述第二事件插入并 行事件队列。
4、 根据权利要求 1或 2所述的方法, 其特征在于, 所述根据所述第二事 件的优先级将所述第二事件插入并行事件队列, 包括:
根据所述第二事件在所述串行事件队列中的优先级将所述第二事件插入 并行事件队列。
5、 根据权利要求 1-4中任一项所述的方法, 其特征在于, 所述若确定在 执行第一事件的过程中产生第二事件, 则判断所述第二事件是否为并行事件 之前, 还包括:
若确定仿真操作未结束, 则执行所述第一事件。
6、 根据权利要求 5所述的方法, 其特征在于, 所述若确定仿真操作未结 束, 则执行所述第一事件之前, 还包括:
调度所述并行事件队列中的所述第一事件。
7、 一种并行仿真装置, 其特征在于, 包括:
判断模块, 用于若确定在执行第一事件的过程中产生第二事件, 则判断 所述第二事件是否为并行事件;
处理模块, 用于若所述第二事件为并行事件, 则根据所述第二事件的优 先级将所述第二事件插入并行事件队列。
8、 根据权利要求 7所述的装置, 其特征在于, 所述处理模块, 还用于所 述判断所述第二事件是否为并行事件之后, 若所述第二事件不是并行事件, 则将所述第二事件插入串行事件队列。
9、 根据权利要求 7或 8所述的装置, 其特征在于, 所述处理模块, 还用 于:
根据产生所述第二事件的仿真对象的固有优先级将所述第二事件插入并 行事件队列。
10、 根据权利要求 7或 8所述的装置, 其特征在于, 所述处理模块, 还 用于:
根据所述第二事件在所述串行事件队列中的优先级将所述第二事件插入 并行事件队列。
11、 根据权利要求 7-10中任一项所述的装置, 其特征在于, 所述处理模 块, 还用于在所述若确定在执行第一事件的过程中产生第二事件, 则判断所 述第二事件是否为并行事件之前, 若确定仿真操作未结束, 则执行所述第一 事件。
12、 根据权利要求 11所述的装置, 其特征在于, 所述处理模块, 还用于 在所述若确定仿真操作未结束, 则执行所述第一事件之前, 调度所述并行事 件队列中的所述第一事件。
13、 一种并行仿真装置, 其特征在于, 包括:
处理器, 用于若确定在执行第一事件的过程中产生第二事件, 则判断所 述第二事件是否为并行事件; 若所述第二事件为并行事件, 则根据所述第二 事件的优先级将所述第二事件插入并行事件队列。
14、 根据权利要求 13所述的装置, 其特征在于, 所述处理器, 还用于所 述判断所述第二事件是否为并行事件之后, 若所述第二事件不是并行事件, 则将所述第二事件插入串行事件队列。
15、 根据权利要求 13或 14所述的装置, 其特征在于, 所述处理器, 还 用于:
根据产生所述第二事件的仿真对象的固有优先级将所述第二事件插入并 行事件队列。
16、 根据权利要求 13或 14所述的装置, 其特征在于, 所述处理器, 还 用于:
根据所述第二事件在所述串行事件队列中的优先级将所述第二事件插入 并行事件队列。
17、 根据权利要求 13-16 中任一项所述的装置, 其特征在于, 所述处理 器, 还用于在所述若确定在执行第一事件的过程中产生第二事件, 则判断所 述第二事件是否为并行事件之前, 若确定仿真操作未结束, 则执行所述第一 事件。
18、 根据权利要求 17所述的装置, 其特征在于, 所述处理器, 还用于在 所述若确定仿真操作未结束, 则执行所述第一事件之前, 调度所述并行事件 队列中的所述第一事件。
PCT/CN2013/086863 2013-11-11 2013-11-11 并行仿真方法及装置 WO2015066922A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2013/086863 WO2015066922A1 (zh) 2013-11-11 2013-11-11 并行仿真方法及装置
CN201380038604.9A CN105264530A (zh) 2013-11-11 2013-11-11 并行仿真方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/086863 WO2015066922A1 (zh) 2013-11-11 2013-11-11 并行仿真方法及装置

Publications (1)

Publication Number Publication Date
WO2015066922A1 true WO2015066922A1 (zh) 2015-05-14

Family

ID=53040813

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/086863 WO2015066922A1 (zh) 2013-11-11 2013-11-11 并行仿真方法及装置

Country Status (2)

Country Link
CN (1) CN105264530A (zh)
WO (1) WO2015066922A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108646587B (zh) * 2018-04-18 2021-08-17 许继电气股份有限公司 一种emtdc并行仿真方法及系统

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102426619A (zh) * 2011-10-31 2012-04-25 清华大学 针对电路仿真的自适应并行lu分解方法
CN103353910A (zh) * 2013-06-26 2013-10-16 福州大学 一种用于并行电路仿真的电路划分方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101941648A (zh) * 2010-09-29 2011-01-12 中冶南方工程技术有限公司 炼钢连铸车间物流仿真系统中多吊车的冲突处理方法
US9128748B2 (en) * 2011-04-12 2015-09-08 Rocketick Technologies Ltd. Parallel simulation using multiple co-simulators
CN103077006B (zh) * 2012-12-27 2015-08-26 浙江工业大学 一种基于多线程的长事务并行执行方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102426619A (zh) * 2011-10-31 2012-04-25 清华大学 针对电路仿真的自适应并行lu分解方法
CN103353910A (zh) * 2013-06-26 2013-10-16 福州大学 一种用于并行电路仿真的电路划分方法

Also Published As

Publication number Publication date
CN105264530A (zh) 2016-01-20

Similar Documents

Publication Publication Date Title
WO2016112701A1 (zh) 异构多核可重构计算平台上任务调度的方法和装置
CN102799957B (zh) 一种云计算环境下安全感知的科学工作流调度方法
KR101332840B1 (ko) 병렬 컴퓨팅 프레임워크 기반의 클러스터 시스템, 호스트 노드, 계산 노드 및 어플리케이션 실행 방법
US8990783B1 (en) Scheduling generated code based on target characteristics
CN103823706B (zh) 一种基于RTLinux的被控对象模型模拟仿真实时调度方法
WO2014094422A1 (zh) 虚拟机规格调整方法及装置
EP2615546A1 (en) Method and system, scheduler for parallel simulating processors
JP2009025939A (ja) タスク制御方法及び半導体集積回路
CN103065221A (zh) 基于bpel的多学科协同优化流程建模与调度的方法和系统
CN105187327A (zh) 一种分布式消息队列中间件
CN104199739A (zh) 一种基于负载均衡的推测式Hadoop调度方法
CN114579285B (zh) 一种任务运行系统、方法及计算设备
JP2009541851A5 (zh)
JP2008059192A (ja) ハード・ソフト協調検証用シミュレータ
CN105740249B (zh) 一种大数据作业并行调度过程中的处理方法及其系统
CN107797870A (zh) 一种云计算数据资源调度方法
Abeni et al. EDF scheduling of real-time tasks on multiple cores: Adaptive partitioning vs. global scheduling
CN105245372A (zh) 一种基于缓存和异步机制的加载网络资源的优化方法
WO2015066922A1 (zh) 并行仿真方法及装置
US20100325635A1 (en) Method for correct-by-construction development of real-time-systems
CN115756143B (zh) 数据包处理的节能方法、装置、计算机设备和存储介质
US10592473B2 (en) Method for improving energy efficiency of map-reduce system and apparatus thereof
CN104519082A (zh) 一种云计算的扩容方法和装置
CN103294874B (zh) 用于电磁仿真计算系统FEKO的Web服务封装方法以及系统
Madsen et al. Abstract RTOS modeling for multiprocessor system-on-chip

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201380038604.9

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13896950

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13896950

Country of ref document: EP

Kind code of ref document: A1