static void dump_frames(Frame *f, int depth) { for(int i=0; i<depth; i++) putchar('\t'); printf("%s: Vel %f\n", f->GetLabel(), f->GetVelocity().Length()); std::list<Frame*> m_children; for (std::list<Frame*>::iterator i = f->m_children.begin(); i!=f->m_children.end(); ++i) { dump_frames(*i, depth+1); } }
static void mcmdump(const char* path, std::string mc2) { unsigned long size; unsigned char* body; read_mcm(path, &body, &size); dump_frames(path, mc2, body, size); free(body); }
main() { #pragma omp parallel { int rank = omp_get_thread_num(); printf("hello world from %d (level 1)\n", rank); dump_frames(rank, 1); #pragma omp parallel { printf("hello world from %d (level 2)\n", rank); dump_frames(rank, 2); #pragma omp parallel { printf("hello world from %d (level 3)\n", rank); dump_frames(rank, 3); #pragma omp parallel { printf("hello world from %d (level 4)\n", rank); dump_frames(rank, 4); } } } } }