本文整理汇总了C++中stk::CommSparse::recv_buffer方法的典型用法代码示例。如果您正苦于以下问题:C++ CommSparse::recv_buffer方法的具体用法?C++ CommSparse::recv_buffer怎么用?C++ CommSparse::recv_buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stk::CommSparse
的用法示例。
在下文中一共展示了CommSparse::recv_buffer方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unpack_remote_elem_side
void unpack_remote_elem_side(stk::CommSparse& commSparse, int procId, stk::mesh::GraphEdge& recvGraphEdge)
{
stk::mesh::EntityId globalId;
commSparse.recv_buffer(procId).unpack<stk::mesh::EntityId>(globalId);
recvGraphEdge.elem2 = -globalId;
commSparse.recv_buffer(procId).unpack<int>(recvGraphEdge.side2);
}
示例2: unpack_local_elem_side
void unpack_local_elem_side(stk::CommSparse& commSparse,
int procId,
const IdMapper& idMapper,
stk::mesh::GraphEdge& recvGraphEdge)
{
stk::mesh::EntityId globalId;
commSparse.recv_buffer(procId).unpack<stk::mesh::EntityId>(globalId);
recvGraphEdge.elem1 = idMapper.globalToLocal(globalId);
commSparse.recv_buffer(procId).unpack<int>(recvGraphEdge.side1);
}
示例3: ThrowRequireWithSierraHelpMsg
stk::mesh::GraphEdge unpack_edge(stk::CommSparse& comm, const stk::mesh::BulkData& bulkData, const ElemElemGraph& graph, int proc_id)
{
stk::mesh::EntityId id1 = 0, id2 = 0;
unsigned side1 = 0, side2 = 0;
comm.recv_buffer(proc_id).unpack<stk::mesh::EntityId>(id1);
comm.recv_buffer(proc_id).unpack<unsigned>(side1);
comm.recv_buffer(proc_id).unpack<stk::mesh::EntityId>(id2);
comm.recv_buffer(proc_id).unpack<unsigned>(side2);
stk::mesh::Entity element = bulkData.get_entity(stk::topology::ELEM_RANK, id2);
ThrowRequireWithSierraHelpMsg(bulkData.is_valid(element));
stk::mesh::impl::LocalId localId2 = graph.get_local_element_id(element);
stk::mesh::GraphEdge edge(localId2, side2, -id1, side1);
return edge;
}
示例4: unpack_and_update_part_ordinals
void unpack_and_update_part_ordinals(stk::CommSparse &comm, const stk::mesh::BulkData& bulkData, const ElemElemGraph& graph, ParallelPartInfo ¶llelPartInfo)
{
for(int i=0;i<bulkData.parallel_size();++i)
{
while(comm.recv_buffer(i).remaining())
{
stk::mesh::GraphEdge edge = unpack_edge(comm, bulkData, graph, i);
size_t num_ordinals = 0;
comm.recv_buffer(i).unpack<size_t>(num_ordinals);
std::vector<stk::mesh::PartOrdinal> partOrdinals(num_ordinals);
for(stk::mesh::PartOrdinal &partOrdinal : partOrdinals)
comm.recv_buffer(i).unpack<stk::mesh::PartOrdinal>(partOrdinal);
parallelPartInfo[edge.elem2()] = partOrdinals;
}
}
}
示例5: recieve_num_active_neighbors_of_local_elements
void NoGhostGameofLife::recieve_num_active_neighbors_of_local_elements(stk::CommSparse& buffer)
{
for (int procNum = 0; procNum < m_numProcs; procNum++)
{
stk::CommBuffer& buf = buffer.recv_buffer(procNum);
while(buf.remaining())
update_local_element_with_remote_neighbor_data(buf);
}
}
示例6: unpack_remote_elem_key_info_from_buffer
void NoGhostGameofLife::unpack_remote_elem_key_info_from_buffer(stk::CommSparse& buffer)
{
for (int proc = 0; proc < m_numProcs; proc++)
{
stk::CommBuffer& buf = buffer.recv_buffer(proc);
while (buf.remaining())
unpack_remote_info_from_this_processor(proc, buf);
}
}
示例7: recieve_local_element_keys_to_check
void NoGhostGameofLife::recieve_local_element_keys_to_check(stk::CommSparse& buffer)
{
for (int procNum = 0; procNum < m_numProcs; procNum++)
{
stk::CommBuffer& buf = buffer.recv_buffer(procNum);
while (buf.remaining())
m_localElementsToVisit.insert(m_bulkData->
get_entity(stk::unpack<stk::mesh::EntityKey>(buf)));
}
}
示例8: unpack_local_and_remote_key_info_from_each_processor
void NoGhostGameofLife::unpack_local_and_remote_key_info_from_each_processor(stk::CommSparse&
buffer)
{
for (int procRank = 0; procRank < m_numProcs; procRank++)
{
stk::CommBuffer& buf = buffer.recv_buffer(procRank);
while (buf.remaining())
unpack_local_and_remote_keys_from_buffer(buf);
}
}
示例9: unpack_data
void unpack_data(stk::CommSparse& comm, int my_proc_id, int num_procs, std::vector<SideSharingData>& sideSharingDataThisProc)
{
for(int i=0;i<num_procs;++i)
{
while(comm.recv_buffer(i).remaining())
{
stk::mesh::impl::IdViaSidePair receivedIdSide;
stk::mesh::EntityId chosenId;
comm.recv_buffer(i).unpack<stk::mesh::EntityId>(receivedIdSide.id);
comm.recv_buffer(i).unpack<int>(receivedIdSide.side);
comm.recv_buffer(i).unpack<stk::mesh::EntityId>(chosenId);
SideSharingData localTemp;
localTemp.elementAndSide = receivedIdSide;
localTemp.owningProc = std::min(my_proc_id, i);;
localTemp.sharingProc = i;
localTemp.chosenSideId = chosenId;
unpack_vector(comm.recv_buffer(i), localTemp.sideNodes);
unpack_vector(comm.recv_buffer(i), localTemp.partOrdinals);
sideSharingDataThisProc.push_back(localTemp);
}
}
}
示例10: unpack_selector_value
void unpack_selector_value(stk::CommSparse& comm, int rank, RemoteSelectedValue &remoteSelectedValue)
{
int64_t id;
comm.recv_buffer(rank).unpack<int64_t>(id);
remoteSelectedValue.set_id_as_selected(id);
}
示例11:
stk::mesh::EntityId unpack_chosen_side_id(stk::CommSparse &commSparse, int procId)
{
stk::mesh::EntityId chosenSideId;
commSparse.recv_buffer(procId).unpack<stk::mesh::EntityId>(chosenSideId);
return chosenSideId;
}