Comments (3)
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.
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.
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)
- Convertible? HOT 1
- Encountered unrecognized line while parsing Module HOT 16
- Building conda package from source code on pypi HOT 4
- Undefined Symbol Error HOT 3
- Compilation of fortran file fails: cannot open shared object file HOT 3
- ValueError: invalid literal for int() with base 10: '1)' HOT 5
- Linking to OpenBLAS for BLAS and LAPACK on Windows HOT 15
- Question about wrong type of return value(in python) for allocatable real64 arrays(fortran). HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmodpy.