Skip to content

[CoSim] update CoSimIO to v 4.3#11550

Merged
philbucher merged 8 commits intomasterfrom
cosim/update-cosimio-4.3
Sep 29, 2023
Merged

[CoSim] update CoSimIO to v 4.3#11550
philbucher merged 8 commits intomasterfrom
cosim/update-cosimio-4.3

Conversation

@philbucher
Copy link
Member

@philbucher philbucher commented Sep 9, 2023

Minor updates, mainly updating ext libs (mostly ASIO which is why this PR has so many changes)

Also directly using std::filesystem now

@philbucher philbucher added Applications External library FastPR This Pr is simple and / or has been already tested and the revision should be fast labels Sep 9, 2023
@philbucher philbucher requested a review from a team as a code owner September 9, 2023 20:31
@philbucher
Copy link
Member Author

FYI @matekelemen

This reverts commit c26fa90.
to avoid name conflict in Win
@@ -24,5 +24,5 @@ std::string CodeLocation::GetCleanFileName() const
return fs::canonical(fs::path(GetFileName())).lexically_relative(fs::absolute(".")).string();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philbucher This isn't changed! Are you sure that you fixed the problem?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the problem was in the implementation of fs::canonical in the C++11-compatible version of filesystem that we use

I found a couple of (in the meantime fixed) problems, thus after I updated the lib the problem should be solved.

Ideally you could test it :)

See what I wrote here

@pooyan-dadvand
Copy link
Member

@philbucher I don't see the change in the code location

Meanwhile, Why did you changed the GetTempFileName to GetTmpFileName?

@philbucher
Copy link
Member Author

@philbucher I don't see the change in the code location

Meanwhile, Why did you changed the GetTempFileName to GetTmpFileName?

Conflict in Win, see what I wrote here

@pooyan-dadvand
Copy link
Member

@philbucher I have checked your branch and it still suffers from the same error:

RuntimeError: canonical: The system cannot find the path specified.: "..\..\applications\CoSimulationApplication\custom_external_libraries\CoSimIO\co_sim_io\sources\communication\communication.cpp"

Would you please change it to the implementation of the Kratos Code location?

@philbucher
Copy link
Member Author

Would you please change it to the implementation of the Kratos Code location?

KratosMultiphysics/CoSimIO#358

@philbucher
Copy link
Member Author

I pushed the fix, @pooyan-dadvand can you please test it to make sure it works?

And can you please post the output of the error message, I would like to see how it looks

@pooyan-dadvand
Copy link
Member

I have tested it and it works now on my machine!

Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "c:\Users\pooyan\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\__main__.py", line 39, in <module>
    cli.main()
  File "c:\Users\pooyan\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main
    run()
  File "c:\Users\pooyan\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file
    runpy.run_path(target, run_name="__main__")
  File "c:\Users\pooyan\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 321, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "c:\Users\pooyan\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "c:\Users\pooyan\.vscode\extensions\ms-python.python-2023.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
    exec(code, run_globals)
  File "C:\Temp\2DCableFixedTemp\asflux.py", line 15, in <module>
    simulation = CoSimulationAnalysis(parameters)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\co_simulation_analysis.py", line 57, in __init__
    self._GetSolver() # this creates the solver
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\co_simulation_analysis.py", line 93, in _GetSolver
    solver = super()._GetSolver()
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\analysis_stage.py", line 246, in _GetSolver
    self._solver = self._CreateSolver()
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\co_simulation_analysis.py", line 108, in _CreateSolver
    return solver_wrapper_factory.CreateSolverWrapper(self.cosim_settings["solver_settings"], self.models, problem_name)   
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\factories\solver_wrapper_factory.py", line 5, in CreateSolverWrapper
    return base_factory.Create(settings, [models, solver_name], "KratosMultiphysics.CoSimulationApplication")
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\factories\base_factory.py", line 20, in Create
    return imported_module.Create(settings, *args)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\coupled_solvers\gauss_seidel_weak.py", line 5, in Create
    return GaussSeidelWeakCoupledSolver(settings, models, solver_name)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\base_classes\co_simulation_coupled_solver.py", line 98, in __init__
    solver.CreateIO(self.echo_level)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\base_classes\co_simulation_solver_wrapper.py", line 96, in CreateIO
    self.__io = io_factory.CreateIO(self.settings["io_settings"], self.model, self.name, self.data_communicator, self._GetIOType())
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\factories\io_factory.py", line 
5, in CreateIO
    return base_factory.Create(io_settings, [model, solver_name, data_comm], "KratosMultiphysics.CoSimulationApplication.solver_wrappers", io_name)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\factories\base_factory.py", line 20, in Create
    return imported_module.Create(settings, *args)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\solver_wrappers\kratos_co_sim_io.py", line 12, in Create
    return KratosCoSimIO(*args)
  File "C:\Development\Kratos\bin\RelWithDebInfo\KratosMultiphysics\CoSimulationApplication\solver_wrappers\kratos_co_sim_io.py", line 40, in __init__
    info = CoSimIO.Connect(connection_settings)
RuntimeError: Error: Minor version mismatch! My version: 3; partner version: 0

in 1. co_sim_io/sources/communication/communication.cpp : 513 : CoSimIO::Internals::Communication::HandShake
   2. co_sim_io/sources/communication/communication.cpp : 536 : CoSimIO::Internals::Communication::HandShake
   3. co_sim_io/sources/communication/communication.cpp : 108 : CoSimIO::Internals::Communication::Connect

@philbucher
Copy link
Member Author

great, thanks for testing!

Can someone approve then?

Copy link
Member

@pooyan-dadvand pooyan-dadvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@philbucher philbucher merged commit 4f3a88a into master Sep 29, 2023
@philbucher philbucher deleted the cosim/update-cosimio-4.3 branch September 29, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Applications External library FastPR This Pr is simple and / or has been already tested and the revision should be fast

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants