YAP 7.1.0
opt.structs.h
1/************************************************************************
2** **
3** The YapTab/YapOr/OPTYap systems **
4** **
5** YapTab extends the Yap Prolog engine to support sequential tabling **
6** YapOr extends the Yap Prolog engine to support or-parallelism **
7** OPTYap extends the Yap Prolog engine to support or-parallel tabling **
8** **
9** **
10** Yap Prolog was developed at University of Porto, Portugal **
11** **
12************************************************************************/
13
14/**********************
15** typedefs **
16**********************/
17
18typedef double realtime;
19typedef unsigned long bitmap;
20
21#ifdef YAPOR_THREADS
22/* Threads may not assume addresses are the same at different workers */
23static inline choiceptr offset_to_cptr(Int node) {
24 CACHE_REGS
25 return (choiceptr)(LCL0+node);
26}
27
28static inline Int cptr_to_offset(choiceptr node) {
29 CACHE_REGS
30 return (Int)((CELL *)node-LCL0);
31}
32
33static inline choiceptr offset_to_cptr_with_null(Int node) {
34 CACHE_REGS
35 if (node == 0L) return NULL;
36 return (choiceptr)(LCL0+node);
37}
38
39static inline Int cptr_to_offset_with_null(choiceptr node) {
40 CACHE_REGS
41 if (node == NULL) return 0L;
42 return (Int)((CELL *)node-LCL0);
43}
44#endif /* YAPOR_THREADS */
45
46
47
48/**************************************************
49** ma_h_inner_struct and ma_hash_entry **
50**************************************************/
51
52#if (defined(TABLING) || !defined(YAPOR_COW)) && defined(MULTI_ASSIGNMENT_VARIABLES)
53#define MAVARS_HASH_SIZE 512
54
55typedef struct ma_h_entry {
56 CELL* addr;
57 struct ma_h_entry *next;
58} ma_h_inner_struct;
59
60typedef struct {
61 UInt timestmp;
62 struct ma_h_entry val;
63} ma_hash_entry;
64#endif /* (TABLING || !YAPOR_COW) && MULTI_ASSIGNMENT_VARIABLES */
65
66
67
68/***************************************
69** threads_dependency_frame **
70***************************************/
71
72#ifdef THREADS_CONSUMER_SHARING
73struct threads_dependency_frame {
74 lockvar lock;
75 enum {
76 working,
77 idle,
78 completing
79 } state;
80 int terminator;
81 int next;
82};
83#endif /* THREADS_CONSUMER_SHARING */
84
85#define ThDepFr_lock(X) ((X).lock)
86#define ThDepFr_state(X) ((X).state)
87#define ThDepFr_terminator(X) ((X).terminator)
88#define ThDepFr_next(X) ((X).next)
89
90
91
92/**************************
93** page_header **
94**************************/
95
96#ifdef USE_PAGES_MALLOC
97typedef struct page_header {
98 volatile size_t structs_in_use;
99 void *allocated_area;
100 void *first_free_struct;
101 struct page_header *previous;
102 struct page_header *next;
103} *pg_hd_ptr;
104#endif /* USE_PAGES_MALLOC */
105
106#define PgHd_strs_in_use(X) ((X)->structs_in_use)
107#define PgHd_alloc_area(X) ((X)->allocated_area)
108#define PgHd_first_str(X) ((X)->first_free_struct)
109#define PgHd_previous(X) ((X)->previous)
110#define PgHd_next(X) ((X)->next)
111
112
113
114/*****************************************
115** global_page and local_page **
116*****************************************/
117
119#if defined(YAPOR) || defined(THREADS)
120 lockvar lock;
121#endif /* YAPOR || THREADS */
122#ifdef USE_PAGES_MALLOC
123 struct page_header *first_page;
124 struct page_header *last_page;
125 int structs_per_page;
126 volatile long pages_in_use;
127#endif /* USE_PAGES_MALLOC */
128 volatile size_t structs_in_use;
129};
130
132#ifdef USE_PAGES_MALLOC
133 struct page_header *first_page;
134 struct page_header *last_page;
135 int structs_per_page;
136
137 size_t pages_in_use;
138#endif /* USE_PAGES_MALLOC */
139 size_t structs_in_use;
140};
141
142#define PgEnt_lock(X) ((X).lock)
143#define PgEnt_first(X) ((X).first_page)
144#define PgEnt_last(X) ((X).last_page)
145#define PgEnt_strs_per_page(X) ((X).structs_per_page)
146#define PgEnt_pages_in_use(X) ((X).pages_in_use)
147#define PgEnt_strs_in_use(X) ((X).structs_in_use)
148#define PgEnt_strs_free(X) (PgEnt_pg_in_use(X) * PgEnt_str_per_pg(X) - PgEnt_str_in_use(X))
149
150
151
152/***************************
153** global_pages **
154***************************/
155
157#ifdef USE_PAGES_MALLOC
158 struct global_page_entry alloc_pages;
159 struct global_page_entry void_pages;
160#endif /* USE_PAGES_MALLOC */
161
162#ifdef TABLING
163 struct global_page_entry table_entry_pages;
164#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
165 struct global_page_entry subgoal_entry_pages;
166#endif
167 struct global_page_entry subgoal_frame_pages;
168 struct global_page_entry dependency_frame_pages;
169 struct global_page_entry subgoal_trie_node_pages;
170 struct global_page_entry subgoal_trie_hash_pages;
171 struct global_page_entry answer_trie_node_pages;
172 struct global_page_entry answer_trie_hash_pages;
173#if defined(THREADS_FULL_SHARING)
174 struct global_page_entry answer_ref_node_pages;
175#endif
176 struct global_page_entry global_trie_node_pages;
177 struct global_page_entry global_trie_hash_pages;
178#endif /* TABLING */
179
180#ifdef YAPOR
181 struct global_page_entry or_frame_pages;
182 struct global_page_entry query_goal_solution_frame_pages;
183 struct global_page_entry query_goal_answer_frame_pages;
184#ifdef TABLING
185 struct global_page_entry suspension_frame_pages;
186#endif
187#ifdef TABLING_INNER_CUTS
188 struct global_page_entry table_subgoal_solution_frame_pages;
189 struct global_page_entry table_subgoal_answer_frame_pages;
190#endif
191#endif /* YAPOR */
192};
193
194
195
196/**************************
197** local_pages **
198**************************/
199
200#if defined(TABLING) && (defined(YAPOR) || defined(THREADS))
201struct local_pages {
202#ifdef YAPOR
203 struct answer_trie_node *next_free_answer_trie_node;
204#elif THREADS
205#ifdef USE_PAGES_MALLOC
206 struct local_page_entry void_pages;
207#endif
208 struct local_page_entry table_entry_pages;
209#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
210 struct local_page_entry subgoal_entry_pages;
211#endif
212 struct local_page_entry subgoal_frame_pages;
213 struct local_page_entry dependency_frame_pages;
214 struct local_page_entry subgoal_trie_node_pages;
215 struct local_page_entry subgoal_trie_hash_pages;
216 struct local_page_entry answer_trie_node_pages;
217 struct local_page_entry answer_trie_hash_pages;
218#if defined(THREADS_FULL_SHARING)
219 struct local_page_entry answer_ref_node_pages;
220#endif
221 struct local_page_entry global_trie_node_pages;
222 struct local_page_entry global_trie_hash_pages;
223#endif
224};
225#endif /* TABLING && (YAPOR || THREADS) */
226
227
228
229/**********************************
230** global_optyap_locks **
231**********************************/
232
233#ifdef YAPOR
234struct global_optyap_locks {
235 lockvar bitmap_idle_workers;
236 lockvar bitmap_root_cp_workers;
237 lockvar bitmap_invisible_workers;
238 lockvar bitmap_requestable_workers;
239 lockvar bitmap_finished_workers;
240#ifdef TABLING_INNER_CUTS
241 lockvar bitmap_pruning_workers;
242#endif /* TABLING_INNER_CUTS */
243
244 int who_locked_heap;
245 lockvar heap_access;
246 lockvar alloc_block;
247};
248#endif /* YAPOR */
249
250
251
252/***********************************
253** local_optyap_signals **
254***********************************/
255
256#ifdef YAPOR
257struct local_optyap_signals {
258#if defined(YAPOR_COPY) || defined(YAPOR_THREADS)
259 lockvar lock;
260 volatile enum {
261 Q_idle = 0,
262 trail = 1,
263 global = 2,
264 local = 3,
265 P_idle = 4
266 } P_fase, Q_fase;
267#endif /* YAPOR_COPY || YAPOR_THREADS */
268 volatile enum {
269 no_sharing = 0,
270 sharing = 1,
271 nodes_shared = 2,
272 copy_done = 3,
273 worker_ready = 4
274 } reply_signal;
275};
276#endif /* YAPOR */
277
278
279
280/*********************************
281** global_optyap_data **
282*********************************/
283
285 /* global data related to memory management */
286 struct global_pages pages;
287
288#ifdef YAPOR
289 /* global static data */
290 int scheduler_loop;
291 int delayed_release_load;
292 int number_workers;
293 int worker_pid[MAX_WORKERS];
294
295#ifdef YAPOR_COW
296 int master_worker;
297#endif /* YAPOR_COW */
298
299 /* global data related to or-parallelism */
300 realtime execution_time;
301#ifdef YAPOR_THREADS
302 Int root_choice_point_offset;
303#else
304 choiceptr root_choice_point;
305#endif
306 struct or_frame *root_or_frame;
307 bitmap present_workers;
308 volatile bitmap idle_workers;
309 volatile bitmap root_cp_workers;
310 volatile bitmap invisible_workers;
311 volatile bitmap requestable_workers;
312 volatile bitmap finished_workers;
313#ifdef TABLING_INNER_CUTS
314 volatile bitmap pruning_workers;
315#endif /* TABLING_INNER_CUTS */
316 struct global_optyap_locks locks;
317 volatile unsigned int branch[MAX_WORKERS][MAX_BRANCH_DEPTH];
318 volatile char parallel_mode; /* PARALLEL_MODE_OFF / PARALLEL_MODE_ON / PARALLEL_MODE_RUNNING */
319#endif /* YAPOR */
320
321#ifdef TABLING
322 /* global data related to tabling */
323 struct global_trie_node *root_global_trie;
324 struct table_entry *root_table_entry;
325#ifdef LIMIT_TABLING
326 int max_pages;
327 struct subgoal_frame *first_subgoal_frame;
328 struct subgoal_frame *last_subgoal_frame;
329 struct subgoal_frame *check_subgoal_frame;
330#endif /* LIMIT_TABLING */
331#ifdef YAPOR
332 struct dependency_frame *root_dependency_frame;
333#endif /* YAPOR */
334#ifdef THREADS_CONSUMER_SHARING
335 struct threads_dependency_frame threads_dependency_frame[MAX_THREADS];
336#endif /*THREADS_CONSUMER_SHARING*/
337 CELL table_var_enumerator[MAX_TABLE_VARS];
338#ifdef TRIE_LOCK_USING_GLOBAL_ARRAY
339 lockvar trie_locks[TRIE_LOCK_BUCKETS];
340#endif /* TRIE_LOCK_USING_GLOBAL_ARRAY */
341#ifdef TIMESTAMP_CHECK
342 long timestamp;
343#endif /* TIMESTAMP_CHECK */
344#endif /* TABLING */
345};
346
347#define GLOBAL_pages_alloc (GLOBAL_optyap_data.pages.alloc_pages)
348#define GLOBAL_pages_void (GLOBAL_optyap_data.pages.void_pages)
349#define GLOBAL_pages_tab_ent (GLOBAL_optyap_data.pages.table_entry_pages)
350#define GLOBAL_pages_sg_ent (GLOBAL_optyap_data.pages.subgoal_entry_pages)
351#define GLOBAL_pages_sg_fr (GLOBAL_optyap_data.pages.subgoal_frame_pages)
352#define GLOBAL_pages_dep_fr (GLOBAL_optyap_data.pages.dependency_frame_pages)
353#define GLOBAL_pages_sg_node (GLOBAL_optyap_data.pages.subgoal_trie_node_pages)
354#define GLOBAL_pages_sg_hash (GLOBAL_optyap_data.pages.subgoal_trie_hash_pages)
355#define GLOBAL_pages_ans_node (GLOBAL_optyap_data.pages.answer_trie_node_pages)
356#define GLOBAL_pages_ans_hash (GLOBAL_optyap_data.pages.answer_trie_hash_pages)
357#define GLOBAL_pages_ans_ref_node (GLOBAL_optyap_data.pages.answer_ref_node_pages)
358#define GLOBAL_pages_gt_node (GLOBAL_optyap_data.pages.global_trie_node_pages)
359#define GLOBAL_pages_gt_hash (GLOBAL_optyap_data.pages.global_trie_hash_pages)
360#define GLOBAL_pages_or_fr (GLOBAL_optyap_data.pages.or_frame_pages)
361#define GLOBAL_pages_qg_sol_fr (GLOBAL_optyap_data.pages.query_goal_solution_frame_pages)
362#define GLOBAL_pages_qg_ans_fr (GLOBAL_optyap_data.pages.query_goal_answer_frame_pages)
363#define GLOBAL_pages_susp_fr (GLOBAL_optyap_data.pages.suspension_frame_pages)
364#define GLOBAL_pages_tg_sol_fr (GLOBAL_optyap_data.pages.table_subgoal_solution_frame_pages)
365#define GLOBAL_pages_tg_ans_fr (GLOBAL_optyap_data.pages.table_subgoal_answer_frame_pages)
366#define GLOBAL_scheduler_loop (GLOBAL_optyap_data.scheduler_loop)
367#define GLOBAL_delayed_release_load (GLOBAL_optyap_data.delayed_release_load)
368#define GLOBAL_number_workers (GLOBAL_optyap_data.number_workers)
369#define GLOBAL_worker_pid(worker) (GLOBAL_optyap_data.worker_pid[worker])
370#define GLOBAL_master_worker (GLOBAL_optyap_data.master_worker)
371#define GLOBAL_execution_time (GLOBAL_optyap_data.execution_time)
372#ifdef YAPOR_THREADS
373#define Get_GLOBAL_root_cp() offset_to_cptr(GLOBAL_optyap_data.root_choice_point_offset)
374#define Set_GLOBAL_root_cp(bptr) (GLOBAL_optyap_data.root_choice_point_offset = cptr_to_offset(bptr))
375#else
376#define GLOBAL_root_cp (GLOBAL_optyap_data.root_choice_point)
377#define Get_GLOBAL_root_cp() (GLOBAL_optyap_data.root_choice_point)
378#define Set_GLOBAL_root_cp(bptr) (GLOBAL_optyap_data.root_choice_point = (bptr))
379#endif
380#define GLOBAL_root_or_fr (GLOBAL_optyap_data.root_or_frame)
381#define GLOBAL_bm_present_workers (GLOBAL_optyap_data.present_workers)
382#define GLOBAL_bm_idle_workers (GLOBAL_optyap_data.idle_workers)
383#define GLOBAL_bm_root_cp_workers (GLOBAL_optyap_data.root_cp_workers)
384#define GLOBAL_bm_invisible_workers (GLOBAL_optyap_data.invisible_workers)
385#define GLOBAL_bm_requestable_workers (GLOBAL_optyap_data.requestable_workers)
386#define GLOBAL_bm_finished_workers (GLOBAL_optyap_data.finished_workers)
387#define GLOBAL_bm_pruning_workers (GLOBAL_optyap_data.pruning_workers)
388#define GLOBAL_locks_bm_idle_workers (GLOBAL_optyap_data.locks.bitmap_idle_workers)
389#define GLOBAL_locks_bm_root_cp_workers (GLOBAL_optyap_data.locks.bitmap_root_cp_workers)
390#define GLOBAL_locks_bm_invisible_workers (GLOBAL_optyap_data.locks.bitmap_invisible_workers)
391#define GLOBAL_locks_bm_requestable_workers (GLOBAL_optyap_data.locks.bitmap_requestable_workers)
392#define GLOBAL_locks_bm_finished_workers (GLOBAL_optyap_data.locks.bitmap_finished_workers)
393#define GLOBAL_locks_bm_pruning_workers (GLOBAL_optyap_data.locks.bitmap_pruning_workers)
394#define GLOBAL_locks_who_locked_heap (GLOBAL_optyap_data.locks.who_locked_heap)
395#define GLOBAL_locks_heap_access (GLOBAL_optyap_data.locks.heap_access)
396#define GLOBAL_locks_alloc_block (GLOBAL_optyap_data.locks.alloc_block)
397#define GLOBAL_branch(worker, depth) (GLOBAL_optyap_data.branch[worker][depth])
398#define GLOBAL_parallel_mode (GLOBAL_optyap_data.parallel_mode)
399#define GLOBAL_root_gt (GLOBAL_optyap_data.root_global_trie)
400#define GLOBAL_root_tab_ent (GLOBAL_optyap_data.root_table_entry)
401#define GLOBAL_max_pages (GLOBAL_optyap_data.max_pages)
402#define GLOBAL_first_sg_fr (GLOBAL_optyap_data.first_subgoal_frame)
403#define GLOBAL_last_sg_fr (GLOBAL_optyap_data.last_subgoal_frame)
404#define GLOBAL_check_sg_fr (GLOBAL_optyap_data.check_subgoal_frame)
405#define GLOBAL_root_dep_fr (GLOBAL_optyap_data.root_dependency_frame)
406#define GLOBAL_th_dep_fr(wid) (GLOBAL_optyap_data.threads_dependency_frame[wid])
407#define GLOBAL_table_var_enumerator(index) (GLOBAL_optyap_data.table_var_enumerator[index])
408#define GLOBAL_table_var_enumerator_addr(index) (GLOBAL_optyap_data.table_var_enumerator + (index))
409#define GLOBAL_trie_locks(index) (GLOBAL_optyap_data.trie_locks[index])
410#define GLOBAL_timestamp (GLOBAL_optyap_data.timestamp)
411
412
413
414/********************************
415** local_optyap_data **
416********************************/
417
419#if defined(TABLING) && (defined(YAPOR) || defined(THREADS))
420 /* local data related to memory management */
421 struct local_pages pages;
422#endif /* TABLING && (YAPOR || THREADS) */
423
424#ifdef YAPOR
425 lockvar lock;
426 /* local data related to or-parallelism */
427 volatile int load;
428#ifdef YAPOR_THREADS
429 Int top_choice_point_offset;
430#else
431 choiceptr top_choice_point;
432#endif /* YAPOR_THREADS */
433 struct or_frame *top_or_frame;
434#ifdef YAPOR_THREADS
435 Int prune_request_offset;
436#else
437 choiceptr prune_request;
438#endif /* YAPOR_THREADS */
439 volatile int share_request;
440 struct local_optyap_signals share_signals;
441 volatile struct {
442 CELL start;
443 CELL end;
444 } global_copy, local_copy, trail_copy;
445#endif /* YAPOR */
446
447#ifdef TABLING
448 /* local data related to tabling */
449 struct subgoal_frame *top_subgoal_frame;
450 struct dependency_frame *top_dependency_frame;
451#ifdef TABLING_INNER_CUTS
452 choiceptr bottom_pruning_scope;
453#endif /* TABLING_INNER_CUTS */
454#ifdef YAPOR
455#ifdef YAPOR_THREADS
456 Int top_choice_point_on_stack_offset;
457#else
458 choiceptr top_choice_point_on_stack;
459#endif /* YAPOR_THREADS */
460 struct or_frame *top_or_frame_with_suspensions;
461#endif /* YAPOR */
462#ifdef OUTPUT_THREADS_TABLING
463 FILE *thread_output;
464#endif /* OUTPUT_THREADS_TABLING */
465#endif /* TABLING */
466
467#if (defined(TABLING) || !defined(YAPOR_COW)) && defined(MULTI_ASSIGNMENT_VARIABLES)
468 UInt ma_timestamp;
469 ma_h_inner_struct *ma_h_top;
470 ma_hash_entry ma_hash_table[MAVARS_HASH_SIZE];
471#endif /* (TABLING || !YAPOR_COW) && MULTI_ASSIGNMENT_VARIABLES */
472};
473
474#define LOCAL_pages_void (LOCAL_optyap_data.pages.void_pages)
475#define LOCAL_pages_tab_ent (LOCAL_optyap_data.pages.table_entry_pages)
476#define LOCAL_pages_sg_ent (LOCAL_optyap_data.pages.subgoal_entry_pages)
477#define LOCAL_pages_sg_fr (LOCAL_optyap_data.pages.subgoal_frame_pages)
478#define LOCAL_pages_dep_fr (LOCAL_optyap_data.pages.dependency_frame_pages)
479#define LOCAL_pages_sg_node (LOCAL_optyap_data.pages.subgoal_trie_node_pages)
480#define LOCAL_pages_sg_hash (LOCAL_optyap_data.pages.subgoal_trie_hash_pages)
481#define LOCAL_pages_ans_node (LOCAL_optyap_data.pages.answer_trie_node_pages)
482#define LOCAL_pages_ans_hash (LOCAL_optyap_data.pages.answer_trie_hash_pages)
483#define LOCAL_pages_ans_ref_node (LOCAL_optyap_data.pages.answer_ref_node_pages)
484#define LOCAL_pages_gt_node (LOCAL_optyap_data.pages.global_trie_node_pages)
485#define LOCAL_pages_gt_hash (LOCAL_optyap_data.pages.global_trie_hash_pages)
486#define LOCAL_next_free_ans_node (LOCAL_optyap_data.pages.next_free_answer_trie_node)
487#define LOCAL_lock (LOCAL_optyap_data.lock)
488#define LOCAL_load (LOCAL_optyap_data.load)
489#ifdef YAPOR_THREADS
490#define Get_LOCAL_top_cp() offset_to_cptr(LOCAL_optyap_data.top_choice_point_offset)
491#define Set_LOCAL_top_cp(cpt) (LOCAL_optyap_data.top_choice_point_offset = cptr_to_offset(cpt))
492#else
493#define LOCAL_top_cp (LOCAL_optyap_data.top_choice_point)
494#define Get_LOCAL_top_cp() (LOCAL_optyap_data.top_choice_point)
495#define Set_LOCAL_top_cp(cpt) (LOCAL_optyap_data.top_choice_point = cpt)
496#endif /* YAPOR_THREADS */
497#define LOCAL_top_or_fr (LOCAL_optyap_data.top_or_frame)
498#ifdef YAPOR_THREADS
499#define Get_LOCAL_prune_request() offset_to_cptr_with_null(LOCAL_optyap_data.prune_request_offset)
500#define Set_LOCAL_prune_request(cpt) (LOCAL_optyap_data.prune_request_offset = cptr_to_offset_with_null(cpt))
501#else
502#define LOCAL_prune_request (LOCAL_optyap_data.prune_request)
503#define Get_LOCAL_prune_request() (LOCAL_optyap_data.prune_request)
504#define Set_LOCAL_prune_request(cpt) (LOCAL_optyap_data.prune_request = cpt)
505#endif /* YAPOR_THREADS */
506#define LOCAL_share_request (LOCAL_optyap_data.share_request)
507#define LOCAL_reply_signal (LOCAL_optyap_data.share_signals.reply_signal)
508#define LOCAL_p_fase_signal (LOCAL_optyap_data.share_signals.P_fase)
509#define LOCAL_q_fase_signal (LOCAL_optyap_data.share_signals.Q_fase)
510#define LOCAL_lock_signals (LOCAL_optyap_data.share_signals.lock)
511#define LOCAL_start_global_copy (LOCAL_optyap_data.global_copy.start)
512#define LOCAL_end_global_copy (LOCAL_optyap_data.global_copy.end)
513#define LOCAL_start_local_copy (LOCAL_optyap_data.local_copy.start)
514#define LOCAL_end_local_copy (LOCAL_optyap_data.local_copy.end)
515#define LOCAL_start_trail_copy (LOCAL_optyap_data.trail_copy.start)
516#define LOCAL_end_trail_copy (LOCAL_optyap_data.trail_copy.end)
517#define LOCAL_top_sg_fr (LOCAL_optyap_data.top_subgoal_frame)
518#define LOCAL_top_dep_fr (LOCAL_optyap_data.top_dependency_frame)
519#define LOCAL_pruning_scope (LOCAL_optyap_data.bottom_pruning_scope)
520#ifdef YAPOR_THREADS
521#define Get_LOCAL_top_cp_on_stack() offset_to_cptr(LOCAL_optyap_data.top_choice_point_on_stack_offset)
522#define Set_LOCAL_top_cp_on_stack(cpt) (LOCAL_optyap_data.top_choice_point_on_stack_offset = cptr_to_offset(cpt))
523#else
524#define LOCAL_top_cp_on_stack (LOCAL_optyap_data.top_choice_point_on_stack)
525#define Get_LOCAL_top_cp_on_stack() (LOCAL_optyap_data.top_choice_point_on_stack)
526#define Set_LOCAL_top_cp_on_stack(cpt) (LOCAL_optyap_data.top_choice_point_on_stack = cpt)
527#endif /* YAPOR_THREADS */
528#define LOCAL_top_susp_or_fr (LOCAL_optyap_data.top_or_frame_with_suspensions)
529#define LOCAL_thread_output (LOCAL_optyap_data.thread_output)
530#define LOCAL_ma_timestamp (LOCAL_optyap_data.ma_timestamp)
531#define LOCAL_ma_h_top (LOCAL_optyap_data.ma_h_top)
532#define LOCAL_ma_hash_table (LOCAL_optyap_data.ma_hash_table)
533
534#define REMOTE_pages_void(wid) (REMOTE(wid)->optyap_data.pages.void_pages)
535#define REMOTE_pages_tab_ent(wid) (REMOTE(wid)->optyap_data.pages.table_entry_pages)
536#define REMOTE_pages_sg_ent(wid) (REMOTE(wid)->optyap_data.pages.subgoal_entry_pages)
537#define REMOTE_pages_sg_fr(wid) (REMOTE(wid)->optyap_data.pages.subgoal_frame_pages)
538#define REMOTE_pages_dep_fr(wid) (REMOTE(wid)->optyap_data.pages.dependency_frame_pages)
539#define REMOTE_pages_sg_node(wid) (REMOTE(wid)->optyap_data.pages.subgoal_trie_node_pages)
540#define REMOTE_pages_sg_hash(wid) (REMOTE(wid)->optyap_data.pages.subgoal_trie_hash_pages)
541#define REMOTE_pages_ans_node(wid) (REMOTE(wid)->optyap_data.pages.answer_trie_node_pages)
542#define REMOTE_pages_ans_hash(wid) (REMOTE(wid)->optyap_data.pages.answer_trie_hash_pages)
543#define REMOTE_pages_ans_ref_node(wid) (REMOTE(wid)->optyap_data.pages.answer_ref_node_pages)
544#define REMOTE_pages_gt_node(wid) (REMOTE(wid)->optyap_data.pages.global_trie_node_pages)
545#define REMOTE_pages_gt_hash(wid) (REMOTE(wid)->optyap_data.pages.global_trie_hash_pages)
546#define REMOTE_next_free_ans_node(wid) (REMOTE(wid)->optyap_data.pages.next_free_answer_trie_node)
547#define REMOTE_lock(wid) (REMOTE(wid)->optyap_data.lock)
548#define REMOTE_load(wid) (REMOTE(wid)->optyap_data.load)
549#ifdef YAPOR_THREADS
550#define REMOTE_top_cp(wid) offset_to_cptr(REMOTE(wid)->optyap_data.top_choice_point_offset)
551#define Set_REMOTE_top_cp(wid, bptr) (REMOTE(wid)->optyap_data.top_choice_point_offset = cptr_to_offset(bptr))
552#else
553#define REMOTE_top_cp(wid) (REMOTE(wid)->optyap_data.top_choice_point)
554#define Set_REMOTE_top_cp(wid, bptr) (REMOTE(wid)->optyap_data.top_choice_point = (bptr))
555#endif /* YAPOR_THREADS */
556#define REMOTE_top_or_fr(wid) (REMOTE(wid)->optyap_data.top_or_frame)
557#ifdef YAPOR_THREADS
558#define Get_REMOTE_prune_request(wid) offset_to_cptr_with_null(REMOTE(wid)->optyap_data.prune_request_offset)
559#define Set_REMOTE_prune_request(wid,cp) (REMOTE(wid)->optyap_data.prune_request_offset = cptr_to_offset_with_null(cp))
560#else
561#define REMOTE_prune_request(wid) (REMOTE(wid)->optyap_data.prune_request)
562#define Get_REMOTE_prune_request(wid) (REMOTE(wid)->optyap_data.prune_request)
563#define Set_REMOTE_prune_request(wid,cp) (REMOTE(wid)->optyap_data.prune_request = cp)
564#endif /* YAPOR_THREADS */
565#define REMOTE_share_request(wid) (REMOTE(wid)->optyap_data.share_request)
566#define REMOTE_reply_signal(wid) (REMOTE(wid)->optyap_data.share_signals.reply_signal)
567#define REMOTE_p_fase_signal(wid) (REMOTE(wid)->optyap_data.share_signals.P_fase)
568#define REMOTE_q_fase_signal(wid) (REMOTE(wid)->optyap_data.share_signals.Q_fase)
569#define REMOTE_lock_signals(wid) (REMOTE(wid)->optyap_data.share_signals.lock)
570#define REMOTE_start_global_copy(wid) (REMOTE(wid)->optyap_data.global_copy.start)
571#define REMOTE_end_global_copy(wid) (REMOTE(wid)->optyap_data.global_copy.end)
572#define REMOTE_start_local_copy(wid) (REMOTE(wid)->optyap_data.local_copy.start)
573#define REMOTE_end_local_copy(wid) (REMOTE(wid)->optyap_data.local_copy.end)
574#define REMOTE_start_trail_copy(wid) (REMOTE(wid)->optyap_data.trail_copy.start)
575#define REMOTE_end_trail_copy(wid) (REMOTE(wid)->optyap_data.trail_copy.end)
576#define REMOTE_top_sg_fr(wid) (REMOTE(wid)->optyap_data.top_subgoal_frame)
577#define REMOTE_top_dep_fr(wid) (REMOTE(wid)->optyap_data.top_dependency_frame)
578#define REMOTE_pruning_scope(wid) (REMOTE(wid)->optyap_data.bottom_pruning_scope)
579#ifdef YAPOR_THREADS
580#define REMOTE_top_cp_on_stack(wid) offset_to_cptr(REMOTE(wid)->optyap_data.top_choice_point_on_stack_offset)
581#define Set_REMOTE_top_cp_on_stack(wid, bptr) (REMOTE(wid)->optyap_data.top_choice_point_on_stack_offset = cptr_to_offset(bptr))
582#else
583#define REMOTE_top_cp_on_stack(wid) (REMOTE(wid)->optyap_data.top_choice_point_on_stack)
584#define Set_REMOTE_top_cp_on_stack(wid, bptr) (REMOTE(wid)->optyap_data.top_choice_point_on_stack = (bptr))
585#endif /* YAPOR_THREADS */
586#define REMOTE_top_susp_or_fr(wid) (REMOTE(wid)->optyap_data.top_or_frame_with_suspensions)
587#define REMOTE_thread_output(wid) (REMOTE(wid)->optyap_data.thread_output)
588#define REMOTE_ma_timestamp(wid) (REMOTE(wid)->optyap_data.ma_timestamp)
589#define REMOTE_ma_h_top(wid) (REMOTE(wid)->optyap_data.ma_h_top)
590#define REMOTE_ma_hash_table(wid) (REMOTE(wid)->optyap_data.ma_hash_table)
591
592#ifdef YAPOR
593#include "or.structs.h"
594#endif /* YAPOR */
595
596
597#ifdef TABLING
598#include "tab.structs.h"
599#endif /* TABLING */
Definition: opt.structs.h:118
Definition: opt.structs.h:131
Definition: tab.structs.h:22