change define ENV_COPY to YAPOR_COPY
This commit is contained in:
parent
f890a11377
commit
810c96416b
@ -2837,7 +2837,7 @@ YAP_Init(YAP_init_args *yap_init)
|
|||||||
Yap_init_local();
|
Yap_init_local();
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
if (worker_id != 0) {
|
if (worker_id != 0) {
|
||||||
#if SBA||ENV_COPY
|
#if SBA||YAPOR_COPY
|
||||||
/*
|
/*
|
||||||
In the SBA we cannot just happily inherit registers
|
In the SBA we cannot just happily inherit registers
|
||||||
from the other workers
|
from the other workers
|
||||||
|
4
C/init.c
4
C/init.c
@ -1344,13 +1344,13 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s
|
|||||||
worker_id = 0;
|
worker_id = 0;
|
||||||
if (n_workers > MAX_WORKERS)
|
if (n_workers > MAX_WORKERS)
|
||||||
Yap_Error(INTERNAL_ERROR, TermNil, "excessive number of workers (Yap_InitWorkspace)");
|
Yap_Error(INTERNAL_ERROR, TermNil, "excessive number of workers (Yap_InitWorkspace)");
|
||||||
#ifdef ENV_COPY
|
#ifdef YAPOR_COPY
|
||||||
INFORMATION_MESSAGE("YapOr: copy model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
INFORMATION_MESSAGE("YapOr: copy model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
||||||
#elif ACOW
|
#elif ACOW
|
||||||
INFORMATION_MESSAGE("YapOr: acow model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
INFORMATION_MESSAGE("YapOr: acow model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
||||||
#else /* SBA */
|
#else /* SBA */
|
||||||
INFORMATION_MESSAGE("YapOr: sba model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
INFORMATION_MESSAGE("YapOr: sba model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
|
||||||
#endif /* ENV_COPY - ACOW - SBA */
|
#endif /* YAPOR_COPY - ACOW - SBA */
|
||||||
map_memory(Heap, Stack+Atts, Trail, n_workers);
|
map_memory(Heap, Stack+Atts, Trail, n_workers);
|
||||||
#else
|
#else
|
||||||
Yap_InitMemory (Trail, Heap, Stack+Atts);
|
Yap_InitMemory (Trail, Heap, Stack+Atts);
|
||||||
|
14
H/Yap.h
14
H/Yap.h
@ -17,7 +17,7 @@
|
|||||||
#define YAP_H 1
|
#define YAP_H 1
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#if defined(ENV_COPY) || defined(TABLING) || defined(THREADS)
|
#if defined(YAPOR_COPY) || defined(TABLING) || defined(THREADS)
|
||||||
#include "opt.config.h"
|
#include "opt.config.h"
|
||||||
#endif /* YAPOR || TABLING */
|
#endif /* YAPOR || TABLING */
|
||||||
|
|
||||||
@ -39,16 +39,16 @@
|
|||||||
#error Do not explicitly define YAPOR
|
#error Do not explicitly define YAPOR
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
|
|
||||||
#if (defined(ENV_COPY) && (defined(ACOW) || defined(SBA))) || (defined(ACOW) && defined(SBA))
|
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(SBA))) || (defined(ACOW) && defined(SBA))
|
||||||
#error Do not define multiple or-parallel models
|
#error Do not define multiple or-parallel models
|
||||||
#endif /* (ENV_COPY && (ACOW || SBA)) || (ACOW && SBA) */
|
#endif /* (YAPOR_COPY && (ACOW || SBA)) || (ACOW && SBA) */
|
||||||
|
|
||||||
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA) || defined(THREADS)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA) || defined(THREADS)
|
||||||
#define YAPOR 1
|
#define YAPOR 1
|
||||||
#endif /* ENV_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || SBA */
|
||||||
|
|
||||||
#if defined(TABLING) && (defined(ACOW) || defined(SBA))
|
#if defined(TABLING) && (defined(ACOW) || defined(SBA))
|
||||||
#error Currently TABLING only works with ENV_COPY
|
#error Currently TABLING only works with YAPOR_COPY
|
||||||
#endif /* TABLING && (ACOW || SBA) */
|
#endif /* TABLING && (ACOW || SBA) */
|
||||||
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
@ -56,7 +56,7 @@
|
|||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
#undef ACOW
|
#undef ACOW
|
||||||
#undef SBA
|
#undef SBA
|
||||||
#undef ENV_COPY
|
#undef YAPOR_COPY
|
||||||
#endif
|
#endif
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
|
|
||||||
|
@ -998,7 +998,7 @@ typedef struct choicept {
|
|||||||
#define YOUNGER_H(H1, H2) FIXMEE!!!!
|
#define YOUNGER_H(H1, H2) FIXMEE!!!!
|
||||||
|
|
||||||
|
|
||||||
#else /* ENV_COPY || ACOW */
|
#else /* YAPOR_COPY || ACOW */
|
||||||
#define YOUNGER_CP(CP1, CP2) ((CP1) < (CP2))
|
#define YOUNGER_CP(CP1, CP2) ((CP1) < (CP2))
|
||||||
#define EQUAL_OR_YOUNGER_CP(CP1, CP2) ((CP1) <= (CP2))
|
#define EQUAL_OR_YOUNGER_CP(CP1, CP2) ((CP1) <= (CP2))
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ DOCSDIR=$(SHAREDIR)/doc/Yap
|
|||||||
#
|
#
|
||||||
# very experimental stuff, you'll need to contact the developers
|
# very experimental stuff, you'll need to contact the developers
|
||||||
# if you want to use this:
|
# if you want to use this:
|
||||||
# -DENV_COPY: or-parallelism with environment copying, in Muse style.
|
# -DYAPOR_COPY: or-parallelism with environment copying, in Muse style.
|
||||||
# -DSBA: or-parallelism with sparse binding arrays.
|
# -DSBA: or-parallelism with sparse binding arrays.
|
||||||
# -DACOW: or-parallelism with copy-on-write.
|
# -DACOW: or-parallelism with copy-on-write.
|
||||||
# -DTABLING: support for tabling
|
# -DTABLING: support for tabling
|
||||||
|
@ -188,9 +188,9 @@ void Yap_init_local(void) {
|
|||||||
LOCAL_load = 0;
|
LOCAL_load = 0;
|
||||||
LOCAL_share_request = MAX_WORKERS;
|
LOCAL_share_request = MAX_WORKERS;
|
||||||
LOCAL_reply_signal = worker_ready;
|
LOCAL_reply_signal = worker_ready;
|
||||||
#ifdef ENV_COPY
|
#ifdef YAPOR_COPY
|
||||||
INIT_LOCK(LOCAL_lock_signals);
|
INIT_LOCK(LOCAL_lock_signals);
|
||||||
#endif /* ENV_COPY */
|
#endif /* YAPOR_COPY */
|
||||||
Set_LOCAL_prune_request(NULL);
|
Set_LOCAL_prune_request(NULL);
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
INIT_LOCK(LOCAL_lock);
|
INIT_LOCK(LOCAL_lock);
|
||||||
|
@ -87,7 +87,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
#if MMAP_MEMORY_MAPPING_SCHEME
|
#if MMAP_MEMORY_MAPPING_SCHEME
|
||||||
long TotalArea;
|
long TotalArea;
|
||||||
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
||||||
#else /* ENV_COPY || SBA */
|
#else /* YAPOR_COPY || SBA */
|
||||||
int i;
|
int i;
|
||||||
long WorkerArea;
|
long WorkerArea;
|
||||||
long TotalArea;
|
long TotalArea;
|
||||||
@ -114,7 +114,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
/* I need this for MMAP to know what it must allocate */
|
/* I need this for MMAP to know what it must allocate */
|
||||||
TotalArea = HeapArea;
|
TotalArea = HeapArea;
|
||||||
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
|
||||||
#else /* ENV_COPY || SBA */
|
#else /* YAPOR_COPY || SBA */
|
||||||
/* the others need n stacks */
|
/* the others need n stacks */
|
||||||
WorkerArea = ADJUST_SIZE_TO_PAGE(GlobalLocalArea + TrailAuxArea);
|
WorkerArea = ADJUST_SIZE_TO_PAGE(GlobalLocalArea + TrailAuxArea);
|
||||||
TotalArea = HeapArea + WorkerArea * n_workers;
|
TotalArea = HeapArea + WorkerArea * n_workers;
|
||||||
@ -134,7 +134,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
#ifdef ACOW
|
#ifdef ACOW
|
||||||
/* single shared segment in ACOW */
|
/* single shared segment in ACOW */
|
||||||
shm_map_memory(0, HeapArea, mmap_addr);
|
shm_map_memory(0, HeapArea, mmap_addr);
|
||||||
#else /* ENV_COPY || SBA */
|
#else /* YAPOR_COPY || SBA */
|
||||||
/* place as segment n otherwise (0..n-1 reserved for worker areas */
|
/* place as segment n otherwise (0..n-1 reserved for worker areas */
|
||||||
shm_map_memory(n_workers, HeapArea, mmap_addr);
|
shm_map_memory(n_workers, HeapArea, mmap_addr);
|
||||||
#endif /* YAPOR_MODEL */
|
#endif /* YAPOR_MODEL */
|
||||||
@ -148,7 +148,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
MAP_PRIVATE|MAP_FIXED, private_fd_mapfile, 0) == (void *) -1)
|
MAP_PRIVATE|MAP_FIXED, private_fd_mapfile, 0) == (void *) -1)
|
||||||
Yap_Error(FATAL_ERROR, TermNil, "mmap error (map_memory)");
|
Yap_Error(FATAL_ERROR, TermNil, "mmap error (map_memory)");
|
||||||
close(private_fd_mapfile);
|
close(private_fd_mapfile);
|
||||||
#else /* ENV_COPY || SBA */
|
#else /* YAPOR_COPY || SBA */
|
||||||
for (i = 0; i < n_workers; i++) {
|
for (i = 0; i < n_workers; i++) {
|
||||||
/* initialize worker vars */
|
/* initialize worker vars */
|
||||||
worker_area(i) = Yap_GlobalBase + i * WorkerArea;
|
worker_area(i) = Yap_GlobalBase + i * WorkerArea;
|
||||||
@ -226,7 +226,7 @@ void unmap_memory (void) {
|
|||||||
strcpy(MapFile,"./mapfile");
|
strcpy(MapFile,"./mapfile");
|
||||||
#ifdef ACOW
|
#ifdef ACOW
|
||||||
itos(Yap_master_worker, &MapFile[9]);
|
itos(Yap_master_worker, &MapFile[9]);
|
||||||
#else /* ENV_COPY || SBA */
|
#else /* YAPOR_COPY || SBA */
|
||||||
itos(Yap_worker_pid(0), &MapFile[9]);
|
itos(Yap_worker_pid(0), &MapFile[9]);
|
||||||
#endif
|
#endif
|
||||||
if (remove(MapFile) == 0)
|
if (remove(MapFile) == 0)
|
||||||
@ -250,7 +250,7 @@ void remap_memory(void) {
|
|||||||
Yap_LocalBase += worker_id * WorkerArea;
|
Yap_LocalBase += worker_id * WorkerArea;
|
||||||
Yap_TrailTop += worker_id * WorkerArea;
|
Yap_TrailTop += worker_id * WorkerArea;
|
||||||
#endif /* SBA */
|
#endif /* SBA */
|
||||||
#ifdef ENV_COPY
|
#ifdef YAPOR_COPY
|
||||||
void *remap_addr;
|
void *remap_addr;
|
||||||
long remap_offset;
|
long remap_offset;
|
||||||
long WorkerArea;
|
long WorkerArea;
|
||||||
@ -282,6 +282,6 @@ void remap_memory(void) {
|
|||||||
for (i = 0; i < Yap_number_workers; i++) {
|
for (i = 0; i < Yap_number_workers; i++) {
|
||||||
worker_offset(i) = worker_area(i) - worker_area(worker_id);
|
worker_offset(i) = worker_area(i) - worker_area(worker_id);
|
||||||
}
|
}
|
||||||
#endif /* ENV_COPY */
|
#endif /* YAPOR_COPY */
|
||||||
}
|
}
|
||||||
#endif /* YAPOR && !THREADS */
|
#endif /* YAPOR && !THREADS */
|
||||||
|
@ -345,7 +345,7 @@ struct optyap_global_data{
|
|||||||
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
struct local_signals{
|
struct local_signals{
|
||||||
#if defined(ENV_COPY) || defined(THREADS)
|
#if defined(YAPOR_COPY) || defined(THREADS)
|
||||||
lockvar lock;
|
lockvar lock;
|
||||||
volatile enum {
|
volatile enum {
|
||||||
Q_idle = 0,
|
Q_idle = 0,
|
||||||
@ -354,7 +354,7 @@ struct local_signals{
|
|||||||
local = 3,
|
local = 3,
|
||||||
P_idle = 4
|
P_idle = 4
|
||||||
} P_fase, Q_fase;
|
} P_fase, Q_fase;
|
||||||
#endif /* ENV_COPY || THREADS */
|
#endif /* YAPOR_COPY || THREADS */
|
||||||
volatile enum {
|
volatile enum {
|
||||||
no_sharing = 0,
|
no_sharing = 0,
|
||||||
sharing = 1,
|
sharing = 1,
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
** ------------------ */
|
** ------------------ */
|
||||||
|
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#ifdef ENV_COPY
|
#ifdef YAPOR_COPY
|
||||||
#ifdef HAVE_STRING_H
|
#ifdef HAVE_STRING_H
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif /* HAVE_STRING_H */
|
#endif /* HAVE_STRING_H */
|
||||||
@ -698,4 +698,4 @@ void share_private_nodes(int worker_q) {
|
|||||||
REMOTE_load(worker_q) = LOCAL_load = 0;
|
REMOTE_load(worker_q) = LOCAL_load = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* ENV_COPY */
|
#endif /* YAPOR_COPY */
|
||||||
|
@ -135,7 +135,7 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr,
|
|||||||
SCHEDULER_GET_WORK(); \
|
SCHEDULER_GET_WORK(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENV_COPY) || defined(SBA) || defined(THREADS)
|
#if defined(YAPOR_COPY) || defined(SBA) || defined(THREADS)
|
||||||
#define SCH_check_share_request() \
|
#define SCH_check_share_request() \
|
||||||
if (SCH_any_share_request) { \
|
if (SCH_any_share_request) { \
|
||||||
ASP = YENV; \
|
ASP = YENV; \
|
||||||
@ -149,7 +149,7 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr,
|
|||||||
if (! p_share_work()) \
|
if (! p_share_work()) \
|
||||||
goto shared_fail; \
|
goto shared_fail; \
|
||||||
}
|
}
|
||||||
#endif /* ENV_COPY || SBA || ACOW */
|
#endif /* YAPOR_COPY || SBA || ACOW */
|
||||||
|
|
||||||
#define SCH_check_requests() \
|
#define SCH_check_requests() \
|
||||||
SCH_check_prune_request(); \
|
SCH_check_prune_request(); \
|
||||||
|
@ -544,4 +544,4 @@ void share_private_nodes(int worker_q) {
|
|||||||
REMOTE_load(worker_q) = LOCAL_load = 0;
|
REMOTE_load(worker_q) = LOCAL_load = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* ENV_COPY */
|
#endif /* YAPOR_COPY */
|
||||||
|
2
configure
vendored
2
configure
vendored
@ -7498,7 +7498,7 @@ case "$orparallelism" in
|
|||||||
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
||||||
;;
|
;;
|
||||||
yes|env-copy)
|
yes|env-copy)
|
||||||
YAP_EXTRAS="$YAP_EXTRAS -DENV_COPY=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -1282,7 +1282,7 @@ case "$orparallelism" in
|
|||||||
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
|
||||||
;;
|
;;
|
||||||
yes|env-copy)
|
yes|env-copy)
|
||||||
YAP_EXTRAS="$YAP_EXTRAS -DENV_COPY=1"
|
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -149,14 +149,14 @@ print_usage(void)
|
|||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
fprintf(stderr," -ts Maximum table space area in Mbytes (default: unlimited)\n");
|
fprintf(stderr," -ts Maximum table space area in Mbytes (default: unlimited)\n");
|
||||||
#endif /* TABLING */
|
#endif /* TABLING */
|
||||||
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
||||||
fprintf(stderr," -w Number of workers (default: %d)\n",
|
fprintf(stderr," -w Number of workers (default: %d)\n",
|
||||||
DEFAULT_NUMBERWORKERS);
|
DEFAULT_NUMBERWORKERS);
|
||||||
fprintf(stderr," -sl Loop scheduler executions before look for hiden shared work (default: %d)\n",
|
fprintf(stderr," -sl Loop scheduler executions before look for hiden shared work (default: %d)\n",
|
||||||
DEFAULT_SCHEDULERLOOP);
|
DEFAULT_SCHEDULERLOOP);
|
||||||
fprintf(stderr," -d Value of delayed release of load (default: %d)\n",
|
fprintf(stderr," -d Value of delayed release of load (default: %d)\n",
|
||||||
DEFAULT_DELAYEDRELEASELOAD);
|
DEFAULT_DELAYEDRELEASELOAD);
|
||||||
#endif /* ENV_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || SBA */
|
||||||
/* nf: Preprocessor */
|
/* nf: Preprocessor */
|
||||||
/* fprintf(stderr," -DVar=Name Persistent definition\n"); */
|
/* fprintf(stderr," -DVar=Name Persistent definition\n"); */
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
@ -245,7 +245,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
|||||||
case 'q':
|
case 'q':
|
||||||
iap->QuietMode = TRUE;
|
iap->QuietMode = TRUE;
|
||||||
break;
|
break;
|
||||||
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
||||||
case 'w':
|
case 'w':
|
||||||
ssize = &(iap->NumberWorkers);
|
ssize = &(iap->NumberWorkers);
|
||||||
goto GetSize;
|
goto GetSize;
|
||||||
@ -258,7 +258,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
|||||||
case 'd':
|
case 'd':
|
||||||
if (!strcmp("dump-runtime-variables",p))
|
if (!strcmp("dump-runtime-variables",p))
|
||||||
return dump_runtime_variables();
|
return dump_runtime_variables();
|
||||||
#endif /* ENV_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || SBA */
|
||||||
#ifdef USE_SOCKET
|
#ifdef USE_SOCKET
|
||||||
case 'c': /* running as client */
|
case 'c': /* running as client */
|
||||||
{
|
{
|
||||||
@ -386,12 +386,12 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
|
|||||||
case 's':
|
case 's':
|
||||||
case 'S':
|
case 'S':
|
||||||
ssize = &(iap->StackSize);
|
ssize = &(iap->StackSize);
|
||||||
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA)
|
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
|
||||||
if (p[1] == 'l') {
|
if (p[1] == 'l') {
|
||||||
p++;
|
p++;
|
||||||
ssize = &(iap->SchedulerLoop);
|
ssize = &(iap->SchedulerLoop);
|
||||||
}
|
}
|
||||||
#endif /* ENV_COPY || ACOW || SBA */
|
#endif /* YAPOR_COPY || ACOW || SBA */
|
||||||
goto GetSize;
|
goto GetSize;
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'A':
|
case 'A':
|
||||||
|
Reference in New Issue
Block a user