[m-rev.] diff: Provide access to runtime granularity control primitives.

Zoltan Somogyi zs at csse.unimelb.edu.au
Thu Jun 4 18:03:59 AEST 2009


On 04-Jun-2009, Paul Bone <pbone at csse.unimelb.edu.au> wrote:
> +void MR_record_conditional_parallelism_descision(MR_Unsigned descision)

runtime/mercury_context.[ch]:
library/par_builtin.m:
	Fix spelling error in Paul's change, and fix some old bad indentation.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_allegro
cvs diff: Diffing extras/graphics/mercury_allegro/examples
cvs diff: Diffing extras/graphics/mercury_allegro/samples
cvs diff: Diffing extras/graphics/mercury_allegro/samples/demo
cvs diff: Diffing extras/graphics/mercury_allegro/samples/mandel
cvs diff: Diffing extras/graphics/mercury_allegro/samples/pendulum2
cvs diff: Diffing extras/graphics/mercury_allegro/samples/speed
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/posix/samples
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/par_builtin.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/par_builtin.m,v
retrieving revision 1.17
diff -u -b -r1.17 par_builtin.m
--- library/par_builtin.m	4 Jun 2009 07:52:01 -0000	1.17
+++ library/par_builtin.m	4 Jun 2009 07:54:51 -0000
@@ -374,7 +374,7 @@
 #ifdef MR_LL_PARALLEL_CONJ
     SUCCESS_INDICATOR = MR_choose_parallel_over_sequential_cond(NumCPUs);
   #ifdef MR_DEBUG_RUNTIME_GRANULARITY_CONTROL
-    MR_record_conditional_parallelism_descision(SUCCESS_INDICATOR);
+    MR_record_conditional_parallelism_decision(SUCCESS_INDICATOR);
   #endif
 #else
     MR_fatal_error(
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_context.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_context.c,v
retrieving revision 1.61
diff -u -b -r1.61 mercury_context.c
--- runtime/mercury_context.c	4 Jun 2009 06:42:13 -0000	1.61
+++ runtime/mercury_context.c	4 Jun 2009 07:55:59 -0000
@@ -699,43 +699,44 @@
 static volatile MR_Unsigned MR_par_cond_stats_last;
 static volatile MR_Unsigned MR_par_cond_stats_last_count;
 
-void MR_record_conditional_parallelism_descision(MR_Unsigned descision)
+void MR_record_conditional_parallelism_decision(MR_Unsigned decision)
 {
-    MR_LOCK(&MR_par_cond_stats_lock, "record_conditional_parallelism_decision");
-    if (MR_par_cond_stats_file == NULL)
-    {
+    MR_LOCK(&MR_par_cond_stats_lock,
+        "record_conditional_parallelism_decision");
+
+    if (MR_par_cond_stats_file == NULL) {
         MR_par_cond_stats_file = fopen(MR_PAR_COND_STATS_FILENAME, "w");
-        MR_par_cond_stats_last = descision;
+        MR_par_cond_stats_last = decision;
         MR_par_cond_stats_last_count = 1;
-    }
-    else
-    {
-        if (descision == MR_par_cond_stats_last)
-        {
+    } else {
+        if (decision == MR_par_cond_stats_last) {
             MR_par_cond_stats_last_count++;
-        }
-        else
-        {
+        } else {
             fprintf(MR_par_cond_stats_file, "%d %d\n", MR_par_cond_stats_last,
                 MR_par_cond_stats_last_count);
-            MR_par_cond_stats_last = descision;
+            MR_par_cond_stats_last = decision;
             MR_par_cond_stats_last_count = 1;
         }
     }
-    MR_UNLOCK(&MR_par_cond_stats_lock, "record_conditional_parallelism_decision i");
+
+    MR_UNLOCK(&MR_par_cond_stats_lock,
+        "record_conditional_parallelism_decision");
 }
 
 void MR_write_out_conditional_parallelism_log(void)
 {
-    MR_LOCK(&MR_par_cond_stats_lock, "write_out_conditional_parallelism_log");
-    if (MR_par_cond_stats_file != NULL)
-    {
-        fprintf(MR_par_cond_stats_file, "%d %d\n", MR_par_cond_stats_last,
-            MR_par_cond_stats_last_count);
+    MR_LOCK(&MR_par_cond_stats_lock,
+        "write_out_conditional_parallelism_log");
+
+    if (MR_par_cond_stats_file != NULL) {
+        fprintf(MR_par_cond_stats_file, "%d %d\n",
+            MR_par_cond_stats_last, MR_par_cond_stats_last_count);
         fclose(MR_par_cond_stats_file);
         MR_par_cond_stats_file = NULL;
     }
-    MR_UNLOCK(&MR_par_cond_stats_lock, "write_out_conditional_parallelism_log i");
+
+    MR_UNLOCK(&MR_par_cond_stats_lock,
+        "write_out_conditional_parallelism_log");
 }
 
 #endif /* MR_DEBUG_RUNTIME_GRANULARITY_CONTROL */
Index: runtime/mercury_context.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_context.h,v
retrieving revision 1.47
diff -u -b -r1.47 mercury_context.h
--- runtime/mercury_context.h	4 Jun 2009 06:42:13 -0000	1.47
+++ runtime/mercury_context.h	4 Jun 2009 07:54:13 -0000
@@ -886,7 +886,7 @@
   ** be run sequentially.
   ** This is not (yet) thread safe.
   */
-  void MR_record_conditional_parallelism_descision(MR_Unsigned descision);
+  void MR_record_conditional_parallelism_decision(MR_Unsigned decision);
 
   /*
   ** flush and close the log of conditional parallelism decisions 
Index: runtime/mercury_thread.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_thread.h,v
retrieving revision 1.26
diff -u -b -r1.26 mercury_thread.h
--- runtime/mercury_thread.h	4 May 2009 01:50:41 -0000	1.26
+++ runtime/mercury_thread.h	4 Jun 2009 08:01:36 -0000
@@ -31,20 +31,19 @@
   typedef pthread_mutex_t   MercuryLock;
   typedef pthread_cond_t    MercuryCond;
 
-  int MR_mutex_lock(MercuryLock *lock, const char *from);
-  int MR_mutex_unlock(MercuryLock *lock, const char *from);
-  int MR_cond_signal(MercuryCond *cond);
-  int MR_cond_broadcast(MercuryCond *cond);
-  int MR_cond_wait(MercuryCond *cond, MercuryLock *lock);
+  extern int        MR_mutex_lock(MercuryLock *lock, const char *from);
+  extern int        MR_mutex_unlock(MercuryLock *lock, const char *from);
+  extern int        MR_cond_signal(MercuryCond *cond);
+  extern int        MR_cond_broadcast(MercuryCond *cond);
+  extern int        MR_cond_wait(MercuryCond *cond, MercuryLock *lock);
 
   extern MR_bool MR_debug_threads;
 
   #ifndef MR_DEBUG_THREADS
     /*
-    ** The following macros should be used once the
-    ** use of locking in the generated code is considered
-    ** stable, since the alternative versions do the
-    ** same thing, but with debugging support.
+    ** The following macros should be used once the use of locking
+    ** in the generated code is considered stable, since the alternative
+    ** versions do the same thing, but with debugging support.
     */
     #define MR_LOCK(lck, from)  pthread_mutex_lock((lck))
     #define MR_UNLOCK(lck, from)    pthread_mutex_unlock((lck))
@@ -84,7 +83,6 @@
                 :                   \
                     pthread_cond_wait((cnd), (mtx)) \
                 )
-
   #endif
 
     /*
@@ -96,7 +94,8 @@
   #define MR_RELEASE_GLOBAL_LOCK(where) MR_UNLOCK(&MR_global_lock, (where))
 
   #if defined(MR_DIGITAL_UNIX_PTHREADS)
-    #define MR_GETSPECIFIC(key)     ({      \
+    #define MR_GETSPECIFIC(key)                         \
+        ({                                              \
         pthread_addr_t gstmp;           \
         pthread_getspecific((key), &gstmp); \
         (void *) gstmp;             \
@@ -121,8 +120,8 @@
   ** be called with the given argument in the new thread.
   */
 
-  MercuryThread     *MR_create_thread(MR_ThreadGoal *);
-  void              MR_destroy_thread(void *eng);
+  extern MercuryThread      *MR_create_thread(MR_ThreadGoal *);
+  extern void               MR_destroy_thread(void *eng);
   extern MR_bool    MR_exit_now;
 
   /*
@@ -245,20 +244,20 @@
 /*
 ** Allocate an index into the thread-local mutable array for a mutable.
 */
-extern MR_Unsigned
-MR_new_thread_local_mutable_index(void);
+extern MR_Unsigned  MR_new_thread_local_mutable_index(void);
 
 /*
 ** Allocate a thread-local mutable array.
 */
-extern MR_ThreadLocalMuts *
-MR_create_thread_local_mutables(MR_Unsigned numslots);
+extern MR_ThreadLocalMuts
+                    *MR_create_thread_local_mutables(MR_Unsigned numslots);
 
 /*
 ** Make a copy of a thread-local mutable array.
 */
 extern MR_ThreadLocalMuts *
-MR_clone_thread_local_mutables(const MR_ThreadLocalMuts *old_muts);
+                    MR_clone_thread_local_mutables(
+                        const MR_ThreadLocalMuts *old_muts);
 
 #define MR_THREAD_LOCAL_MUTABLES                                        \
     (MR_ENGINE(MR_eng_this_context)->MR_ctxt_thread_local_mutables)
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/standalone_c
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/solver_types
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing ssdb
cvs diff: Diffing tests
cvs diff: Diffing tests/analysis
cvs diff: Diffing tests/analysis/ctgc
cvs diff: Diffing tests/analysis/excp
cvs diff: Diffing tests/analysis/ext
cvs diff: Diffing tests/analysis/sharing
cvs diff: Diffing tests/analysis/table
cvs diff: Diffing tests/analysis/trail
cvs diff: Diffing tests/analysis/unused_args
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/stm
cvs diff: Diffing tests/stm/orig
cvs diff: Diffing tests/stm/orig/stm-compiler
cvs diff: Diffing tests/stm/orig/stm-compiler/test1
cvs diff: Diffing tests/stm/orig/stm-compiler/test10
cvs diff: Diffing tests/stm/orig/stm-compiler/test2
cvs diff: Diffing tests/stm/orig/stm-compiler/test3
cvs diff: Diffing tests/stm/orig/stm-compiler/test4
cvs diff: Diffing tests/stm/orig/stm-compiler/test5
cvs diff: Diffing tests/stm/orig/stm-compiler/test6
cvs diff: Diffing tests/stm/orig/stm-compiler/test7
cvs diff: Diffing tests/stm/orig/stm-compiler/test8
cvs diff: Diffing tests/stm/orig/stm-compiler/test9
cvs diff: Diffing tests/stm/orig/stm-compiler-par
cvs diff: Diffing tests/stm/orig/stm-compiler-par/bm1
cvs diff: Diffing tests/stm/orig/stm-compiler-par/bm2
cvs diff: Diffing tests/stm/orig/stm-compiler-par/stmqueue
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test1
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test10
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test11
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test2
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test3
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test4
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test5
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test6
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test7
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test8
cvs diff: Diffing tests/stm/orig/stm-compiler-par/test9
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test1
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test2
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test3
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test4
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test5
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test6
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test7
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test8
cvs diff: Diffing tests/stm/orig/stm-compiler-par-asm_fast/test9
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list