1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
--- Yap-5.0.1.orig/C/save.c 2005-08-25 00:21:48.000000000 +1200
+++ Yap-5.0.1/C/save.c 2006-02-25 00:40:13.000000000 +1300
@@ -463,7 +463,7 @@
{
int j;
/* Then save the whole heap */
-#if defined(YAPOR) || defined(TABLING)
+#if defined(YAPOR) || defined(TABLING) && !defined(YAP_MEMORY_ALLOC_SCHEME)
/* skip the local and global data structures */
j = Unsigned(&GLOBAL) - Unsigned(Yap_HeapBase);
putout(j);
@@ -871,7 +871,7 @@
static int
CopyCode(void)
{
-#if defined(YAPOR) || defined(TABLING)
+#if (defined(YAPOR) || defined(TABLING)) && !defined(YAP_MEMORY_ALLOC_SCHEME)
/* skip the local and global data structures */
CELL j = get_cell();
if (Yap_ErrorMessage)
--- Yap-5.0.1.orig/OPTYap/opt.config.h 2005-08-22 23:09:14.000000000 +1200
+++ Yap-5.0.1/OPTYap/opt.config.h 2006-02-25 00:38:28.000000000 +1300
@@ -26,8 +26,8 @@
/* ----------------------------------------- **
** memory alloc scheme (define one) **
** ----------------------------------------- */
-#define SHM_MEMORY_ALLOC_SCHEME 1
-/* #define YAP_MEMORY_ALLOC_SCHEME 1 */
+/* #define SHM_MEMORY_ALLOC_SCHEME 1 */
+#define YAP_MEMORY_ALLOC_SCHEME 1
/* #define MALLOC_MEMORY_ALLOC_SCHEME 1 */
/* ------------------------------------------- **
--- Yap-5.0.1.orig/OPTYap/opt.init.c 2005-08-22 23:09:14.000000000 +1200
+++ Yap-5.0.1/OPTYap/opt.init.c 2006-02-24 22:46:00.000000000 +1300
@@ -159,9 +159,11 @@
void init_local(void) {
+#if defined(YAPOR) || defined(THREADS)
+ LOCAL = REMOTE + worker_id;
+#endif
#ifdef YAPOR
/* local data related to or-parallelism */
- LOCAL = REMOTE + worker_id;
LOCAL_top_cp = B_BASE;
LOCAL_top_or_fr = GLOBAL_root_or_fr;
LOCAL_load = 0;
--- Yap-5.0.1.orig/OPTYap/opt.structs.h 2005-08-22 23:09:14.000000000 +1200
+++ Yap-5.0.1/OPTYap/opt.structs.h 2006-02-24 21:29:32.000000000 +1300
@@ -41,7 +41,7 @@
** ---------------------- */
struct pages {
-#ifdef YAPOR
+#if defined(YAPOR) || defined(THREADS)
lockvar lock;
#endif /* YAPOR */
volatile long pages_allocated;
@@ -274,9 +274,11 @@
** --------------------------- */
struct local_data{
+#if defined(YAPOR) || defined(THREADS)
+ lockvar lock;
+#endif
#ifdef YAPOR
/* local data related to or-parallelism */
- lockvar lock;
volatile int load;
choiceptr top_choice_point;
struct or_frame *top_or_frame;
--- Yap-5.0.1.orig/OPTYap/tab.structs.h 2005-08-22 23:09:14.000000000 +1200
+++ Yap-5.0.1/OPTYap/tab.structs.h 2006-02-24 21:49:27.000000000 +1300
@@ -50,7 +50,7 @@
** ---------------------------- */
typedef struct table_entry {
-#ifdef YAPOR
+#if defined(YAPOR) || defined(THREADS)
lockvar lock;
#endif /* YAPOR */
struct pred_entry *pred_entry;
@@ -149,8 +149,10 @@
** ------------------------------ */
typedef struct subgoal_frame {
-#ifdef YAPOR
+#if defined(YAPOR) || defined(THREADS)
lockvar lock;
+#endif
+#ifdef YAPOR
int generator_worker;
struct or_frame *top_or_frame_on_generator_branch;
#endif /* YAPOR */
@@ -225,8 +227,10 @@
** --------------------------------- */
typedef struct dependency_frame {
-#ifdef YAPOR
+#if defined(YAPOR) || defined(THREADS)
lockvar lock;
+#endif
+#ifdef YAPOR
int leader_dependency_is_on_stack;
struct or_frame *top_or_frame;
#ifdef TIMESTAMP_CHECK
|