#include <stdio.h>
#include <math.h>
#include “mpi.h”
#define rows 100
#define cols 200
int main (int argc,char **argv){
int I,j,rank,size;
double xlocal[rows][cols];
MPI_Init(&argc, &argv);//start mpi processes
MPI_Comm_rank(MPI_COMM_WORLD, &rank) ;
MPI_Comm_size(MPI_COMM_WORLD, &size);
for(i=rank;I < rows/size + rows/size*rank ;i++)
for(j=0;j<cols;j++)
xlocal[rows][cols] = rank;
MPI_Finalize();
return 0;
}
#include <stdio.h>
#include <math.h>
#include “mpi.h”
#define rows 100
#define cols 200
int main (int argc,char **argv){
int I,j,rank,size;
double xlocal[rows][cols];
MPI_Init(&argc, &argv);//start mpi processes
MPI_Comm_rank(MPI_COMM_WORLD, &rank) ;
MPI_Comm_size(MPI_COMM_WORLD, &size);
for(i=rank;I < rows/size + rows/size*rank ;i++)
for(j=0;j<cols;j++)
xlocal[rows][cols] = rank;
MPI_Finalize();
return 0;
}
* השאלה נוספה בתאריך: 02-01-2023