Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance FMU Constructor for Distributed MPI Environments #1

Open
prudhomm opened this issue Dec 2, 2023 · 0 comments · Fixed by #2 · May be fixed by NTNU-IHB/FMI4cpp#152
Open

Enhance FMU Constructor for Distributed MPI Environments #1

prudhomm opened this issue Dec 2, 2023 · 0 comments · Fixed by #2 · May be fixed by NTNU-IHB/FMI4cpp#152
Assignees
Labels
enhancement New feature or request

Comments

@prudhomm
Copy link
Member

prudhomm commented Dec 2, 2023

Description

In distributed MPI environments, the current design of the fmu constructor in fmi4cpp leads to inefficiencies when thousands of processes simultaneously attempt to unzip an FMU file. This issue proposes an enhancement to the constructor to allow controlled unzipping.

Proposed Change

Introduce a boolean parameter in the fmu constructor to control the unzipping process. This parameter will enable one MPI process to unzip the FMU, while others wait and then directly load the library from the unzipped path.

Code Snippet

fmu::fmu(const fs::path& fmuPath, bool unzipFmu = true) {
    // Existing checks and setup
    if (unzipFmu) {
        // Current unzip logic
    } else {
        // Assume path is to unzipped FMU
        resource_ = std::make_shared<fmu_resource>(fmuPath);
        modelDescription_ = std::move(parse_model_description(resource_->model_description_path()));
    }
}

Rationale

This modification will significantly reduce the filesystem load and enhance performance in MPI-based distributed systems, where only one process needs to perform the unzipping.

Additional Context

  • The communicator may not always be MPI_COMM_WORLD; it could be a subcommunicator.
  • The fmu class should remain agnostic of MPI to maintain its design integrity.

Request

Kindly consider this enhancement for upcoming releases to improve fmi4cpp's suitability for large-scale parallel computing environments.

@prudhomm prudhomm self-assigned this Dec 2, 2023
@prudhomm prudhomm added the enhancement New feature or request label Dec 2, 2023
@prudhomm prudhomm added this to Feel++ Dec 2, 2023
@github-project-automation github-project-automation bot moved this to Backlog in Feel++ Dec 2, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in Feel++ Dec 4, 2023
prudhomm added a commit to feelpp/feelpp that referenced this issue Dec 4, 2023
prudhomm added a commit to feelpp/feelpp that referenced this issue Dec 4, 2023
@prudhomm prudhomm reopened this Oct 27, 2024
@github-project-automation github-project-automation bot moved this from Done to Todo in Feel++ Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
1 participant