本文整理汇总了C++中DataStore::map方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStore::map方法的具体用法?C++ DataStore::map怎么用?C++ DataStore::map使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStore
的用法示例。
在下文中一共展示了DataStore::map方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loader
void
evaluate(KMRNext* next, int rank, int nprocs)
{
vector<long> datalist;
for (size_t i = 0; i < static_cast<size_t>(nprocs); i++) {
datalist.push_back(i);
}
DataLoader loader(1);
size_t dim_ary[2] = {static_cast<size_t>(nprocs), 100};
DataStore *ds0 = next->create_ds(2);
ds0->set(dim_ary);
ds0->load_integers(datalist, loader);
long ary_ff[2] = {View::SplitNone, View::SplitNone};
View vff(2);
vff.set(ary_ff);
long ary_ft[2] = {View::SplitNone, View::SplitAll};
View vft(2);
vft.set(ary_ft);
long ary_tf[2] = {View::SplitAll, View::SplitNone};
View vtf(2);
vtf.set(ary_tf);
long ary_tt[2] = {View::SplitAll, View::SplitAll};
View vtt(2);
vtt.set(ary_tt);
Timer timer_ff;
DataStore *ds = ds0->duplicate();
collate_ds(ds);
for (size_t i = 0; i < kNumIterations; i++) {
PseudoMapper mapper(rank);
timer_ff.start();
ds->map(mapper, vff);
timer_ff.finish();
#if DEBUG
ds->collate();
assert(ds->collated() == false);
#endif
}
delete ds;
Timer timer_ft;
ds = ds0->duplicate();
collate_ds(ds);
for (size_t i = 0; i < kNumIterations; i++) {
PseudoMapper mapper(rank);
timer_ft.start();
ds->map(mapper, vft);
timer_ft.finish();
#if DEBUG
ds->collate();
assert(ds->collated() == false);
#endif
}
delete ds;
Timer timer_tf;
ds = ds0->duplicate();
collate_ds(ds);
for (size_t i = 0; i < kNumIterations; i++) {
PseudoMapper mapper(rank);
timer_tf.start();
ds->map(mapper, vtf);
timer_tf.finish();
#if DEBUG
ds->collate();
assert(ds->collated() == false);
#endif
}
delete ds;
Timer timer_tt;
ds = ds0->duplicate();;
collate_ds(ds);
for (size_t i = 0; i < kNumIterations; i++) {
PseudoMapper mapper(rank);
timer_tt.start();
ds->map(mapper, vtt);
timer_tt.finish();
#if DEBUG
ds->collate();
assert(ds->collated() == false);
#endif
}
delete ds;
delete ds0;
if (rank == 0) {
cout << " ," << timer_ff.str(true, true);
cout << "FF," << timer_ff.str(false);
cout << "FT," << timer_ft.str(false);
cout << "TF," << timer_tf.str(false);
cout << "TT," << timer_tt.str(false) << endl;
}
}