mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-10 19:33:11 +00:00
Threadscope grades are enabled by using the grade component 'threadscope'.
They are supported only with low-lavel C parallel grades. Support for
threadscope in high level C grades is intended in the future but does not work
now.
runtime/mercury_conf_param.h:
Create the MR_THREADSCOPE macro that is defined if the grade is a
threadscope grade.
Define MR_PROFILE_FOR_PARALLEL_EXECUTION if MR_THREADSCOPE is defined.
Emit an error if MR_LL_PARALLEL_CONJ is defined before it is implied by
MR_THREADSAFE and ! MR_HIGHLEVEL_CODE
runtime/mercury_grade.h
Update the grade symbol for the threadscope grade component.
runtime/mercury_atomic_ops.c:
runtime/mercury_atomic_ops.h:
runtime/mercury_context.c:
runtime/mercury_context.h:
runtime/mercury_engine.c:
runtime/mercury_engine.h:
runtime/mercury_thread.c:
runtime/mercury_threadscope.c:
runtime/mercury_threadscope.h:
runtime/mercury_wrapper.c:
Now that MR_PROFILE_FOR_IMPLICIT_PARALLELISM is implied by MR_THREADSAFE we
don't need to test for MR_THREADSAFE when we test for
MR_PROFILE_FOR_IMPLICIT_PARALLELISM. The same is true for
MR_LL_PARALLEL_CONJ which is implied by MR_THREADSAFE &&
!MR_HIGHLEVEL_CODE.
Replace some occurances of MR_PROFILE_FOR_IMPLICIT_PARALLELISM with
MR_THREADSCOPE where the conditionally compiled code is used to support
threadscope profiling.
scripts/init_grade_options.sh-subr:
scripts/canonical_grade.sh-subr:
scripts/parse_grade_options.sh-subr:
scripts/final_grade_options.sh-subr:
scripts/mgnuc.in:
compiler/handle_options.m:
compiler/options.m:
compiler/compile_target_code.m:
configure.in:
Add support for the new grade component.
Pass -DMR_THREADSCOPE to the C compiler when using a threadscope grade.
Add assertions to ensure that the 'threadscope' grade component is used
only with the 'par' grade component.
doc/user_guide.texi:
Added commented-out documentation for the threadscope greate component.
Adjusted documentation of the --profile-parallel-execution runtime option
to describe the correct prerequisite compile time options.
Added my name to the authors list.
runtime/mercury_context.c:
Corrected grammar and prose in comments in the MR_do_join_and_continue code.
109 lines
2.5 KiB
Plaintext
109 lines
2.5 KiB
Plaintext
#---------------------------------------------------------------------------#
|
|
# Copyright (C) 1998-2002, 2004-2007, 2009-2010 The University of Melbourne.
|
|
# This file may only be copied under the terms of the GNU General
|
|
# Public License - see the file COPYING in the Mercury distribution.
|
|
#---------------------------------------------------------------------------#
|
|
#
|
|
# final_grade_options.sh-subr:
|
|
# An `sh' subroutine for handling implications between grade-related
|
|
# options. Used by the `ml', `mgnuc' and `c2init' scripts.
|
|
#
|
|
# The code here should be inserted after a script's option-parsing
|
|
# loop.
|
|
#
|
|
# IMPORTANT: any changes to the handling of grades here may also require
|
|
# changes to compiler/handle_options.m.
|
|
#
|
|
# This file should only use the shell variables initialized by
|
|
# init_grade_options.sh-subr.
|
|
#
|
|
#---------------------------------------------------------------------------#
|
|
|
|
use_minimal_model=false
|
|
case $use_minimal_model_stack_copy in
|
|
true)
|
|
use_minimal_model=true
|
|
;;
|
|
esac
|
|
case $use_minimal_model_own_stacks in
|
|
true)
|
|
use_minimal_model=true
|
|
;;
|
|
esac
|
|
|
|
#
|
|
# .tr grade is not compatible with .*mm*
|
|
# (see comment in runtime/mercury_tabling.c for rationale)
|
|
#
|
|
case $use_trail,$use_minimal_model in true,true)
|
|
echo "trailing and minimal model tabling are not compatible" 1>&2
|
|
exit 1 ;;
|
|
esac
|
|
|
|
#
|
|
# .exts grade is not compatible with .stseg
|
|
# (they are alternative ways of doing the same thing)
|
|
#
|
|
case $extend_stacks,$stack_segments in true,true)
|
|
echo "--extend-stacks-when-needed and --stack-segments are not compatible" 1>&2
|
|
exit 1 ;;
|
|
esac
|
|
|
|
#
|
|
# --decl-debug implies --debug
|
|
#
|
|
case $decl_debug in true)
|
|
debug=true ;;
|
|
esac
|
|
|
|
#
|
|
# --target asm, IL or Java implies --high-level-code
|
|
#
|
|
case $target in asm|il|java)
|
|
highlevel_code=true ;;
|
|
esac
|
|
|
|
#
|
|
# --target IL or Java implies --high-level-data
|
|
#
|
|
case $target in il|java)
|
|
highlevel_data=true ;;
|
|
esac
|
|
|
|
#
|
|
# --target IL or Java or Erlang implies --gc automatic
|
|
#
|
|
case $target in il|java|erlang)
|
|
gc_method=automatic ;;
|
|
esac
|
|
|
|
#
|
|
# --high-level-code disables the use of low-level gcc extensions
|
|
#
|
|
case $highlevel_code in true)
|
|
non_local_gotos=false
|
|
asm_labels=false
|
|
global_regs=false
|
|
;;
|
|
esac
|
|
|
|
#
|
|
# --use-regions-debug and --use-regions-profiling aren't meaningful
|
|
# without --use-regions
|
|
#
|
|
case $use_regions in false)
|
|
use_regions_debug=false
|
|
use_regions_profiling=false
|
|
;;
|
|
esac
|
|
|
|
#
|
|
# threadscope doesn't make sense in non-parallel grades.
|
|
#
|
|
case $thread_safe in false)
|
|
threadscope=false
|
|
;;
|
|
esac
|
|
|
|
#---------------------------------------------------------------------------#
|