void tarjan_local_init (run_t *run, wctx_t *ctx) { ctx->local = RTmallocZero (sizeof (alg_local_t)); ctx->local->target = state_info_create (); // extend state_info with tarjan_state information state_info_add_simple (ctx->local->target, sizeof (uint32_t), &ctx->local->target_tarjan.index); state_info_add_simple (ctx->local->target, sizeof (uint32_t), &ctx->local->target_tarjan.lowlink); state_info_add_simple (ctx->state, sizeof (uint32_t), &ctx->local->state_tarjan.index); state_info_add_simple (ctx->state, sizeof (uint32_t), &ctx->local->state_tarjan.lowlink); size_t len = state_info_serialize_int_size (ctx->state); ctx->local->search_stack = dfs_stack_create (len); ctx->local->tarjan_stack = dfs_stack_create (len); ctx->local->cnt.scc_count = 0; ctx->local->cnt.tarjan_counter = 0; ctx->local->visited_states = fset_create (sizeof (ref_t), sizeof (raw_data_t), 10, dbs_size); #ifdef SEARCH_COMPLETE_GRAPH // provide the input file name to dlopen_setup dlopen_setup (files[0]); #endif (void) run; }
fset_node_t *_fset_node_create(const char *name){ fset_node_t *node = malloc(sizeof(fset_node_t)); node->data = fset_create(); node->next = NULL; strncpy(node->name, name, 31); return node; }
void cndfs_local_setup (run_t *run, wctx_t *ctx) { cndfs_alg_local_t *cloc = (cndfs_alg_local_t *) ctx->local; cloc->timer = RTcreateTimer (); ndfs_local_setup (run, ctx); size_t len = state_info_serialize_int_size (ctx->state); cloc->in_stack = dfs_stack_create (len); cloc->out_stack = dfs_stack_create (len); if ((get_strategy(run->alg) & Strat_TA) == 0) { cloc->pink = fset_create (sizeof(ref_t), sizeof(size_t), FSET_MIN_SIZE, 24); } if (get_strategy(run->alg) & Strat_CNDFS) return; if (run->shared->rec == NULL) { Abort ("Missing recursive strategy for %s!", key_search(strategies, get_strategy(run->alg))); return; } HREassert (ctx->global != NULL, "Run global before local init"); // We also need to finalize the worker initialization: ctx->global->rec = run_init (run->shared->rec, ctx->model); // Recursive strategy maybe unaware of its caller, so here we update its // recursive bits (top-level strategy always has rec_bits == 0, which // is ensured by ndfs_local_setup): ctx->global->rec->local->rec_bits = run->shared->color_bit_shift; cloc->rec = ctx->global->rec->local; }