1

I'm generating a Co-Simulation FMU using Dymola. The FMU is consumed by FMPy. There are external thermodynamic calls in the model.

When the Dymola flag Advanced.ParallelizeCode is set to false, the FMU can be run using FMPy and Dymola. When the Dymola flag Advanced.ParallelizeCode is set to true, the FMU can be run using Dymola but not using FMPy.

What can be causing this issue?

Thanks!

Neotake
  • 79
  • 7
  • Is your external code thread safe? Then try setting `Advanced.ExternalFunctionCritical=false` – matth Sep 26 '18 at 08:02
  • Which version of Dymola are you using? Are the external thermodynamic calls using ExternalObject or just using normal external functions? – Hans Olsson Sep 26 '18 at 09:47
  • Have you tried the FMU in other importing tools or have you run the FMU Compliance Checker on it? (https://trac.fmi-standard.org/browser/branches/public/Test_FMUs/Compliance-Checker) – Christian Bertsch Sep 26 '18 at 15:51
  • @matth, yes the external code is thread safe and `Advanced.ExternalFunctionCritical=false`. – Neotake Sep 27 '18 at 13:14
  • @HansOlsson Version 2019 (64-bit), 2018-04-11 The header file is like this: EXTLIB_EXPORT double RefrigerationVaporDn(double a_dP, double a_dT, const double a_pdXn[13]); Is this what you mean? – Neotake Sep 27 '18 at 13:17
  • @ChristianBertsch, I have just checked it using FMUChecker-2.0-win64 (default options). [FMU status:OK] everywhere. – Neotake Sep 27 '18 at 13:42
  • Is this related to multithreading? There exists a feature branch of fmpy https://github.com/CATIA-Systems/FMPy/tree/feature/26-multithreading, but I do not know about its functionality or maturity. You could also create a ticket at https://github.com/CATIA-Systems/FMPy/issues. – Christian Bertsch Sep 29 '18 at 10:50
  • @ChristianBertsch, good idea. The ticket can be followed here [https://github.com/CATIA-Systems/FMPy/issues/47](https://github.com/CATIA-Systems/FMPy/issues/47) – Neotake Oct 05 '18 at 08:46
  • @HansOlsson, we used normal external functions. – Neotake Oct 05 '18 at 11:35
  • @ChristianBertsch, we can't execute the FMU because our trial license expired. Right now we can't test if the multi-threaded branch solves the problem. When we tried this was the message: [FATAL] b'The license file was not found. Use the environment variable "DYMOLA_RUNTIME_LICENSE" to specify your Dymola license file.\n' – Neotake Oct 05 '18 at 11:40
  • Which Compiler do you use? Visual Studio or gcc? There is a problem with the licensing of FMUs generated with gcc on Windows. – Christian Bertsch Oct 07 '18 at 14:03
  • @ChristianBertsch, I was using Visual Studio 2017. Thanks! – Neotake Oct 10 '18 at 13:40

0 Answers0