chnage define ACOW to YAPOR_COW

This commit is contained in:
Joao 2011-03-30 16:39:09 +01:00
parent 3e148c3541
commit 662658986a
15 changed files with 50 additions and 50 deletions

View File

@ -1346,11 +1346,11 @@ Yap_InitWorkspace(UInt Heap, UInt Stack, UInt Trail, UInt Atts, UInt max_table_s
Yap_Error(INTERNAL_ERROR, TermNil, "excessive number of workers (Yap_InitWorkspace)");
#ifdef YAPOR_COPY
INFORMATION_MESSAGE("YapOr: copy model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
#elif ACOW
#elif YAPOR_COW
INFORMATION_MESSAGE("YapOr: acow model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
#else /* YAPOR_SBA */
INFORMATION_MESSAGE("YapOr: sba model with %d worker%s", n_workers, n_workers == 1 ? "":"s");
#endif /* YAPOR_COPY - ACOW - YAPOR_SBA */
#endif /* YAPOR_COPY - YAPOR_COW - YAPOR_SBA */
map_memory(Heap, Stack+Atts, Trail, n_workers);
#else
Yap_InitMemory (Trail, Heap, Stack+Atts);

View File

@ -1830,7 +1830,7 @@ InitSignals (void)
#if HAVE_SIGSEGV && !defined(THREADS)
my_signal_info (SIGSEGV, HandleSIGSEGV);
#endif
#ifdef ACOW
#ifdef YAPOR_COW
signal(SIGCHLD, SIG_IGN); /* avoid ghosts */
#endif
} else {

14
H/Yap.h
View File

@ -39,22 +39,22 @@
#error Do not explicitly define YAPOR
#endif /* YAPOR */
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(YAPOR_SBA))) || (defined(ACOW) && defined(YAPOR_SBA))
#if (defined(YAPOR_COPY) && (defined(YAPOR_COW) || defined(YAPOR_SBA))) || (defined(YAPOR_COW) && defined(YAPOR_SBA))
#error Do not define multiple or-parallel models
#endif /* (YAPOR_COPY && (ACOW || YAPOR_SBA)) || (ACOW && YAPOR_SBA) */
#endif /* (YAPOR_COPY && (YAPOR_COW || YAPOR_SBA)) || (YAPOR_COW && YAPOR_SBA) */
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA) || defined(THREADS)
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA) || defined(THREADS)
#define YAPOR 1
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
#if defined(TABLING) && (defined(ACOW) || defined(YAPOR_SBA))
#if defined(TABLING) && (defined(YAPOR_COW) || defined(YAPOR_SBA))
#error Currently TABLING only works with YAPOR_COPY
#endif /* TABLING && (ACOW || YAPOR_SBA) */
#endif /* TABLING && (YAPOR_COW || YAPOR_SBA) */
#ifdef YAPOR
#define FIXED_STACKS 1
#ifdef THREADS
#undef ACOW
#undef YAPOR_COW
#undef YAPOR_SBA
#undef YAPOR_COPY
#endif

View File

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

View File

@ -62,7 +62,7 @@ quality:
o -DYAPOR gives or-parallelism in Muse style. If you add -DSBA to it
you will have the Sparse Binding Array instead of copying. If you add
-DACOW instead you will have the \alphaCOW model, that is, forking
-DYAPOR_COW instead you will have the \alphaCOW model, that is, forking
instead of copying.
1.3 Porting Yap

View File

@ -44,7 +44,7 @@ DOCSDIR=$(SHAREDIR)/doc/Yap
# if you want to use this:
# -DYAPOR_COPY: or-parallelism with environment copying, in Muse style.
# -DYAPOR_SBA: or-parallelism with sparse binding arrays.
# -DACOW: or-parallelism with copy-on-write.
# -DYAPOR_COW: or-parallelism with copy-on-write.
# -DTABLING: support for tabling
#
#

View File

@ -28,7 +28,7 @@
#ifdef TABLING
#include "tab.macros.h"
#endif /* TABLING */
#if defined(TABLING) || !defined(ACOW)
#if defined(TABLING) || !defined(YAPOR_COW)
#ifndef TABLING
#include "opt.mavar.h"
#endif /* !TABLING */
@ -37,10 +37,10 @@ ma_hash_entry Yap_ma_hash_table[MAVARS_HASH_SIZE];
UInt Yap_timestamp; /* an unsigned int */
ma_h_inner_struct *Yap_ma_h_top;
#endif /* MULTI_ASSIGNMENT_VARIABLES */
#endif /* TABLING || !ACOW */
#ifdef ACOW
#endif /* TABLING || !YAPOR_COW */
#ifdef YAPOR_COW
#include "sys/wait.h"
#endif /* ACOW */
#endif /* YAPOR_COW */
@ -255,7 +255,7 @@ void init_workers(void) {
#ifdef THREADS
return;
#endif
#ifdef ACOW
#ifdef YAPOR_COW
if (Yap_number_workers> 1) {
int son;
son = fork();
@ -274,7 +274,7 @@ void init_workers(void) {
exit(0);
} else Yap_worker_pid(0) = getpid();
}
#endif /* ACOW */
#endif /* YAPOR_COW */
for (proc = 1; proc < Yap_number_workers; proc++) {
int son;
son = fork();

View File

@ -82,7 +82,7 @@ close_mapfile(void) {
void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_workers) {
void *mmap_addr = (void *)MMAP_ADDR;
#ifdef ACOW
#ifdef YAPOR_COW
int private_fd_mapfile;
#if MMAP_MEMORY_MAPPING_SCHEME
long TotalArea;
@ -108,7 +108,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
Yap_GlobalBase = mmap_addr + HeapArea;
/* shared memory allocation - model dependent */
#ifdef ACOW
#ifdef YAPOR_COW
/* acow just needs one stack */
#ifdef MMAP_MEMORY_MAPPING_SCHEME
/* I need this for MMAP to know what it must allocate */
@ -131,7 +131,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
#endif
#else /* SHM_MEMORY_MAPPING_SCHEME */
/* Most systems are limited regarding what we can allocate */
#ifdef ACOW
#ifdef YAPOR_COW
/* single shared segment in ACOW */
shm_map_memory(0, HeapArea, mmap_addr);
#else /* YAPOR_COPY || YAPOR_SBA */
@ -140,7 +140,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
#endif /* YAPOR_MODEL */
#endif /* MEMORY_MAPPING_SCHEME */
#ifdef ACOW
#ifdef YAPOR_COW
/* just allocate local space for stacks */
if ((private_fd_mapfile = open("/dev/zero", O_RDWR)) < 0)
Yap_Error(FATAL_ERROR, TermNil, "open error (map_memory)");
@ -201,22 +201,22 @@ void unmap_memory (void) {
INFORMATION_MESSAGE("Killing process %d", Yap_worker_pid(proc));
}
}
#ifdef ACOW
#ifdef YAPOR_COW
if (Yap_number_workers > 1) {
if (kill(Yap_master_worker, SIGINT) != 0)
INFORMATION_MESSAGE("Can't kill process %d", Yap_master_worker);
else
INFORMATION_MESSAGE("Killing process %d", Yap_master_worker);
}
#endif /* ACOW */
#endif /* YAPOR_COW */
}
#ifdef SHM_MEMORY_MAPPING_SCHEME
#ifdef ACOW
#ifdef YAPOR_COW
i = 0;
#else
for (i = 0; i < Yap_number_workers + 1; i++)
#endif /* ACOW */
#endif /* YAPOR_COW */
{
if (shmctl(shm_mapid[i], IPC_RMID, 0) == 0)
INFORMATION_MESSAGE("Removing shared memory segment %d", shm_mapid[i]);
@ -224,7 +224,7 @@ void unmap_memory (void) {
}
#else /* MMAP_MEMORY_MAPPING_SCHEME */
strcpy(MapFile,"./mapfile");
#ifdef ACOW
#ifdef YAPOR_COW
itos(Yap_master_worker, &MapFile[9]);
#else /* YAPOR_COPY || YAPOR_SBA */
itos(Yap_worker_pid(0), &MapFile[9]);
@ -238,9 +238,9 @@ void unmap_memory (void) {
void remap_memory(void) {
#ifdef ACOW
#ifdef YAPOR_COW
/* do nothing */
#endif /* ACOW */
#endif /* YAPOR_COW */
#ifdef YAPOR_SBA
/* setup workers so that they have different areas */
long WorkerArea = worker_offset(1);

View File

@ -170,9 +170,9 @@ struct optyap_global_data{
int delayed_release_load;
int number_workers;
int worker_pid[MAX_WORKERS];
#ifdef ACOW
#ifdef YAPOR_COW
int master_worker;
#endif /* ACOW */
#endif /* YAPOR_COW */
/* global data related to or-performance */
realtime execution_time;

View File

@ -16,7 +16,7 @@
** ------------------ */
#include "Yap.h"
#ifdef ACOW
#ifdef YAPOR_COW
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
@ -230,4 +230,4 @@ void share_private_nodes(int worker_q) {
REMOTE_load(worker_q) = LOCAL_load = 0;
return;
}
#endif /* ACOW */
#endif /* YAPOR_COW */

View File

@ -143,13 +143,13 @@ STD_PROTO(static inline qg_sol_fr_ptr CUT_prune_solution_frames, (qg_sol_fr_ptr,
p_share_work(); \
setregs(); \
}
#else /* ACOW */
#else /* YAPOR_COW */
#define SCH_check_share_request() \
if (SCH_any_share_request) { \
if (! p_share_work()) \
goto shared_fail; \
}
#endif /* YAPOR_COPY || YAPOR_SBA || ACOW */
#endif /* YAPOR_COPY || YAPOR_SBA || YAPOR_COW */
#define SCH_check_requests() \
SCH_check_prune_request(); \

View File

@ -54,17 +54,17 @@
#error Do not explicitly define YAPOR
#endif /* YAPOR */
#if (defined(YAPOR_COPY) && (defined(ACOW) || defined(YAPOR_SBA))) || (defined(ACOW) && defined(YAPOR_SBA))
#if (defined(YAPOR_COPY) && (defined(YAPOR_COW) || defined(YAPOR_SBA))) || (defined(YAPOR_COW) && defined(YAPOR_SBA))
#error Do not define multiple or-parallel models
#endif /* (YAPOR_COPY && (ACOW || YAPOR_SBA)) || (ACOW && YAPOR_SBA) */
#endif /* (YAPOR_COPY && (YAPOR_COW || YAPOR_SBA)) || (YAPOR_COW && YAPOR_SBA) */
#if defined(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
#define YAPOR 1
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
#if defined(TABLING) && (defined(ACOW) || defined(YAPOR_SBA))
#if defined(TABLING) && (defined(YAPOR_COW) || defined(YAPOR_SBA))
#error Currently TABLING only works with YAPOR_COPY
#endif /* TABLING && (ACOW || YAPOR_SBA) */
#endif /* TABLING && (YAPOR_COW || YAPOR_SBA) */
#ifdef YAPOR
#define FIXED_STACKS 1

2
configure vendored
View File

@ -7495,7 +7495,7 @@ case "$orparallelism" in
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_SBA=1"
;;
a-cow)
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COW=1"
;;
yes|env-copy)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"

View File

@ -1279,7 +1279,7 @@ case "$orparallelism" in
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_SBA=1"
;;
a-cow)
YAP_EXTRAS="$YAP_EXTRAS -DACOW=1"
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COW=1"
;;
yes|env-copy)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"

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(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_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 /* YAPOR_COPY || ACOW || YAPOR_SBA */
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_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(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_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 /* YAPOR_COPY || ACOW || YAPOR_SBA */
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_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(YAPOR_COPY) || defined(ACOW) || defined(YAPOR_SBA)
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
if (p[1] == 'l') {
p++;
ssize = &(iap->SchedulerLoop);
}
#endif /* YAPOR_COPY || ACOW || YAPOR_SBA */
#endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */
goto GetSize;
case 'a':
case 'A':