本文整理汇总了C++中DataSetList::SetHasCopies方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSetList::SetHasCopies方法的具体用法?C++ DataSetList::SetHasCopies怎么用?C++ DataSetList::SetHasCopies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSetList
的用法示例。
在下文中一共展示了DataSetList::SetHasCopies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
// Exec_SortEnsembleData::Execute()
Exec::RetType Exec_SortEnsembleData::Execute(CpptrajState& State, ArgList& argIn)
{
debug_ = State.Debug();
DataSetList setsToSort;
std::string dsarg = argIn.GetStringNext();
while (!dsarg.empty()) {
setsToSort += State.DSL().GetMultipleSets( dsarg );
dsarg = argIn.GetStringNext();
}
int err = 0;
# ifdef MPI
// For now, require ensemble mode in parallel.
if (!Parallel::EnsembleIsSetup()) {
rprinterr("Error: Data set ensemble sort requires ensemble mode in parallel.\n");
return CpptrajState::ERR;
}
// Only TrajComm masters have complete data.
if (Parallel::TrajComm().Master()) {
comm_ = Parallel::MasterComm();
# endif
DataSetList OutputSets;
err = SortData( setsToSort, OutputSets );
if (err == 0) {
// Remove unsorted sets.
for (DataSetList::const_iterator ds = setsToSort.begin(); ds != setsToSort.end(); ++ds)
State.DSL().RemoveSet( *ds );
// Add sorted sets.
for (DataSetList::const_iterator ds = OutputSets.begin(); ds != OutputSets.end(); ++ds)
State.DSL().AddSet( *ds );
// Since sorted sets have been transferred to master DSL, OutputSets now
// just has copies.
OutputSets.SetHasCopies( true );
mprintf("\tSorted sets:\n");
OutputSets.List();
}
# ifdef MPI
}
if (Parallel::World().CheckError( err ))
# else
if (err != 0)
# endif
return CpptrajState::ERR;
return CpptrajState::OK;
}