資源簡介
墨爾本大學研究生并行計算課程的一個作業,包含一個Sequential代碼和一個blocking communication和一個nonblocking communication的并行代碼,均是用C語言完成,并附有完整的report。可在集群計算機上并行運行
代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#define?STOPPOINT?0.1
#define?BOUNDARY?10
#define?MAXITERATION?10000
#define?MAXSIZE?(1000+2)
static?int?distribute(float?*heat?int?p?int?pSize?int?n?int?m?int?step?double?*tComm?double?*tComp?double?*tStop);
int?main(int?argc?char?*argv[]){
int?m?n?p?pSize;
int?i?j;
int?step;
float?*heat;
double?tStart?tEnd;
????????double?tComm?=?0?tComp?=?0?tStop?=?0;
MPI_Init(&argc?&argv);
MPI_Comm_rank(MPI_COMM_WORLD?&p);
MPI_Comm_size(MPI_COMM_WORLD?&pSize);
n?=?MAXSIZE;
m?=?(n-2)/pSize+2;
heat?=?malloc(sizeof(float)*n*m);
for?(i?=?0;?i? for?(j?=?0;?j? heat[n*i+j]?=?0;
if(p==0){
for?(i?=?0;?i?
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2009-10-31?19:40??433677?Project?2?Submission?-?Group?15\
?????文件????????4808??2009-10-24?12:24??433677?Project?2?Submission?-?Group?15\heatParaB.c
?????文件????????5568??2009-10-24?12:24??433677?Project?2?Submission?-?Group?15\heatParaNB.c
?????文件????????1723??2009-10-31?01:18??433677?Project?2?Submission?-?Group?15\Heat_Sequential.cpp
?????文件??????121524??2009-10-31?19:37??433677?Project?2?Submission?-?Group?15\report_porj2.pdf
評論
共有 條評論