Answers for "what's the print?"

0

what's the print?

#include <stdio.h>
#include <mpi.h>

int main(int argc , char **argv)
{
  int size, rank;
  MPI_Init data;

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &size);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  data = rank;

  MPI_Bcast(&data, 1, MPI_INT, 3, MPI_COMM_WORLD);

  printf("rank %d: data=%lf\n", rank, data);

  MPI_Finalize();

  return 0;
Posted by: Guest on June-26-2021

Browse Popular Code Answers by Language