change define ENV_COPY to YAPOR_COPY

This commit is contained in:
Joao 2011-03-30 14:35:10 +01:00
parent f890a11377
commit 810c96416b
14 changed files with 36 additions and 36 deletions

View File

@ -2837,7 +2837,7 @@ YAP_Init(YAP_init_args *yap_init)
Yap_init_local();
#ifdef YAPOR
if (worker_id != 0) {
#if SBA||ENV_COPY
#if SBA||YAPOR_COPY
/*
In the SBA we cannot just happily inherit registers
from the other workers

View File

@ -1344,13 +1344,13 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s
worker_id = 0;
if (n_workers > MAX_WORKERS)
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");
#elif ACOW
INFORMATION_MESSAGE("YapOr: acow model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
#else /* SBA */
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);
#else
Yap_InitMemory (Trail, Heap, Stack+Atts);

14
H/Yap.h
View File

@ -17,7 +17,7 @@
#define YAP_H 1
#include "config.h"
#if defined(ENV_COPY) || defined(TABLING) || defined(THREADS)
#if defined(YAPOR_COPY) || defined(TABLING) || defined(THREADS)
#include "opt.config.h"
#endif /* YAPOR || TABLING */
@ -39,16 +39,16 @@
#error Do not explicitly define 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
#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
#endif /* ENV_COPY || ACOW || SBA */
#endif /* YAPOR_COPY || ACOW || 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) */
#ifdef YAPOR
@ -56,7 +56,7 @@
#ifdef THREADS
#undef ACOW
#undef SBA
#undef ENV_COPY
#undef YAPOR_COPY
#endif
#endif /* YAPOR */

View File

@ -998,7 +998,7 @@ typedef struct choicept {
#define YOUNGER_H(H1, H2) FIXMEE!!!!
#else /* ENV_COPY || ACOW */
#else /* YAPOR_COPY || ACOW */
#define YOUNGER_CP(CP1, CP2) ((CP1) < (CP2))
#define EQUAL_OR_YOUNGER_CP(CP1, CP2) ((CP1) <= (CP2))

View File

@ -42,7 +42,7 @@ DOCSDIR=$(SHAREDIR)/doc/Yap
#
# very experimental stuff, you'll need to contact the developers
# 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.
# -DACOW: or-parallelism with copy-on-write.
# -DTABLING: support for tabling

View File

@ -188,9 +188,9 @@ void Yap_init_local(void) {
LOCAL_load = 0;
LOCAL_share_request = MAX_WORKERS;
LOCAL_reply_signal = worker_ready;
#ifdef ENV_COPY
#ifdef YAPOR_COPY
INIT_LOCK(LOCAL_lock_signals);
#endif /* ENV_COPY */
#endif /* YAPOR_COPY */
Set_LOCAL_prune_request(NULL);
#endif /* YAPOR */
INIT_LOCK(LOCAL_lock);

View File

@ -87,7 +87,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
#if MMAP_MEMORY_MAPPING_SCHEME
long TotalArea;
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
#else /* ENV_COPY || SBA */
#else /* YAPOR_COPY || SBA */
int i;
long WorkerArea;
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 */
TotalArea = HeapArea;
#endif /* MMAP_MEMORY_MAPPING_SCHEME */
#else /* ENV_COPY || SBA */
#else /* YAPOR_COPY || SBA */
/* the others need n stacks */
WorkerArea = ADJUST_SIZE_TO_PAGE(GlobalLocalArea + TrailAuxArea);
TotalArea = HeapArea + WorkerArea * n_workers;
@ -134,7 +134,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
#ifdef ACOW
/* single shared segment in ACOW */
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 */
shm_map_memory(n_workers, HeapArea, mmap_addr);
#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)
Yap_Error(FATAL_ERROR, TermNil, "mmap error (map_memory)");
close(private_fd_mapfile);
#else /* ENV_COPY || SBA */
#else /* YAPOR_COPY || SBA */
for (i = 0; i < n_workers; i++) {
/* initialize worker vars */
worker_area(i) = Yap_GlobalBase + i * WorkerArea;
@ -226,7 +226,7 @@ void unmap_memory (void) {
strcpy(MapFile,"./mapfile");
#ifdef ACOW
itos(Yap_master_worker, &MapFile[9]);
#else /* ENV_COPY || SBA */
#else /* YAPOR_COPY || SBA */
itos(Yap_worker_pid(0), &MapFile[9]);
#endif
if (remove(MapFile) == 0)
@ -250,7 +250,7 @@ void remap_memory(void) {
Yap_LocalBase += worker_id * WorkerArea;
Yap_TrailTop += worker_id * WorkerArea;
#endif /* SBA */
#ifdef ENV_COPY
#ifdef YAPOR_COPY
void *remap_addr;
long remap_offset;
long WorkerArea;
@ -282,6 +282,6 @@ void remap_memory(void) {
for (i = 0; i < Yap_number_workers; i++) {
worker_offset(i) = worker_area(i) - worker_area(worker_id);
}
#endif /* ENV_COPY */
#endif /* YAPOR_COPY */
}
#endif /* YAPOR && !THREADS */

View File

@ -345,7 +345,7 @@ struct optyap_global_data{
#ifdef YAPOR
struct local_signals{
#if defined(ENV_COPY) || defined(THREADS)
#if defined(YAPOR_COPY) || defined(THREADS)
lockvar lock;
volatile enum {
Q_idle = 0,
@ -354,7 +354,7 @@ struct local_signals{
local = 3,
P_idle = 4
} P_fase, Q_fase;
#endif /* ENV_COPY || THREADS */
#endif /* YAPOR_COPY || THREADS */
volatile enum {
no_sharing = 0,
sharing = 1,

View File

@ -16,7 +16,7 @@
** ------------------ */
#include "Yap.h"
#ifdef ENV_COPY
#ifdef YAPOR_COPY
#ifdef HAVE_STRING_H
#include <string.h>
#endif /* HAVE_STRING_H */
@ -698,4 +698,4 @@ void share_private_nodes(int worker_q) {
REMOTE_load(worker_q) = LOCAL_load = 0;
return;
}
#endif /* ENV_COPY */
#endif /* YAPOR_COPY */

View File

@ -135,7 +135,7 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr,
SCHEDULER_GET_WORK(); \
}
#if defined(ENV_COPY) || defined(SBA) || defined(THREADS)
#if defined(YAPOR_COPY) || defined(SBA) || defined(THREADS)
#define SCH_check_share_request() \
if (SCH_any_share_request) { \
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()) \
goto shared_fail; \
}
#endif /* ENV_COPY || SBA || ACOW */
#endif /* YAPOR_COPY || SBA || ACOW */
#define SCH_check_requests() \
SCH_check_prune_request(); \

View File

@ -544,4 +544,4 @@ void share_private_nodes(int worker_q) {
REMOTE_load(worker_q) = LOCAL_load = 0;
return;
}
#endif /* ENV_COPY */
#endif /* YAPOR_COPY */

2
configure vendored
View File

@ -7498,7 +7498,7 @@ case "$orparallelism" in
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
;;
yes|env-copy)
YAP_EXTRAS="$YAP_EXTRAS -DENV_COPY=1"
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"
;;
esac

View File

@ -1282,7 +1282,7 @@ case "$orparallelism" in
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
;;
yes|env-copy)
YAP_EXTRAS="$YAP_EXTRAS -DENV_COPY=1"
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"
;;
esac

View File

@ -149,14 +149,14 @@ print_usage(void)
#ifdef TABLING
fprintf(stderr," -ts Maximum table space area in Mbytes (default: unlimited)\n");
#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",
DEFAULT_NUMBERWORKERS);
fprintf(stderr," -sl Loop scheduler executions before look for hiden shared work (default: %d)\n",
DEFAULT_SCHEDULERLOOP);
fprintf(stderr," -d Value of delayed release of load (default: %d)\n",
DEFAULT_DELAYEDRELEASELOAD);
#endif /* ENV_COPY || ACOW || SBA */
#endif /* YAPOR_COPY || ACOW || SBA */
/* nf: Preprocessor */
/* fprintf(stderr," -DVar=Name Persistent definition\n"); */
fprintf(stderr,"\n");
@ -245,7 +245,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
case 'q':
iap->QuietMode = TRUE;
break;
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA)
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
case 'w':
ssize = &(iap->NumberWorkers);
goto GetSize;
@ -258,7 +258,7 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
case 'd':
if (!strcmp("dump-runtime-variables",p))
return dump_runtime_variables();
#endif /* ENV_COPY || ACOW || SBA */
#endif /* YAPOR_COPY || ACOW || SBA */
#ifdef USE_SOCKET
case 'c': /* running as client */
{
@ -386,12 +386,12 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
case 's':
case 'S':
ssize = &(iap->StackSize);
#if defined(ENV_COPY) || defined(ACOW) || defined(SBA)
#if defined(YAPOR_COPY) || defined(ACOW) || defined(SBA)
if (p[1] == 'l') {
p++;
ssize = &(iap->SchedulerLoop);
}
#endif /* ENV_COPY || ACOW || SBA */
#endif /* YAPOR_COPY || ACOW || SBA */
goto GetSize;
case 'a':
case 'A':