Giter Club home page Giter Club logo

Comments (3)

tchlux avatar tchlux commented on June 23, 2024

I use OpenMP all the time, there's a preconfigured argument omp=True that will add the -fopenmp flag for OpenMP compilation! Of course all of that is customizable, and you can see and control all the different internals through fmodpy.configure()!

And hmm, presumably cafrun communicates with the compiled program somehow, probably by setting environment variables. If you find out how the communication is done, then you should be able to mimic that in the python runtime! Let me look around.

Edit: I looked around and I don't see any immediately available docs that explain how cafrun works in conjunction with a caf compiler. The core concept to remember is, fmodpy is all about compiling Fortran code into something that can be imported in Python. That means that Python is always the parent process. As long as you can make this work in a way that any other C code could link against it, then it can work with Python.

from fmodpy.

tchlux avatar tchlux commented on June 23, 2024

Looks like the number of processes being launched can be controlled with a hosts file: https://www.open-mpi.org/doc/v3.0/man1/mpiexec.1.php

But still, seems like the logic in the process launcher mpiexec (or cafrun) is necessary to establish the (MPI) comms network. If you want this to work from Python, you're going to have to find a way to include that setup in the compiled program that you import into Python. That will probably look like including the source code for cafrun within your executable, so that when it is compiled it can be executed as one single code.

from fmodpy.

koshMer avatar koshMer commented on June 23, 2024

Thanks for your help! When I have some spare time I will look into that, though that's a bit over my head.
I'll leave this open for now - if that's ok ^^ - and come back to it when I have something to share.

from fmodpy.

Related Issues (9)

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.