|
|
Mixing FORTRAN and C(++) and MPI
Hello!
I am planning to combine and parallelize two independent, serial
programs, one of which is a FORTRAN program and the other one
is in C++. Hence I'll finish up with mixing FORTRAN and C++
modules to create a linux executable. Inevitably, at some stage
these fortran and C++ bits will have to communicate with each
other via MPI.
Is such thing possible? Would C++ MPI_Recv's be able
to receive messages from fortran's MPI_SEND's and vice
versa? Any other problems I might run into (except for different
array indexing in these two languages)?
Thanks in advance.
- J.
PS. I'm talking MPI-1.2
|
|
0
|
|
|
|
Reply
|
jacek-NOSPAM- (33)
|
7/16/2003 10:46:52 AM |
|
"Andreas Fromm" <afromm@physik.uni-erlangen.de> wrote in message
news:bf8ini$cde$1@rznews2.rrze.uni-erlangen.de...
>
> If you just need to comunicate data between your FORTRAN
> and C code, it should be easyer to directly call the
> corresponding functions frem the other Program.
> Your compiler doc should provide the info you need. It
> also should be much faster then using MPI to do the
> comunication.
But what mechanism do you want to suggest in order
to communicate data across different nodes? I'm talking
about a parallel program that links modules both in
FORTRAN and in C++. I need to be sure that I won't have
trouble sending and receivng MPI messages across
different nodes with codes on both sides written in
different languages. If it were all on one node, that would
be no problem.
- J.
|
|
0
|
|
|
|
Reply
|
Jacek
|
7/19/2003 11:51:24 PM
|
|
Jacek Dziedzic wrote:
> "Andreas Fromm" <afromm@physik.uni-erlangen.de> wrote in message
> news:bf8ini$cde$1@rznews2.rrze.uni-erlangen.de...
>
>>If you just need to comunicate data between your FORTRAN
>>and C code, it should be easyer to directly call the
>>corresponding functions frem the other Program.
>>Your compiler doc should provide the info you need. It
>>also should be much faster then using MPI to do the
>>comunication.
>
>
> But what mechanism do you want to suggest in order
> to communicate data across different nodes? I'm talking
> about a parallel program that links modules both in
> FORTRAN and in C++. I need to be sure that I won't have
> trouble sending and receivng MPI messages across
> different nodes with codes on both sides written in
> different languages. If it were all on one node, that would
> be no problem.
>
> - J.
>
>
Of course, if you use more then 1 node, MPI is what you need. I just was
saying waht I said, becasue I've seen peaple using MPI for things like
"interlanguage"-communication on serial programms. Its a possibility,
but not the fastest one could think of.
Regards
Andreas
|
|
0
|
|
|
|
Reply
|
Andreas
|
7/21/2003 12:48:52 PM
|
|
"Jacek Dziedzic" <jacek-NOSPAM-@janowo.net> wrote in message
news:20725-1058658767@213.17.251.170...
> But what mechanism do you want to suggest in order
> to communicate data across different nodes? I'm talking
> about a parallel program that links modules both in
> FORTRAN and in C++. I need to be sure that I won't have
> trouble sending and receivng MPI messages across
> different nodes with codes on both sides written in
> different languages. If it were all on one node, that would
> be no problem.
I'd suggest that you use MPI in one language. E.g. MPI and some computing in
C++ and some extra computing in Fortran. If you need to send a message from
Fortran - write your own C++ wrapper for the corresponding MPI call. IMHO -
this approach will give you less headache when linking with different
libraries.
/Iakov
|
|
0
|
|
|
|
Reply
|
Iakov
|
8/21/2003 2:28:55 PM
|
|
|
3 Replies
275 Views
(page loaded in 0.059 seconds)
Similiar Articles: comp.parallel.mpi - page 5Mixing FORTRAN and C(++) and MPI 3 176 (7/16/2003 10:46:52 AM) Hello! I am planning to combine and parallelize two independent, serial programs, one of which is a ... is there any parallel fortran code for matrix diagonalization ...Use MPI inside a for loop - comp.parallel.mpi Hello all, I need to make below ... problem with mixed c and fortran code - comp.lang.fortran ... is there any parallel fortran ... problem with mixed c and fortran code - comp.lang.fortran ...Compile Fortran 95/2003 code + MPI in Windows using Gfortran ... ifort 12 - comp.lang ... gfortran for 64-bit Windows - comp.lang.fortran problem with mixed c and fortran ... Where did Fortran go? - comp.lang.fortranAnd, FWIW, nearly everyone I work with uses MPI ... > > - I/O is not faster from C or Fortran than say Python. ... Fortran 90+ program;* thus, you can widely mix Fortran 77 ... Free LAPACK for Intel Fortran 8 on Windows? - comp.lang.fortran ...Compile Fortran 95/2003 code + MPI in Windows using Gfortran ..... compile Fortran 77 ... Ultimate 64bit SP2 Intel Core2 Quad CPU 3Ghz ... Tutorial: Mixed C and Fortran ... This implicit statement is not positioned correctly within the ...Looks like you can't mix USE with IMPORT, though. ... http://software.intel.com/sites/support/ My Fortran blog ... program testSubA.F95 subroutine ... line with "use mpi ... ifort 12 - comp.lang.fortranproblem with mixed c and fortran code - comp.lang.fortran ... ifort 12 - comp.lang ... Compile Fortran 95/2003 code + MPI in Windows using Gfortran ... ifort 12 - comp.lang ... Usage of iso_c_binding - comp.lang.fortranproblem with mixed c and fortran code - comp.lang.fortran ... My loss is your gain ... Compile Fortran 95/2003 code + MPI in Windows using Gfortran ... Usage of iso_c_binding ... using gfortran to call windows api functions - comp.lang.fortran ...Compile Fortran 95/2003 code + MPI in Windows using Gfortran ..... of "fortran 95/2003 ... problem with mixed c and fortran code - comp.lang.fortran ..... Printing from c ... trouble with Windows gfortran - comp.lang.fortranCompile Fortran 95/2003 code + MPI in Windows using Gfortran ... But, in Windows Openmpi ... problem with mixed c and fortran code - comp.lang.fortran ... trouble with Windows ... Mixing UPC and C/C++/MPI/FORTRAN - Berkeley Unified Parallel C ...Mixing UPC and C/C++/MPI/FORTRAN As of release 2.0, Berkeley UPC supports creating applications which are a hybrid of UPC and C, C++, and/or FORTRAN. IBM Linux cluster systems fundamentals - Hybrid parallel job exampleFortran code that runs the example; C code that runs the same example; C++ code that runs the same ... #!/bin/ksh # # LSF batch script to run the test mixed MPI/OMP codes ... 7/24/2012 9:16:45 PM
|
|
|
|
|
|
|
|
|