change macros GLOBAL to Yap
This commit is contained in:
@@ -159,7 +159,7 @@ void Yap_init_optyap_preds(void) {
|
||||
|
||||
#ifdef YAPOR
|
||||
void finish_yapor(void) {
|
||||
GLOBAL_execution_time = current_time() - GLOBAL_execution_time;
|
||||
Yap_execution_time = current_time() - Yap_execution_time;
|
||||
show_answers();
|
||||
return;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ static Int p_abolish_all_tables( USES_REGS1 ) {
|
||||
sg_hash_ptr hash;
|
||||
sg_node_ptr sg_node;
|
||||
|
||||
tab_ent = GLOBAL_root_tab_ent;
|
||||
tab_ent = Yap_root_tab_ent;
|
||||
while(tab_ent) {
|
||||
hash = TabEnt_hash_chain(tab_ent);
|
||||
TabEnt_hash_chain(tab_ent) = NULL;
|
||||
@@ -388,7 +388,7 @@ static Int p_abolish_all_tables( USES_REGS1 ) {
|
||||
static Int p_show_tabled_predicates( USES_REGS1 ) {
|
||||
tab_ent_ptr tab_ent;
|
||||
|
||||
tab_ent = GLOBAL_root_tab_ent;
|
||||
tab_ent = Yap_root_tab_ent;
|
||||
fprintf(Yap_stdout, "Tabled predicates\n");
|
||||
if (tab_ent == NULL)
|
||||
fprintf(Yap_stdout, " NONE\n");
|
||||
@@ -421,7 +421,7 @@ static Int p_show_table( USES_REGS1 ) {
|
||||
static Int p_show_all_tables( USES_REGS1 ) {
|
||||
tab_ent_ptr tab_ent;
|
||||
|
||||
tab_ent = GLOBAL_root_tab_ent;
|
||||
tab_ent = Yap_root_tab_ent;
|
||||
while(tab_ent) {
|
||||
show_table(tab_ent, SHOW_MODE_STRUCTURE);
|
||||
tab_ent = TabEnt_next(tab_ent);
|
||||
@@ -479,9 +479,9 @@ static Int p_show_statistics_tabling( USES_REGS1 ) {
|
||||
total_bytes += aux_bytes;
|
||||
#ifdef SHM_MEMORY_ALLOC_SCHEME
|
||||
fprintf(Yap_stdout, "Total memory in use (I+II+III): %10ld bytes (%ld pages in use)\n",
|
||||
total_bytes, Pg_str_in_use(GLOBAL_PAGES_void));
|
||||
total_bytes, Pg_str_in_use(Yap_pages_void));
|
||||
fprintf(Yap_stdout, "Total memory allocated: %10ld bytes (%ld pages in total)\n",
|
||||
Pg_pg_alloc(GLOBAL_PAGES_void) * Yap_page_size, Pg_pg_alloc(GLOBAL_PAGES_void));
|
||||
Pg_pg_alloc(Yap_pages_void) * Yap_page_size, Pg_pg_alloc(Yap_pages_void));
|
||||
#else
|
||||
fprintf(Yap_stdout, "Total memory in use (I+II+III): %10ld bytes\n", total_bytes);
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
@@ -502,7 +502,7 @@ static Int p_show_statistics_global_trie( USES_REGS1 ) {
|
||||
|
||||
static Int p_yapor_threads( USES_REGS1 ) {
|
||||
#if defined(YAPOR) && defined(THREADS)
|
||||
return Yap_unify(MkIntegerTerm(number_workers),ARG1);
|
||||
return Yap_unify(MkIntegerTerm(Yap_number_workers),ARG1);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
@@ -518,25 +518,25 @@ static Int p_worker( USES_REGS1 ) {
|
||||
|
||||
|
||||
static Int p_yapor_on( USES_REGS1 ) {
|
||||
return (PARALLEL_EXECUTION_MODE);
|
||||
return (Yap_parallel_execution_mode);
|
||||
}
|
||||
|
||||
|
||||
static Int p_start_yapor( USES_REGS1 ) {
|
||||
#ifdef TIMESTAMP_CHECK
|
||||
GLOBAL_timestamp = 0;
|
||||
Yap_time_stamp = 0;
|
||||
#endif /* TIMESTAMP_CHECK */
|
||||
GLOBAL_answers = NO_ANSWER;
|
||||
BITMAP_delete(GLOBAL_bm_idle_workers, 0);
|
||||
BITMAP_clear(GLOBAL_bm_invisible_workers);
|
||||
BITMAP_clear(GLOBAL_bm_requestable_workers);
|
||||
Yap_answers = NO_ANSWER;
|
||||
BITMAP_delete(Yap_bm_idle_workers, 0);
|
||||
BITMAP_clear(Yap_bm_invisible_workers);
|
||||
BITMAP_clear(Yap_bm_requestable_workers);
|
||||
#ifdef TABLING_INNER_CUTS
|
||||
BITMAP_clear(GLOBAL_bm_pruning_workers);
|
||||
BITMAP_clear(Yap_bm_pruning_workers);
|
||||
#endif /* TABLING_INNER_CUTS */
|
||||
make_root_choice_point();
|
||||
GLOBAL_performance_mode &= ~PERFORMANCE_IN_EXECUTION;
|
||||
GLOBAL_execution_time = current_time();
|
||||
BITMAP_clear(GLOBAL_bm_finished_workers);
|
||||
Yap_performance_mode &= ~PERFORMANCE_IN_EXECUTION;
|
||||
Yap_execution_time = current_time();
|
||||
BITMAP_clear(Yap_bm_finished_workers);
|
||||
PUT_IN_EXECUTING(worker_id);
|
||||
return (TRUE);
|
||||
}
|
||||
@@ -575,7 +575,7 @@ static Int p_execution_mode( USES_REGS1 ) {
|
||||
t = Deref(ARG1);
|
||||
if (IsVarTerm(t)) {
|
||||
Term ta;
|
||||
if (PARALLEL_EXECUTION_MODE)
|
||||
if (Yap_parallel_execution_mode)
|
||||
ta = MkAtomTerm(Yap_LookupAtom("parallel"));
|
||||
else
|
||||
ta = MkAtomTerm(Yap_LookupAtom("sequential"));
|
||||
@@ -586,11 +586,11 @@ static Int p_execution_mode( USES_REGS1 ) {
|
||||
char *s;
|
||||
s = RepAtom(AtomOfTerm(t))->StrOfAE;
|
||||
if (strcmp(s,"parallel") == 0) {
|
||||
PARALLEL_EXECUTION_MODE = TRUE;
|
||||
Yap_parallel_execution_mode = TRUE;
|
||||
return(TRUE);
|
||||
}
|
||||
if (strcmp(s,"sequential") == 0) {
|
||||
PARALLEL_EXECUTION_MODE = FALSE;
|
||||
Yap_parallel_execution_mode = FALSE;
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
@@ -603,11 +603,11 @@ static Int p_performance( USES_REGS1 ) {
|
||||
realtime one_worker_execution_time = 0;
|
||||
int i;
|
||||
|
||||
GLOBAL_performance_mode |= PERFORMANCE_IN_EXECUTION;
|
||||
Yap_performance_mode |= PERFORMANCE_IN_EXECUTION;
|
||||
t = Deref(ARG1);
|
||||
if (IsVarTerm(t)) {
|
||||
Term ta;
|
||||
if (GLOBAL_performance_mode & PERFORMANCE_ON) {
|
||||
if (Yap_performance_mode & PERFORMANCE_ON) {
|
||||
ta = MkAtomTerm(Yap_LookupAtom("on"));
|
||||
} else {
|
||||
ta = MkAtomTerm(Yap_LookupAtom("off"));
|
||||
@@ -619,16 +619,16 @@ static Int p_performance( USES_REGS1 ) {
|
||||
char *s;
|
||||
s = RepAtom(AtomOfTerm(t))->StrOfAE;
|
||||
if (strcmp(s, "on") == 0) {
|
||||
GLOBAL_performance_mode |= PERFORMANCE_ON;
|
||||
Yap_performance_mode |= PERFORMANCE_ON;
|
||||
return(TRUE);
|
||||
}
|
||||
if (strcmp(s,"off") == 0) {
|
||||
GLOBAL_performance_mode &= ~PERFORMANCE_ON;
|
||||
Yap_performance_mode &= ~PERFORMANCE_ON;
|
||||
return(TRUE);
|
||||
}
|
||||
if (strcmp(s,"clear") == 0) {
|
||||
GLOBAL_number_goals = 0;
|
||||
GLOBAL_best_times(0) = 0;
|
||||
Yap_number_goals = 0;
|
||||
Yap_best_times(0) = 0;
|
||||
return(TRUE);
|
||||
}
|
||||
}
|
||||
@@ -639,31 +639,31 @@ static Int p_performance( USES_REGS1 ) {
|
||||
else
|
||||
return(FALSE);
|
||||
|
||||
if (GLOBAL_number_goals) {
|
||||
if (Yap_number_goals) {
|
||||
fprintf(Yap_stdout, "[\n Best execution times:\n");
|
||||
for (i = 1; i <= GLOBAL_number_goals; i++) {
|
||||
fprintf(Yap_stdout, " %d. time: %f seconds", i, GLOBAL_best_times(i));
|
||||
for (i = 1; i <= Yap_number_goals; i++) {
|
||||
fprintf(Yap_stdout, " %d. time: %f seconds", i, Yap_best_times(i));
|
||||
if (one_worker_execution_time != 0)
|
||||
fprintf(Yap_stdout, " --> speedup %f (%6.2f %% )\n",
|
||||
one_worker_execution_time / GLOBAL_best_times(i),
|
||||
one_worker_execution_time / GLOBAL_best_times(i) / number_workers * 100 );
|
||||
one_worker_execution_time / Yap_best_times(i),
|
||||
one_worker_execution_time / Yap_best_times(i) / Yap_number_workers* 100 );
|
||||
else fprintf(Yap_stdout, "\n");
|
||||
}
|
||||
|
||||
fprintf(Yap_stdout, " Average : %f seconds",
|
||||
GLOBAL_best_times(0) / GLOBAL_number_goals);
|
||||
Yap_best_times(0) / Yap_number_goals);
|
||||
if (one_worker_execution_time != 0)
|
||||
fprintf(Yap_stdout, " --> speedup %f (%6.2f %% )",
|
||||
one_worker_execution_time * GLOBAL_number_goals / GLOBAL_best_times(0),
|
||||
one_worker_execution_time * GLOBAL_number_goals / GLOBAL_best_times(0) / number_workers * 100 );
|
||||
one_worker_execution_time * Yap_number_goals / Yap_best_times(0),
|
||||
one_worker_execution_time * Yap_number_goals / Yap_best_times(0) / Yap_number_workers* 100 );
|
||||
|
||||
if (GLOBAL_number_goals >= 3) {
|
||||
if (Yap_number_goals >= 3) {
|
||||
fprintf(Yap_stdout, "\n Average (best three): %f seconds",
|
||||
(GLOBAL_best_times(1) + GLOBAL_best_times(2) + GLOBAL_best_times(3)) / 3);
|
||||
(Yap_best_times(1) + Yap_best_times(2) + Yap_best_times(3)) / 3);
|
||||
if (one_worker_execution_time != 0)
|
||||
fprintf(Yap_stdout, " --> speedup %f (%6.2f %% ) ]\n\n",
|
||||
one_worker_execution_time * 3 / (GLOBAL_best_times(1) + GLOBAL_best_times(2) + GLOBAL_best_times(3)),
|
||||
one_worker_execution_time * 3 / (GLOBAL_best_times(1) + GLOBAL_best_times(2) + GLOBAL_best_times(3)) / number_workers * 100 );
|
||||
one_worker_execution_time * 3 / (Yap_best_times(1) + Yap_best_times(2) + Yap_best_times(3)),
|
||||
one_worker_execution_time * 3 / (Yap_best_times(1) + Yap_best_times(2) + Yap_best_times(3)) / Yap_number_workers* 100 );
|
||||
else fprintf(Yap_stdout, "\n]\n\n");
|
||||
} else fprintf(Yap_stdout, "\n]\n\n");
|
||||
return (TRUE);
|
||||
@@ -694,7 +694,7 @@ static Int p_parallel_new_answer( USES_REGS1 ) {
|
||||
|
||||
|
||||
static Int p_parallel_yes_answer( USES_REGS1 ) {
|
||||
GLOBAL_answers = YES_ANSWER;
|
||||
Yap_answers = YES_ANSWER;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@@ -715,9 +715,9 @@ static Int p_show_statistics_or( USES_REGS1 ) {
|
||||
total_bytes += aux_bytes;
|
||||
#ifdef SHM_MEMORY_ALLOC_SCHEME
|
||||
fprintf(Yap_stdout, "Total memory in use (I+II+III): %10ld bytes (%ld pages in use)\n",
|
||||
total_bytes, Pg_str_in_use(GLOBAL_PAGES_void));
|
||||
total_bytes, Pg_str_in_use(Yap_pages_void));
|
||||
fprintf(Yap_stdout, "Total memory allocated: %10ld bytes (%ld pages in total)\n",
|
||||
Pg_pg_alloc(GLOBAL_PAGES_void) * Yap_page_size, Pg_pg_alloc(GLOBAL_PAGES_void));
|
||||
Pg_pg_alloc(Yap_pages_void) * Yap_page_size, Pg_pg_alloc(Yap_pages_void));
|
||||
#else
|
||||
fprintf(Yap_stdout, "Total memory in use (I+II+III): %10ld bytes\n", total_bytes);
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
@@ -771,9 +771,9 @@ static Int p_show_statistics_opt( USES_REGS1 ) {
|
||||
total_bytes += aux_bytes;
|
||||
#ifdef SHM_MEMORY_ALLOC_SCHEME
|
||||
fprintf(Yap_stdout, "Total memory in use (I+II+III+IV): %10ld bytes (%ld pages in use)\n",
|
||||
total_bytes, Pg_str_in_use(GLOBAL_PAGES_void));
|
||||
total_bytes, Pg_str_in_use(Yap_pages_void));
|
||||
fprintf(Yap_stdout, "Total memory allocated: %10ld bytes (%ld pages in total)\n",
|
||||
Pg_pg_alloc(GLOBAL_PAGES_void) * Yap_page_size, Pg_pg_alloc(GLOBAL_PAGES_void));
|
||||
Pg_pg_alloc(Yap_pages_void) * Yap_page_size, Pg_pg_alloc(Yap_pages_void));
|
||||
#else
|
||||
fprintf(Yap_stdout, "Total memory in use (I+II+III+IV): %10ld bytes\n", total_bytes);
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
@@ -791,99 +791,99 @@ static Int p_get_optyap_statistics( USES_REGS1 ) {
|
||||
if (value == 0) { /* total_memory */
|
||||
bytes = 0;
|
||||
#ifdef TABLING
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_tab_ent) * sizeof(struct table_entry);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_sg_fr) * sizeof(struct subgoal_frame);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_dep_fr) * sizeof(struct dependency_frame);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_sg_node) * sizeof(struct subgoal_trie_node);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_ans_node) * sizeof(struct answer_trie_node);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_sg_hash) * sizeof(struct subgoal_trie_hash);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_ans_hash) * sizeof(struct answer_trie_hash);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_gt_node) * sizeof(struct global_trie_node);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_gt_hash) * sizeof(struct global_trie_hash);
|
||||
bytes += Pg_str_in_use(Yap_pages_tab_ent) * sizeof(struct table_entry);
|
||||
bytes += Pg_str_in_use(Yap_pages_sg_fr) * sizeof(struct subgoal_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_dep_fr) * sizeof(struct dependency_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_sg_node) * sizeof(struct subgoal_trie_node);
|
||||
bytes += Pg_str_in_use(Yap_pages_ans_node) * sizeof(struct answer_trie_node);
|
||||
bytes += Pg_str_in_use(Yap_pages_sg_hash) * sizeof(struct subgoal_trie_hash);
|
||||
bytes += Pg_str_in_use(Yap_pages_ans_hash) * sizeof(struct answer_trie_hash);
|
||||
bytes += Pg_str_in_use(Yap_pages_gt_node) * sizeof(struct global_trie_node);
|
||||
bytes += Pg_str_in_use(Yap_pages_gt_hash) * sizeof(struct global_trie_hash);
|
||||
#endif /* TABLING */
|
||||
#ifdef YAPOR
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_or_fr) * sizeof(struct or_frame);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr) * sizeof(struct query_goal_solution_frame);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_or_fr ) * sizeof(struct or_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
|
||||
#endif /* YAPOR */
|
||||
#if defined(YAPOR) && defined(TABLING)
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_susp_fr) * sizeof(struct suspension_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_susp_fr) * sizeof(struct suspension_frame);
|
||||
#ifdef TABLING_INNER_CUTS
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
|
||||
bytes += Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
|
||||
bytes += Pg_str_in_use(Yap_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
|
||||
#endif /* TABLING_INNER_CUTS */
|
||||
#endif /* YAPOR && TABLING */
|
||||
#ifdef SHM_MEMORY_ALLOC_SCHEME
|
||||
structs = Pg_pg_alloc(GLOBAL_PAGES_void) * Yap_page_size;
|
||||
structs = Pg_pg_alloc(Yap_pages_void) * Yap_page_size;
|
||||
#else
|
||||
structs = bytes;
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
}
|
||||
#ifdef TABLING
|
||||
if (value == 1) { /* table_entries */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_tab_ent) * sizeof(struct table_entry);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_tab_ent);
|
||||
bytes = Pg_str_in_use(Yap_pages_tab_ent) * sizeof(struct table_entry);
|
||||
structs = Pg_str_in_use(Yap_pages_tab_ent);
|
||||
}
|
||||
if (value == 2) { /* subgoal_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_sg_fr) * sizeof(struct subgoal_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_sg_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_sg_fr) * sizeof(struct subgoal_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_sg_fr);
|
||||
}
|
||||
if (value == 3) { /* dependency_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_dep_fr) * sizeof(struct dependency_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_dep_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_dep_fr) * sizeof(struct dependency_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_dep_fr);
|
||||
}
|
||||
if (value == 6) { /* subgoal_trie_nodes */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_sg_node) * sizeof(struct subgoal_trie_node);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_sg_node);
|
||||
bytes = Pg_str_in_use(Yap_pages_sg_node) * sizeof(struct subgoal_trie_node);
|
||||
structs = Pg_str_in_use(Yap_pages_sg_node);
|
||||
}
|
||||
if (value == 7) { /* answer_trie_nodes */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_ans_node) * sizeof(struct answer_trie_node);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_ans_node);
|
||||
bytes = Pg_str_in_use(Yap_pages_ans_node) * sizeof(struct answer_trie_node);
|
||||
structs = Pg_str_in_use(Yap_pages_ans_node);
|
||||
}
|
||||
if (value == 8) { /* subgoal_trie_hashes */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_sg_hash) * sizeof(struct subgoal_trie_hash);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_sg_hash);
|
||||
bytes = Pg_str_in_use(Yap_pages_sg_hash) * sizeof(struct subgoal_trie_hash);
|
||||
structs = Pg_str_in_use(Yap_pages_sg_hash);
|
||||
}
|
||||
if (value == 9) { /* answer_trie_hashes */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_ans_hash) * sizeof(struct answer_trie_hash);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_ans_hash);
|
||||
bytes = Pg_str_in_use(Yap_pages_ans_hash) * sizeof(struct answer_trie_hash);
|
||||
structs = Pg_str_in_use(Yap_pages_ans_hash);
|
||||
}
|
||||
if (value == 10) { /* global_trie_nodes */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_gt_node) * sizeof(struct global_trie_node);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_gt_node);
|
||||
bytes = Pg_str_in_use(Yap_pages_gt_node) * sizeof(struct global_trie_node);
|
||||
structs = Pg_str_in_use(Yap_pages_gt_node);
|
||||
}
|
||||
if (value == 11) { /* global_trie_hashes */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_gt_hash) * sizeof(struct global_trie_hash);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_gt_hash);
|
||||
bytes = Pg_str_in_use(Yap_pages_gt_hash) * sizeof(struct global_trie_hash);
|
||||
structs = Pg_str_in_use(Yap_pages_gt_hash);
|
||||
}
|
||||
#endif /* TABLING */
|
||||
#ifdef YAPOR
|
||||
if (value == 4) { /* or_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_or_fr) * sizeof(struct or_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_or_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_or_fr ) * sizeof(struct or_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_or_fr );
|
||||
}
|
||||
if (value == 12) { /* query_goal_solution_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr) * sizeof(struct query_goal_solution_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_qg_sol_fr );
|
||||
}
|
||||
if (value == 13) { /* query_goal_answer_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_qg_ans_fr);
|
||||
}
|
||||
#endif /* YAPOR */
|
||||
#if defined(YAPOR) && defined(TABLING)
|
||||
if (value == 5) { /* suspension_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_susp_fr) * sizeof(struct suspension_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_susp_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_susp_fr) * sizeof(struct suspension_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_susp_fr);
|
||||
}
|
||||
#ifdef TABLING_INNER_CUTS
|
||||
if (value == 14) { /* table_subgoal_solution_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_tg_sol_fr);
|
||||
}
|
||||
if (value == 15) { /* table_subgoal_answer_frames */
|
||||
bytes = Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
|
||||
structs = Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr);
|
||||
bytes = Pg_str_in_use(Yap_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
|
||||
structs = Pg_str_in_use(Yap_pages_tg_ans_fr);
|
||||
}
|
||||
#endif /* TABLING_INNER_CUTS */
|
||||
#endif /* YAPOR && TABLING */
|
||||
@@ -938,12 +938,12 @@ static inline void show_answers(void) {
|
||||
aux_answer2 = aux_answer1;
|
||||
aux_answer1 = AnsFr_next(aux_answer1);
|
||||
FREE_QG_ANSWER_FRAME(aux_answer2);
|
||||
GLOBAL_answers++;
|
||||
Yap_answers++;
|
||||
}
|
||||
FREE_QG_SOLUTION_FRAME(OrFr_qg_solutions(LOCAL_top_or_fr));
|
||||
OrFr_qg_solutions(LOCAL_top_or_fr) = NULL;
|
||||
}
|
||||
switch(GLOBAL_answers) {
|
||||
switch(Yap_answers) {
|
||||
case YES_ANSWER:
|
||||
fprintf(Yap_stderr, "[ yes");
|
||||
break;
|
||||
@@ -954,27 +954,27 @@ static inline void show_answers(void) {
|
||||
fprintf(Yap_stderr, "[ 1 answer found");
|
||||
break;
|
||||
default:
|
||||
fprintf(Yap_stderr, "[ %d answers found", GLOBAL_answers);
|
||||
fprintf(Yap_stderr, "[ %d answers found", Yap_answers);
|
||||
break;
|
||||
}
|
||||
fprintf(Yap_stderr, " (in %f seconds) ]\n\n", GLOBAL_execution_time);
|
||||
fprintf(Yap_stderr, " (in %f seconds) ]\n\n", Yap_execution_time);
|
||||
|
||||
if (GLOBAL_performance_mode == PERFORMANCE_ON) {
|
||||
for (i = GLOBAL_number_goals; i > 0; i--) {
|
||||
if (GLOBAL_best_times(i) > GLOBAL_execution_time) {
|
||||
if (Yap_performance_mode == PERFORMANCE_ON) {
|
||||
for (i = Yap_number_goals; i > 0; i--) {
|
||||
if (Yap_best_times(i) > Yap_execution_time) {
|
||||
if (i + 1 < MAX_BEST_TIMES)
|
||||
GLOBAL_best_times(i + 1) = GLOBAL_best_times(i);
|
||||
Yap_best_times(i + 1) = Yap_best_times(i);
|
||||
else {
|
||||
GLOBAL_best_times(0) -= GLOBAL_best_times(i);
|
||||
Yap_best_times(0) -= Yap_best_times(i);
|
||||
}
|
||||
}
|
||||
else break;
|
||||
}
|
||||
if (i + 1 < MAX_BEST_TIMES) {
|
||||
GLOBAL_best_times(0) += GLOBAL_execution_time;
|
||||
GLOBAL_best_times(i + 1) = GLOBAL_execution_time;
|
||||
if (GLOBAL_number_goals + 1 < MAX_BEST_TIMES)
|
||||
GLOBAL_number_goals++;
|
||||
Yap_best_times(0) += Yap_execution_time;
|
||||
Yap_best_times(i + 1) = Yap_execution_time;
|
||||
if (Yap_number_goals + 1 < MAX_BEST_TIMES)
|
||||
Yap_number_goals++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1031,7 +1031,7 @@ static inline long show_statistics_table_entries(void) {
|
||||
tab_ent_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_tab_ent);
|
||||
pg_hd = Pg_free_pg(Yap_pages_tab_ent);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1040,15 +1040,15 @@ static inline long show_statistics_table_entries(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_table_entries, Pg_str_free(GLOBAL_PAGES_tab_ent) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_table_entries, Pg_str_free(Yap_pages_tab_ent) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Table entries: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_tab_ent) * sizeof(struct table_entry), Pg_pg_alloc(GLOBAL_PAGES_tab_ent), Pg_str_in_use(GLOBAL_PAGES_tab_ent));
|
||||
Pg_str_in_use(Yap_pages_tab_ent) * sizeof(struct table_entry), Pg_pg_alloc(Yap_pages_tab_ent), Pg_str_in_use(Yap_pages_tab_ent));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Table entries: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_tab_ent) * sizeof(struct table_entry), Pg_str_in_use(GLOBAL_PAGES_tab_ent));
|
||||
Pg_str_in_use(Yap_pages_tab_ent) * sizeof(struct table_entry), Pg_str_in_use(Yap_pages_tab_ent));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_tab_ent) * sizeof(struct table_entry);
|
||||
return Pg_str_in_use(Yap_pages_tab_ent) * sizeof(struct table_entry);
|
||||
}
|
||||
|
||||
|
||||
@@ -1059,7 +1059,7 @@ static inline long show_statistics_subgoal_frames(void) {
|
||||
sg_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_sg_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_sg_fr);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1068,15 +1068,15 @@ static inline long show_statistics_subgoal_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_subgoal_frames, Pg_str_free(GLOBAL_PAGES_sg_fr) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_subgoal_frames, Pg_str_free(Yap_pages_sg_fr) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Subgoal frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_sg_fr) * sizeof(struct subgoal_frame), Pg_pg_alloc(GLOBAL_PAGES_sg_fr), Pg_str_in_use(GLOBAL_PAGES_sg_fr));
|
||||
Pg_str_in_use(Yap_pages_sg_fr) * sizeof(struct subgoal_frame), Pg_pg_alloc(Yap_pages_sg_fr), Pg_str_in_use(Yap_pages_sg_fr));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Subgoal frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_sg_fr) * sizeof(struct subgoal_frame), Pg_str_in_use(GLOBAL_PAGES_sg_fr));
|
||||
Pg_str_in_use(Yap_pages_sg_fr) * sizeof(struct subgoal_frame), Pg_str_in_use(Yap_pages_sg_fr));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_sg_fr) * sizeof(struct subgoal_frame);
|
||||
return Pg_str_in_use(Yap_pages_sg_fr) * sizeof(struct subgoal_frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -1087,7 +1087,7 @@ static inline long show_statistics_dependency_frames(void) {
|
||||
dep_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_dep_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_dep_fr);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1096,15 +1096,15 @@ static inline long show_statistics_dependency_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_dependency_frames, Pg_str_free(GLOBAL_PAGES_dep_fr) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_dependency_frames, Pg_str_free(Yap_pages_dep_fr) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Dependency frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_dep_fr) * sizeof(struct dependency_frame), Pg_pg_alloc(GLOBAL_PAGES_dep_fr), Pg_str_in_use(GLOBAL_PAGES_dep_fr));
|
||||
Pg_str_in_use(Yap_pages_dep_fr) * sizeof(struct dependency_frame), Pg_pg_alloc(Yap_pages_dep_fr), Pg_str_in_use(Yap_pages_dep_fr));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Dependency frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_dep_fr) * sizeof(struct dependency_frame), Pg_str_in_use(GLOBAL_PAGES_dep_fr));
|
||||
Pg_str_in_use(Yap_pages_dep_fr) * sizeof(struct dependency_frame), Pg_str_in_use(Yap_pages_dep_fr));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_dep_fr) * sizeof(struct dependency_frame);
|
||||
return Pg_str_in_use(Yap_pages_dep_fr) * sizeof(struct dependency_frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -1115,7 +1115,7 @@ static inline long show_statistics_subgoal_trie_nodes(void) {
|
||||
sg_node_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_sg_node);
|
||||
pg_hd = Pg_free_pg(Yap_pages_sg_node);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1124,15 +1124,15 @@ static inline long show_statistics_subgoal_trie_nodes(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_subgoal_trie_nodes, Pg_str_free(GLOBAL_PAGES_sg_node) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_subgoal_trie_nodes, Pg_str_free(Yap_pages_sg_node) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Subgoal trie nodes: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_sg_node) * sizeof(struct subgoal_trie_node), Pg_pg_alloc(GLOBAL_PAGES_sg_node), Pg_str_in_use(GLOBAL_PAGES_sg_node));
|
||||
Pg_str_in_use(Yap_pages_sg_node) * sizeof(struct subgoal_trie_node), Pg_pg_alloc(Yap_pages_sg_node), Pg_str_in_use(Yap_pages_sg_node));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Subgoal trie nodes: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_sg_node) * sizeof(struct subgoal_trie_node), Pg_str_in_use(GLOBAL_PAGES_sg_node));
|
||||
Pg_str_in_use(Yap_pages_sg_node) * sizeof(struct subgoal_trie_node), Pg_str_in_use(Yap_pages_sg_node));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_sg_node) * sizeof(struct subgoal_trie_node);
|
||||
return Pg_str_in_use(Yap_pages_sg_node) * sizeof(struct subgoal_trie_node);
|
||||
}
|
||||
|
||||
|
||||
@@ -1143,7 +1143,7 @@ static inline long show_statistics_answer_trie_nodes(void) {
|
||||
ans_node_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_ans_node);
|
||||
pg_hd = Pg_free_pg(Yap_pages_ans_node);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1152,15 +1152,15 @@ static inline long show_statistics_answer_trie_nodes(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_answer_trie_nodes, Pg_str_free(GLOBAL_PAGES_ans_node) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_answer_trie_nodes, Pg_str_free(Yap_pages_ans_node) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Answer trie nodes: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_ans_node) * sizeof(struct answer_trie_node), Pg_pg_alloc(GLOBAL_PAGES_ans_node), Pg_str_in_use(GLOBAL_PAGES_ans_node));
|
||||
Pg_str_in_use(Yap_pages_ans_node) * sizeof(struct answer_trie_node), Pg_pg_alloc(Yap_pages_ans_node), Pg_str_in_use(Yap_pages_ans_node));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Answer trie nodes: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_ans_node) * sizeof(struct answer_trie_node), Pg_str_in_use(GLOBAL_PAGES_ans_node));
|
||||
Pg_str_in_use(Yap_pages_ans_node) * sizeof(struct answer_trie_node), Pg_str_in_use(Yap_pages_ans_node));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_ans_node) * sizeof(struct answer_trie_node);
|
||||
return Pg_str_in_use(Yap_pages_ans_node) * sizeof(struct answer_trie_node);
|
||||
}
|
||||
|
||||
|
||||
@@ -1171,7 +1171,7 @@ static inline long show_statistics_subgoal_trie_hashes(void) {
|
||||
sg_hash_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_sg_hash);
|
||||
pg_hd = Pg_free_pg(Yap_pages_sg_hash);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1180,15 +1180,15 @@ static inline long show_statistics_subgoal_trie_hashes(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_subgoal_trie_hashes, Pg_str_free(GLOBAL_PAGES_sg_hash) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_subgoal_trie_hashes, Pg_str_free(Yap_pages_sg_hash) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Subgoal trie hashes: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_sg_hash) * sizeof(struct subgoal_trie_hash), Pg_pg_alloc(GLOBAL_PAGES_sg_hash), Pg_str_in_use(GLOBAL_PAGES_sg_hash));
|
||||
Pg_str_in_use(Yap_pages_sg_hash) * sizeof(struct subgoal_trie_hash), Pg_pg_alloc(Yap_pages_sg_hash), Pg_str_in_use(Yap_pages_sg_hash));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Subgoal trie hashes: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_sg_hash) * sizeof(struct subgoal_trie_hash), Pg_str_in_use(GLOBAL_PAGES_sg_hash));
|
||||
Pg_str_in_use(Yap_pages_sg_hash) * sizeof(struct subgoal_trie_hash), Pg_str_in_use(Yap_pages_sg_hash));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_sg_hash) * sizeof(struct subgoal_trie_hash);
|
||||
return Pg_str_in_use(Yap_pages_sg_hash) * sizeof(struct subgoal_trie_hash);
|
||||
}
|
||||
|
||||
|
||||
@@ -1199,7 +1199,7 @@ static inline long show_statistics_answer_trie_hashes(void) {
|
||||
ans_hash_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_ans_hash);
|
||||
pg_hd = Pg_free_pg(Yap_pages_ans_hash);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1208,15 +1208,15 @@ static inline long show_statistics_answer_trie_hashes(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_answer_trie_hashes, Pg_str_free(GLOBAL_PAGES_ans_hash) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_answer_trie_hashes, Pg_str_free(Yap_pages_ans_hash) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Answer trie hashes: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_ans_hash) * sizeof(struct answer_trie_hash), Pg_pg_alloc(GLOBAL_PAGES_ans_hash), Pg_str_in_use(GLOBAL_PAGES_ans_hash));
|
||||
Pg_str_in_use(Yap_pages_ans_hash) * sizeof(struct answer_trie_hash), Pg_pg_alloc(Yap_pages_ans_hash), Pg_str_in_use(Yap_pages_ans_hash));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Answer trie hashes: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_ans_hash) * sizeof(struct answer_trie_hash), Pg_str_in_use(GLOBAL_PAGES_ans_hash));
|
||||
Pg_str_in_use(Yap_pages_ans_hash) * sizeof(struct answer_trie_hash), Pg_str_in_use(Yap_pages_ans_hash));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_ans_hash) * sizeof(struct answer_trie_hash);
|
||||
return Pg_str_in_use(Yap_pages_ans_hash) * sizeof(struct answer_trie_hash);
|
||||
}
|
||||
|
||||
|
||||
@@ -1227,7 +1227,7 @@ static inline long show_statistics_global_trie_nodes(void) {
|
||||
gt_node_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_gt_node);
|
||||
pg_hd = Pg_free_pg(Yap_pages_gt_node);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1236,15 +1236,15 @@ static inline long show_statistics_global_trie_nodes(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_global_trie_nodes, Pg_str_free(GLOBAL_PAGES_gt_node) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_global_trie_nodes, Pg_str_free(Yap_pages_gt_node) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Global trie nodes: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_gt_node) * sizeof(struct global_trie_node), Pg_pg_alloc(GLOBAL_PAGES_gt_node), Pg_str_in_use(GLOBAL_PAGES_gt_node));
|
||||
Pg_str_in_use(Yap_pages_gt_node) * sizeof(struct global_trie_node), Pg_pg_alloc(Yap_pages_gt_node), Pg_str_in_use(Yap_pages_gt_node));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Global trie nodes: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_gt_node) * sizeof(struct global_trie_node), Pg_str_in_use(GLOBAL_PAGES_gt_node));
|
||||
Pg_str_in_use(Yap_pages_gt_node) * sizeof(struct global_trie_node), Pg_str_in_use(Yap_pages_gt_node));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_gt_node) * sizeof(struct global_trie_node);
|
||||
return Pg_str_in_use(Yap_pages_gt_node) * sizeof(struct global_trie_node);
|
||||
}
|
||||
|
||||
|
||||
@@ -1255,7 +1255,7 @@ static inline long show_statistics_global_trie_hashes(void) {
|
||||
gt_hash_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_gt_hash);
|
||||
pg_hd = Pg_free_pg(Yap_pages_gt_hash);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1264,15 +1264,15 @@ static inline long show_statistics_global_trie_hashes(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
TABLING_ERROR_CHECKING(statistics_global_trie_hashes, Pg_str_free(GLOBAL_PAGES_gt_hash) != cont);
|
||||
TABLING_ERROR_CHECKING(statistics_global_trie_hashes, Pg_str_free(Yap_pages_gt_hash) != cont);
|
||||
#endif /* DEBUG_TABLING */
|
||||
fprintf(Yap_stdout, " Global trie hashes: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_gt_hash) * sizeof(struct global_trie_hash), Pg_pg_alloc(GLOBAL_PAGES_gt_hash), Pg_str_in_use(GLOBAL_PAGES_gt_hash));
|
||||
Pg_str_in_use(Yap_pages_gt_hash) * sizeof(struct global_trie_hash), Pg_pg_alloc(Yap_pages_gt_hash), Pg_str_in_use(Yap_pages_gt_hash));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Global trie hashes: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_gt_hash) * sizeof(struct global_trie_hash), Pg_str_in_use(GLOBAL_PAGES_gt_hash));
|
||||
Pg_str_in_use(Yap_pages_gt_hash) * sizeof(struct global_trie_hash), Pg_str_in_use(Yap_pages_gt_hash));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_gt_hash) * sizeof(struct global_trie_hash);
|
||||
return Pg_str_in_use(Yap_pages_gt_hash) * sizeof(struct global_trie_hash);
|
||||
}
|
||||
#endif /* TABLING */
|
||||
|
||||
@@ -1285,7 +1285,7 @@ static inline long show_statistics_or_frames(void) {
|
||||
or_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_or_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_or_fr );
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1294,15 +1294,15 @@ static inline long show_statistics_or_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
YAPOR_ERROR_CHECKING(statistics_or_frames, Pg_str_free(GLOBAL_PAGES_or_fr) != cont);
|
||||
YAPOR_ERROR_CHECKING(statistics_or_frames, Pg_str_free(Yap_pages_or_fr ) != cont);
|
||||
#endif /* DEBUG_YAPOR */
|
||||
fprintf(Yap_stdout, " Or-frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_or_fr) * sizeof(struct or_frame), Pg_pg_alloc(GLOBAL_PAGES_or_fr), Pg_str_in_use(GLOBAL_PAGES_or_fr));
|
||||
Pg_str_in_use(Yap_pages_or_fr ) * sizeof(struct or_frame), Pg_pg_alloc(Yap_pages_or_fr ), Pg_str_in_use(Yap_pages_or_fr ));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Or-frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_or_fr) * sizeof(struct or_frame), Pg_str_in_use(GLOBAL_PAGES_or_fr));
|
||||
Pg_str_in_use(Yap_pages_or_fr ) * sizeof(struct or_frame), Pg_str_in_use(Yap_pages_or_fr ));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_or_fr) * sizeof(struct or_frame);
|
||||
return Pg_str_in_use(Yap_pages_or_fr ) * sizeof(struct or_frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -1313,7 +1313,7 @@ static inline long show_statistics_query_goal_solution_frames(void) {
|
||||
qg_sol_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_qg_sol_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_qg_sol_fr );
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1322,15 +1322,15 @@ static inline long show_statistics_query_goal_solution_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
YAPOR_ERROR_CHECKING(statistics_query_goal_solution_frames, Pg_str_free(GLOBAL_PAGES_qg_sol_fr) != cont);
|
||||
YAPOR_ERROR_CHECKING(statistics_query_goal_solution_frames, Pg_str_free(Yap_pages_qg_sol_fr ) != cont);
|
||||
#endif /* DEBUG_YAPOR */
|
||||
fprintf(Yap_stdout, " Query goal solution frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr) * sizeof(struct query_goal_solution_frame), Pg_pg_alloc(GLOBAL_PAGES_qg_sol_fr), Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr));
|
||||
Pg_str_in_use(Yap_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame), Pg_pg_alloc(Yap_pages_qg_sol_fr ), Pg_str_in_use(Yap_pages_qg_sol_fr ));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Query goal solution frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr) * sizeof(struct query_goal_solution_frame), Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr));
|
||||
Pg_str_in_use(Yap_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame), Pg_str_in_use(Yap_pages_qg_sol_fr ));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_qg_sol_fr) * sizeof(struct query_goal_solution_frame);
|
||||
return Pg_str_in_use(Yap_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -1341,7 +1341,7 @@ static inline long show_statistics_query_goal_answer_frames(void) {
|
||||
qg_ans_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_qg_ans_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_qg_ans_fr);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1350,15 +1350,15 @@ static inline long show_statistics_query_goal_answer_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
YAPOR_ERROR_CHECKING(statistics_query_goal_answer_frames, Pg_str_free(GLOBAL_PAGES_qg_ans_fr) != cont);
|
||||
YAPOR_ERROR_CHECKING(statistics_query_goal_answer_frames, Pg_str_free(Yap_pages_qg_ans_fr) != cont);
|
||||
#endif /* DEBUG_YAPOR */
|
||||
fprintf(Yap_stdout, " Query goal answer frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr) * sizeof(struct query_goal_answer_frame), Pg_pg_alloc(GLOBAL_PAGES_qg_ans__fr), Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr));
|
||||
Pg_str_in_use(Yap_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame), Pg_pg_alloc(Yap_pages_qg_ans__fr), Pg_str_in_use(Yap_pages_qg_ans_fr));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Query goal answer frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr) * sizeof(struct query_goal_answer_frame), Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr));
|
||||
Pg_str_in_use(Yap_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame), Pg_str_in_use(Yap_pages_qg_ans_fr));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
|
||||
return Pg_str_in_use(Yap_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
|
||||
}
|
||||
#endif /* YAPOR */
|
||||
|
||||
@@ -1371,7 +1371,7 @@ static inline long show_statistics_suspension_frames(void) {
|
||||
susp_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_susp_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_susp_fr);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1380,15 +1380,15 @@ static inline long show_statistics_suspension_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
OPTYAP_ERROR_CHECKING(statistics_suspension_frames, Pg_str_free(GLOBAL_PAGES_susp_fr) != cont);
|
||||
OPTYAP_ERROR_CHECKING(statistics_suspension_frames, Pg_str_free(Yap_pages_susp_fr) != cont);
|
||||
#endif /* DEBUG_OPTYAP */
|
||||
fprintf(Yap_stdout, " Suspension frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_susp_fr) * sizeof(struct suspension_frame), Pg_pg_alloc(GLOBAL_PAGES_susp_fr), Pg_str_in_use(GLOBAL_PAGES_susp_fr));
|
||||
Pg_str_in_use(Yap_pages_susp_fr) * sizeof(struct suspension_frame), Pg_pg_alloc(Yap_pages_susp_fr), Pg_str_in_use(Yap_pages_susp_fr));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Suspension frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_susp_fr) * sizeof(struct suspension_frame), Pg_str_in_use(GLOBAL_PAGES_susp_fr));
|
||||
Pg_str_in_use(Yap_pages_susp_fr) * sizeof(struct suspension_frame), Pg_str_in_use(Yap_pages_susp_fr));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_susp_fr) * sizeof(struct suspension_frame);
|
||||
return Pg_str_in_use(Yap_pages_susp_fr) * sizeof(struct suspension_frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -1400,7 +1400,7 @@ static inline long show_statistics_table_subgoal_solution_frames(void) {
|
||||
tg_sol_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_tg_sol_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_tg_sol_fr);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1409,15 +1409,15 @@ static inline long show_statistics_table_subgoal_solution_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
OPTYAP_ERROR_CHECKING(statistics_table_subgoal_solution_frames, Pg_str_free(GLOBAL_PAGES_tg_sol_fr) != cont);
|
||||
OPTYAP_ERROR_CHECKING(statistics_table_subgoal_solution_frames, Pg_str_free(Yap_pages_tg_sol_fr) != cont);
|
||||
#endif /* DEBUG_OPTYAP */
|
||||
fprintf(Yap_stdout, " Table subgoal solution frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame), Pg_pg_alloc(GLOBAL_PAGES_tg_sol_fr), Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr));
|
||||
Pg_str_in_use(Yap_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame), Pg_pg_alloc(Yap_pages_tg_sol_fr), Pg_str_in_use(Yap_pages_tg_sol_fr));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Table subgoal solution frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame), Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr));
|
||||
Pg_str_in_use(Yap_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame), Pg_str_in_use(Yap_pages_tg_sol_fr));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
|
||||
return Pg_str_in_use(Yap_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -1428,7 +1428,7 @@ static inline long show_statistics_table_subgoal_answer_frames(void) {
|
||||
tg_ans_fr_ptr aux_ptr;
|
||||
long cont = 0;
|
||||
|
||||
pg_hd = Pg_free_pg(GLOBAL_PAGES_tg_ans_fr);
|
||||
pg_hd = Pg_free_pg(Yap_pages_tg_ans_fr);
|
||||
while (pg_hd) {
|
||||
aux_ptr = PgHd_free_str(pg_hd);
|
||||
while (aux_ptr) {
|
||||
@@ -1437,15 +1437,15 @@ static inline long show_statistics_table_subgoal_answer_frames(void) {
|
||||
}
|
||||
pg_hd = PgHd_next(pg_hd);
|
||||
}
|
||||
OPTYAP_ERROR_CHECKING(statistics_table_subgoal_answer_frames, Pg_str_free(GLOBAL_PAGES_tg_ans_fr) != cont);
|
||||
OPTYAP_ERROR_CHECKING(statistics_table_subgoal_answer_frames, Pg_str_free(Yap_pages_tg_ans_fr) != cont);
|
||||
#endif /* DEBUG_OPTYAP */
|
||||
fprintf(Yap_stdout, " Table subgoal answer frames: %10ld bytes (%ld pages and %ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame), Pg_pg_alloc(GLOBAL_PAGES_tg_ans_fr), Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr));
|
||||
Pg_str_in_use(Yap_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame), Pg_pg_alloc(Yap_pages_tg_ans_fr), Pg_str_in_use(Yap_pages_tg_ans_fr));
|
||||
#else
|
||||
fprintf(Yap_stdout, " Table subgoal answer frames: %10ld bytes (%ld structs in use)\n",
|
||||
Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame), Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr));
|
||||
Pg_str_in_use(Yap_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame), Pg_str_in_use(Yap_pages_tg_ans_fr));
|
||||
#endif /* SHM_MEMORY_ALLOC_SCHEME */
|
||||
return Pg_str_in_use(GLOBAL_PAGES_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
|
||||
return Pg_str_in_use(Yap_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
|
||||
}
|
||||
#endif /* TABLING_INNER_CUTS */
|
||||
#endif /* YAPOR && TABLING */
|
||||
|
Reference in New Issue
Block a user