0

I have the following 3D array.

U[Timesteps][X][Y]

With Ranges

Timesteps ( 0 to 100)
X ( 0 to 480)
Y ( 0 to 480)

I need to split the array send across the nodes for processing using MPI.

I want to split like the following way

Process ( Node 0) Should get

U[Timesteps][X][Y]

With Ranges

Timesteps ( 0 to 100)
X ( 0 to 200)
Y ( 0 to 200)

and Process ( Node 1) Should get

U[Timesteps][X][Y]

With Ranges

Timesteps ( 0 to 100)
X ( 201 to 480)
Y ( 201 to 480)

Likewise I can split for as many nodes that becomes available at run time. ( i.e spliting on x and Y with full timesteps)

Can anyone help with sample MPI Code..I am getting confused in the derived data type use of MPI for my requirement.

Thanks

High Performance Mark
  • 77,191
  • 7
  • 105
  • 161
Anup Buchke
  • 5,210
  • 5
  • 22
  • 38

1 Answers1

0

After some going through some MPI tutorials I got how to send 3D arrays. We need to use MPI_TYPE_INDEXED derived data type

Anup Buchke
  • 5,210
  • 5
  • 22
  • 38