void operator()(tbb::flow::continue_msg) const {
    const vfgpu_hdr_t& hdr0 = hdrs_all[f0], 
                       hdr1 = hdrs_all[f1];
    GLHeader h0 = conv_hdr(cfg, hdr0), 
             h1 = conv_hdr(cfg, hdr1);
    const std::vector<vfgpu_pf_t>& pfs0 = pfs_all[f0], 
                                   pfs1 = pfs_all[f1];
    const std::vector<vfgpu_pe_t>& pes = pes_all[interval];
    const std::vector<VortexObject>& vobjs0 = vobjs_all[f0],
                                     vobjs1 = vobjs_all[f1];
    std::vector<VortexLine>& vlines0 = vlines_all[f0], 
                             vlines1 = vlines_all[f1];

    GLGPU3DDataset *ds = new GLGPU3DDataset;
    ds->SetHeader(h0);
    ds->SetMeshType(cfg.meshtype);
    ds->BuildMeshGraph();

    VortexExtractor *ex = new VortexExtractor;
    ex->SetDataset(ds);
    
    for (int i=0; i<pfs0.size(); i++) {
      const vfgpu_pf_t &pf = pfs0[i];
      int chirality = pf.fid_and_chirality & 0x80000000 ? 1 : -1;
      int fid = pf.fid_and_chirality & 0x7fffffff;
      ex->AddPuncturedFace(fid, 0, chirality, pf.pos);
    }
    
    for (int i=0; i<pfs1.size(); i++) {
      const vfgpu_pf_t &pf = pfs1[i];
      int chirality = pf.fid_and_chirality & 0x80000000 ? 1 : -1;
      int fid = pf.fid_and_chirality & 0x7fffffff;
      ex->AddPuncturedFace(fid, 1, chirality, pf.pos);
    }

    for (int i=0; i<pes.size(); i++) {
      const vfgpu_pe_t &pe = pes[i];
      int chirality = pe & 0x80000000 ? 1 : -1;
      int eid = pe & 0x7fffffff;
      ex->AddPuncturedEdge(eid, chirality, 0);
    }

    ex->SetVortexObjects(vobjs0, 0);
    ex->SetVortexObjects(vobjs1, 1);
    VortexTransitionMatrix mat = ex->TraceOverTime();
    mat.SetInterval(interval);
    mat.Modularize();
    vt.AddMatrix(mat);

    delete ex;
    delete ds;
    
    // compute_moving_speed(f0, f1, vlines0, vlines1, mat);
    write_mat(f0, f1, mat);
    write_vlines(f0, vlines0);
    
    fprintf(stderr, "interval={%d, %d}, #pfs0=%d, #pfs1=%d, #pes=%d\n", 
        interval.first, interval.second, (int)pfs0.size(), (int)pfs1.size(), (int)pes.size());
    
    // release resources
    pes_all[interval].clear();
    int &fc0 = frame_counter[f0], 
        &fc1 = frame_counter[f1];
    __sync_fetch_and_add(&fc0, 1);
    __sync_fetch_and_add(&fc1, 1);
    if (fc0 == 2) {
      pfs_all[fc0] = std::vector<vfgpu_pf_t>();
      vobjs_all[fc0] = std::vector<VortexObject>();
      vlines_all[fc0] = std::vector<VortexLine>();
    }
    if (fc1 == 2) {
      pfs_all[fc1] = std::vector<vfgpu_pf_t>();
      vobjs_all[fc1] = std::vector<VortexObject>();
      vlines_all[fc1] = std::vector<VortexLine>();
    }
    
    __sync_fetch_and_sub(&num_buffered_frames, 1);
  }