diff --git a/compiler/AST/AggregateType.cpp b/compiler/AST/AggregateType.cpp index 539b29d68898..65eb8be1d734 100644 --- a/compiler/AST/AggregateType.cpp +++ b/compiler/AST/AggregateType.cpp @@ -68,6 +68,8 @@ AggregateType::AggregateType(AggregateTag initTag) : mIsGenericWithDefaults = false; mIsGenericWithSomeDefaults = false; foundGenericFields = false; + postinit = nullptr; + typeSignature = NULL; @@ -132,6 +134,7 @@ AggregateType* AggregateType::copyInner(SymbolMap* map) { } copy_type->genericField = genericField; + copy_type->postinit = postinit; return copy_type; } @@ -234,6 +237,12 @@ void AggregateType::verify() { INT_FATAL(this, "Substitution value not in tree"); } } + + // Should we just change all checks of this flag to a check against + // postinit being non-nullptr? Or a nice method query? + if ((postinit != nullptr) != this->symbol->hasFlag(FLAG_HAS_POSTINIT)) { + INT_FATAL(this, "postinit state is inconsistent"); + } } int AggregateType::numFields() const { diff --git a/compiler/include/AggregateType.h b/compiler/include/AggregateType.h index 579005a4f296..b329d2147da6 100644 --- a/compiler/include/AggregateType.h +++ b/compiler/include/AggregateType.h @@ -233,6 +233,9 @@ class AggregateType final : public Type { // A list of the generic fields in this type. std::vector genericFields; + // pointer to postinit() method, if defined + FnSymbol* postinit; + private: // Only used for LLVM. diff --git a/compiler/passes/initializerRules.cpp b/compiler/passes/initializerRules.cpp index f470ab55e8ba..7ad1014e93c4 100644 --- a/compiler/passes/initializerRules.cpp +++ b/compiler/passes/initializerRules.cpp @@ -1186,8 +1186,13 @@ static bool findPostinitAndMark(AggregateType* at) { int size = at->methods.n; for (int i = 0; i < size && retval == false; i++) { - if (at->methods.v[i] != NULL) - retval = at->methods.v[i]->isPostInitializer(); + FnSymbol* methodi = at->methods.v[i]; + if (methodi != nullptr && methodi->isPostInitializer()) { + // capture the post-initializer upon finding it + at->postinit = methodi; + retval = true; + break; + } } } else { @@ -1443,10 +1448,23 @@ static void buildPostInit(AggregateType* at) { fn->addFlag(FLAG_METHOD_PRIMARY); if (at->isClass()) { + // If our parent class's postinit() is throwing, ours needs to be as well + forv_Vec(AggregateType, pt, at->dispatchParents) { + if (pt->hasPostInitializer()) { + if (pt->postinit->throwsError()) { + fn->throwsErrorInit(); + break; + } + } + } + + // Insert call to parent class postinit() insertSuperPostInit(fn); } at->methods.add(fn); + + at->postinit = fn; } // @@ -1465,11 +1483,9 @@ static int insertPostInit(AggregateType* at, bool insertSuper) { if (method == nullptr) continue; if (method->isPostInitializer()) { - if (method->throwsError() == true) { - USR_FATAL_CONT(method, "postinit cannot be declared as throws yet"); - } if (method->where == NULL) { found = true; + at->postinit = method; } if (method->formals.length > 2) { // Only accept method token and 'this' diff --git a/compiler/resolution/initializerResolution.cpp b/compiler/resolution/initializerResolution.cpp index 34f39b17ab12..51520bb75b34 100644 --- a/compiler/resolution/initializerResolution.cpp +++ b/compiler/resolution/initializerResolution.cpp @@ -191,7 +191,10 @@ static FnSymbol* buildNewWrapper(FnSymbol* initFn, Expr* allocator = nullptr) { } } - if (initFn->throwsError()) { + // If either the initializer throws, or the postinit throws, make + // this function representing the 'new' throw as well + if (initFn->throwsError() || + (type->hasPostInitializer() && type->postinit->throwsError())) { fn->throwsErrorInit(); BlockStmt* tryBody = new BlockStmt(innerInit); diff --git a/compiler/resolution/virtualDispatch.cpp b/compiler/resolution/virtualDispatch.cpp index 65ed84b16478..e55e9fe90765 100644 --- a/compiler/resolution/virtualDispatch.cpp +++ b/compiler/resolution/virtualDispatch.cpp @@ -450,7 +450,8 @@ static void resolveOverrideAndAdjustMaps(FnSymbol* pfn, FnSymbol* cfn) { if (signaturesMatch(pfn, cfn) && evaluateWhereClause(cfn) && - evaluateWhereClause(pfn)) { + evaluateWhereClause(pfn) && + !pfn->isPostInitializer()) { // postinits don't override resolveSpecifiedReturnType(cfn); resolveFunction(cfn); diff --git a/doc/rst/technotes/throwingInit.rst b/doc/rst/technotes/throwingInit.rst index dfb7889cf39f..2aefef76f00c 100644 --- a/doc/rst/technotes/throwingInit.rst +++ b/doc/rst/technotes/throwingInit.rst @@ -89,7 +89,7 @@ before the error is thrown back to the caller. proc init(xVal: int) throws { x = xVal; - this.complete(); + init this; validate(this); } } @@ -115,9 +115,9 @@ Calling Throwing Functions ~~~~~~~~~~~~~~~~~~~~~~~~~~ When an initializer is declared with the ``throws`` keyword, calls to throwing -functions may be made in the body of the initializer after ``this.complete()`` +functions may be made in the body of the initializer after ``init this`` (see :ref:`Limitations_on_Instance_Usage_in_Initializers` for information on -``this.complete()`` and the example in :ref:`init_declaring_init_as_throws`). +``init this`` and the example in :ref:`init_declaring_init_as_throws`). As a result, thrown errors will be propagated outside of the initializer. The memory that would have been used to store the instance created by the initializer will be cleaned up prior to propagating the error. @@ -125,7 +125,7 @@ initializer will be cleaned up prior to propagating the error. .. note:: Calls to throwing functions are not currently allowed prior to - ``this.complete()``. + ``init this``. When an initializer is not declared with the ``throws`` keyword, calls to throwing functions may be made anywhere in the body of the initializer. Such @@ -141,7 +141,7 @@ include: - being able to ``throw`` from anywhere in the body of an initializer - being able to write ``try`` / ``try!`` with ``catch`` blocks anywhere in the body of an initializer -- being able to call functions that ``throw`` prior to ``this.complete()`` +- being able to call functions that ``throw`` prior to ``init this`` (see :ref:`Limitations_on_Instance_Usage_in_Initializers` for a description) - including ``super.init`` calls when the parent initializer throws, e.g., @@ -152,7 +152,7 @@ include: proc init(xVal: int) throws { x = xVal; - this.complete(); + init this; someThrowingFunc(this); } } @@ -163,6 +163,6 @@ include: proc init(xVal: int, yVal: bool) throws { super.init(xVal); // This call is not valid today y = yVal; - this.complete(); + init this; } } diff --git a/doc/rst/usingchapel/multilocale.rst b/doc/rst/usingchapel/multilocale.rst index 06481bfedeca..c5539302ab39 100644 --- a/doc/rst/usingchapel/multilocale.rst +++ b/doc/rst/usingchapel/multilocale.rst @@ -176,6 +176,7 @@ smp fast other everything =================== ==================== +.. _readme-colocale: Co-locales ++++++++++ diff --git a/modules/internal/ChapelLocale.chpl b/modules/internal/ChapelLocale.chpl index 9c4bf7f17b2c..530fef11393e 100644 --- a/modules/internal/ChapelLocale.chpl +++ b/modules/internal/ChapelLocale.chpl @@ -226,6 +226,23 @@ module ChapelLocale { */ inline proc locale.maxTaskPar: int { return this._value.maxTaskPar; } + /* + Get the number of co-locales on the locale's node, inclusive. + + Note that this may not be equal to the number of locales on the node due + to oversubscription. The value is one in the typical case in which there + is only one locale per node. For example, if a job is launched with ``-nl + 2`` then ``numColocales`` will be one, and if it is launched with ``-nl + 1x2`` ``numColocales`` will be two. + + More information about co-locales can be found here: :ref:`readme-colocale` + + :returns: the number of co-locales on the locale's node + :rtype: int + */ + @unstable("'locale.numColocales' is unstable") + inline proc locale.numColocales: int { return this._value.numColocales; } + // the following are normally taken care of by `forwarding`. However, they // don't work if they are called in a promoted expression. See 15148 @@ -326,6 +343,8 @@ module ChapelLocale { var maxTaskPar: int; + var numColocales: int; + proc id : int do return chpl_nodeFromLocaleID(__primitive("_wide_get_locale", this)); @chpldoc.nodoc diff --git a/modules/internal/LocaleModelHelpSetup.chpl b/modules/internal/LocaleModelHelpSetup.chpl index 0fad10b67047..2ed779420189 100644 --- a/modules/internal/LocaleModelHelpSetup.chpl +++ b/modules/internal/LocaleModelHelpSetup.chpl @@ -169,6 +169,9 @@ module LocaleModelHelpSetup { extern proc chpl_task_getMaxPar(): uint(32); dst.maxTaskPar = chpl_task_getMaxPar(); + + extern proc chpl_get_num_colocales_on_node(): c_int; + dst.numColocales = chpl_get_num_colocales_on_node(); } proc helpSetupLocaleNUMA(dst:borrowed LocaleModel, out local_name:string, numSublocales, type NumaDomain) { @@ -219,6 +222,9 @@ module LocaleModelHelpSetup { extern proc chpl_task_getMaxPar(): uint(32); dst.maxTaskPar = chpl_task_getMaxPar(); + extern proc chpl_get_num_colocales_on_node(): c_int; + dst.numColocales = chpl_get_num_colocales_on_node(); + var childSpace = {0..#numSublocales}; const origSubloc = chpl_task_getRequestedSubloc(); diff --git a/modules/internal/localeModels/flat/LocaleModel.chpl b/modules/internal/localeModels/flat/LocaleModel.chpl index e916dbd0fd0c..d09cfb87c7cc 100644 --- a/modules/internal/localeModels/flat/LocaleModel.chpl +++ b/modules/internal/localeModels/flat/LocaleModel.chpl @@ -155,6 +155,7 @@ module LocaleModel { nPUsLogAcc = 0; nPUsLogAll = 0; maxTaskPar = 0; + numColocales = 0; } // The setup() function must use chpl_initOnLocales() to iterate (in diff --git a/modules/internal/localeModels/gpu/LocaleModel.chpl b/modules/internal/localeModels/gpu/LocaleModel.chpl index 2d35606d8cde..2a38e34fe946 100644 --- a/modules/internal/localeModels/gpu/LocaleModel.chpl +++ b/modules/internal/localeModels/gpu/LocaleModel.chpl @@ -387,6 +387,7 @@ module LocaleModel { nPUsLogAcc = 0; nPUsLogAll = 0; maxTaskPar = 0; + numColocales = 0; } // The setup() function must use chpl_initOnLocales() to iterate (in diff --git a/modules/packages/DistributedBag.chpl b/modules/packages/DistributedBag.chpl index 53803d0072cc..986fdcc96582 100644 --- a/modules/packages/DistributedBag.chpl +++ b/modules/packages/DistributedBag.chpl @@ -624,7 +624,7 @@ module DistributedBag { this.eltType = eltType; this.parentHandle = parentHandle; - // KNOWN ISSUE: 'this.complete' produces an error when 'eltType' is a Chapel + // KNOWN ISSUE: 'init this' produces an error when 'eltType' is a Chapel // array (see Github issue #19859). } diff --git a/runtime/include/chpl-comm.h b/runtime/include/chpl-comm.h index 332f361b26e6..471434a1914c 100644 --- a/runtime/include/chpl-comm.h +++ b/runtime/include/chpl-comm.h @@ -611,6 +611,12 @@ void chpl_set_local_rank(int32_t rank); // not been called. int32_t chpl_get_local_rank(void); +// Sets the number of colocales on the local node. +void chpl_set_num_colocales_on_node(int32_t count); + +// Returns the number of colocales on the local node. +int32_t chpl_get_num_colocales_on_node(void); + #ifdef __cplusplus } #endif diff --git a/runtime/src/chpl-comm.c b/runtime/src/chpl-comm.c index df08be509d8f..64c765a5b93b 100644 --- a/runtime/src/chpl-comm.c +++ b/runtime/src/chpl-comm.c @@ -46,6 +46,7 @@ int32_t chpl_nodeID = -1; int32_t chpl_numNodes = -1; static int32_t numLocalesOnNode = -1; static int32_t localRank = -1; +static int32_t numColocalesOnNode = 1; // @@ -269,3 +270,14 @@ int32_t chpl_get_local_rank(void) { return localRank; } +void chpl_set_num_colocales_on_node(int32_t count) { + if (count <= 0) { + chpl_internal_error_v("count (%d) must be > 0", count); + } + numColocalesOnNode = count; +} + +int32_t chpl_get_num_colocales_on_node(void) { + return numColocalesOnNode; +} + diff --git a/runtime/src/topo/hwloc/topo-hwloc.c b/runtime/src/topo/hwloc/topo-hwloc.c index 80d264188b2b..3ea4217e0c42 100644 --- a/runtime/src/topo/hwloc/topo-hwloc.c +++ b/runtime/src/topo/hwloc/topo-hwloc.c @@ -575,8 +575,17 @@ static void partitionResources(void) { if (numLocalesOnNode > 1) { oversubscribed = true; } - if ((numColocales > 0) && (numLocalesOnNode <= numColocales)){ - numPartitions = numColocales; + if (numColocales > 0) { + if (numLocalesOnNode <= numColocales) { + // There are fewer colocales than there should be, probably because the + // number of locales isn't evenly divisable by the number of nodes. + // Partition resources as if there are the full complement of + // colocales, but set the number of colocales to the actual number. + numPartitions = numColocales; + chpl_set_num_colocales_on_node(numLocalesOnNode); + } else { + chpl_set_num_colocales_on_node(numColocales); + } } logAccSets = sys_calloc(numPartitions, sizeof(hwloc_cpuset_t)); if ((numColocales > 0) && (numLocalesOnNode > numColocales)) { diff --git a/test/ANNOTATIONS.yaml b/test/ANNOTATIONS.yaml index 21cd4315a837..d1d20a5b2658 100644 --- a/test/ANNOTATIONS.yaml +++ b/test/ANNOTATIONS.yaml @@ -1217,6 +1217,8 @@ listBenchmark1: - Reduce uses of Math by automatically included modules (#19885) 06/07/22: - Fix performance of list benchmark by making these helpers inlined (#19947) + 12/12/24: + - Remove check on 'log' input with --no-checks (#26368) lulesh: 03/15/14: @@ -1941,6 +1943,8 @@ revcomp: &revcomp-base - Deprecate 'iokind' type and 'kind' field (#23007) 08/30/23: - Improve performance of readBinary and writeBinary for dense arrays (#23162) + 12/12/24: + - Remove check on 'log' input with --no-checks (#26368) revcomp-submitted: 06/07/22: diff --git a/test/chplenv/printchplbuilds/README b/test/chplenv/printchplbuilds/README new file mode 100644 index 000000000000..0238d8c97171 --- /dev/null +++ b/test/chplenv/printchplbuilds/README @@ -0,0 +1,2 @@ +These tests check that `$CHPL_HOME/util/chplenv/printchplbuilds.py` continues +to work properly. diff --git a/test/chplenv/printchplbuilds/printchplbuilds-check.prediff b/test/chplenv/printchplbuilds/printchplbuilds-check.prediff index bac1b1ea00a5..7abb77ac11f0 100755 --- a/test/chplenv/printchplbuilds/printchplbuilds-check.prediff +++ b/test/chplenv/printchplbuilds/printchplbuilds-check.prediff @@ -1,5 +1,10 @@ #!/usr/bin/env python3 +""" +Ensure that `printchplbuilds --check` works as expected and has a return code of 0. +`--check` makes sure the current config matches a built runtime. +""" + import sys import os import subprocess as sp diff --git a/test/chplenv/printchplbuilds/printchplbuilds-print1.prediff b/test/chplenv/printchplbuilds/printchplbuilds-print1.prediff index ed8299375e0c..3772d22a2659 100755 --- a/test/chplenv/printchplbuilds/printchplbuilds-print1.prediff +++ b/test/chplenv/printchplbuilds/printchplbuilds-print1.prediff @@ -1,5 +1,11 @@ #!/usr/bin/env python3 +""" +Ensure that `printchplbuilds` reports the current build the same as `printchplenv`. +This test defines what variables should be in the `printchplbuilds` output +and then runs `printchplenv` to get the values. +""" + import sys import os import subprocess as sp @@ -43,7 +49,7 @@ chpl_vars = [ ("CHPL_TASKS", None), ("CHPL_TIMERS", None), ("CHPL_UNWIND", None), - ("CHPL_MEM", None), + ("CHPL_TARGET_MEM", None), ("CHPL_ATOMICS", None), ("CHPL_HWLOC", None), ("CHPL_HWLOC_PCI", None, lambda env: env["CHPL_HWLOC"] == "bundled"), diff --git a/test/chplenv/printchplbuilds/printchplbuilds.prediff b/test/chplenv/printchplbuilds/printchplbuilds.prediff index 7ce132c10602..6af326cec725 100755 --- a/test/chplenv/printchplbuilds/printchplbuilds.prediff +++ b/test/chplenv/printchplbuilds/printchplbuilds.prediff @@ -1,5 +1,9 @@ #!/usr/bin/env python3 +""" +Ensure that a plain invocation of `printchplbuilds` works as expected and has a return code of 0. +""" + import sys import os import subprocess as sp diff --git a/test/classes/initializers/errors/errHandling/deinitFields.bad b/test/classes/initializers/errors/errHandling/deinitFields.bad new file mode 100644 index 000000000000..0a9add28dd4c --- /dev/null +++ b/test/classes/initializers/errors/errHandling/deinitFields.bad @@ -0,0 +1,4 @@ +In C's init +In R's init +Caught error +Past creation of myC diff --git a/test/classes/initializers/errors/errHandling/deinitFields.chpl b/test/classes/initializers/errors/errHandling/deinitFields.chpl new file mode 100644 index 000000000000..fe0336370c39 --- /dev/null +++ b/test/classes/initializers/errors/errHandling/deinitFields.chpl @@ -0,0 +1,34 @@ +record R { + proc init() { + writeln("In R's init"); + } + + proc deinit() { + writeln("In R's deinit"); + } +} + +class C { + var r: R; + + proc callThrowing() throws { + throw new Error(); + } + + proc init() throws { + writeln("In C's init"); + init this; + callThrowing(); + } + + proc deinit() { + writeln("In C's deinit"); + } +} + +try { + var myC = new C(); +} catch { + writeln("Caught error"); +} +writeln("Past creation of myC"); diff --git a/test/classes/initializers/errors/errHandling/deinitFields.future b/test/classes/initializers/errors/errHandling/deinitFields.future new file mode 100644 index 000000000000..430625c448fe --- /dev/null +++ b/test/classes/initializers/errors/errHandling/deinitFields.future @@ -0,0 +1,8 @@ +unimplemented feature: throwing initializers don't deinit fields + +This test notes that when an initializer throws, we don't do anything +to deinit the object's fields, which it seems we must do to clean up. +Here, I've set up the .good assuming we would not call C's deinit() +because C was never fully initialized. + +#26437 diff --git a/test/classes/initializers/errors/errHandling/deinitFields.good b/test/classes/initializers/errors/errHandling/deinitFields.good new file mode 100644 index 000000000000..16fb82abe373 --- /dev/null +++ b/test/classes/initializers/errors/errHandling/deinitFields.good @@ -0,0 +1,5 @@ +In C's init +In R's init +In R's deinit +Caught error +Past creation of myC diff --git a/test/classes/initializers/errors/errHandling/throwViaHelper.chpl b/test/classes/initializers/errors/errHandling/throwViaHelper.chpl new file mode 100644 index 000000000000..022e3b350f57 --- /dev/null +++ b/test/classes/initializers/errors/errHandling/throwViaHelper.chpl @@ -0,0 +1,26 @@ +class Foo { + var x: int; + + proc helpThrow(x: int) throws { + if (x > 5) { + throw new Error("x too large"); + } + } + + proc init(x: int) throws { + this.x = x; + init this; + helpThrow(x); + } +} + +proc main() { + try { + var f1 = new Foo(3); + writeln(f1); + var f2 = new Foo(7); + writeln(f2); + } catch e { + writeln(e.message()); + } +} diff --git a/test/classes/initializers/errors/errHandling/throwViaHelper.good b/test/classes/initializers/errors/errHandling/throwViaHelper.good new file mode 100644 index 000000000000..ba253fa61e89 --- /dev/null +++ b/test/classes/initializers/errors/errHandling/throwViaHelper.good @@ -0,0 +1,2 @@ +{x = 3} +x too large diff --git a/test/classes/initializers/errors/errHandling/throwWithoutHelper.bad b/test/classes/initializers/errors/errHandling/throwWithoutHelper.bad new file mode 100644 index 000000000000..95bd0cf519f5 --- /dev/null +++ b/test/classes/initializers/errors/errHandling/throwWithoutHelper.bad @@ -0,0 +1,2 @@ +throwWithoutHelper.chpl:4: In initializer: +throwWithoutHelper.chpl:8: error: initializers are not yet allowed to throw errors diff --git a/test/classes/initializers/errors/errHandling/throwWithoutHelper.chpl b/test/classes/initializers/errors/errHandling/throwWithoutHelper.chpl new file mode 100644 index 000000000000..25692a5f5c3e --- /dev/null +++ b/test/classes/initializers/errors/errHandling/throwWithoutHelper.chpl @@ -0,0 +1,22 @@ +class Foo { + var x: int; + + proc init(x: int) throws { + this.x = x; + init this; + if (x > 5) { + throw new Error("x too large"); + } + } +} + +proc main() { + try { + var f1 = new Foo(3); + writeln(f1); + var f2 = new Foo(7); + writeln(f2); + } catch e { + writeln(e.message()); + } +} diff --git a/test/classes/initializers/errors/errHandling/throwWithoutHelper.future b/test/classes/initializers/errors/errHandling/throwWithoutHelper.future new file mode 100644 index 000000000000..18e257b710dd --- /dev/null +++ b/test/classes/initializers/errors/errHandling/throwWithoutHelper.future @@ -0,0 +1,10 @@ +unimplemented feature: throwing initializers post-'init this' without helpers + +It seems we can throw within initializers if we put the throwing +behavior into a helper function (see 'throwingViaHelper.chpl') but not +if we put it directly (this test). This may be a known limitation in +the current, but the throwingInit.rst technote doesn't seem to mention +it and I didn't see a future for it in this directory, so am adding +this one. + +#26438 diff --git a/test/classes/initializers/errors/errHandling/throwWithoutHelper.good b/test/classes/initializers/errors/errHandling/throwWithoutHelper.good new file mode 100644 index 000000000000..ba253fa61e89 --- /dev/null +++ b/test/classes/initializers/errors/errHandling/throwWithoutHelper.good @@ -0,0 +1,2 @@ +{x = 3} +x too large diff --git a/test/classes/initializers/postInit/deinitFields.bad b/test/classes/initializers/postInit/deinitFields.bad new file mode 100644 index 000000000000..0a9add28dd4c --- /dev/null +++ b/test/classes/initializers/postInit/deinitFields.bad @@ -0,0 +1,4 @@ +In C's init +In R's init +Caught error +Past creation of myC diff --git a/test/classes/initializers/postInit/deinitFields.chpl b/test/classes/initializers/postInit/deinitFields.chpl new file mode 100644 index 000000000000..f2dff3bd7574 --- /dev/null +++ b/test/classes/initializers/postInit/deinitFields.chpl @@ -0,0 +1,32 @@ +record R { + proc init() { + writeln("In R's init"); + } + + proc deinit() { + writeln("In R's deinit"); + } +} + +class C { + var r: R; + + proc init() throws { + writeln("In C's init"); + } + + proc postinit() throws { + throw new Error(); + } + + proc deinit() { + writeln("In C's deinit"); + } +} + +try { + var myC = new C(); +} catch { + writeln("Caught error"); +} +writeln("Past creation of myC"); diff --git a/test/classes/initializers/postInit/deinitFields.future b/test/classes/initializers/postInit/deinitFields.future new file mode 100644 index 000000000000..51712644f90b --- /dev/null +++ b/test/classes/initializers/postInit/deinitFields.future @@ -0,0 +1,15 @@ +unimplemented feature: throwing postinits don't deinit fields + +I suspect that addressing ../errors/errhandling/deinitFields.chpl +would likely fix this test as well, but wanted to add a separate test +to be sure. + +One interesting question about this test is whether C.deinit() should +be called by the language as part of the cleanup in the sense that "We +completed all the init() calls, so it's initialized" or whether the +postinit()s are still considered part of the initialization, such that +by not completing them, we didn't complete the initialization of C. +The .good here is set up to not invoke C's initializer, but that's +arbitrary and I'm not trying to take a strong stance on the issue. + +#26437 diff --git a/test/classes/initializers/postInit/deinitFields.good b/test/classes/initializers/postInit/deinitFields.good new file mode 100644 index 000000000000..16fb82abe373 --- /dev/null +++ b/test/classes/initializers/postInit/deinitFields.good @@ -0,0 +1,5 @@ +In C's init +In R's init +In R's deinit +Caught error +Past creation of myC diff --git a/test/classes/initializers/postInit/throwing-superclass.chpl b/test/classes/initializers/postInit/throwing-superclass.chpl new file mode 100644 index 000000000000..09ef14978ef5 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass.chpl @@ -0,0 +1,29 @@ +interface dummy { } +interface dummy2 { } + +class Foo { + var x: int; + + proc postinit() throws { + if (x > 5) { + throw new Error("x too large"); + } + } +} + +class Bar : dummy, Foo, dummy2 { + proc init(x: int) { + super.init(x=x); + } +} + +proc main() { + try { + var f1 = new Bar(3); + writeln(f1); + var f2 = new Bar(7); + writeln(f2); + } catch e { + writeln(e.message()); + } +} diff --git a/test/classes/initializers/postInit/throwing-superclass.good b/test/classes/initializers/postInit/throwing-superclass.good new file mode 100644 index 000000000000..ba253fa61e89 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass.good @@ -0,0 +1,2 @@ +{x = 3} +x too large diff --git a/test/classes/initializers/postInit/throwing-superclass2.chpl b/test/classes/initializers/postInit/throwing-superclass2.chpl new file mode 100644 index 000000000000..bd1d7135c430 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass2.chpl @@ -0,0 +1,29 @@ +interface dummy { } +interface dummy2 { } + +class Foo { + var x: int; +} + +class Bar : dummy, Foo, dummy2 { + proc init(x: int) { + super.init(x=x); + } + + proc postinit() throws { + if (x > 5) { + throw new Error("x too large"); + } + } +} + +proc main() { + try { + var f1 = new Bar(3); + writeln(f1); + var f2 = new Bar(7); + writeln(f2); + } catch e { + writeln(e.message()); + } +} diff --git a/test/classes/initializers/postInit/throwing-superclass2.good b/test/classes/initializers/postInit/throwing-superclass2.good new file mode 100644 index 000000000000..ba253fa61e89 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass2.good @@ -0,0 +1,2 @@ +{x = 3} +x too large diff --git a/test/classes/initializers/postInit/throwing-superclass3.chpl b/test/classes/initializers/postInit/throwing-superclass3.chpl new file mode 100644 index 000000000000..3aa56937c58e --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass3.chpl @@ -0,0 +1,33 @@ +interface dummy { } +interface dummy2 { } + +class Foo { + var x: int; + + proc postinit() throws { + if (x > 5) { + throw new Error("x too large"); + } + } +} + +class Bar : dummy, Foo, dummy2 { + proc init(x: int) { + super.init(x=x); + } + + proc postinit() { + writeln("In Bar's postinit"); + } +} + +proc main() { + try { + var f1 = new Bar(3); + writeln(f1); + var f2 = new Bar(7); + writeln(f2); + } catch e { + writeln(e.message()); + } +} diff --git a/test/classes/initializers/postInit/throwing-superclass3.good b/test/classes/initializers/postInit/throwing-superclass3.good new file mode 100644 index 000000000000..1d717b847df7 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass3.good @@ -0,0 +1,5 @@ +In Bar's postinit +{x = 3} +uncaught Error: x too large + throwing-superclass3.chpl:9: thrown here + throwing-superclass3.chpl:19: uncaught here diff --git a/test/classes/initializers/postInit/throwing-superclass4.chpl b/test/classes/initializers/postInit/throwing-superclass4.chpl new file mode 100644 index 000000000000..8f1829a401a7 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass4.chpl @@ -0,0 +1,33 @@ +interface dummy { } +interface dummy2 { } + +class Foo { + var x: int; + + proc postinit() throws { + writeln("In Foo's postinit"); + } +} + +class Bar : dummy, Foo, dummy2 { + proc init(x: int) { + super.init(x=x); + } + + proc postinit() throws { + if (x > 5) { + throw new Error("x too large"); + } + } +} + +proc main() { + try { + var f1 = new Bar(3); + writeln(f1); + var f2 = new Bar(7); + writeln(f2); + } catch e { + writeln(e.message()); + } +} diff --git a/test/classes/initializers/postInit/throwing-superclass4.good b/test/classes/initializers/postInit/throwing-superclass4.good new file mode 100644 index 000000000000..b6310b7450e1 --- /dev/null +++ b/test/classes/initializers/postInit/throwing-superclass4.good @@ -0,0 +1,4 @@ +In Foo's postinit +{x = 3} +In Foo's postinit +x too large diff --git a/test/classes/initializers/postInit/throwing.bad b/test/classes/initializers/postInit/throwing.bad deleted file mode 100644 index 8ed57c5e9622..000000000000 --- a/test/classes/initializers/postInit/throwing.bad +++ /dev/null @@ -1 +0,0 @@ -throwing.chpl:4: error: postinit cannot be declared as throws yet diff --git a/test/classes/initializers/postInit/throwing.future b/test/classes/initializers/postInit/throwing.future deleted file mode 100644 index 9b4ce5df8a50..000000000000 --- a/test/classes/initializers/postInit/throwing.future +++ /dev/null @@ -1,2 +0,0 @@ -feature request: support throwing from postinit -#21418 diff --git a/test/distributions/bradc/extremeBlock.skipif b/test/distributions/bradc/extremeBlock.skipif new file mode 100755 index 000000000000..2a8d9725acef --- /dev/null +++ b/test/distributions/bradc/extremeBlock.skipif @@ -0,0 +1,12 @@ +#!/bin/bash + +# Our darwin testing machine cannot handle 32 locales +# under gasnet with segment=fast, so skip this test in that config. + +if [[ $CHPL_TARGET_PLATFORM == darwin && + $CHPL_COMM == gasnet && + $CHPL_GASNET_SEGMENT == fast ]]; then + echo True +else + echo False +fi diff --git a/test/release/examples/hello2-module.arg.good b/test/release/examples/hello2-module.arg.good new file mode 100644 index 000000000000..d4db6f7bca13 --- /dev/null +++ b/test/release/examples/hello2-module.arg.good @@ -0,0 +1 @@ +Hello, Chapel programmers! diff --git a/test/release/examples/hello2-module.execopts b/test/release/examples/hello2-module.execopts new file mode 100644 index 000000000000..3877f3dba86e --- /dev/null +++ b/test/release/examples/hello2-module.execopts @@ -0,0 +1,2 @@ + # hello2-module.good +--message="Hello, Chapel programmers!" # hello2-module.arg.good diff --git a/test/runtime/jhh/numColocales.chpl b/test/runtime/jhh/numColocales.chpl new file mode 100644 index 000000000000..bf573d313163 --- /dev/null +++ b/test/runtime/jhh/numColocales.chpl @@ -0,0 +1,15 @@ +// Verify that here.numColocales equals CHPL_RT_LOCALES_PER_NODE if it is +// set. +use OS.POSIX; +use IO.FormattedIO; + +var value = getenv("CHPL_RT_LOCALES_PER_NODE"); +if value { + var n = string.createCopyingBuffer(value):int; + if n != here.numColocales { + writef("CHPL_RT_LOCALES_PER_NODE != here.numColocales (%i != %i)\n", + n, here.numColocales); + exit(0); + } +} +writeln("Success"); diff --git a/test/runtime/jhh/numColocales.good b/test/runtime/jhh/numColocales.good new file mode 100644 index 000000000000..35821117c875 --- /dev/null +++ b/test/runtime/jhh/numColocales.good @@ -0,0 +1 @@ +Success diff --git a/test/runtime/jhh/numColocales.numlocales b/test/runtime/jhh/numColocales.numlocales new file mode 100644 index 000000000000..9a7456b54df2 --- /dev/null +++ b/test/runtime/jhh/numColocales.numlocales @@ -0,0 +1,2 @@ +2 + diff --git a/test/runtime/jhh/numColocales2.chpl b/test/runtime/jhh/numColocales2.chpl new file mode 120000 index 000000000000..8351e6087258 --- /dev/null +++ b/test/runtime/jhh/numColocales2.chpl @@ -0,0 +1 @@ +numColocales.chpl \ No newline at end of file diff --git a/test/runtime/jhh/numColocales2.execenv b/test/runtime/jhh/numColocales2.execenv new file mode 100644 index 000000000000..ab0e3375b09b --- /dev/null +++ b/test/runtime/jhh/numColocales2.execenv @@ -0,0 +1 @@ +CHPL_RT_LOCALES_PER_NODE=2 \ No newline at end of file diff --git a/test/runtime/jhh/numColocales2.good b/test/runtime/jhh/numColocales2.good new file mode 120000 index 000000000000..c4c7f4e13801 --- /dev/null +++ b/test/runtime/jhh/numColocales2.good @@ -0,0 +1 @@ +numColocales.good \ No newline at end of file diff --git a/test/runtime/jhh/numColocales2.numlocales b/test/runtime/jhh/numColocales2.numlocales new file mode 120000 index 000000000000..9fcd0f4df281 --- /dev/null +++ b/test/runtime/jhh/numColocales2.numlocales @@ -0,0 +1 @@ +numColocales.numlocales \ No newline at end of file diff --git a/test/runtime/jhh/numColocales2.skipif b/test/runtime/jhh/numColocales2.skipif new file mode 100644 index 000000000000..44bdc380d857 --- /dev/null +++ b/test/runtime/jhh/numColocales2.skipif @@ -0,0 +1,7 @@ +CHPL_LAUNCHER == amudprun +CHPL_LAUNCHER == aprun +CHPL_LAUNCHER == lsf-gasnetrun_ibv +CHPL_LAUNCHER == mpirun +CHPL_LAUNCHER == mpirun4ofi +CHPL_LAUNCHER == pals +CHPL_LAUNCHER == pbs-aprun diff --git a/test/studies/amr/lib/amr/AMRHierarchy_def.chpl b/test/studies/amr/lib/amr/AMRHierarchy_def.chpl index 52919c1ddf30..50449a5fff91 100644 --- a/test/studies/amr/lib/amr/AMRHierarchy_def.chpl +++ b/test/studies/amr/lib/amr/AMRHierarchy_def.chpl @@ -574,7 +574,7 @@ class PhysicalBoundary proc init ( level: unmanaged Level ) { - this.complete(); + init this; for grid in level.grids { var boundary_multidomain = new unmanaged MultiDomain(dimension,strideKind.any); diff --git a/test/studies/shootout/submitted/knucleotide3.chpl b/test/studies/shootout/submitted/knucleotide3.chpl index e8309bce31c4..f086f61b2980 100644 --- a/test/studies/shootout/submitted/knucleotide3.chpl +++ b/test/studies/shootout/submitted/knucleotide3.chpl @@ -61,7 +61,7 @@ proc writeFreqs(data, param nclSize) { var arr = for (s,f) in zip(freqs.keys(), freqs.values()) do (f,s); // print the array, sorted by decreasing frequency - sort(arr, reverseComparator); + sort(arr, new reverseComparator()); for (f, s) in arr do writef("%s %.3dr\n", decode(s, nclSize), (100.0 * f) / (data.size - nclSize)); diff --git a/test/studies/shootout/submitted/knucleotide3.good b/test/studies/shootout/submitted/knucleotide3.good index 1d3dabb827fd..072e3660e26f 100644 --- a/test/studies/shootout/submitted/knucleotide3.good +++ b/test/studies/shootout/submitted/knucleotide3.good @@ -1,5 +1,3 @@ -knucleotide3.chpl:57: In function 'writeFreqs': -knucleotide3.chpl:64: warning: The variable 'reverseComparator' is now deprecated, please create a new instance of the ReverseComparator type reversing the DefaultComparator instead. A 30.279 T 30.113 G 19.835 diff --git a/test/studies/shootout/submitted/knucleotide3.notest b/test/studies/shootout/submitted/knucleotide3.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/knucleotide3.txt.good b/test/studies/shootout/submitted/knucleotide3.txt.good index 034f2d8f9d96..f16dd0dcbda5 100644 --- a/test/studies/shootout/submitted/knucleotide3.txt.good +++ b/test/studies/shootout/submitted/knucleotide3.txt.good @@ -1,5 +1,3 @@ -knucleotide3.chpl:57: In function 'writeFreqs': -knucleotide3.chpl:64: warning: The variable 'reverseComparator' is now deprecated, please create a new instance of the ReverseComparator type reversing the DefaultComparator instead. T 31.520 A 29.600 C 19.480 diff --git a/test/studies/shootout/submitted/knucleotide4.chpl b/test/studies/shootout/submitted/knucleotide4.chpl index 4271f478f289..31e9a3d779ff 100644 --- a/test/studies/shootout/submitted/knucleotide4.chpl +++ b/test/studies/shootout/submitted/knucleotide4.chpl @@ -60,7 +60,7 @@ proc writeFreqs(data, param nclSize) { var arr = for (s,f) in zip(freqs.keys(), freqs.values()) do (f,s.val); // print the array, sorted by decreasing frequency - sort(arr, reverseComparator); + sort(arr, new reverseComparator()); for (f, s) in arr do writef("%s %.3dr\n", decode(s, nclSize), (100.0 * f) / (data.size - nclSize)); diff --git a/test/studies/shootout/submitted/knucleotide4.good b/test/studies/shootout/submitted/knucleotide4.good index 296e973ce99f..072e3660e26f 100644 --- a/test/studies/shootout/submitted/knucleotide4.good +++ b/test/studies/shootout/submitted/knucleotide4.good @@ -1,5 +1,3 @@ -knucleotide4.chpl:56: In function 'writeFreqs': -knucleotide4.chpl:63: warning: The variable 'reverseComparator' is now deprecated, please create a new instance of the ReverseComparator type reversing the DefaultComparator instead. A 30.279 T 30.113 G 19.835 diff --git a/test/studies/shootout/submitted/knucleotide4.notest b/test/studies/shootout/submitted/knucleotide4.notest deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/studies/shootout/submitted/knucleotide4.txt.good b/test/studies/shootout/submitted/knucleotide4.txt.good index b399d4e57008..f16dd0dcbda5 100644 --- a/test/studies/shootout/submitted/knucleotide4.txt.good +++ b/test/studies/shootout/submitted/knucleotide4.txt.good @@ -1,5 +1,3 @@ -knucleotide4.chpl:56: In function 'writeFreqs': -knucleotide4.chpl:63: warning: The variable 'reverseComparator' is now deprecated, please create a new instance of the ReverseComparator type reversing the DefaultComparator instead. T 31.520 A 29.600 C 19.480 diff --git a/test/unstable/locale-numColocales.chpl b/test/unstable/locale-numColocales.chpl new file mode 100644 index 000000000000..61ff9e8c1f31 --- /dev/null +++ b/test/unstable/locale-numColocales.chpl @@ -0,0 +1 @@ +const n = here.numColocales; diff --git a/test/unstable/locale-numColocales.good b/test/unstable/locale-numColocales.good new file mode 100644 index 000000000000..6918dd83506d --- /dev/null +++ b/test/unstable/locale-numColocales.good @@ -0,0 +1 @@ +locale-numColocales.chpl:1: warning: 'locale.numColocales' is unstable diff --git a/util/cron/common-champs.bash b/util/cron/common-champs.bash index fbf5952b1216..03fa4fb1fc13 100644 --- a/util/cron/common-champs.bash +++ b/util/cron/common-champs.bash @@ -32,6 +32,8 @@ module load cray-pmi module load cray-mpich module load cray-hdf5-parallel +module load gcc-native/10.3 + module list # note that this part is similar to common-hpe-apollo.bash, but diff --git a/util/cron/nightly b/util/cron/nightly index 4e319d793c73..0d42fc1d088c 100755 --- a/util/cron/nightly +++ b/util/cron/nightly @@ -21,7 +21,7 @@ use FindBin; use lib "$FindBin::Bin"; use nightlysubs; -use nightly_email; +use nightly_email_file; # Mailing lists. $failuremail = "chapel+tests\@discoursemail.com"; $replymail = ""; @@ -879,7 +879,7 @@ if ($runtests == 0) { # FIXME: Pass correct args here! # `$chplhomedir/util/cron/nightly_email.pl $status "$rawsummary" "$sortedsummary" "$prevsummary" "$mailer" "$nochangerecipient" "$recipient" "$subjectid" "$config_name" "$revision" "$rawlog" "$starttime" "$endtime" "$crontab" "$testdirs" $debug`; # Write the test results to the summary log. - writeFile($status, "$rawsummary", "$sortedsummary", "$prevsummary", "$mysystemlog", "$prevmysystemlog", "", "$nochangerecipient", "$recipient", "$subjectid", "$config_name", "$revision", "$rawlog", "$starttime", "$endtime", "$crontab", "$testdirs", $debug); + nightly_email_file($status, "$rawsummary", "$sortedsummary", "$prevsummary", "$mysystemlog", "$prevmysystemlog", "$nochangerecipient", "$recipient", "$subjectid", "$config_name", "$revision", "$rawlog", "$starttime", "$endtime", "$crontab", "$testdirs", $debug); # # analyze memory leaks tests # @@ -905,4 +905,3 @@ if ($runtests == 0) { } } exit 0; - diff --git a/util/cron/nightly_email.pm b/util/cron/nightly_email_file.pm similarity index 86% rename from util/cron/nightly_email.pm rename to util/cron/nightly_email_file.pm index d7091aba8cf1..a275b305e01c 100755 --- a/util/cron/nightly_email.pm +++ b/util/cron/nightly_email_file.pm @@ -5,17 +5,22 @@ use lib "$FindBin::Bin"; use nightlysubs; -sub writeFile{ +sub nightly_email_file{ $num_args = @_; - if ($num_args != 18) { - print "usage: nightly_email.pm \$status \$rawsummary \$sortedsummary \n"; - print " \$prevsummary \$mysystemlog \$prevmysystemlog \$mailer \$nochangerecipient \$recipient \n"; + if ($num_args != 17) { + print "usage: nightly_email_file.pm \$status \$rawsummary \$sortedsummary \n"; + print " \$prevsummary \$mysystemlog \$prevmysystemlog \$nochangerecipient \$recipient \n"; print " \$subjectid \$config_name \$revision \$rawlog \$starttime \n"; print " \$endtime \$crontab \$testdirs \$debug\n"; + + print "INFO: Number of arguments is $num_args\n"; + for my $i (0 .. $#_) { + print "INFO: Argument $i: $_[$i]\n"; + } exit 1; } - my ($status, $rawsummary, $sortedsummary, ,$prevsummary, $mysystemlog, $prevmysystemlog, $mailer, $nochangerecipient, $recipient, $subjectid, $config_name, $revision, $rawlog, $starttime, $endtime, $crontab, $testdirs, $debug)=@_; + my ($status, $rawsummary, $sortedsummary, ,$prevsummary, $mysystemlog, $prevmysystemlog, $nochangerecipient, $recipient, $subjectid, $config_name, $revision, $rawlog, $starttime, $endtime, $crontab, $testdirs, $debug)=@_; $status = $_[0]; $rawsummary = $_[1]; @@ -23,18 +28,17 @@ sub writeFile{ $prevsummary = $_[3]; $mysystemlog = $_[4]; $prevmysystemlog = $_[5]; - $mailer = $_[6]; - $nochangerecipient = $_[7]; - $recipient = $_[8]; - $subjectid = $_[9]; - $config_name = $_[10]; - $revision = $_[11]; - $rawlog = $_[12]; - $starttime = $_[13]; - $endtime = $_[14]; - $crontab = $_[15]; - $testdirs = $_[16]; - $debug = $_[17]; + $nochangerecipient = $_[6]; + $recipient = $_[7]; + $subjectid = $_[8]; + $config_name = $_[9]; + $revision = $_[10]; + $rawlog = $_[11]; + $starttime = $_[12]; + $endtime = $_[13]; + $crontab = $_[14]; + $testdirs = $_[15]; + $debug = $_[16]; # Nothing sorts the system log for us; do that now, so that 'comm' is # given a lexically sorted input as it expects. @@ -154,4 +158,4 @@ sub writeFile{ return(0); } -return(1); \ No newline at end of file +return(1); diff --git a/util/cron/test-darwin-arm.bash b/util/cron/test-darwin-arm.bash deleted file mode 100755 index 9fc822104cdb..000000000000 --- a/util/cron/test-darwin-arm.bash +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# -# Test full suite for default configuration on ARM darwin - -UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd) -source $UTIL_CRON_DIR/common.bash -source $UTIL_CRON_DIR/common-darwin.bash -source $UTIL_CRON_DIR/common-localnode-paratest.bash - -export CHPL_NIGHTLY_TEST_CONFIG_NAME="darwin-arm" - -$UTIL_CRON_DIR/nightly -cron $(get_nightly_paratest_args) diff --git a/util/cron/test-darwin.bash b/util/cron/test-darwin.bash index c3c8d3faf149..6580d6945d3e 100755 --- a/util/cron/test-darwin.bash +++ b/util/cron/test-darwin.bash @@ -1,11 +1,12 @@ #!/usr/bin/env bash # -# Test examples for default configuration on darwin +# Test full suite for default configuration on darwin UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd) source $UTIL_CRON_DIR/common.bash source $UTIL_CRON_DIR/common-darwin.bash +source $UTIL_CRON_DIR/common-localnode-paratest.bash export CHPL_NIGHTLY_TEST_CONFIG_NAME="darwin" -$UTIL_CRON_DIR/nightly -cron -examples -blog +$UTIL_CRON_DIR/nightly -cron -blog $(get_nightly_paratest_args) diff --git a/util/cron/test-gasnet.darwin-arm.bash b/util/cron/test-gasnet.darwin-arm.bash deleted file mode 100755 index aa76f9d4bb7c..000000000000 --- a/util/cron/test-gasnet.darwin-arm.bash +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -# -# Test gasnet (segment everything) against multilocale tests on ARM Darwin - -UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd) -source $UTIL_CRON_DIR/common-gasnet.bash -source $UTIL_CRON_DIR/common-darwin.bash -source $UTIL_CRON_DIR/common-localnode-paratest.bash - -export CHPL_NIGHTLY_TEST_CONFIG_NAME="gasnet.darwin-arm" - -$UTIL_CRON_DIR/nightly -cron -multilocale $(get_nightly_paratest_args) diff --git a/util/cron/test-gasnet.darwin.bash b/util/cron/test-gasnet.darwin.bash index 7bf7cf427329..d4eed5f4dff9 100755 --- a/util/cron/test-gasnet.darwin.bash +++ b/util/cron/test-gasnet.darwin.bash @@ -1,11 +1,12 @@ #!/usr/bin/env bash # -# Test gasnet (segment everything) against example tests +# Test gasnet (segment everything) against multilocale tests on darwin UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd) source $UTIL_CRON_DIR/common-gasnet.bash source $UTIL_CRON_DIR/common-darwin.bash +source $UTIL_CRON_DIR/common-localnode-paratest.bash export CHPL_NIGHTLY_TEST_CONFIG_NAME="gasnet.darwin" -$UTIL_CRON_DIR/nightly -cron -examples +$UTIL_CRON_DIR/nightly -cron -multilocale $(get_nightly_paratest_args) diff --git a/util/cron/test-gasnet.fast.darwin.bash b/util/cron/test-gasnet.fast.darwin.bash index f1055055edac..398756a90bbe 100755 --- a/util/cron/test-gasnet.fast.darwin.bash +++ b/util/cron/test-gasnet.fast.darwin.bash @@ -1,12 +1,13 @@ #!/usr/bin/env bash # -# Test gasnet (segment fast) against hellos on darwin +# Test gasnet (segment fast) against multilocale tests on darwin UTIL_CRON_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) ; pwd) source $UTIL_CRON_DIR/common-gasnet.bash export CHPL_GASNET_SEGMENT=fast source $UTIL_CRON_DIR/common-darwin.bash +source $UTIL_CRON_DIR/common-localnode-paratest.bash export CHPL_NIGHTLY_TEST_CONFIG_NAME="gasnet.fast.darwin" -$UTIL_CRON_DIR/nightly -cron -hellos +$UTIL_CRON_DIR/nightly -cron -multilocale $(get_nightly_paratest_args) diff --git a/util/packaging/docker/test/Dockerfile b/util/packaging/docker/test/Dockerfile index 616fc443eb11..eed62de61234 100644 --- a/util/packaging/docker/test/Dockerfile +++ b/util/packaging/docker/test/Dockerfile @@ -15,6 +15,13 @@ RUN mkdir -p /home/linuxbrew # RUN sudo apt-get install -y vim # ENV EDITOR=vim +# Do the updates before applying our chapel.rb changes +# Update Homebrew itself +RUN brew update +# Upgrade to the latest version of all installed formulae +RUN brew upgrade + + # necessary so that updated chapel.rb formula can be committed, which is only way it # will be tested RUN git config --global user.name "Chapel Tester" diff --git a/util/packaging/docker/test/brew_install.bash b/util/packaging/docker/test/brew_install.bash index 107e945b7df1..7584fdd31e1b 100755 --- a/util/packaging/docker/test/brew_install.bash +++ b/util/packaging/docker/test/brew_install.bash @@ -3,8 +3,6 @@ export HOMEBREW_NO_INSTALL_FROM_API=1 # Might not be needed, but also doesn't hurt and matches homebrew CI export HOMEBREW_NO_AUTO_UPDATE=1 -#Update homebrew -brew update #Script used in docker exec command to test homebrew formula # brew test-bot --only-tap-syntax @@ -15,30 +13,30 @@ brew update # echo "brew test-bot --only-tap-syntax succeeded" # fi -# # tests commands -# brew test-bot --only-cleanup-before -# if [ $? -ne 0 ]; then -# echo "brew test-bot --only-cleanup-before failed" -# exit 1 -# else -# echo "brew test-bot --only-cleanup-before succeeded" -# fi +# tests commands +brew test-bot --only-cleanup-before +if [ $? -ne 0 ]; then + echo "brew test-bot --only-cleanup-before failed" + exit 1 +else + echo "brew test-bot --only-cleanup-before succeeded" +fi -# brew test-bot --only-setup -# if [ $? -ne 0 ]; then -# echo "brew test-bot --only-setup failed" -# exit 1 -# else -# echo "brew test-bot --only-setup succeeded" -# fi +brew test-bot --only-setup + if [ $? -ne 0 ]; then + echo "brew test-bot --only-setup failed" + exit 1 + else + echo "brew test-bot --only-setup succeeded" + fi -# brew test-bot --only-formulae-dependents --junit --testing-formulae=chapel --skipped-or-failed-formulae=chapel -# if [ $? -ne 0 ]; then -# echo "brew test-bot --only-formulae-dependents --junit --testing-formulae=chapel --skipped-or-failed-formulae=chapel failed" -# exit 1 -# else -# echo "brew test-bot --only-formulae-dependents --junit --testing-formulae=chapel --skipped-or-failed-formulae=chapel succeeded" -# fi +brew test-bot --only-formulae-dependents --junit --testing-formulae=chapel --skipped-or-failed-formulae=chapel +if [ $? -ne 0 ]; then + echo "brew test-bot --only-formulae-dependents --junit --testing-formulae=chapel --skipped-or-failed-formulae=chapel failed" + exit 1 +else + echo "brew test-bot --only-formulae-dependents --junit --testing-formulae=chapel --skipped-or-failed-formulae=chapel succeeded" +fi # This is the bulk of the testing and the same command that Homebrew CI runs brew test-bot --skip-online-checks --only-formulae --junit --only-json-tab --skip-dependents --testing-formulae="chapel" --added-formulae="" --deleted-formulae="" diff --git a/util/packaging/homebrew/chapel-main.rb b/util/packaging/homebrew/chapel-main.rb index d21e71b45ce8..5cf35bbb9be6 100644 --- a/util/packaging/homebrew/chapel-main.rb +++ b/util/packaging/homebrew/chapel-main.rb @@ -78,7 +78,6 @@ def install rm_r("third-party/llvm/llvm-src/") rm_r("third-party/gasnet/gasnet-src/") rm_r("third-party/libfabric/libfabric-src/") - rm_r("third-party/fltk/fltk-1.3.8-source.tar.gz") rm_r("third-party/libunwind/libunwind-src/") rm_r("third-party/gmp/gmp-src/") rm_r("third-party/qthread/qthread-src/")