MPI Lab Problem

Code scope

  • Let all of your codes between MPI_Init(), MPI_Finalize()

  • Codes out of the MPI_Init(), MPI_Finalize() may not executed by all processes

Argument

  • argc means the number of argument

  • argv store the argument

  • argv include the executable file

Collective call

  • Bcast                                                           

  • Reduce

  • Allreduce

  • Scatter

  • Gather

  • Alltoall

  • Allgather

Hint

  • Calculate the start position, workload by rank

  • Be care of the type

  • Calculate the local area

  • use MPI_Reduce to collect all local area

MPI Lab Problem

By zlsh80826

MPI Lab Problem

  • 450