João Silva patch for yapor copy+tabling

This commit is contained in:
Vitor Santos Costa 2014-03-08 11:50:20 +00:00
parent 233c4ee903
commit 3d0bb05ef0
6 changed files with 56 additions and 29 deletions

View File

@ -3406,6 +3406,11 @@ Yap_cclause(volatile Term inp_clause, Int NOfArgs, Term mod, volatile Term src)
/* first, initialise cglobs->cint.CompilerBotch to handle all cases of interruptions */ /* first, initialise cglobs->cint.CompilerBotch to handle all cases of interruptions */
compiler_struct cglobs; compiler_struct cglobs;
#ifdef TABLING_INNER_CUTS
PInstr cglobs_cut_mark;
cglobs.cut_mark = &cglobs_cut_mark;
#endif /* TABLING_INNER_CUTS */
/* make sure we know there was no error yet */ /* make sure we know there was no error yet */
LOCAL_ErrorMessage = NULL; LOCAL_ErrorMessage = NULL;
if ((botch_why = sigsetjmp(cglobs.cint.CompilerBotch, 0))) { if ((botch_why = sigsetjmp(cglobs.cint.CompilerBotch, 0))) {

View File

@ -11,6 +11,9 @@
** ** ** **
************************************************************************/ ************************************************************************/
#ifndef OR_MACROS_H
#define OR_MACROS_H
/* -------------------- ** /* -------------------- **
** Prototypes ** ** Prototypes **
** -------------------- */ ** -------------------- */
@ -605,3 +608,5 @@ qg_sol_fr_ptr CUT_prune_solution_frames(qg_sol_fr_ptr solutions, int ltt) {
} }
return solutions; return solutions;
} }
#endif

View File

@ -162,8 +162,8 @@ void Yap_init_yapor_stacks_memory(UInt TrailStackArea, UInt HeapStackArea, UInt
LOCAL_TrailBase = LOCAL_GlobalBase + GlobalLocalStackArea; LOCAL_TrailBase = LOCAL_GlobalBase + GlobalLocalStackArea;
LOCAL_LocalBase = LOCAL_TrailBase - CellSize; LOCAL_LocalBase = LOCAL_TrailBase - CellSize;
LOCAL_TrailTop = LOCAL_TrailBase + TrailStackArea; LOCAL_TrailTop = LOCAL_TrailBase + TrailStackArea;
HeapLim = LOCAL_GlobalBase;
Yap_InitHeap(Yap_HeapBase); Yap_InitHeap(Yap_HeapBase);
HeapLim = LOCAL_GlobalBase;
return; return;
} }

View File

@ -20,6 +20,9 @@
#include <string.h> #include <string.h>
#endif /* HAVE_STRING_H */ #endif /* HAVE_STRING_H */
#include "opt.mavar.h" #include "opt.mavar.h"
#ifdef YAPOR
#include "or.macros.h"
#endif
#ifdef THREADS #ifdef THREADS
static inline void **__get_insert_thread_bucket(void **, lockvar * USES_REGS); static inline void **__get_insert_thread_bucket(void **, lockvar * USES_REGS);

39
configure vendored
View File

@ -4546,6 +4546,21 @@ $as_echo "#define MinStackSpace (1024*SIZEOF_INT_P)" >>confdefs.h
$as_echo "#define MinTrailSpace (256*SIZEOF_INT_P)" >>confdefs.h $as_echo "#define MinTrailSpace (256*SIZEOF_INT_P)" >>confdefs.h
if test "$orparallelism" = threads
then
orparallelism="yes"
threads="yes"
fi
if "$orparallelism" = copy || "$orparallelism" = yes -a "$threads" = no
then
orparallelism="copy"
use_malloc="no"
elif "$orparallelism" != no
then
tabling="no"
fi
if test "$orparallelism" != no if test "$orparallelism" != no
then then
@ -4553,14 +4568,6 @@ cat >>confdefs.h <<_ACEOF
#define MAX_WORKERS $yap_cv_max_workers #define MAX_WORKERS $yap_cv_max_workers
_ACEOF _ACEOF
if test "$orparallelism" = copy -o "$orparallelism" = yes
then
use_malloc="no"
fi
if test "$orparallelism" = threads
then
threads="yes"
fi
else else
$as_echo "#define MAX_WORKERS 1" >>confdefs.h $as_echo "#define MAX_WORKERS 1" >>confdefs.h
@ -7424,7 +7431,7 @@ fi
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DRATIONAL_TREES=1" YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DRATIONAL_TREES=1"
if test "$orparallelism" = no if test "$tabling" = yes
then then
YAP_EXTRAS="$YAP_EXTRAS -DTABLING=1" YAP_EXTRAS="$YAP_EXTRAS -DTABLING=1"
fi fi
@ -7476,7 +7483,7 @@ as_fn_error $? "--or-parallelism=$orparallelism incompatible with threads
See \`config.log' for more details" "$LINENO" 5; } See \`config.log' for more details" "$LINENO" 5; }
;; ;;
yes|threads) yes)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_THREADS=1" YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_THREADS=1"
;; ;;
esac esac
@ -7488,7 +7495,7 @@ else
a-cow) a-cow)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COW=1" YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COW=1"
;; ;;
yes|copy) copy)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1" YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"
;; ;;
esac esac
@ -9370,7 +9377,7 @@ $as_echo "#define USE_SYSTEM_MALLOC 1" >>confdefs.h
fi fi
else else
case "$orparallelism" in case "$orparallelism" in
sba|yes|copy) sba|copy)
if test x"$ac_cv_func_mmap" = x"yes" if test x"$ac_cv_func_mmap" = x"yes"
then then
@ -12169,7 +12176,7 @@ else
JAVA_TEST=Test.java JAVA_TEST=Test.java
CLASS_TEST=Test.class CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST cat << \EOF > $JAVA_TEST
/* #line 12172 "configure" */ /* #line 12179 "configure" */
public class Test { public class Test {
} }
EOF EOF
@ -12345,7 +12352,7 @@ EOF
if uudecode$EXEEXT Test.uue; then if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes ac_cv_prog_uudecode_base64=yes
else else
echo "configure: 12348: uudecode had trouble decoding base 64 file 'Test.uue'" >&5 echo "configure: 12355: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5 echo "configure: failed file was:" >&5
cat Test.uue >&5 cat Test.uue >&5
ac_cv_prog_uudecode_base64=no ac_cv_prog_uudecode_base64=no
@ -12476,7 +12483,7 @@ else
JAVA_TEST=Test.java JAVA_TEST=Test.java
CLASS_TEST=Test.class CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST cat << \EOF > $JAVA_TEST
/* #line 12479 "configure" */ /* #line 12486 "configure" */
public class Test { public class Test {
} }
EOF EOF
@ -12511,7 +12518,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class CLASS_TEST=Test.class
TEST=Test TEST=Test
cat << \EOF > $JAVA_TEST cat << \EOF > $JAVA_TEST
/* [#]line 12514 "configure" */ /* [#]line 12521 "configure" */
public class Test { public class Test {
public static void main (String args[]) { public static void main (String args[]) {
System.exit (0); System.exit (0);

View File

@ -308,17 +308,24 @@ AC_ARG_WITH(max-threads,
AC_DEFINE(MinHeapSpace, (2048*SIZEOF_INT_P), [at least 2M Cells for Heap]) AC_DEFINE(MinHeapSpace, (2048*SIZEOF_INT_P), [at least 2M Cells for Heap])
AC_DEFINE(MinStackSpace,(1024*SIZEOF_INT_P), [at least 1M Cells for Stack]) AC_DEFINE(MinStackSpace,(1024*SIZEOF_INT_P), [at least 1M Cells for Stack])
AC_DEFINE(MinTrailSpace,(256*SIZEOF_INT_P), [at least 1/2M Cells for Trail]) AC_DEFINE(MinTrailSpace,(256*SIZEOF_INT_P), [at least 1/2M Cells for Trail])
if test "$orparallelism" = threads
then
orparallelism="yes"
threads="yes"
fi
if [ "$orparallelism" = copy ] || [ "$orparallelism" = yes -a "$threads" = no ]
then
orparallelism="copy"
use_malloc="no"
elif [ "$orparallelism" != no ]
then
tabling="no"
fi
if test "$orparallelism" != no if test "$orparallelism" != no
then then
AC_DEFINE_UNQUOTED(MAX_WORKERS,$yap_cv_max_workers,[maximum amount of or-parallelism]) AC_DEFINE_UNQUOTED(MAX_WORKERS,$yap_cv_max_workers,[maximum amount of or-parallelism])
if test "$orparallelism" = copy -o "$orparallelism" = yes
then
use_malloc="no"
fi
if test "$orparallelism" = threads
then
threads="yes"
fi
else else
AC_DEFINE(MAX_WORKERS,1) AC_DEFINE(MAX_WORKERS,1)
fi fi
@ -1110,7 +1117,7 @@ fi
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DRATIONAL_TREES=1" YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1 -DRATIONAL_TREES=1"
if test "$orparallelism" = no if test "$tabling" = yes
then then
YAP_EXTRAS="$YAP_EXTRAS -DTABLING=1" YAP_EXTRAS="$YAP_EXTRAS -DTABLING=1"
fi fi
@ -1160,7 +1167,7 @@ if test "$threads" = "yes"
[--or-parallelism=$orparallelism incompatible with threads] [--or-parallelism=$orparallelism incompatible with threads]
) )
;; ;;
yes|threads) yes)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_THREADS=1" YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_THREADS=1"
;; ;;
esac esac
@ -1172,7 +1179,7 @@ else
a-cow) a-cow)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COW=1" YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COW=1"
;; ;;
yes|copy) copy)
YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1" YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_COPY=1"
;; ;;
esac esac
@ -1682,7 +1689,7 @@ then
fi fi
else else
case "$orparallelism" in case "$orparallelism" in
sba|yes|copy) sba|copy)
if test x"$ac_cv_func_mmap" = x"yes" if test x"$ac_cv_func_mmap" = x"yes"
then then
AC_DEFINE(USE_SYSTEM_MMAP,1,[use mmap in or-parallel allocation]) AC_DEFINE(USE_SYSTEM_MMAP,1,[use mmap in or-parallel allocation])