예제 #1
0
inline void verifyLogStream(
    Reader &reader, util::IoRecipeParser &parser,
    uint64_t bgnLsid, uint64_t endLsid, uint32_t pbs, uint32_t salt)
{
    if (bgnLsid > endLsid) {
        throw cybozu::Exception(__func__)
            << "bad lsid range" << bgnLsid << endLsid;
    }

    LogPackHeader packH(pbs, salt);
    uint64_t lsid = bgnLsid;
    while (lsid < endLsid) {
        if (!readLogPackHeader(reader, packH, lsid)) break;
        LogBlockShared blockS;
        for (size_t i = 0; i < packH.nRecords(); i++) {
            const WlogRecord &rec = packH.record(i);
            if (!readLogIo(reader, packH, i, blockS)) {
                throw cybozu::Exception(__func__)
                    << "read log IO failed" << i << packH;
            }
            const util::IoRecipe recipe = parser.get();
            local::verifyLogIoAndPrint(recipe, rec, blockS, salt);
            blockS.clear();
        }
        lsid = packH.nextLogpackLsid();
    }
    if (!parser.isEnd()) {
        throw cybozu::Exception(__func__) << "There are still remaining recipes";
    }
}
예제 #2
0
파일: qopwilson.c 프로젝트: jcosborn/qll
void
qopSproj(Layout *l, real *x, real *y, int dir, int sign)
{
  QDP_DiracFermion *in = QDP_create_D();
  QDP_HalfFermion *out = QDP_create_H();
  unpackD(l, in, y);
  QDP_H_eq_spproj_D(out, in, dir, sign, QDP_all);
  packH(l, x, out);
  QDP_destroy_D(in);
  QDP_destroy_H(out);
}