在并行模式下运行测试时,如何解决缺少的Simulink仿真技巧问题? [英] How to fix missing simulink simulation artificats issue when running test in parallel mode?

查看:80
本文介绍了在并行模式下运行测试时,如何解决缺少的Simulink仿真技巧问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有29个Simulink/Matlab测试.它具有许多不同的参考模型.在运行20秒模拟之前,它必须加载所有参考模型并在工作文件夹中创建许多模拟工件.测试之间共享许多参考模型.

I have 29 Simulink/Matlab Test. It has a lot of different reference models. Before running a 20 second simulation , it has to load all reference models and create a lot of simulation artifacts in a work folder. A lot of reference model are shared in-between test.

当一次运行一个测试时,我没有问题,所有模拟工件都已创建并用于运行各种模拟.一切顺利.

When running one test at a time, I have no issue, all simulation artifact are created and used to run the various simulation. Everything Passes.

通过并行处理运行所有程序时.我有一个问题,一些模拟工件没有生成或丢失,因此即使在运行之前我的模拟也失败了,但令人惊讶的是,并非所有29个都失败了.它实际上是随机的,上一次是17,另一次是22.甚至以0失败运行了一次.

When running it all via parallel processing. I have a issue.Some simulation artifact are not built or missing, hence my simulation fails even before running.But surprisingly, not all 29 of them fail. It actually random,last time it was 17, another time it was 22. And it even ran once with 0 fail.

另一个说明,我只有在出于CI目的而在Azure-Pipelines上的自托管计算机上运行它时才会遇到此问题.

Another note, I only have this issue when running it on a self-hosted computer on Azure-Pipelines for CI purposes.

我想解决此问题,并在一次并行运行中一次重现稳定的测试通过/失败结果.我该怎么办?

I would like to fix this issue and reproduce stable test pass/fail results of one at a time run, but on parallel process run. How would I do that?

错误:

2020-11-03T03:16:27.1083996Z Making simulation target "Foo_src_sfun", ...
2020-11-03T03:16:27.1084227Z 
2020-11-03T03:16:27.1084361Z 
2020-11-03T03:16:27.1084502Z 
2020-11-03T03:16:27.1084789Z Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
2020-11-03T03:16:27.1085188Z Copyright (C) Microsoft Corporation.  All rights reserved.
2020-11-03T03:16:27.1085441Z 
2020-11-03T03:16:27.1085815Z NMAKE : fatal error U1052: file 'Foo_src_sfun.mak' not found
2020-11-03T03:16:27.1086175Z Stop.

2020-11-03T03:16:27.1089399Z ================================================================================
2020-11-03T03:16:27.1089936Z Error occurred in TestSim/testSim(File=test_FooTest1_slx) and it did not run to completion.
2020-11-03T03:16:27.1090308Z 
2020-11-03T03:16:27.1090497Z     ---------
2020-11-03T03:16:27.1090720Z     Error ID:
2020-11-03T03:16:27.1090946Z     ---------
2020-11-03T03:16:27.1091254Z     'Slvnv:simcoverage:SimulationFailed'
2020-11-03T03:16:27.1091481Z 
2020-11-03T03:16:27.1091669Z     --------------
2020-11-03T03:16:27.1091919Z     Error Details:
2020-11-03T03:16:27.1092186Z     --------------
2020-11-03T03:16:27.1092419Z     Error using cvsim
2020-11-03T03:16:27.1092659Z     Simulation failed
2020-11-03T03:16:27.1092864Z     
2020-11-03T03:16:27.1093112Z     Error in testRunner (line 145)
2020-11-03T03:16:27.1093477Z             [cvdo, simOutRes] = cvsim(testObj,paramStruct) ;
2020-11-03T03:16:27.1093765Z     
2020-11-03T03:16:27.1094034Z     Error in TestSim/testSim (line 30)
2020-11-03T03:16:27.1094373Z                 [cvdo, simOutRes, ErrLog] = testRunner(File,20);
2020-11-03T03:16:27.1094638Z     
2020-11-03T03:16:27.1094830Z     Caused by:
2020-11-03T03:16:27.1095168Z         Error using autobuild_kernel>autobuild_local (line 219)
2020-11-03T03:16:27.1095612Z         Unable to create mex function 'Foo_src_sfun.mexw64'
2020-11-03T03:16:27.1096006Z         required for simulation.
2020-11-03T03:16:27.1096427Z ================================================================================

更新:

我发现我还有另一种错误,几乎导致了相同的结果.

I found that I have also another kind of error, leads pretty much to same result.

2020-11-03T03:18:36.1668328Z Making simulation target "Foo2_src_sfun", ...
2020-11-03T03:18:36.1668601Z 
2020-11-03T03:18:36.1668735Z 
2020-11-03T03:18:36.1669087Z 'Foo2_src_sfun.bat' is not recognized as an internal or external command,
2020-11-03T03:18:36.1669483Z operable program or batch file.
2020-11-03T03:18:36.1669685Z 
2020-11-03T03:18:36.1669892Z >>Removing MiL paths...
2020-11-03T03:18:36.1670104Z >>Done

推荐答案

在并行运行之前,我做了一个runSingleTest().在运行之前,它会在**/work/sim_artifact文件夹中创建所有必需的模型参考mexw64文件.

I made a runSingleTest() that I run before my parallel run. Before running it creates all required model reference mexw64 files in the **/work/sim_artifact folder.

因此,当并行运行时,他们不需要创建任何新文件,他们可以使用已有文件或更新文件.

Hence when the parallel run they don't need to create any new files, they either use whats already there or update the files.

自那次更改以来,我一直没有任何问题.由于进行了重复测试,因此运行时间更长.

I have been having no issue since that change. Just a longer run time because of that repetitive test.

这篇关于在并行模式下运行测试时,如何解决缺少的Simulink仿真技巧问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆