Skip to content

Commit

Permalink
preparation for multi-threading
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo committed Nov 3, 2023
1 parent 39fc0d8 commit b99b6af
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FMIImport"
uuid = "9fcbc62e-52a0-44e9-a616-1359a0008194"
authors = ["TT <tobias.thummerer@informatik.uni-augsburg.de>", "LM <lars.mikelsons@informatik.uni-augsburg.de>", "JK <josef.kircher@student.uni-augsburg.de>"]
version = "0.16.0"
version = "0.16.1"

[deps]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Expand All @@ -13,7 +13,7 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
EzXML = "1.1.0"
FMICore = "0.18.0"
FMICore = "0.18.2"
RelocatableFolders = "1"
ZipFile = "0.10.0"
julia = "1.6"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ To keep dependencies nice and clean, the original package [*FMI.jl*](https://git
- [*FMIImport.jl*](https://github.com/ThummeTo/FMIImport.jl): Importing FMUs into Julia
- [*FMIExport.jl*](https://github.com/ThummeTo/FMIExport.jl): Exporting stand-alone FMUs from Julia Code
- [*FMICore.jl*](https://github.com/ThummeTo/FMICore.jl): C-code wrapper for the FMI-standard
- [*FMISensitivity.jl*](https://github.com/ThummeTo/FMISensitivity.jl): Static and dynamic sensitivities over FMUs
- [*FMIBuild.jl*](https://github.com/ThummeTo/FMIBuild.jl): Compiler/Compilation dependencies for FMIExport.jl
- [*FMIFlux.jl*](https://github.com/ThummeTo/FMIFlux.jl): Machine Learning with FMUs (differentiation over FMUs)
- [*FMIZoo.jl*](https://github.com/ThummeTo/FMIZoo.jl): A collection of testing and example FMUs
Expand Down
2 changes: 2 additions & 0 deletions src/FMI2/c.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ function fmi2FreeInstance!(c::FMU2Component; popComponent::Bool = true)

compAddr = c.compAddr

@assert c.threadid == Threads.threadid() "Thread #$(Threads.threadid()) tried to free component with address $(c.compAddr), but doesn't own it.\nThe component is owned by thread $(c.threadid)"

if popComponent
lock(lk_fmi2FreeInstance) do
ind = findall(x -> x.compAddr == compAddr, c.fmu.components)
Expand Down
2 changes: 1 addition & 1 deletion src/FMI2/prep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function prepareSolveFMU(fmu::FMU2,
if hasCurrentComponent(fmu)
c = getCurrentComponent(fmu)
else
@warn "Found no FMU instance, but executionConfig doesn't force allocation. Allocating one. Use `fmi2Instantiate(fmu)` to prevent this message."
@warn "Found no FMU instance, but executionConfig doesn't force allocation. Allocating one.\nUse `fmi2Instantiate(fmu)` to prevent this message."
c = fmi2Instantiate!(fmu; type=type)
end
end
Expand Down

0 comments on commit b99b6af

Please sign in to comment.