Branch: refs/heads/main
Revision: dbb3e248ff3bb73839d2266637a7364c5b2a2cda
Author: jabraham17
Link: Remove the unused/deprecated ChapelThreads by jabraham17 · Pull Request #29294 · chapel-lang/chapel · GitHub
Log Message:
Remove the unused/deprecated ChapelThreads (#29294 )
Removes the unused/deprecated ChapelThreads module and its two symbols.
The symbols in it were deprecated in
committed 06:44PM - 25 Apr 13 UTC
[Not reviewed; the original r21174 was reviewed by Tom.]
Replace configuration … variables that parameterize runtime behavior with
environment variables, as follows:
callStackSize CHPL_RT_CALL_STACK_SIZE
commConcurrency CHPL_RT_COMM_CONCURRENCY
numHardwareThreads CHPL_RT_NUM_HARDWARE_THREADS
numThreadsPerLocale CHPL_RT_NUM_THREADS_PER_LOCALE
Actually, commConcurrency and numHardwareThreads had not made it into
the ranks of full-fledged config vars yet. They were only used in the
Cray specific runtime layers, in environment variable form. The other
two, callStackSize and numThreadsPerLocale, were in general use. Only
numThreadsPerLocale was referred to by any test code, though.
We are doing this in order to remove am initialization dependence loop:
these values are needed early in runtime initialization, but if they are
Chapel config vars (or consts) their values are not set until after that
point. This was forcing us to scan for them manually in the command
line, which isn't safe.
As a side effect of this change, the various values that parameterize
the tasking and threading layers are now acquired by code in those
layers, instead of being acquired in main() and passed via the call to
chpl_task_init(). These values include the desired number and maximum
threads per locale, the call stack size, and the number of polling tasks
the comm layer requires. The details are described in the per-file
comments below.
The file specific changes are as follows.
MODULES:
modules/internal/ChapelThreads.chpl
Initialize numThreadsPerLocale with chpl_task_getenvNumThreadsPerLocale().
Remove the legality check for that variable, since this is now done in the
various tasking layers. Use chpl_task_getenvCallStackSize() to initialize
callStackSize. Remove the use of ChapelBase, which is no longer needed.
Remove chpl__MaxThreadsPerLocale, which is unused. numThreadsPerLocale
and callStackSize are still config consts here, but they are deprecated
and will eventually be removed.
RUNTIME:
runtime/include/chpl-tasks.h
Adjust the chpl_task_init() interface. We don't pass anything to this
function any more. It gets everything it needs from the environment.
Add new functions chpl_task_getenvNumThreadsPerLocale() and
chpl_task_getenvCallStackSize(void), which retrieve the values of the
environment variables needed to initialize the runtime. These are in
runtime/src/chpl-tasks.c, described below.
runtime/include/chpl-threads.h
Adjust the chpl_thread_init() interface. We don't pass the number of
threads, maximum number of threads, or call stack size to this
function any more. It gets everything it needs from the environment.
runtime/include/chplcgfns.h
Remove global declarations for numThreadsPerLocale and callStackSize,
and also chpl__maxThreadsPerLocale, which doesn't seem to be used
anywhere.
runtime/src/tasks/fifo/tasks-fifo.c
runtime/src/tasks/mta/tasks-mta.c
runtime/src/tasks/none/tasks-none.c
runtime/src/tasks/massivethreads/tasks-massivethreads.c
Adjust the chpl_task_init() interface. Adjust messages to refer
generically to the number of threads and the call stack size, instead
of to the named variables. In tasks-none.c, fix some flaws in the
code having to do with setting and getting the locale, so that it will
at least build.
runtime/src/threads/minimal/threads-minimal.c
runtime/src/threads/pthreads/threads-pthreads.c
Adjust the chpl_thread_init() interface. Adjust messages to refer
generically to the number of threads and the call stack size, instead
of to the named variables.
runtime/src/chpl-tasks.c (new)
New file, containing chpl_task_getenvNumThreadsPerLocale() and
chpl_task_getenvCallStackSize().
runtime/src/main.c
Adjust to changed interface for chpl_task_init().
runtime/include/chplsys.h
runtime/src/chplsys.c
Remove chpl_maxThreads(), which is no longer needed because the
tasking layers call chpl_comm_getMaxThreads() directly. In the .h
file, also remove chpl_maxThreadsLimit(), which didn't exist.
runtime/src/config.c
Emit deprecation warnings when the old config vars are used.
runtime/src/Makefile.share
Add new file runtime/src/chpl-tasks.c.
third-party/massivethreads/massivethreads-0.3beta/README
Documentation changes.
third-party/qthread/qthread-1.9/src/interfaces/chapel/tasks-qthreads.c
third-party/qthread/qthread-1.9/src/interfaces/chapel/comm-qthreads.c
Adjust the chpl_task_init() interface. We don't pass anything to this
function any more. It gets everything it needs from the environment.
Removed commentary regarding a limitation related to the use of config
variables for the number of threads and call stack size.
DOCUMENTATION:
doc/release/README.tasks
doc/release/platforms/README.cray
doc/release/README.executing
Documentation changes.
TESTING:
util/cron/nightly.chap02
util/cron/nightly.chap09
Replace "-execopts --numThreadsPerLocale=x" commandline arguments to
the nightly script with setting CHPL_RT_NUM_THREADS_PER_LOCALE=x
instead.
test/exercises/RandomNumber6.execopts
test/exercises/RandomNumber6.execenv (new)
test/distributions/robust/associative/basic/array_write.execopts (deleted)
test/distributions/robust/associative/basic/array_write.execenv (new)
test/distributions/robust/associative/basic/whole_domain_assign.execopts (deleted)
test/distributions/robust/associative/basic/whole_domain_assign.execenv (new)
test/distributions/robust/associative/basic/domain_write.execopts (deleted)
test/distributions/robust/associative/basic/domain_write.execenv (new)
test/trivial/sungeun/invalid_config_vals.execopts
test/trivial/sungeun/invalid_config_vals.mTPL.good (deleted)
test/trivial/sungeun/invalid_config_vals.nTPL.chpl (new)
test/trivial/sungeun/invalid_config_vals.nTPL.execenv (new)
test/trivial/sungeun/invalid_config_vals.nTPL.good (new)
test/studies/madness/aniruddha/madchap/EXECOPTS
test/studies/madness/aniruddha/madchap/mytests/par-refine/test_refine.execopts (deleted)
test/studies/madness/aniruddha/madchap/mytests/par-refine/test_refine.execenv (new)
test/studies/madness/aniruddha/madchap/mytests/par-compress/test_compress.execopts (deleted)
test/studies/madness/aniruddha/madchap/mytests/par-compress/test_compress.execenv (new)
test/studies/madness/aniruddha/madchap/mytests/par-reconstruct/test_reconstruct.execopts (deleted)
test/studies/madness/aniruddha/madchap/mytests/par-reconstruct/test_reconstruct.execenv (new)
test/studies/madness/aniruddha/madchap/EXECENV (new)
test/stress/deitz/test_10k_coforall.execopts
test/stress/deitz/test_10k_coforall.execenv (new)
test/domains/sungeun/assoc/stress.execopts
test/domains/sungeun/assoc/stress.numthr.chpl (new)
test/domains/sungeun/assoc/stress.numthr.compopts (new)
test/domains/sungeun/assoc/stress.numthr.execopts (new)
test/domains/sungeun/assoc/stress.numthr.execenv (new)
test/domains/sungeun/assoc/stress.numthr.good (new)
test/parallel/coforall/bradc/manyThreads-inorder.execopts (deleted)
test/parallel/coforall/bradc/manyThreads-inorder.execenv (new)
test/parallel/begin/dinan/mvm_coforall.execopts (deleted)
test/parallel/begin/dinan/mvm_coforall.execenv (new)
test/parallel/cobegin/deitz/test_big_recursive_cobegin.execopts
test/parallel/cobegin/deitz/test_big_recursive_cobegin.execenv (new)
test/parallel/cobegin/stonea/reports.execenv (new)
test/parallel/cobegin/stonea/reports.lastexecopts (deleted)
test/parallel/cobegin/gbt/cobegin-stacksize.execopts (deleted)
test/parallel/cobegin/gbt/cobegin-stacksize.execenv (new)
test/parallel/taskPool/figueroa/OneThread.execopts (deleted)
test/parallel/taskPool/figueroa/OneThread.execenv (new)
test/parallel/taskPool/figueroa/OneThreadSyncStmt.execopts (deleted)
test/parallel/taskPool/figueroa/QueuedTasks.lastexecopts (deleted)
test/parallel/taskPool/figueroa/QueuedTasks.execenv (new)
test/parallel/taskPool/figueroa/ManyThreads.execopts (deleted)
test/parallel/taskPool/figueroa/ManyThreads.execenv (new)
test/parallel/taskPool/figueroa/ManyThreads.comm-gasnet.good
test/parallel/taskPool/figueroa/OneThreadSyncStmt.execenv (new)
test/execflags/shannon/configs/help/basehelp.txt
test/execflags/bradc/callStackSize.execenv (new)
test/execflags/bradc/callStackSize.execopts (deleted)
test/multilocale/gasnet/bradc/257threads.execopts (deleted)
test/multilocale/gasnet/bradc/257threads.execenv (new)
test/multilocale/gasnet/bradc/257threads.good
test/multilocale/gasnet/bradc/257threads-quiet.execopts
test/multilocale/gasnet/bradc/257threads-quiet.execenv (new)
test/multilocale/diten/needMultiLocales/coforallon_maxThreads.execopts (deleted)
test/multilocale/diten/needMultiLocales/coforallon_maxThreads.execenv (new)
test/multilocale/gbt/hello-numThreads-1.execopts (deleted)
test/multilocale/gbt/hello-numThreads-1.execenv (new)
Replace the use of --callStackSize=s and/or --numThreadsPerLocale=n in
EXECOPTS or .execopts files with CHPL_RT_CALL_STACK_SIZE=s and/or
CHPL_RT_NUM_THREADS_PER_LOCALE=n in EXECENV or .execenv files. This
takes advantage of the new sub_test per-test environment capability
committed in r21166 [to branches/hierarchical_locales, and pushed to
trunk in r21320]. Where the config var setting was the only thing
in execopts that file is deleted. domains/sungeun/assoc/stress.numthr
and trivial/sungeun/invalid_config_vals.nTPL are new tests created
because the config var setting was one of several lines in the
.execopts file, and there wasn't a way to express that only one of the
test runs should use the new .execenv environment. In a few cases I
also changed .good files to reflect new message text for improper
values (negative, e.g.) for the number of threads or call stack size.
git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@21322 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
and intended to be removed, but numThreadsPerLocale never was.
This PR updates 3 tests that never switched to use here.maxTaskPar
[Reviewed by @benharsh ]
Compare: Comparing 33828cca63db63dd3e708c20f0dca916e862bc45...80bf6ac0692dc597cc50148c7aa4b27407bd5fa3 · chapel-lang/chapel · GitHub
Diff:
M modules/internal/ChapelStandard.chpl
D modules/internal/ChapelThreads.chpl
M test/compflags/ferguson/print-module-resolution.good
M test/modules/sungeun/init/printModuleInitOrder.good
M test/studies/madness/aniruddha/madchap/mytests/par-compress/MRA.chpl
M test/studies/madness/aniruddha/madchap/mytests/par-reconstruct/MRA.chpl
M test/studies/madness/aniruddha/madchap/mytests/par-refine/MRA.chpl
https://github.com/chapel-lang/chapel/pull/29294.diff