With GASNet amudprun+ssh launch, forward environment to user process.

GASNet's amudprun launcher does not forward the environment from the
launcher to the the user processes.  Do it ourselves in this case, using
the new -E option to the user program.

runtime/src/launch/amudprun/launch-amudprun.c
  If we using the ssh spawner, add the environment to the user program
  command line via the new -E option.
  While here, I also did a little cleaning up: moved _nlbuf (renamed to
  nlbuf, what's with the leading '_' on a file-static var?) into the
  only function that uses it, and changed sprintf(3) to snprintf(3) in
  the two places where we print into limited-size buffers.  The buffers
  should always be long enough, but it's still good style.  I also got
  rid of a pair of comments that didn't seem to be adding anything.

test/execflags/gbt/getenv.chpl
test/execflags/gbt/getenv.execenv
test/execflags/gbt/getenv.good
test/execflags/gbt/getenv.numlocales
test/execflags/gbt/getenv.skipif
  Add a test that runs only for comm=gasnet, and checks that a user
  environment variable is available.
For GASNet udp conduit + ssh spawner, send env to user prog via -E options.

This modifies our amudprun launcher to send all of the environment
variables to the user program instances via -E options.  Unfortunately,
doing so requires an update to GASNet, because the udp conduit's ssh
spawner can only handle 1024-byte command lines and the ones this mod
causes us to create are quite a lot larger than that.

The file-specific changes are as follows.

runtime/src/arg.c
Send a -E option to the user (*_real) program for every environment
setting.

third-party/gasnet/GASNet-1.22.0/other/amudp/amudp_spawn.cpp
Modify the udp conduit's ssh spawner to handl;e command lines of
arbitrary length.

third-party/gasnet/GASNet-1.22.0/gasnet_trace.c
Allow for much longer command lines in the tracing code.  I didn't do a
full solution for arbitrary-length command lines here, because command
line buffers with statrically determined lengths are everywhere in
GASNet and where would it all end?

test/execflags/gbt/getenv.good
test/execflags/gbt/getenv.prediff
Update the test that checks for correct functioning of this feature.
Allow the lcd architecture to be found for chapel modules

We add the architecture to the gen directory so that we can differentiate
between knc and non-knc builds. However, we build the module with the lowest
common denominator processor module loaded so that users can build with any
compatible processor module loaded and we don't have to build a binary for each
one. For instance, we build with sandybridge, but a user can have either
sandybridge or ivybridge loaded and the binaries will be compatible. However,
we would have sandybridge in the gen directory for the module, and the current
scripts would try to look for a gen directory with ivybridge in it. This adds a
routine in chpl_arch to get the lowest common denominator for the modules, and
gets it for the runtime in printchplenv iff a cray module is loaded, and it's
home location is the same as chapel home.

The reason for that is because a developer might have a module loaded, but also
have a working chapel repo that is their chapel home. Just because the module
is loaded, doesn't mean you need to get the lcd. You only want the lcd iff the
module is loaded, and the module binary is the one actually being used.
Fix record-in-record bug.

In code with nested class or record declarations, generic arguments used to
establish the concrete type of the containing class should be inherited by the
contained class.

Currently, an attempt to create a variable of a nested type fails with a cryptic
message like:
>>> recordrecord1.chpl:4: error: unresolved call 'R2(y=int, outer=R(int))' [functionResolution.cpp:1599]
because constructors for outer-level types are turned into free functions, but
apparently those for nested types are not.

This patch adjust calls to nested-class constructors, so they appear to be
method calls.  (Eventually, this change will be applied to outer-level
constructors as well.)

With this patch in place, the test cases in users/ferguson/nested work as
expected.

TODO: String comparison with "outer" is somewhat fragile, so this should be
replaced by a flag on the field and/or arg.

*DETAILS

+++ b/compiler/passes/buildDefaultFunctions.cpp
In build_record_copy_function(AggregateType* ct), added a clause to handle the
"outer" arg specially, by inserting the method token at the beginning of the
argument list.  This means that a constructor call containing an argument called
"outer" will be converted into a method call.
In build_record_init_function(AggregateType* ct), we ignore the partial
(generic) type of the outer class or record, and use a field query instead to
obtain the concrete type of the outer class or record during resolution.
When the method token appears in a formal argument list, we pass it positionally
(because resolution cannot deal with a named argument of type _MT).

+++ b/compiler/passes/scopeResolve.cpp
Flag as generic the "outer" arg added by move_constructor_to_outer(FnSymbol*
fn, AggregateType* outerType).

+++ b/compiler/resolution/functionResolution.cpp
In generateConcreteConstructorCall(Type* type), add special handling for calls
to consrtuctors of nested record types.  These constructors must be invoked as
method calls.  Thus, if a generic field named "outer" appears in the argument
list, the method token is added to the head of the argument list.
In fixupRuntimeTypeArguments(CallExpr* call), skip the method token if it is
present.
In flattenAndResolveArgs(CallExpr* call), skip the method token if it is
present.
In resolvePrimInit(CallExpr* call), do not create a call to _defaultOf(type
_MT).  dtAny cannot match dtMethodToken, so there is currently no way to express
_defaultOf(type _MT) in module code.  The added code just short-circuits the
resolution of (init _MT), whose value is therefore internally fixed at "_mt".

+++ b/test/users/ferguson/nested/classrecord1.good
+++ b/test/users/ferguson/nested/recordrecord1.good
The expected value of these two tests was incorrectly given as 7.  The correct
value is zero, because only the generic type arguments are inherited from the
parent class, not runtime values.

--- a/test/users/ferguson/nested/classrecord1.future
--- a/test/users/ferguson/nested/classrecord2.future
--- a/test/users/ferguson/nested/classrecord3.future
--- a/test/users/ferguson/nested/recordrecord1.future
--- a/test/users/ferguson/nested/recordrecord2.future
--- a/test/users/ferguson/nested/recordrecord3.future
These futures were removed, because the corresponding test cases now work correctly.
Style changes suggested by Kyle
Merge pull request #186 from ronawho/moduleLCD

Allow the lcd architecture to be found for chapel modules

[content reviewed by @gbtitus, python style by @Kyle-B]

We add the architecture to the gen directory so that we can differentiate
between knc and non-knc builds. However, we build the module with the lowest
common denominator processor module loaded so that users can build with any
compatible processor module loaded and we don't have to build a binary for each
one. For instance, we build with sandybridge, but a user can have either
sandybridge or ivybridge loaded and the binaries will be compatible. However,
we would have sandybridge in the gen directory for the module, and the current
scripts would try to look for a gen directory with ivybridge in it. This adds a
routine in chpl_arch to get the lowest common denominator for the modules, and
gets it for the runtime in printchplenv iff a cray module is loaded, and it's
home location is the same as chapel home.

The reason for that is because a developer might have a module loaded, but also
have a working chapel repo that is their chapel home. Just because the module
is loaded, doesn't mean you need to get the lcd. You only want the lcd iff the
module is loaded, and the module binary is the one actually being used.
First approach to a helper setenv function for qthreads

Want a helper function for qthreads to setenvs because qthreads has two
varations of each env var QT_VAR and QTHREAD_VAR and it's easy to forget to
check both. This also adds warnings if we don't set because the qthreads env
vars were already set by a user.
Update helper routine and actually use it

This updates the chpl_qt_setenv function with some more debug info and sets
the QTHREAD_ version of the env var too (just incase the precedence of QT_
every changes in the qthreads source.)

Also adds a TODO for the CALL_STACK env var and changes our uses of setenv to
chpl_qt_setenv
Didn't quote setting "core"
Fixes some bugs with print formatters that clang reports, but gcc doesn't

Just changes some print formatters.

Note that clang gives us a bunch of warnings about qthreads code that I shared
with the qthreads team. These were the only ones in "our" source and not in
qthreads proper
Add ability to remove a file or directory from Chapel code by
specifying its name, as well as tests of that functionality.
Clean up changes to rename: I misspelled occurred, and I decided to use
2> for the preexec error message instead of just repeating it.
Replace spinwait in syncvar unlock with qthread_yield

Testing out the correctness/performance implications of this. This makes sense
because if a qthread is just spinning while waiting on a sync var, we really
want them to yield, and let somebody else do some work.

I believe if we used real qthread sync vars we wouldn't need to do this, but
the yield in the unlock would still be needed.

It might also make sense to only do this every x iterations of the loop, but
that means adding a counter to that, which might not be worth it.
In build_record_init_function, avoid creation of a temp to hold the method token.

The method token should always be used as a literal.  Without this special test, we get
verification failures on tests in users/ferguson/nested.
Merge pull request #189 from ronawho/qthreads-syncvar-deadlock

Replace spinwait in syncvar unlock with qthread_yield

[idea ok'd / from @gbtitus]

Testing out the performance implications of this. This makes sense
because if a qthread is just spinning while waiting on a sync var, we really
want them to yield, and let somebody else do some work.

I believe if we used real qthread sync vars we wouldn't need to do this, but
the yield in the unlock would still be needed.

It might also make sense to only do this every x iterations of the loop, but
that means adding a counter to that, which might not be worth it. We'll see
Update localeModels/gbt/maxTaskPar to handle ugni+flat+muxed.
Merge pull request #190 from gbtitus/maxTaskPar-for-Cray

Update localeModels/gbt/maxTaskPar to handle ugni+flat+muxed.

[Not reviewed.]
Put the GASNet source files back how they were. I'm going to apply the
official GASNet version of the changes to those files instead.
Remove arbitrary limit on command line length

This commit is a minor variation on one contributed by Greg Titus
of Cray.  The purpose is to remove the arbitrary 1024-character
limit on the length of the ssh command line run via system() when
AMUDP is using SPAWNFN=S.  This allows for a much longer command
line, as required by the Chapel runtime when using this spawner.
Merge pull request #192 from lydia-duncan/fileRemove

Add ability to remove a file/directory [reviewed by hilde]

Add ability to remove a file or directory using Chapel code. This follows the same
strategy as the C remove function - it will complain if the file to be deleted does not
exist, or if the directory to be deleted is not empty.

Details:
modules/standard/IO.chpl: Adds two functions removeFile, one which throws an
ioerror if one occurred and one which merely returns the error via an out
argument to the function. Both take in the name of the file or directory to be
removed. While I was there, I checked my spelling.
runtime/include/qio/qio.h
runtime/src/qio/qio.c: Adds backend support for the removeFile function in the form
of qio_file_remove. This function calls the C function remove on the given
filename and returns a qioerr translation of any error that may have occurred.
Another comment spellcheck.
test/io/lydia/remove: Adds four tests of the functionality - removing a file and an
empty directory work as expected, removing a file that doesn't exist generates
an error, and removing a non-empty directory generates an error.
test/io/lydia/rename: Altered my preexec so that it sends errors to the .exec.out.tmp
file instead of detecting if one occurred and sending a generic error.