Code Monkey home page Code Monkey logo

Comments (4)

VictorEijkhout avatar VictorEijkhout commented on July 26, 2024

from mpl.

a-jp avatar a-jp commented on July 26, 2024

You did, but my intention was to provide a solution that hopefully made no external mods to the wrapped comm_. Thereby satisfying what I believe to be the design constraints of MPL while also allowing users such as me the ability to operate with MPI and MPL within the same code base. It would be trivial to extend my proposal to say (untested and uncompiled):

    MPI_Comm& get_mpi_comm_nonconst()
    {
        return comm_;
    }

    /// \brief Allow raw MPI commands to be run 
    /// that need access to the MPI_Comm from this
    /// \param userCode a functor provided by the user taking a MPI_Comm&
    template<typename UserCode>
    void execute_raw_modifiable_mpi(const UserCode& userCode)
    {
        userCode(get_mpi_comm_nonconst());
    }

Here the purpose is to make it clear that what you get can change the wrapped comm_ with reference to 'execute_raw_mpi` which cannot I believe mod the communicator, only use it.

from mpl.

rabauke avatar rabauke commented on July 26, 2024

Although, I fully understand the desire to find a way to mix MPL with MPI code I will not incorporate this in any way into MPL. The more I think about it the more skeptical I get. It might be very useful in the short run, it will likely cause many issues in the long run.

The problem lies not so much in introducing an execute_raw_modifiable_mpi method or something similar. Problems will arise when removing it once MPL has become close to feature complete (It's long way ahead, I know.) This might be a huge breaking change for those who rely on this feature. I do not want to introduce features into MPL, where I know from day one on that I want to get rid of them at a later stage.

Furthermore, allowing a mixed programming style that uses MPI and MPL eliminates the need to develop MPL further.

from mpl.

a-jp avatar a-jp commented on July 26, 2024

Understood

from mpl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.