Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Plain Text by p1 ( 12 years ago )
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "mpi.h"

int main( int argc, char *argv[] )
{
    MPI_Comm intercomm;
    char     str[10] = "none";
    int      rank;

    MPI_Init( &argc;, &argv; );
    MPI_Comm_rank( MPI_COMM_WORLD, &rank; );
    MPI_Comm_get_parent( &intercomm; );

    srand(time(0));

    double losowa = (rand() % 1000) / 10.;

   MPI_Send(&losowa;, 1, MPI_DOUBLE, rank, 1, intercomm);

    double liczba = 0;
    MPI_Recv(&liczba;, 1, MPI_DOUBLE, rank, 2, intercomm, MPI_STATUS_IGNORE);
    
    printf("liczby: %lf\t%lf\n", losowa, liczba);

    MPI_Finalize();

    return 0;
}

 

Revise this Paste

Your Name: Code Language: