Hello Jeff Squyres,
Thank you very much for the immediate reply. I am able to successfully
access the data from the common block but the values are zero. In my
algorithm I even update a common block but the update made by the shared
library is not taken in to account by the executable. Can you please be very
specific how to make the parallel algorithm aware of the data? Actually I am
not writing any MPI code inside? It's the executable (third party software)
who does that part. All that I am doing is to compile my code with MPI c
compiler and add it in the LD_LIBIRARY_PATH.
In fact I did a simple test by creating a shared library using a FORTRAN
code and the update made to the common block is taken in to account by the
executable. Is there any flag or pragma that need to be activated for mixed
Thank you once again for the reply.
From: users-bounces_at_[hidden] [mailto:users-bounces_at_[hidden]] On
Behalf Of Jeff Squyres
Sent: vendredi 31 octobre 2008 18:53
To: Open MPI Users
Subject: Re: [OMPI users] MPI + Mixed language coding(Fortran90 + C++)
On Oct 31, 2008, at 11:57 AM, Rajesh Ramaya wrote:
> I am completely new to MPI. I have a basic question concerning
> MPI and mixed language coding. I hope any of you could help me out.
> Is it possible to access FORTRAN common blocks in C++ in a MPI
> compiled code. It works without MPI but as soon I switch to MPI the
> access of common block does not work anymore.
> I have a Linux MPI executable which loads a shared library at
> runtime and resolves all undefined symbols etc The shared library
> is written in C++ and the MPI executable in written in FORTRAN. Some
> of the input that the shared library looking for are in the Fortran
> common blocks. As I access those common blocks during runtime the
> values are not initialized. I would like to know if what I am
> doing is possible ?I hope that my problem is clear......
Generally, MPI should not get in the way of sharing common blocks
between Fortran and C/C++. Indeed, in Open MPI itself, we share a few
common blocks between Fortran and the main C Open MPI implementation.
What is the exact symptom that you are seeing? Is the application
failing to resolve symbols at run-time, possibly indicating that
something hasn't instantiated a common block? Or are you able to
successfully access the data from the common block, but it doesn't
have the values you expect (e.g., perhaps you're seeing all zeros)?
If the former, you might want to check your build procedure. You
*should* be able to simply replace your C++ / F90 compilers with
mpicxx and mpif90, respectively, and be able to build an MPI version
of your app. If the latter, you might need to make your parallel
algorithm aware of what data is available in which MPI process --
perhaps not all the data is filled in on each MPI process...?
users mailing list