#include "mpi h"


Download 134.19 Kb.
bet1/2
Sana21.05.2022
Hajmi134.19 Kb.
#684003
  1   2
Bog'liq
Xaitov Daler 4-exam
Lesson 8, Lesson 8, Lesson 8, Aniq-va-tabiiy-fanlarni-oqitish-metodikasiKimyo ozbek, Aniq-va-tabiiy-fanlarni-oqitish-metodikasiKimyo ozbek, 20-Мавзу, Toshkent davlat sharqshunoslik instituti, Тилхат ва туш.хати Дўстл, Юсупов Азизбек Холмухаматович, Умумий психология, Nizom basketboll, Nizom basketboll, ZPLtGvoAwlN9kSV5NExE4dxMn0KK3bpN, Erkinov Sherzod 164 psixologuya yakuniy, grafik

1) Ikkita jarayondan uchinchi jarayonga istalgan tipdagi bir xil teg orqali ma’lumot jo’nating va uni MPI_ANY_SOURCE ni ishlatgan holda qabul qiling va ma’lumotni ekranga chiqaring va ma’lumot qaysi jarayondan чqabul qilinganligini izohlang.
#include "mpi.h"
#include
#include
using namespace std;
int main(int argc, char**argv)
{
int rank;
float a,b,c;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
a = 0.0; b = 0.0; c=0.0;
if (rank == 0)
{
a=3.7;
MPI_Send(&a, 1, MPI_FLOAT, 2 3, MPI_COMM_WORLD);
}
if (rank == 1)
{
b = 4.5;
MPI_Send(&b, 1, MPI_FLOAT, 2, 3, MPI_COMM_WORLD);
}
if (rank == 2)
{
MPI_Recv(&c, 1, MPI_FLOAT, MPI_ANY_SOURCE, 3, MPI_COMM_WORLD, &status);
cout << "Process : " <#include
#include
using namespace std;
int main(int argc, char**argv)
{
int rank;
float a,b,c;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
a = 0.0; b = 0.0; c=0.0;
if (rank == 0)
{
a=2.5;
MPI_Send(&a, 1, MPI_FLOAT, 2, 7, MPI_COMM_WORLD);
}
if (rank == 1)
{
b = 5.5;
MPI_Send(&b, 1, MPI_FLOAT, 2, 3, MPI_COMM_WORLD);
}
if (rank == 2)
{
MPI_Recv(&c, 1, MPI_FLOAT, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
cout << "Process : " <bir nechta jarayonlardan


Download 134.19 Kb.

Do'stlaringiz bilan baham:
  1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2022
ma'muriyatiga murojaat qiling