#include <mpi.h>
#include <vector>
Go to the source code of this file.
static int clearPending |
( |
int |
numNodes, |
|
|
int |
myrank, |
|
|
MPI_Request * |
recvReq, |
|
|
double & |
tot |
|
) |
| |
|
static |
static double doWork |
( |
double * |
work | ) |
|
|
static |
static double* get_next_work_item |
( |
int |
numCalls | ) |
|
|
static |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 33 of file proc4.cpp.
References doWork(), get_next_work_item(), numEntries, numNodes, recvBuf, and totCalls.
39 tc * ( ( ne * (ne - 1.0) )/2.0 ) +
40 ne * ( tc * (tc - 1.0) )/2.0;
46 MPI_Init(&argc, &argv);
50 MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
51 MPI_Comm_size(MPI_COMM_WORLD, &
numNodes);
58 int begin = myrank * numCallsPerNode;
59 int end = begin + numCallsPerNode;
62 for (
int i = 0; i < numCallsPerNode; ++i ) {
66 sendBuf[targetNode * numEntries + j ] = work[j];
70 for (
int j = 0; j <
numNodes; ++j ) {
71 MPI_Scatter( sendBuf, numEntries, MPI_DOUBLE,
72 recvBuf, numEntries * (1 + j ), MPI_DOUBLE, j,
81 MPI_Allgather( &tot, 1, MPI_DOUBLE,
82 totBuf, 1, MPI_DOUBLE,
92 cout << myrank <<
": Tot = " << tot <<
93 ", expected = " << expectedTot <<
94 ", subtot = " << subtot << endl;
static double doWork(double *work)
static unsigned int numNodes
static double * get_next_work_item(int numCalls)
static vector< vector< double > > recvBuf
const int numEntries = 10 |
vector< vector< double > > recvBuf |
|
static |
const int totCalls = 2 * 65536 |