Comments (13)
uhm, depends on your mpi implementation. that's all handled by the mpirun command, which is not part of opm.
from opm-common.
4
Thank you for your reply. I believe that the number '4' in the example above is chosen by the specific user. I thought that, initially, this number is assigned as a parameter in the code (for example, I've seen NUM_PROCS, NP, MPI_PROCS, BASE_MPI_PROCS, TEST_MPI_PROCS, nprocs).
from opm-common.
yes. I suggest you read some basic MPI tutorial, https://mpitutorial.com/tutorials/mpi-hello-world/ was my first hit on google, no quality control but i'm sure it's on topic.
https://github.com/OPM/opm-simulators/blob/master/opm/simulators/flow/Main.cpp#L125 is the setup code for the flow simulators. the gist of it is;
mpirun parses the command line parameters, launches the specified amount of flow executables, the processes then read out the total number of processes (MPI_Comm_size) and its assigned rank (MPI_Comm_rank) from the MPI library. These mpi calls are wrapped in the Parallel::Communication class, ie. comm.size() and comm.rank();
from opm-common.
Your comments and suggestions are highly appreciated. I am new in MPI and C++ OOP. My background is Fortran. When I run the Flow executable file, it uses 1 MPI processes with 2 OMP threads on each. Are these numbers set by default in the source code? I would like to continue working with the Flow executable file and I'm interested in implementing the read a number of MPI processes from an input file.
from opm-common.
threads are set by default in the executable, but that is not an mpi thing, that's an openmp thing, see https://github.com/OPM/opm-simulators/blob/master/opm/simulators/flow/Main.hpp#L669
but it's important to understand that threads and processes are different things. a process is a separate instance of the application, a thread is the number of cores usable by a single instance of the application.
when you run the executable directly only a single instance of the executable is started - it's exactly like running a normal sequential program. which means the world comm will have size 1, and the single instance will have rank 0.
when you run through mpirun -np x, x instances of the application is started. each of these processes will have y threads (defaults to 2).
pointers to read more: threads is 'shared memory parallelism', while mpi/processes are 'distributed memory parallelism'.
from opm-common.
oh, and you can use both mpi and openmp in fortran applications as well.
from opm-common.
and no, you cannot implement reading the number of processes from an input file in flow itself. mpirun is necessary to launch applications, and this launches the flow executable. by the time the simulator is launched it's too late. this needs to be done in a frontend script/tool.
from opm-common.
Thank you for your informative reply. In this case I need to develop a frontend script/tool which reads a number of MPI processes from an input file and launches the Flow executable file according to the input number of MPI processes. Do you think it's possible? If so, I would prefer using C++ for a frontend script/tool development.
from opm-common.
it's most definitely possible. personally i'd use something more suited for such tasks though, such as python, but to each his own.
from opm-common.
also maybe https://github.com/OPM/opm-utilities/tree/master/opmrun might be of use
from opm-common.
I can see that OPMRUN is an excellent tool. When developing a frontend script/tool for my purpose, may there be a need for introducing any change in the OPM Flow source code which is compiled to an executable file?
from opm-common.
nope.
from opm-common.
Thanks.
from opm-common.
Related Issues (20)
- Source code of the opm python library HOT 2
- Test data_InterRegFlow fails on ppc64el built with -O3 optimization level HOT 9
- Potential Problem in MULTREGTScanner HOT 8
- Update Manual to Reflect Real PYACTION Requirements
- Difference between mpi-default-bin and mpi-default-dev HOT 3
- Consider Python 3.11 support HOT 4
- Problem with the keyword EQUIL HOT 2
- Buckley-Leverett 1D HOT 3
- Tabulated test fails on some 64bit architectures HOT 2
- Extend support for SWATINIT with mixed-wet Pc curves
- [BugReport] EclipseState::hasInputLgrs() definition missing
- Compilation with GCC 8.2.0 fails HOT 10
- UDQ update status not reflected in restart HOT 1
- Unnecessary population of thcwaterData HOT 1
- Missing `SectionType` for parsing parts of data file (BUG?): `RUNSPEC` and `EDIT` HOT 10
- Bug or feature? Field property created only with EQUALS returns false for has_key
- Cannot open initially shut well with neither ACTIONX nor PYACTION HOT 1
- Reliable order of FIP regions statistics/reports
- Inconsistent handling of PORV/MULTPV in EDIT section
- error: redefinition of class std::numeric_limits<__float128> HOT 2
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 opm-common.