-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPI9Matr11.cpp
More file actions
30 lines (24 loc) · 763 Bytes
/
MPI9Matr11.cpp
File metadata and controls
30 lines (24 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "pt4.h"
#include "mpi.h"
#include <cmath>
int k; // количество процессов
int r; // ранг текущего процесса
int m, p, q; // размеры исходных матриц
int na, nb; // размеры полос матриц
int *a_, *b_, *c_; // массивы для хранения исходных матриц в главном процессе
int *a, *b, *c; // массивы для хранения полос матриц в каждом процессе
MPI_Datatype MPI_BAND_B; // тип данных для полосы матрицы B
MPI_Datatype MPI_BAND_C; // тип данных для полосы матрицы C
void Solve()
{
Task("MPI9Matr11?");
int flag;
MPI_Initialized(&flag);
if (flag == 0)
return;
int rank, size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
k = size;
r = rank;
}