Re: send array using MPI



Hi Michael,

* Michael Wild <themiwi@xxxxxxxxxxxxxxx> wrote:
Fabian Braennstroem wrote:
Hi,

I try to write a small fortran/mpi program to solve the
poisson eqn. To accomplish that, I have to send a part of
the calculated 2D array to the other processors.

The array is defined in a COMMON file: f(i,j) with i=100 and
j=100.

I want to send the values for j=10 and i=1 to 100; so I
actually send 100 values to the other processors.

My problem is, that I do not know, how I declare the range
of the sending array to the MPI_SEND routine.


CALL MPI_Send(f(1,100),count,MPI_FLOAT,1, 0,MPI_COMM_WORLD, ierr)

'count' should be set to 100, but how can I declare the
range!?

Would be nice, if you have an idea, how I can do that in
fortran77!

Greetings!
Fabian


why do you pass f(1,100)? pass it f(1,10) and count=100. as fortran
stores column major, there's no problem. it will start in column 10, row
1 and send off until column 10, row 100.

Thanks for your hint, I forgot that! It works now, but how would I do it
the other way: i=10 and j=1 to 100?

Greetings!
Fabian
.



Relevant Pages

  • Re: send array using MPI
    ... I try to write a small fortran/mpi program to solve the ... the calculated 2D array to the other processors. ... i don't think there's a way to allow for a "stride" in the mpi calls. ... either sent the elements individualy or copy them to a temporary array. ...
    (comp.lang.fortran)
  • send array using MPI
    ... I try to write a small fortran/mpi program to solve the ... To accomplish that, I have to send a part of ... the calculated 2D array to the other processors. ... My problem is, that I do not know, how I declare the range ...
    (comp.lang.fortran)
  • Re: send array using MPI
    ... I try to write a small fortran/mpi program to solve the ... To accomplish that, I have to send a part of ... the calculated 2D array to the other processors. ... My problem is, that I do not know, how I declare the range ...
    (comp.lang.fortran)
  • Re: Passing an array of structuresfrom a pointer?
    ... to only declare structs in headers and then define the ... the struct should be declared ... what if you have a simple array like this: ... In the header we would declare? ...
    (microsoft.public.vc.language)
  • Re: vb.net class
    ... about fixed array lenghts or using ReDim statements. ... code ensures everything in the array is a String because you declare it ... Count can be generated from the time list, not need to store ...
    (microsoft.public.dotnet.languages.vb)