Assert (implicitly) that chpl_taskID_t is a 64-bit integral type.

[Reviewed by Brad.]

This restricts us to only casting chpl_taskID_t values to/from 64-bit
ints and uints.  The former matches the usage in DefaultRectangular, and
the latter matches that in ChapelIO.  This gets rid of one use of
_isPrimitiveType(), helping us toward removing it altogether.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23847 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Regularize the use of FLAG_COMPILER_NESTED_FUNCTION.

Replaced some strcmps with proper application of this flag.

Also, simplified flattenGlobalFunctions(), since the flag seems to be moot
when the normalize pass is entered.

Renamed flattenGlobalFunctions() as moveGlobalDeclarationsToModuleScope().

[tested on / (std)]
[tested on distributions/ domains/ multilocale/ performance/ (gasnet)]


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23848 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Triage update for the past week.

REGRESSIONS:

* Memory use increased by 8 bytes on 7/11/14, with no-local and qthreads/numa:
 memory/shannon/printFinalMemStat

* These are expected to be fixed shortly:
 compflags/bradc/readDirInsteadOfFile
 io/bradc/testPath
 studies/filerator/listdir

TRIAGE:

* Extended the "glibc detected" section.
  The failures are not new; I consolitated and extended their description
  based on what I saw this week and some history mining.

* Added timeouts for
    domains/sungeun/assoc/parSafeMember
    studies/shootout/binary-trees/binary-trees_iter (performance)
  These are not new either.

* Another occurrence of "slave got an unknown command on coord socket" error.

* While there, replaced qthreads.none -> qthreads
  - all except for domainReassignNoAlias. There, does "none" mean comm=none?



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23849 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add --about flag to Chapel binaries

[reviewed by Greg]

This patch add an --about flag to all Chapel binaries that prints out
information about how the program was compiled and exits.  Current, it
print the compiler command line, CHPL_HOME and all CHPL_* environment
variables (whether relevant or not).  As a sort of clean-up tasks, I
saved all the CHPL_* environment variables and variable names in
arrays so that we could just march through the arrays during codegen.
Previously, we'd explicitly naming each one again when putting that
info into the generated code.  This makes it so that you only have to
change driver.cpp when adding a new environment variable.

CHANGES:

compiler/include/driver.h
compiler/main/driver.cpp:

- Add chpl_env_vars and chpl_env_var_names and populate them with the
  name and value of the CHPL_* environment variables at compile time

compiler/passes/codegen.cpp:

- Rewrite codegen of the CHPL_* env vars to use the arrays described
  above

- Add a NULL file pointer check when writing to
  chpl_compilation_config.h

- Generate a chpl_program_about() function that prints out compilation
  information

- Move the #include of chpl_compilation_config.h to be after we
  include stdchpl.h (to get stdio.h)

runtime/src/arg.c:

- Add the --about/-a flag to all Chapel binaries and launcher programs
  which is done by calling chpl_program_about() in the generated code

runtime/etc/Makefile.launcher:

- Add the #include of chpl_compilation_config.h to the launcher program

TEST CHANGES:

test/execflags/shannon/help.good
test/execflags/shannon/configs/help/basehelp.txt
test/execflags/ferguson/help2.good:

- Update --help output to include --about

test/execflags/ferguson/args.0-6.good
test/execflags/ferguson/args.execopts:

- Change this test case to use something other than -a, since now that
  is no longer passed on to a Chapel program that declare main with
  args

test/execflags/sungeun/*:

- New test to lock in --about behavior



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23850 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Make paratest look in certain directories where it should and it didn't.

[reviewed by Sung]

Turns out that paratest.server skips some directories that have no
.chpl files in them and that start_test doesn't skip.

As a result, when someone runs parallel testing, certain directories
with C tests only are skipped. If there are errors in those
directories, they are not reported to the person running the
tests. Those errors are then picked by the nightly scripts.

Directories are filtered by chpl_files() in paratest.server and by a
combination of conditions in start_test. This patch adjusts the former
to (supposedly) match the latter.

In other words, The logic around *.test.c is the same in paratest and
start_test, AFAICT. The mismatch that this change addresses happens
when the directory has no .chpl or .test.c files, but has a sub_test.

While there:

* In paratest.server react to NOTEST, rather than *NOTEST, to match start_test.

* Add a cross-reference comment to the corresponding condition in start_test. 


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23851 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Fixed up the last remaining qthreads.none in TRIAGE.

Based on test history, "none" means comm=none. I adjusted the text
to make that clear.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23852 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add batch script for running nightly on windows.

After much trial and error, this script seems to work on windows. The actual
cygwin command is a little messy, but it does work in our headless testing
environment.

Also, update common.bash to reuse CHPL_NIGHTLY_LOGDIR variable when it is
already set in the environment.

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

r23779 turned off work stealing by default for qthreads to test the performance
impact. It did not have the desired impact (meaning multithreaded schedulers
have additional overhead beyond the work stealing routines) so I'm removing it.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23854 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add perf tests for chap15 and chap16.

Discussed with @ronawho.

git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23855 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Use PWD instead of WORKSPACE in windows batch script.

WORKSPACE use windows file path separators, which does not translate well to
the cygwin/bash environment. PWD uses the cygwin/bash file separator _and_ it
uses the correct file system mapping.

git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23856 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add --verify to .skipif for nightly testing of about.chpl



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23857 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Allow noinit on records and classes (but not dists/arrays/domains/syncs/singles) [reviewed by Sung]

Making use of the defaultTypeConstructor for a class or record allows for
construction of an instance without initialization of the particular fields 
that would make it a complete instantiation of the type.  This was the
brainflash I was missing when originally implementing noinit.  The type
constructor makes use of the param and type arguments necessary for determining
the space of the type while leaving the initialization of the remaining
arguments to the default initializer.  It thus makes sense that noinit would
"call" this method (type constructor calls are removed at the end of function
resolution, so they are "called" by the compiler but don't turn up in the
generated C code).

Dists, domains, arrays, syncs, and singles are more complicated than the base
class/record situation and so are not solved by this simple solution -
domains, for instance, access the inner fields of their _value field during
assignment and we do not currently have a way to check if that field has been
initialized yet (for noinit, it has not).  This field cannot be assigned to
at the moment: there is an getter-only override and no corresponding setter
due to the potential privitization of the type.  Dists and arrays are in a
similar situation: their _value field also has a getter-only override.  My
suspicion is that syncs and singles will need to have their write** methods
adjusted for the possibility of an uninitialized value field.  Until these
problems are solved, these types will continue to be barred from using noinit.

This commit also removes the futures from 7 noinit tests, all involving classes
and records, as they should work now.

tested over std/


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23858 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Flatten the nested pair of BlockStmt for the body of every proc


The parser creates an empty BlockStmt for the body of a proc when the
proc is constructed.  If the body of the procedure is a block statement
it inserts the new BlockStmt into the existing one which results in
nesting.

A little work demonstrated that the only code that currently relies on
this nesting is insertAutoDestroyCalls() in resolution/callDestructors.cpp.


This patch contains the following


1) Changes to build.cpp to remove the nesting.


   Changes are limited to buildFunctionSymbol() and buildFunctionDecl().
   Most of the changes are for formatting

   a) The formals list for both function spanned two lines with multiple
      params on each line.  Switch to one line per param since they can't
      all fit on one line with a reasonable screen width.

   b) There were a couple of calls where the argument list spread a long-ish
      list of actuals over two lines.  Converted to one line per actual.

   c) Modified the bracing style to match the dominant style for the file.


   The functional change is near the end of buildFunctionDecl.  If the
   BlockStmt for the body is currently empty, then copy the statements
   in the new BlockStmt in to the body.

   It is important to copy the statements from the new BlockStmt to the
   existing BlockStmt, rather than assign the new Stmt to the body, to
   preserve the line number for any error/warning messsages.





2) Two important changes to the logic for inserting autoDestroy calls
   and then some minor tweaks.


   The function to insert autoDestory calls performs a linear walk of
   every block statement and

     A) Collects every variable declaration that needs needs a matching
        auto-destroy

     B) If any statement *contains* code that jumps out of the current
        block (gotos that are generated for return, yield, break, continue),
        insert the required set of auto-destory calls immediately before
        the goto.

     C) Detect the end of the block (fall of the end, a goto, or a return)
        and insert the required auto-destroy immediately before the end


   The changes are

     a) Trivial: In insertAutoDestroyCalls()

        Skip the "GOTO from block" analysis if there aren't any autoDestroy variables

        If we have found the end of the block, remove the call to clear the Vec vars 
        immediately before the break.  vars is about to go out of scope.


     b) Trivial: In stmtDefinesAnAutoDestroyedVariable()

        Add an additional test to avoid collecting variables that have been
        flagged as AUTO_DESTROY but where the variable's type does not have
        a function in the autoDestroyMap.

        This test is copied from the guard code for actually inserting any
        autoDestroy calls.  This will reduce the number of elements in
        vars[] for some blocks and may reduce the analysis time.


     c) Important: In gotoExitsBlock()

        This is part of the logic for (B). Consider a function of the form

        proc test() {
          var myVar : MyClass;


          if (****)
             return;

          .....
        }

        where myVar should be autoDestroyed at the end of the block.  The
        current code inserts an auto-destroy immediately before the 
        explicit return statement because (i) an earlier pass had inserted
        the return label in the outermost block stmt (ii) the test for (B)
        saw a goto from the "user's top-level" Block to the enclosing
        block.

        The synthesized label and the return are now in the same block and
        hence break the "leaving the block" test.

        Added an explicit check for a goto with tag GOTO_RETURN to handle this.
        This has the small benefit of short-circuiting the nesting analysis for
        this case.

        I believe RETURN is the only kind of GOTO that requires this change but
        one or two others (YIELD?) may benefit.


     d) Important: In stmtMustExitBlock()

        There are several tests to determine if we've found the point at
        which we are committed to leaving a block; this becomes the
        anchor-point for inserting the auto-destroy calls.

        Extend this list of checks to take note of a label that immediately
        preceeds a GOTO rather than just a GOTO.  This is the matching case
        for handling a return correctly.  Without this change the auto destroy
        calls would be inserted between the label and the actual goto but the
        returns would jump to the label.

     e) Trivial:    In stmtMustExitBlock()

        Refactored a couple of the tests with trivial "helper" functions to
        help the code to flow a little better.





Compiled:   clang STD,   gcc STD/LLVM

Tested:     paratest
            paratest with memleaks

Reviewed:   Tom

       
  



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23859 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Fix some QIO coverity problems

[trivial and not reviewed]



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23860 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add linebreak after build url in test release and token count.

I forgot to include the linebreak in r23838.

git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23861 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Test full suite nightly on windows.

Removes the script to run examples and adds a new one to run the full suite.

git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23862 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Begin to relocate creation of the Module initialization function


Currently the parser inserts a clumsy version of the Module initFunction
into almost every module.  The goal is to perform this operation at the
start of the normalize().

The challenge in moving this operation is that there is code in several
passes that assumes that the modules have the initFunction.  This code
needs to be modified to implement the same business logic after this
migration.

I am breaking this motion in to several steps to reduce the amount of code
that needs to be reviewed at each step.



This step has the modest task of adding the initialization function at the
start of scopeResolve().



1) compiler/AST/build.{h,cpp}

Remove the definition of void createInitFn(ModuleSymbol* mod) and the
invocation of the function from buildModule.

Alter addPragmaFlags so that it no longer tries to propagate the
FLAG_EXPORT_INIT flag to the module initFunction.  This update will
be performed when the initFunction is created.

Also some #include cleanup in build.h and some trivial reformatting.




2) compiler/AST/type.cpp

Update the definition of initTheProgram to (a) avoid adding an
initFunction (b) to insert the use statement in to the module block
rather than the initFunction (c) insert the class definition for
Object in to the module body rather than the initFunction

Also some trivial reformatting for long arglists




3) compiler/passes/checkParsed.cpp

   a) check_parsed_var verified that any config vars were located
      with the initFn.  Changed this to ensure these are at the
      top level of the Module

   b) added a new top-level function checkModule.  This function
      scans each module and complains if there is a return or yield
      at the top-level of a chapel file

      Historically this test was performed while scanning the initFunction.

   c) Finally renamed the internal functions with underscores in their names
      to the more standard camel case.




4) compiler/passes/scopeResolve.cpp

Installed a new function insertModuleInit() that inserts an initFunction
into every module (other than root) and then propagates the EXPORT_INIT
flag if present.




Compiled:   STD on clang   STD/LLVM on gcc

Tested:     Several small tests with visual inspection of ASTs
            paratest

Review:     Tom






git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23863 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Don't force QT_WORKER_UNIT=core with the nemesis thread scheduler.

[Reviewed by Elliot.]

We limit the #workers to no more than the #PUs (hyperthreads) in
qthreads.  But we also tell qthreads to distribute the workers onto
processor cores, not PUs.  This creates a conflict when the #workers is
greater than the #cores.  The regular qthreads thread scheduler is okay
with this, but the nemesis scheduler gripes about it.  So, if we're
using the nemesis scheduler, don't force worker distribution onto the
cores, just let qthreads do what it wants in this case.

This is an adjustment to r23836, and should be removed when that commit
is removed.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23864 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Do some cleaning up.

[Not reviewed.]

There are three changes here:
- Change chpl_localeID to chpl_nodeID.  We changed the name of this
  global variable many months ago.  We missed these uses, and were not
  reminded of them because they occur in debug code and we don't build
  qthreads with that enabled.
- Change some <TAB> characters to spaces.
- Fix some indentation.  The r23836 changes indented by 2 columns, but
  qthreads uses 4-space indentation.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23865 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Removing bulkget in favor of standard IO's readstring

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