本文整理汇总了C++中Status::Get_source方法的典型用法代码示例。如果您正苦于以下问题:C++ Status::Get_source方法的具体用法?C++ Status::Get_source怎么用?C++ Status::Get_source使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status::Get_source方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void DepthBuilderP2PNoBlock::synchAction()
{
Status status;
if (isRecvActive && recvRequest.Test(status)) {
assert(0 <= requestedVertex && requestedVertex <= graph->numLocalVertex);
//printf("%d: write depth [ %ld] to %d\n", rank, depth[requestedVertex], status.Get_source());
sendVertex(depth[requestedVertex], status.Get_source(), DEPTH_SEND_TAG);
isRecvActive = false;
}
startRecv();
}
示例2: while
void BFSTaskP2P::performBFSSynch()
{
Status status;
Vertex memory[2] = {0};
while (true) {
if (waitSynch(BFS_SYNCH_TAG, status)) {
comm->Recv(&memory[0], 2, VERTEX_TYPE, status.Get_source(), BFS_DATA_TAG);
const Vertex currLocal = memory[0];
const Vertex parentGlobal = memory[1];
BFSdgmark::processLocalChild(parentGlobal, currLocal);
} else {
//synchronization is not neaded mode
break;
}
}
}
示例3: barrier
void task5() {
barrier("Task 5");
if (id != size - 1) {
int data = rand();
int to = size - 1;
comm.Send(&data, 1, INTEGER, to, 0);
printf("Process %d sent data [%d] to %d\n", id, data, to);
} else {
Status s;
comm.Probe(ANY_SOURCE, ANY_TAG, s);
int count = s.Get_count(INTEGER);
int* buffer = new int[count];
int from = s.Get_source();
comm.Recv(buffer, count, INTEGER, from, 0);
for (int i = 0; i < count; ++i) {
printf("Process %d recieved data [%d] from %d\n", id, *(buffer + i), from);
}
delete buffer;
}
}