91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5KB
    文件類型: .c
    金幣: 1
    下載: 0 次
    發布日期: 2021-01-06
  • 語言: 其他
  • 標簽: C??language??MPI??

資源簡介

在MPI編譯環境下在C源代碼的 基礎上編寫的并行程序:高斯消元法求解線性方程組。

資源截圖

代碼片段和文件信息


#include
#include
#include“mpi.h“
#include“stdio.h“
#include
const?int?rows?=?8;?/*the?rows?of?matrix*/
const?int?cols?=?8;?/*the?cols?of?matrix*/
int?main(int?argc?char?**argv)

{
int?ijkmyidnumprocsanstag;
double??A[rows][cols]B[cols]X[rows]AB[rows][cols+1];
int?masterpro;
double?buf[cols+1];
double?starttimeendtime;
double?tmptotaltime;
srand((unsigned?int)time(NULL));
MPI_Status?status;
masterpro?=?0;
MPI_Init(&argc&argv);
MPI_Comm_rank(MPI_COMM_WORLD&myid);
MPI_Comm_size(MPI_COMM_WORLD&numprocs);
if?(myid==0)
????{
??????starttime?=?MPI_Wtime();
??????for(i=0;i?????????{
????????????B[i]=rand()%20;
????????????for(j=0;j?????????????????{
????????????????????A[j][i]=rand()%20;
???????????????

評論

共有 條評論