Filing some future for != and == of empty records

Empty record == and != always return true or false respectively,
regardless of the type of the second argument (int in these cases).

This happens because we build the functions with the second argument
as dtAny to handle sub-records, and then they later get instantiated
during resolution with the actual type.  The body of the function is
empty other than the return statement because the records have not
fields, so it compiles and runs.



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@21812 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Bug fix and minor tweaks to modules/standard/AdvancedIters.chpl.

[committing on behalf of Ben, plus minor tweaks]

* The dynamic iterator used to have all the work done in the (single)
current task when the number of chunks is less than the number of tasks.

This commit makes the current task handle all work when it all fits in
one chunk. Otherwise, the number of tasks created is min(tasks to
satisfy work, number of user specified tasks).

Note that having the current task handle all work has (and has had)
the benefit of avoiding the creation and use of a sync variable,
splitLock$, and other overhead.

** TODO: apply the same to guided and adaptive iterators?

* Do not report "serial execution because there is not enough work"
when there is only a single task. This is for consistency with
other leader iterators that stick to a single task when there is little
work but do not print the warning.

** The above report is enabled, though, when debugAdvancedIters is enabled.

* Converted a halt() to a compilerError().

* Asserted that the 'chunkSize' argument is positive and
halted unless 'numTasks' is positive or 0.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@21813 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Revamp on statements

[Joint commit with David Iten, mutually reviewed]

This commit does three things that are closely tied together.

1. Move local on optimization from the compiler to the LocaleModel
2. Remove task private 'here' and here's locale ID
3. Revert to using locale ID for on statements

These commits were combined because (1) is simpler with (3), and (2)
is much simpler with (3).

1. This optimization is being moved to the locale model, for a couple
of reasons.  First off, it is dead simple to implement in the modules.
Secondly, a locale model should be allowed to decide what happens in
the "local" case.

2. The hierarchical locales work (r21480) added a 'here' and here's
locale ID fields to task private data.  These values can be computed
for a small cost (probably smaller than digging into task private
data), and in addition, 'here' is not used very often any more (the
replicated root locale removed the 'here' check in
chpl_localeID_to_locale()).  As a result, we no longer have to set
these in the on function wrapper.  We will remove the fields in the
task data structures in a subsequent commit.

3. r21480 also changed on statements to use locales rather than locale
IDs.  This was done to reduce communication, since all id look ups had
to go to locale 0 before the rootLocale was replicated.  But it is not
needed any more, and it is also unnatural, as the chpl_executeOn*()
functions take locale IDs as arguments.

Also updated comments along the way.

========

modules/internal/localeModels/flat/LocaleModel.chpl:

- Implement local on optimization in the chpl_executeOn*() functions
  as needed
- Remove call to set 'here'
- Remove unnecessary extern declaration

modules/internal/ChapelLocale.chpl:

- Remove calls to set 'here' and locale ID
- Create a "dummy" locale for use during start up
- Have chpl_localeID_to_locale() return that dummy locale when the
  rootLocale has not yet been initialized (this was what was happening
  before, but the dummy locale was not explicitly named and just
  stuffed into the task private 'here')
- Change here to simply call chpl_localeID_to_locale() with a locale
  ID built on the fly

compiler/include/primitive.h:
compiler/AST/primitive.cpp:

- Remove PRIM_TASK_SET|GET_LOCALE_ID and PRIM_TASK_SET|GET_HERE_PTR

compiler/AST/checkAST.cpp
compiler/AST/expr.cpp:
compiler/optimizations/optimizeOnClauses.cpp:
compiler/passes/cleanup.cpp:

- Remove uses of PRIM_TASK_SET|GET_LOCALE_ID and
  PRIM_TASK_SET|GET_HERE_PTR

compiler/AST/build.cpp:
compiler/passes/createTaskFunctions.cpp:

- Revert to using locale ID instead of locale for on statements
  (pretty much the exact code as was present before r21480)

compiler/passes/parallel.cpp:

- Remove optimizeOnCall() completely
- Revert to using locale ID instead of locale for on statements
- Remove setting of 'here' and here's locale ID from the wrapper
  function

runtime/include/chpl-gen-includes.h:

- Change chpl_gen_getLocaleID() to build the locale ID on the fly
- Remove chpl_gen_setLocaleID()



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@21814 3a8e244f-b0f2-452b-bcba-4c88e055c3ca