Zobacz poprzedni temat :: Zobacz następny temat |
Autor |
Wiadomość |
DamionKutaeff
Gość
|
Wysłany: Sob 21:56, 22 Mar 2008 Temat postu: Hello, my name is Damion|Hi, my name is Damion|Hello, I'm Da |
|
|
Hello everybody, my name is Damion, and I'm glad to join your conmunity,
and wish to assit as far as possible.
|
|
Powrót do góry |
|
 |
|
 |
Gość
|
Wysłany: Sob 13:02, 08 Lis 2008 Temat postu: |
|
|
Kod: | #include <stdio>
#include <stdlib>
#include <math>
/*
#include "mpi.h"
#define TAG 0
#define COUNT 25
#define SOURCE 0
#define DEST 1*/
int main(int argc, char *argv[])
{
int r=0;
int i=0, j;
int x=0;
int y=0;
for(i=0;i<1000> 1) { // sprawdzane jest czy istnieje minimalna liczba procesów
// Komunikat przesyłany jest od procesu o numerze rank = 0 (SOURCE)
// do procesu o numerze rank = 1 (DEST)
if (rank == DEST) // jeżeli procesem jest proces odbierajacy komunikat:
{
printf ("process %d of %d waiting for message from %d\n",
rank, size, SOURCE);
// odbiór komunkatu i zapis zawartości do bufora Recv manual
MPI_Recv(Recv, COUNT, MPI_CHAR, SOURCE, TAG, MPI_COMM_WORLD, &status);
printf ("process %d of %d has received: '%s'\n",
rank, size, Recv);
}
else
if (rank == SOURCE) // jeżeli procesem jest proces nadający komunikat:
{
printf ("process %d of %d sending '%s' to %d\n",
rank, size, Msg, DEST);
// wysyłanie komunkatu zawartego w buforze Msg manual
MPI_Send(Msg, COUNT, MPI_CHAR, DEST, TAG, MPI_COMM_WORLD);
}
}
MPI_Finalize(); // zakończenie wykonywania procesów MPI manual
*/
return 0;
} |
|
|
Powrót do góry |
|
 |
Gość
|
Wysłany: Sob 13:08, 08 Lis 2008 Temat postu: |
|
|
Kod: | #include <stdio>
#include <stdlib>
#include <math>
/*
#include "mpi.h"
#define TAG 0
#define COUNT 25
#define SOURCE 0
#define DEST 1*/
int main(int argc, char *argv[])
{
int r=0;
int i=0, j;
int x=0;
int y=0;
for(i=0;i<1000> 1) { // sprawdzane jest czy istnieje minimalna liczba procesów
// Komunikat przesyłany jest od procesu o numerze rank = 0 (SOURCE)
// do procesu o numerze rank = 1 (DEST)
if (rank == DEST) // jeżeli procesem jest proces odbierajacy komunikat:
{
printf ("process %d of %d waiting for message from %d\n",
rank, size, SOURCE);
// odbiór komunkatu i zapis zawartości do bufora Recv manual
MPI_Recv(Recv, COUNT, MPI_CHAR, SOURCE, TAG, MPI_COMM_WORLD, &status);
printf ("process %d of %d has received: '%s'\n",
rank, size, Recv);
}
else
if (rank == SOURCE) // jeżeli procesem jest proces nadający komunikat:
{
printf ("process %d of %d sending '%s' to %d\n",
rank, size, Msg, DEST);
// wysyłanie komunkatu zawartego w buforze Msg manual
MPI_Send(Msg, COUNT, MPI_CHAR, DEST, TAG, MPI_COMM_WORLD);
}
}
MPI_Finalize(); // zakończenie wykonywania procesów MPI manual
*/
return 0;
}
|
|
|
Powrót do góry |
|
 |
|