本文整理汇总了C++中avtContract_p::SetReplicateSingleDomainOnAllProcessors方法的典型用法代码示例。如果您正苦于以下问题:C++ avtContract_p::SetReplicateSingleDomainOnAllProcessors方法的具体用法?C++ avtContract_p::SetReplicateSingleDomainOnAllProcessors怎么用?C++ avtContract_p::SetReplicateSingleDomainOnAllProcessors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类avtContract_p
的用法示例。
在下文中一共展示了avtContract_p::SetReplicateSingleDomainOnAllProcessors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: avtDataRequest
avtDataRequest_p
LoadBalancer::Reduce(avtContract_p input)
{
avtDataRequest_p data = input->GetDataRequest();
//
// It is difficult for the load balancer to communicate with the originating
// source because it is done through callbacks.
// So we do it by setting a Boolean in the contract. Since there is only
// one path that involves actually doing data replication, and many that don't,
// we will unset the Boolean now and reset it in the case we actually do
// data replication.
//
#ifdef PARALLEL
// only used in parallel
bool dataReplicationRequested = input->ReplicateSingleDomainOnAllProcessors();
#endif
input->SetReplicateSingleDomainOnAllProcessors(false);
//
// Pipeline index 0 is reserved for meta-data. It should already be
// load balanced.
//
if (input->GetPipelineIndex() == 0)
{
return data;
}
//
// Assess load balancing specially for serial engines.
//
if (nProcs <= 1)
{
bool doDynLB = CheckDynamicLoadBalancing(input);
if (!doDynLB && scheme != LOAD_BALANCE_STREAM)
{
pipelineInfo[input->GetPipelineIndex()].complete = true;
return data;
}
else
{
avtDataObjectSource::RegisterProgressCallback(NULL,NULL);
avtSILRestriction_p orig_silr = data->GetRestriction();
avtSILRestriction_p silr = new avtSILRestriction(orig_silr);
avtDataRequest_p new_data =
new avtDataRequest(data, silr);
avtSILRestrictionTraverser trav(silr);
vector<int> list;
trav.GetDomainList(list);
if (pipelineInfo[input->GetPipelineIndex()].current < 0)
pipelineInfo[input->GetPipelineIndex()].current = 0;
int domain = list[pipelineInfo[input->GetPipelineIndex()].current];
int sggDomain = avtStreamingGhostGenerator::LBGetNextDomain();
if (sggDomain >= 0)
domain = sggDomain;
vector<int> domainList(1, domain);
new_data->GetRestriction()
->RestrictDomainsForLoadBalance(domainList);
UpdateProgress(pipelineInfo[input->GetPipelineIndex()].current,
(int)list.size());
pipelineInfo[input->GetPipelineIndex()].current++;
if (pipelineInfo[input->GetPipelineIndex()].current == (int)list.size())
pipelineInfo[input->GetPipelineIndex()].complete = true;
return new_data;
}
}
#ifdef PARALLEL
avtSILRestriction_p orig_silr = data->GetRestriction();
avtSILRestriction_p silr = new avtSILRestriction(orig_silr);
avtDataRequest_p new_data = new avtDataRequest(data, silr);
avtSILRestrictionTraverser trav(silr);
// set up MPI message tags
static int lastDomDoneMsg = GetUniqueMessageTag();
static int newDomToDoMsg = GetUniqueMessageTag();
// Make sure that we have domain to file mapping available.
LBInfo &lbInfo(pipelineInfo[input->GetPipelineIndex()]);
std::string meshName = GetMeshName(input, dbState[lbInfo.db]);
GetIOInformation(lbInfo.db, dbState[lbInfo.db], meshName);
if (scheme == LOAD_BALANCE_STREAM)
{
if (pipelineInfo[input->GetPipelineIndex()].current < 0)
{
pipelineInfo[input->GetPipelineIndex()].current = 0;
//
// We probably want to do something more sophisticated in the future
// (like walking through a SIL). For now, just use the "chunks"
// mechanism set up with convenience methods.
//
vector<int> list;
trav.GetDomainList(list);
//.........这里部分代码省略.........