#include #include #include #include "mpi.h" #define N 128 double get_dtime(void){ struct timeval tv; gettimeofday(&tv, NULL); return ((double)(tv.tv_sec) + (double)(tv.tv_usec) * 0.001 * 0.001); } int main(int argc,char **argv){ double A[N][N],B[N][N],C[N][N],C1[N/4][N],C2[N/4][N],C3[N/4][N]; double d1,d2; int i,j,k; int procs,rank; MPI_Status stat; /*MPI初期化*/ MPI_Init(&argc,&argv); /*全体のプロセス数所得*/ MPI_Comm_size(MPI_COMM_WORLD,&procs); /*自分のランク番号取得*/ MPI_Comm_rank(MPI_COMM_WORLD,&rank); if(rank==0){ /*行列の初期化*/ for(i = 0; i < N; i++) { for(j = 0; j < N; j++){ if(i != j){ A[i][j] = 0.0; B[i][j] = 0.0; }else{ A[i][j] = i+1; B[i][j] = 1; } C[i][j]=0.0; if(i