diff --git a/compiler/AST/interfaces.cpp b/compiler/AST/interfaces.cpp index d925c237c12e..9fe7a8f7872c 100644 --- a/compiler/AST/interfaces.cpp +++ b/compiler/AST/interfaces.cpp @@ -34,6 +34,10 @@ InterfaceSymbol* gHashable = nullptr; InterfaceSymbol* gContextManager = nullptr; +InterfaceSymbol* gWriteSerializable = nullptr; +InterfaceSymbol* gReadDeserializable = nullptr; +InterfaceSymbol* gInitDeserializable = nullptr; +InterfaceSymbol* gSerializable = nullptr; static Symbol* isInterfaceFormalSymbol(Symbol* sym) { if (TypeSymbol* var = toTypeSymbol(sym)) @@ -74,6 +78,14 @@ DefExpr* InterfaceSymbol::buildDef(const char* name, gHashable = isym; } else if (gContextManager == nullptr && strcmp("contextManager", name) == 0) { gContextManager = isym; + } else if (gWriteSerializable == nullptr && strcmp("writeSerializable", name) == 0) { + gWriteSerializable = isym; + } else if (gReadDeserializable == nullptr && strcmp("readDeserializable", name) == 0) { + gReadDeserializable = isym; + } else if (gInitDeserializable == nullptr && strcmp("initDeserializable", name) == 0) { + gInitDeserializable = isym; + } else if (gSerializable == nullptr && strcmp("serializable", name) == 0) { + gSerializable = isym; } for_alist(formal, formals->argList) { diff --git a/compiler/include/symbol.h b/compiler/include/symbol.h index 92e50c536911..ef1d92205bf5 100644 --- a/compiler/include/symbol.h +++ b/compiler/include/symbol.h @@ -574,6 +574,10 @@ class InterfaceSymbol final : public Symbol { extern InterfaceSymbol* gHashable; extern InterfaceSymbol* gContextManager; +extern InterfaceSymbol* gWriteSerializable; +extern InterfaceSymbol* gReadDeserializable; +extern InterfaceSymbol* gInitDeserializable; +extern InterfaceSymbol* gSerializable; /************************************* | ************************************** * * diff --git a/compiler/passes/buildDefaultFunctions.cpp b/compiler/passes/buildDefaultFunctions.cpp index cdccafd16041..f8f75db21ace 100644 --- a/compiler/passes/buildDefaultFunctions.cpp +++ b/compiler/passes/buildDefaultFunctions.cpp @@ -1916,11 +1916,12 @@ static void buildDefaultReadWriteFunctions(AggregateType* ct) { } forv_Vec(FnSymbol, method, ct->methods) { + int n = method ? method->numFormals() : 0; if (method != nullptr && method->isInitializer() && - method->numFormals() == 4 && - strcmp(method->getFormal(3)->name, "reader") == 0 && - strcmp(method->getFormal(4)->name, "deserializer") == 0) { + n >= 4 && + strcmp(method->getFormal(n-1)->name, "reader") == 0 && + strcmp(method->getFormal(n)->name, "deserializer") == 0) { readerInit = method; break; } diff --git a/compiler/passes/normalize.cpp b/compiler/passes/normalize.cpp index c49de823e703..3bab034747b4 100644 --- a/compiler/passes/normalize.cpp +++ b/compiler/passes/normalize.cpp @@ -71,6 +71,8 @@ static void replaceFunctionWithInstantiationsOfPrimitive(FnSymbol* fn); static void fixupQueryFormals(FnSymbol* fn); static void fixupCastFormals(FnSymbol* fn); +static void fixupExplicitGenericVariables(DefExpr* def); + static void updateInitMethod (FnSymbol* fn); static void checkUseBeforeDefs(); @@ -2995,6 +2997,10 @@ void normalizeVariableDefinition(DefExpr* defExpr) { if (foundSplitInit == false && refVar) errorIfSplitInitializationRequired(defExpr, prevent); + if (type != nullptr) { + fixupExplicitGenericVariables(defExpr); + } + if (requestedSplitInit && foundSplitInit == false) { // Create a dummy DEFAULT_INIT_VAR to sort out later in resolution // to support a pattern like @@ -4843,6 +4849,44 @@ static void addToWhereClause(FnSymbol* fn, combine->insertAtTail(test); } +static void fixupExplicitGenericVariables(DefExpr* def) { + // this is a workaround for `(CallExpr _domain ?)` not being resolved + // fixup the pattern `(CallExpr _domain ?)` to be `(_domain(?))`, + // marking the `DefExpr` as generic + CHPL_ASSERT(def && def->exprType); + + if (CallExpr* call = toCallExpr(def->exprType)) { + // if its a call like `_domain ?`, make it `_domain(?)` and MARKED_GENERIC + SymExpr* symExpr = nullptr; + bool actIsQuestion = false; + if (auto se = toSymExpr(call->baseExpr)) { + + // only perform this transformation if the generic has no defaults + // this is a workaround for something like `range`, which is generic with + // defaults and which this normalization breaks + bool genericWithDefaults = false; + if (AggregateType* at = toAggregateType(se->symbol()->type)) { + genericWithDefaults = at->isGenericWithDefaults(); + } + if (!genericWithDefaults) symExpr = se; + } + if (call->numActuals() == 1) { + if (auto se = toSymExpr(call->get(1))) { + actIsQuestion = se->symbol() == gUninstantiated; + } + } + + if (symExpr && actIsQuestion) { + Symbol* symToSetGeneric = def->sym; + if (symToSetGeneric) { + symToSetGeneric->addFlag(FLAG_MARKED_GENERIC); + symExpr->remove(); + call->replace(symExpr); + } + } + } +} + /************************************* | ************************************** * * * * diff --git a/compiler/resolution/functionResolution.cpp b/compiler/resolution/functionResolution.cpp index b11a66512eda..ad7dca02062e 100644 --- a/compiler/resolution/functionResolution.cpp +++ b/compiler/resolution/functionResolution.cpp @@ -11263,11 +11263,36 @@ static AggregateType* getBaseTypeForInterfaceWarnings(Type* ts) { return toReturn; } +static bool matchesSerializeShape(FnSymbol* fn, + const char* first, const char* second) { + // Initializer needs at least 4 : this, _mt, , reader, deserializer + int n = fn->numFormals(); + if (fn->isInitializer()) { + if (n < 4) return false; + } else if (n != 4) { + // (de)serialize have only 4: this, _mt, , <(de)serializer> + return false; + } + + bool ret = strcmp(fn->getFormal(n-1)->name, first) == 0 && + strcmp(fn->getFormal(n)->name, second) == 0; + return ret; +} + +static bool isSerdeSingleInterface(InterfaceSymbol* isym) { + return isym == gWriteSerializable || + isym == gReadDeserializable || + isym == gInitDeserializable; +} + static void checkSpeciallyNamedMethods() { static const std::unordered_map reservedNames = { { astr("hash"), gHashable }, { astr("enterContext"), gContextManager }, - { astr("exitContext"), gContextManager }, + { astr("exitContext"), gContextManager }, + { astr("serialize"), gWriteSerializable }, + { astr("deserialize"), gReadDeserializable }, + { astr("init"), gInitDeserializable }, }; SpecialMethodMap flagged; @@ -11275,18 +11300,39 @@ static void checkSpeciallyNamedMethods() { for_alive_in_Vec(FnSymbol, fn, gFnSymbols) { if (!fn->isMethod()) continue; if (fn->isCompilerGenerated() || fn->hasFlag(FLAG_FIELD_ACCESSOR)) continue; - // The parent class must have this function, and would've been flagged. - // the user will already get the warning. - if (fn->hasFlag(FLAG_OVERRIDE)) continue; auto reservedIter = reservedNames.find(fn->name); if (reservedIter == reservedNames.end()) continue; + auto found = reservedIter->second; + + if (found == gHashable || found == gContextManager) { + // The parent class must have this function, and would've been flagged. + // the user will already get the warning. + if (fn->hasFlag(FLAG_OVERRIDE)) continue; + } auto receiverType = fn->getReceiverType(); auto at = getBaseTypeForInterfaceWarnings(receiverType); - if (!at || (reservedIter->second == gHashable && at == dtObject)) continue; + if (!at || (found == gHashable && at == dtObject)) continue; - auto key = SpeciallyNamedMethodKey(reservedIter->second, at); + // _iteratorRecord currently doesn't work with 'implements' statements at + // the moment (likely due to its typeclass-like nature), so we skip all + // iterator records manually here for the 'writeSerializable' case. + if (at->symbol->hasFlag(FLAG_ITERATOR_RECORD) && + found == gWriteSerializable) continue; + + if ((found == gInitDeserializable || found == gReadDeserializable) && + !matchesSerializeShape(fn, "reader", "deserializer")) continue; + + if (found == gWriteSerializable && + !matchesSerializeShape(fn, "writer", "serializer")) continue; + + auto key = SpeciallyNamedMethodKey(found, at); flagged[key].speciallyNamedMethods[fn->name] = fn; + + if (isSerdeSingleInterface(found)) { + auto key = SpeciallyNamedMethodKey(gSerializable, at); + flagged[key].speciallyNamedMethods[fn->name] = fn; + } } for_alive_in_Vec(ImplementsStmt, istm, gImplementsStmts) { @@ -11299,6 +11345,14 @@ static void checkSpeciallyNamedMethods() { // flagged set, because we found an instance. auto isym = istm->iConstraint->ifcSymbol(); flagged.erase(SpeciallyNamedMethodKey(isym, at)); + + if (isym == gSerializable) { + flagged.erase(SpeciallyNamedMethodKey(gWriteSerializable, at)); + flagged.erase(SpeciallyNamedMethodKey(gReadDeserializable, at)); + flagged.erase(SpeciallyNamedMethodKey(gInitDeserializable, at)); + } else if (isSerdeSingleInterface(isym)) { + flagged.erase(SpeciallyNamedMethodKey(gSerializable, at)); + } } // the things now left in flagged, we did not find any implements statements @@ -11307,6 +11361,11 @@ static void checkSpeciallyNamedMethods() { auto ifc = flaggedTypeIfc.first.first; auto at = flaggedTypeIfc.first.second; + // Don't recommend 'serializable' so that there are not duplicates + if (ifc == gSerializable) { + continue; + } + USR_WARN(at, "the type '%s' defines methods that previously had special meaning. " "These will soon require '%s' to implement the '%s' interface to " diff --git a/doc/rst/language/spec/iterators.rst b/doc/rst/language/spec/iterators.rst index 3f79b90fd0b1..74bc1c7a6799 100644 --- a/doc/rst/language/spec/iterators.rst +++ b/doc/rst/language/spec/iterators.rst @@ -232,6 +232,7 @@ typically made by iterating over it in a loop. .. BLOCK-test-chapelnoprint + Tree implements writeSerializable; override proc Tree.serialize(writer, ref serializer) { var first = true; diff --git a/modules/dists/BlockCycDist.chpl b/modules/dists/BlockCycDist.chpl index 757e6e54f2bc..a98877184df1 100644 --- a/modules/dists/BlockCycDist.chpl +++ b/modules/dists/BlockCycDist.chpl @@ -182,7 +182,7 @@ executes each iteration on the locale where that iteration's index is mapped to. */ -class BlockCyclic : BaseDist { +class BlockCyclic : BaseDist, writeSerializable { param rank: int; type idxType = int; @@ -447,7 +447,7 @@ proc BlockCyclic.dsiPrivatize(privatizeData) { //////////////////////////////////////////////////////////////////////////////// // BlockCyclic Local Distribution Class // -class LocBlockCyclic { +class LocBlockCyclic : writeSerializable { param rank: int; type idxType; @@ -747,7 +747,7 @@ proc BlockCyclicDom.dsiReprivatize(other, reprivatizeData) { //////////////////////////////////////////////////////////////////////////////// // BlockCyclic Local Domain Class // -class LocBlockCyclicDom { +class LocBlockCyclicDom : writeSerializable { param rank: int; type idxType; param strides: strideKind; @@ -1111,7 +1111,7 @@ iter BlockCyclicDom.dsiLocalSubdomains(loc: locale) { //////////////////////////////////////////////////////////////////////////////// // BlockCyclic Local Array Class // -class LocBlockCyclicArr { +class LocBlockCyclicArr : writeSerializable { type eltType; param rank: int; type idxType; diff --git a/modules/dists/BlockDist.chpl b/modules/dists/BlockDist.chpl index 5063646a68ab..879642b2bf50 100644 --- a/modules/dists/BlockDist.chpl +++ b/modules/dists/BlockDist.chpl @@ -374,7 +374,7 @@ and array: */ pragma "ignore noinit" -record blockDist { +record blockDist : writeSerializable { param rank: int; type idxType = int; type sparseLayoutType = unmanaged DefaultDist; @@ -492,7 +492,7 @@ type Block = blockDist; @chpldoc.nodoc -class BlockImpl : BaseDist { +class BlockImpl : BaseDist, writeSerializable { param rank: int; type idxType = int; var boundingBox: domain(rank, idxType); @@ -582,7 +582,7 @@ class BlockArr: BaseRectangularArr(?) { // locDom: reference to local domain class // myElems: a non-distributed array of local elements // -class LocBlockArr { +class LocBlockArr : writeSerializable { type eltType; param rank: int; type idxType; @@ -2147,7 +2147,7 @@ config param debugBlockScan = false; * suitable for general use since there are races with when the value gets * written to, but safe for single writer, single reader case here. */ -class BoxedSync { +class BoxedSync : writeSerializable { type T; var s: sync int; // int over bool to enable native qthread sync var res: T; diff --git a/modules/dists/CyclicDist.chpl b/modules/dists/CyclicDist.chpl index f997d571ef08..8aeaa87ee732 100644 --- a/modules/dists/CyclicDist.chpl +++ b/modules/dists/CyclicDist.chpl @@ -233,7 +233,7 @@ This distribution has not been tuned for performance. */ pragma "ignore noinit" -record cyclicDist { +record cyclicDist : writeSerializable { param rank: int; type idxType = int; @@ -351,7 +351,7 @@ operator =(ref a: cyclicDist(?), b: cyclicDist(?)) { type Cyclic = cyclicDist; @chpldoc.nodoc -class CyclicImpl: BaseDist { +class CyclicImpl: BaseDist, writeSerializable { param rank: int; type idxType = int; @@ -1231,7 +1231,7 @@ proc CyclicArr.setRADOpt(val=true) { if doRADOpt then setupRADOpt(); } -class LocCyclicArr { +class LocCyclicArr : writeSerializable { type eltType; param rank: int; type idxType; diff --git a/modules/dists/DSIUtil.chpl b/modules/dists/DSIUtil.chpl index 5f24fcd67f17..2f29830c0972 100644 --- a/modules/dists/DSIUtil.chpl +++ b/modules/dists/DSIUtil.chpl @@ -683,7 +683,7 @@ proc bulkCommConvertCoordinate(ind, bView:domain, aView:domain) return result; } -record chpl_PrivatizedDistHelper { +record chpl_PrivatizedDistHelper : writeSerializable { // type instanceType; var _pid:int; // only used when privatized pragma "owned" diff --git a/modules/dists/DimensionalDist2D.chpl b/modules/dists/DimensionalDist2D.chpl index b92bf7e8ab3b..de1ce6a54d30 100644 --- a/modules/dists/DimensionalDist2D.chpl +++ b/modules/dists/DimensionalDist2D.chpl @@ -374,7 +374,7 @@ class DimensionalArr : BaseRectangularArr(?) { unmanaged LocDimensionalArr(eltType, allocDom.locDdescType); } -class LocDimensionalArr { +class LocDimensionalArr : writeSerializable { type eltType; const locDom; // a LocDimensionalDom pragma "local field" pragma "unsafe" diff --git a/modules/dists/HashedDist.chpl b/modules/dists/HashedDist.chpl index cec98317d0ad..27367d2091f3 100644 --- a/modules/dists/HashedDist.chpl +++ b/modules/dists/HashedDist.chpl @@ -115,7 +115,7 @@ The `Hashed` domain map initializer is defined as follows: targetLocales: [] locale = Locales) */ -class Hashed : BaseDist { +class Hashed : BaseDist, writeSerializable { // GENERICS: @@ -572,7 +572,7 @@ class UserMapAssocDom: BaseAssociativeDom { // // the local domain class // -class LocUserMapAssocDom { +class LocUserMapAssocDom : writeSerializable { // GENERICS: @@ -964,7 +964,7 @@ class UserMapAssocArr: AbsBaseArr(?) { // // the local array class // -class LocUserMapAssocArr { +class LocUserMapAssocArr : writeSerializable { // GENERICS: diff --git a/modules/dists/PrivateDist.chpl b/modules/dists/PrivateDist.chpl index 57bc614359db..0a9a7b5981f5 100644 --- a/modules/dists/PrivateDist.chpl +++ b/modules/dists/PrivateDist.chpl @@ -74,7 +74,7 @@ This distribution may perform unnecessary communication between locales. */ -record privateDist { +record privateDist: writeSerializable { forwarding const chpl_distHelp: chpl_PrivatizedDistHelper(unmanaged PrivateImpl); proc init() { @@ -155,7 +155,7 @@ type Private = privateDist; @chpldoc.nodoc -class PrivateImpl: BaseDist { +class PrivateImpl: BaseDist, writeSerializable { override proc dsiNewRectangularDom(param rank: int, type idxType, param strides: strideKind, inds) { for i in inds do diff --git a/modules/dists/ReplicatedDist.chpl b/modules/dists/ReplicatedDist.chpl index 5925d6e3523d..e6ef2087e7bf 100644 --- a/modules/dists/ReplicatedDist.chpl +++ b/modules/dists/ReplicatedDist.chpl @@ -116,7 +116,7 @@ when the initializer encounters an error. pragma "ignore noinit" -record replicatedDist { +record replicatedDist : writeSerializable { forwarding const chpl_distHelp: chpl_PrivatizedDistHelper(unmanaged ReplicatedImpl); proc init(targetLocales: [] locale = Locales, @@ -514,7 +514,7 @@ proc _array.replicand(loc: locale) ref { // // local array class // -class LocReplicatedArr { +class LocReplicatedArr : writeSerializable { // these generic fields let us give types to the other fields easily type eltType; param rank: int; diff --git a/modules/dists/SparseBlockDist.chpl b/modules/dists/SparseBlockDist.chpl index d989318a6fda..dedb2334feb5 100644 --- a/modules/dists/SparseBlockDist.chpl +++ b/modules/dists/SparseBlockDist.chpl @@ -551,7 +551,7 @@ class SparseBlockArr: BaseSparseArr(?) { // locDom: reference to local domain class // myElems: a non-distributed array of local elements // -class LocSparseBlockArr { +class LocSparseBlockArr : writeSerializable { type eltType; param rank: int; type idxType; diff --git a/modules/dists/StencilDist.chpl b/modules/dists/StencilDist.chpl index 3d348fdcd0d8..12670c963a21 100644 --- a/modules/dists/StencilDist.chpl +++ b/modules/dists/StencilDist.chpl @@ -328,7 +328,7 @@ config param disableStencilLazyRAD = defaultDisableLazyRADOpt; */ pragma "ignore noinit" -record stencilDist { +record stencilDist : writeSerializable { param rank: int; type idxType = int; param ignoreFluff = false; @@ -436,7 +436,7 @@ operator =(ref a: stencilDist(?), b: stencilDist(?)) { type Stencil = stencilDist; -class StencilImpl : BaseDist { +class StencilImpl : BaseDist, writeSerializable { param rank: int; type idxType = int; param ignoreFluff: bool; @@ -540,7 +540,7 @@ class StencilArr: BaseRectangularArr(?) { // locDom: reference to local domain class // myElems: a non-distributed array of local elements // -class LocStencilArr { +class LocStencilArr : writeSerializable { type eltType; param rank: int; type idxType; diff --git a/modules/dists/fixDistDocs.perl b/modules/dists/fixDistDocs.perl index 02a7c9c68beb..903ca3b0138f 100755 --- a/modules/dists/fixDistDocs.perl +++ b/modules/dists/fixDistDocs.perl @@ -75,8 +75,19 @@ sub process { } # Skip everything until "class::" or "record::", edit that line and print. + # do skip '.. warning' while () { - if (/^.. (class|record)::/) { + # if the next line is a warning (like an unstable warning), keep it + # note this only handles single line warnings + if (/^.. warning::$/) { + print MOD; + # print the three lines after ''.. warning' + for (1..3) { + my $warningNextLine = ; + print MOD $warningNextLine; + } + } + elsif (/^.. (class|record)::/) { s/ : Base.*//; print MOD; last; diff --git a/modules/internal/Atomics.chpl b/modules/internal/Atomics.chpl index 2ea394f0492a..799b9174bdc1 100644 --- a/modules/internal/Atomics.chpl +++ b/modules/internal/Atomics.chpl @@ -230,7 +230,7 @@ module Atomics { pragma "atomic type" pragma "ignore noinit" - record AtomicBool { + record AtomicBool : writeSerializable { // Support `valType` on atomic bool type and instances for symmetry with // numeric atomics @chpldoc.nodoc @@ -431,7 +431,7 @@ module Atomics { pragma "atomic type" pragma "ignore noinit" - record AtomicT { + record AtomicT : writeSerializable { @chpldoc.nodoc type valType; diff --git a/modules/internal/Bytes.chpl b/modules/internal/Bytes.chpl index d09fda88675d..a49f1491931e 100644 --- a/modules/internal/Bytes.chpl +++ b/modules/internal/Bytes.chpl @@ -413,7 +413,7 @@ module Bytes { } @chpldoc.nodoc - record _bytes { + record _bytes : writeSerializable, readDeserializable { var buffLen: int = 0; // length of string in bytes var buffSize: int = 0; // size of the buffer we own var buff: bufferType = nil; diff --git a/modules/internal/ChapelArray.chpl b/modules/internal/ChapelArray.chpl index 50fdbe0b954b..b34496bb49dc 100644 --- a/modules/internal/ChapelArray.chpl +++ b/modules/internal/ChapelArray.chpl @@ -714,7 +714,7 @@ module ChapelArray { pragma "distribution" pragma "ignore noinit" @chpldoc.nodoc - record _distribution { + record _distribution : writeSerializable, readDeserializable { var _pid:int; // only used when privatized pragma "owned" var _instance; // generic, but an instance of a subclass of BaseDist @@ -958,7 +958,7 @@ module ChapelArray { // the serialize routines to fire, when their where-clause permits. pragma "always RVF" /* The array type */ - record _array { + record _array : writeSerializable, readDeserializable { var _pid:int; // only used when privatized pragma "owned" pragma "alias scope from this" diff --git a/modules/internal/ChapelBase.chpl b/modules/internal/ChapelBase.chpl index fbf96fef773c..4da4182de960 100644 --- a/modules/internal/ChapelBase.chpl +++ b/modules/internal/ChapelBase.chpl @@ -3307,7 +3307,7 @@ module ChapelBase { extern const QIO_TUPLE_FORMAT_JSON:int; // Support for module deinit functions. - class chpl_ModuleDeinit { + class chpl_ModuleDeinit : writeSerializable { const moduleName: c_ptrConst(c_char); // for debugging; non-null, not owned const deinitFun: chpl_c_fn_ptr; // module deinit function const prevModule: unmanaged chpl_ModuleDeinit?; // singly-linked list / LIFO queue diff --git a/modules/internal/ChapelDomain.chpl b/modules/internal/ChapelDomain.chpl index ff4c026c9426..090132c90181 100644 --- a/modules/internal/ChapelDomain.chpl +++ b/modules/internal/ChapelDomain.chpl @@ -1009,7 +1009,7 @@ module ChapelDomain { pragma "domain" pragma "has runtime type" pragma "ignore noinit" - record _domain { + record _domain : writeSerializable, readDeserializable { var _pid:int; // only used when privatized pragma "owned" var _instance; // generic, but an instance of a subclass of BaseDom diff --git a/modules/packages/OrderedMap.chpl b/modules/internal/ChapelIOSerialize.chpl similarity index 64% rename from modules/packages/OrderedMap.chpl rename to modules/internal/ChapelIOSerialize.chpl index 29831a6916b8..0cb32d560c7f 100644 --- a/modules/packages/OrderedMap.chpl +++ b/modules/internal/ChapelIOSerialize.chpl @@ -1,5 +1,6 @@ /* * Copyright 2020-2023 Hewlett Packard Enterprise Development LP + * Copyright 2004-2019 Cray Inc. * Other additional copyright holders may be indicated within. * * The entirety of this work is licensed under the Apache License, @@ -17,9 +18,27 @@ * limitations under the License. */ -@deprecated(notes="The OrderedMap module and the orderedMap type are deprecated in favor of SortedMap and sortedMap") -module OrderedMap { - public use SortedMap; +// ChapelIOSerialize.chpl +// +// IO serialization-related interfaces +module ChapelIOSerialize { + + use ChapelBase; + + // for 'serialize' + interface writeSerializable { + } + + // for 'deserialize' + interface readDeserializable { + } + + // for 'init' that performs deserialization + interface initDeserializable { + } + + // combines previous three + interface serializable { + } - type orderedMap = sortedMap; } diff --git a/modules/internal/ChapelIteratorSupport.chpl b/modules/internal/ChapelIteratorSupport.chpl index f687acb51d1a..9a5a705d3c04 100644 --- a/modules/internal/ChapelIteratorSupport.chpl +++ b/modules/internal/ChapelIteratorSupport.chpl @@ -353,22 +353,6 @@ module ChapelIteratorSupport { return false; } - proc _iteratorRecord.writeThis(f) throws { - var first: bool = true; - for e in this { - if !first then - f.write(" "); - else - first = false; - f.write(e); - } - } - - @chpldoc.nodoc - proc _iteratorRecord.serialize(writer, ref serializer) throws { - writeThis(writer); - } - operator =(ref ic: _iteratorRecord, xs) { for (e, x) in zip(ic, xs) do e = x; diff --git a/modules/internal/ChapelLocale.chpl b/modules/internal/ChapelLocale.chpl index c5263c28a2ba..1085fb3f7927 100644 --- a/modules/internal/ChapelLocale.chpl +++ b/modules/internal/ChapelLocale.chpl @@ -290,7 +290,7 @@ module ChapelLocale { by the corresponding concrete classes. */ @chpldoc.nodoc - class BaseLocale { + class BaseLocale : writeSerializable { //- Constructor @chpldoc.nodoc proc init() { } diff --git a/modules/internal/ChapelStandard.chpl b/modules/internal/ChapelStandard.chpl index bac9dc5c1b71..cc7958c1fd77 100644 --- a/modules/internal/ChapelStandard.chpl +++ b/modules/internal/ChapelStandard.chpl @@ -58,6 +58,7 @@ module ChapelStandard { public use ChapelArray; public use ChapelDistribution; public use ChapelAutoLocalAccess; + public use ChapelIOSerialize; public use ChapelIO as ChapelIO; public use ChapelHashing; public use DefaultAssociative; diff --git a/modules/internal/ChapelSyncvar.chpl b/modules/internal/ChapelSyncvar.chpl index b84086dd970a..905d14bba524 100644 --- a/modules/internal/ChapelSyncvar.chpl +++ b/modules/internal/ChapelSyncvar.chpl @@ -121,7 +121,7 @@ module ChapelSyncvar { pragma "sync" pragma "default intent is ref" @chpldoc.nodoc - record _syncvar { + record _syncvar : writeSerializable, readDeserializable { type valType; // The compiler knows this name var wrapped : getSyncClassType(valType); @@ -812,7 +812,7 @@ module ChapelSyncvar { pragma "single" pragma "default intent is ref" @chpldoc.nodoc - record _singlevar { + record _singlevar : writeSerializable, readDeserializable { type valType; // The compiler knows this name var wrapped : unmanaged _singlecls(valType); diff --git a/modules/internal/DefaultRectangular.chpl b/modules/internal/DefaultRectangular.chpl index e2e7519a8318..075ee9c3c6a4 100644 --- a/modules/internal/DefaultRectangular.chpl +++ b/modules/internal/DefaultRectangular.chpl @@ -1717,6 +1717,26 @@ module DefaultRectangular { rwLiteral("}"); } + proc DefaultRectangularDom.dsiSerialWrite(f) throws + where _supportsSerializers(f) && f.serializerType != IO.defaultSerializer { + if chpl_warnUnstable then + compilerWarning("Serialization of rectangular domains with non-default Serializer is unstable, and may change in the future"); + var ser = f.serializer.startList(f, rank); + for i in 0.."); } + implements writeSerializable(_ddata); proc chpl_taskID_t.writeThis(f) throws { f.write(this : uint(64)); @@ -783,6 +785,7 @@ module ChapelIO { } des.endTuple(); } + implements readDeserializable(_tuple); @chpldoc.nodoc proc const _tuple.serialize(writer, ref serializer) throws { @@ -793,6 +796,31 @@ module ChapelIO { } ser.endTuple(); } + implements writeSerializable(_tuple); + + proc _iteratorRecord.writeThis(f) throws { + var first: bool = true; + for e in this { + if !first then + f.write(" "); + else + first = false; + f.write(e); + } + } + + @chpldoc.nodoc + proc _iteratorRecord.serialize(writer, ref serializer) throws { + if serializer.type == IO.defaultSerializer { + writeThis(writer); + } else { + if chpl_warnUnstable then + compilerWarning("Serialization of iterators with non-default Serializer is unstable, and may change in the future"); + var ser = serializer.startList(writer, -1); + for e in this do ser.writeElement(e); + ser.endList(); + } + } // Moved here to avoid circular dependencies in ChapelRange // Write implementation for ranges @@ -829,8 +857,15 @@ module ChapelIO { @chpldoc.nodoc proc range.serialize(writer, ref serializer) throws { - writeThis(writer); + if serializer.type == defaultSerializer { + writeThis(writer); + } else { + if chpl_warnUnstable then + compilerWarning("Serialization of ranges with non-default Serializer is unstable, and may change in the future"); + writer.write(this:string); + } } + implements writeSerializable(range); @chpldoc.nodoc proc ref range.readThis(f) throws { @@ -846,7 +881,7 @@ module ChapelIO { use strideKind; select strides { when one do if strideVal != 1 then expectedStride = "stride 1"; - when negOne do if strideVal != 1 then expectedStride = "stride -1"; + when negOne do if strideVal != -1 then expectedStride = "stride -1"; when positive do if strideVal < 0 then expectedStride = "a positive"; when negative do if strideVal > 0 then expectedStride = "a negative"; when any do; @@ -855,8 +890,9 @@ module ChapelIO { "for a range with strides=" + strides:string + ", expected " + (if expectedStride.size > 2 then expectedStride + " stride" else expectedStride) + ", got stride ", strideVal:string); + if ! hasParamStride() then - _stride = strideVal; + this = (this by strideVal):this.type; } if f.matchLiteral(" align ") { @@ -865,15 +901,25 @@ module ChapelIO { // It is valid to align any range. In this case we do not store // the alignment at runtime because it always normalizes to 0. } else { - _alignment = chpl__mod(alignVal, _stride); + this = (this align alignVal):this.type; } } } @chpldoc.nodoc proc ref range.deserialize(reader, ref deserializer) throws { - readThis(reader); + if deserializer.type == IO.defaultDeserializer { + readThis(reader); + } else { + if chpl_warnUnstable then + compilerWarning("Deserialization of ranges with non-default Deserializer is unstable, and may change in the future"); + const data = reader.read(string); + var f = openMemFile(); + f.writer().write(data); + readThis(f.reader()); + } } + implements readDeserializable(range); @chpldoc.nodoc proc range.init(type idxType = int, @@ -882,8 +928,9 @@ module ChapelIO { reader: fileReader(?), ref deserializer) throws { this.init(idxType, bounds, strides); - this.readThis(reader); + this.deserialize(reader, deserializer); } + implements initDeserializable(range); @chpldoc.nodoc override proc LocaleModel.writeThis(f) throws { @@ -895,6 +942,7 @@ module ChapelIO { override proc LocaleModel.serialize(writer, ref serializer) throws { writeThis(writer); } + LocaleModel implements writeSerializable; /* Errors can be printed out. In that event, they will show information about the error including the result @@ -909,6 +957,7 @@ module ChapelIO { override proc Error.serialize(writer, ref serializer) throws { writer.write(chpl_describe_error(this)); } + Error implements writeSerializable; /* Equivalent to ``try! stdout.write``. See :proc:`IO.fileWriter.write` */ proc write(const args ...?n) { diff --git a/modules/standard/CommDiagnostics.chpl b/modules/standard/CommDiagnostics.chpl index 509f5b84b8d0..090cec8cdb50 100644 --- a/modules/standard/CommDiagnostics.chpl +++ b/modules/standard/CommDiagnostics.chpl @@ -344,6 +344,8 @@ module CommDiagnostics */ type commDiagnostics = chpl_commDiagnostics; + commDiagnostics implements writeSerializable; + private extern proc chpl_comm_startVerbose(stacktrace: bool, print_unstable: bool); diff --git a/modules/standard/Heap.chpl b/modules/standard/Heap.chpl index 529b426fc4a6..fdec24e92022 100644 --- a/modules/standard/Heap.chpl +++ b/modules/standard/Heap.chpl @@ -89,7 +89,7 @@ module Heap { } } - record heap { + record heap : writeSerializable { /* The type of the elements contained in this heap. */ type eltType; diff --git a/modules/standard/IO.chpl b/modules/standard/IO.chpl index 9ff10fc95efe..9a30d65487b8 100644 --- a/modules/standard/IO.chpl +++ b/modules/standard/IO.chpl @@ -2361,7 +2361,7 @@ private proc defaultSerializeVal(param writing : bool, } @chpldoc.nodoc -class _serializeWrapper { +class _serializeWrapper : writeSerializable { type T; var member: T; // TODO: Needed to avoid a weird memory error in the following test in @@ -3775,7 +3775,7 @@ proc fileWriter.withSerializer(in serializer: ?st) : fileWriter(this._kind, this // represents a Unicode codepoint // used to pass codepoints to read and write to avoid duplicating code @chpldoc.nodoc -record _internalIoChar { +record _internalIoChar : writeSerializable { /* The codepoint value */ var ch:int(32); @chpldoc.nodoc @@ -3849,7 +3849,7 @@ When reading an ioNewline, read routines will skip any character sequence type ioNewline = chpl_ioNewline; @chpldoc.nodoc -record chpl_ioNewline { +record chpl_ioNewline : writeSerializable { /* Normally, we will skip anything at all to get to a ``\n``, but if skipWhitespaceOnly is set, it will be an error @@ -3888,7 +3888,7 @@ will return an error for incorrectly formatted input type ioLiteral = chpl_ioLiteral; @chpldoc.nodoc -record chpl_ioLiteral { +record chpl_ioLiteral : writeSerializable { /* The value of the literal */ var val: string; /* Should read operations using this literal ignore and consume @@ -10642,7 +10642,7 @@ proc _toRegex(x:?t) } @chpldoc.nodoc -class _channel_regex_info { +class _channel_regex_info : writeSerializable { var hasRegex = false; var matchedRegex = false; var releaseRegex = false; diff --git a/modules/standard/List.chpl b/modules/standard/List.chpl index f1225c260dac..d7495561c77b 100644 --- a/modules/standard/List.chpl +++ b/modules/standard/List.chpl @@ -142,7 +142,7 @@ module List { Unlike an array, the set of indices of a list is always `0.. $2.tmp +mv $2.tmp $2 + +sed 's/\.chpl:[0-9]*:/\.chpl:nnnn:/' $2 > $2.tmp +mv $2.tmp $2 diff --git a/test/io/serializers/write-objects.chpl b/test/io/serializers/write-objects.chpl index 07707459b03d..86ae50500ae8 100644 --- a/test/io/serializers/write-objects.chpl +++ b/test/io/serializers/write-objects.chpl @@ -2,25 +2,25 @@ use IO; use List; -class A { +class A : writeSerializable { override proc serialize(writer: fileWriter(?), ref serializer) throws { writer.write("A()"); } } -class B { +class B : writeSerializable { override proc serialize(writer: fileWriter(?), ref serializer) throws { writer.write("B()"); } } -class C { +class C : writeSerializable { override proc serialize(writer: fileWriter(?), ref serializer) throws { writer.write("C()"); } } -class D : C { +class D : C, writeSerializable { override proc serialize(writer: fileWriter(?), ref serializer) throws { writer.write("D()"); } diff --git a/test/io/vass/writeThis-on.chpl b/test/io/vass/writeThis-on.chpl index 8255d0c71dd3..d860e6b2a342 100644 --- a/test/io/vass/writeThis-on.chpl +++ b/test/io/vass/writeThis-on.chpl @@ -1,6 +1,6 @@ // Illustrate the issue by using a customized writeThis method. -class C { +class C : writeSerializable { const home = here.id; override proc serialize(writer, ref serializer) throws { writer.write("here=", here.id, " home=", home); } } diff --git a/test/library/draft/DataFrames/DataFrames.chpl b/test/library/draft/DataFrames/DataFrames.chpl index eeaeba70577f..da4ea6ee9f21 100644 --- a/test/library/draft/DataFrames/DataFrames.chpl +++ b/test/library/draft/DataFrames/DataFrames.chpl @@ -22,7 +22,7 @@ module DataFrames { use Sort; private use IO; - class Index { + class Index : writeSerializable { @chpldoc.nodoc proc contains(lab): bool { halt("generic Index contains no elements"); @@ -86,7 +86,7 @@ module DataFrames { } } - class TypedIndex : Index { + class TypedIndex : Index, writeSerializable { type idxType; // TODO: implement as binary tree @@ -398,7 +398,7 @@ module DataFrames { } } - class TypedSeries : Series { + class TypedSeries : Series, writeSerializable { type eltType; // TODO: ords dmap Block @@ -746,7 +746,7 @@ module DataFrames { } } - class DataFrame { + class DataFrame : writeSerializable { var labels: domain(string); // TODO: array of owned Series diff --git a/test/library/draft/DistributedList/DistributedList.chpl b/test/library/draft/DistributedList/DistributedList.chpl index 165f205caac3..1032872f28ca 100644 --- a/test/library/draft/DistributedList/DistributedList.chpl +++ b/test/library/draft/DistributedList/DistributedList.chpl @@ -49,7 +49,7 @@ module DistributedList { */ - record distributedList { + record distributedList : writeSerializable { type eltType; param blockSize: int; diff --git a/test/library/draft/DistributedMap/DistributedMap.chpl b/test/library/draft/DistributedMap/DistributedMap.chpl index aa77875a3947..c140d2dee15e 100644 --- a/test/library/draft/DistributedMap/DistributedMap.chpl +++ b/test/library/draft/DistributedMap/DistributedMap.chpl @@ -18,7 +18,7 @@ can be accessed concurrently. Alternatively for intra-locale parallelism we can use, for example, ConcurrentMap from the ConcurrentMap package module. */ pragma "always RVF" -record distributedMap { +record distributedMap : writeSerializable, readDeserializable { type keyType; type valType; // privatization id diff --git a/test/library/draft/DistributedMap/v2/DistributedMap.chpl b/test/library/draft/DistributedMap/v2/DistributedMap.chpl index 7d6726e82b62..593eceb4fa20 100644 --- a/test/library/draft/DistributedMap/v2/DistributedMap.chpl +++ b/test/library/draft/DistributedMap/v2/DistributedMap.chpl @@ -28,7 +28,7 @@ module DistributedMap { private use Aggregator; // TODO: document - record distributedMap { + record distributedMap : serializable { type keyType; type valType; @chpldoc.nodoc @@ -68,7 +68,7 @@ module DistributedMap { } // TODO: document type, methods - class distributedMapImpl { + class distributedMapImpl : serializable { /* Type of map keys. */ type keyType; /* Type of map values. */ diff --git a/test/library/draft/DistributedMap/v3/DistributedMap.chpl b/test/library/draft/DistributedMap/v3/DistributedMap.chpl index 4c5eed8618e9..3de05a63a944 100644 --- a/test/library/draft/DistributedMap/v3/DistributedMap.chpl +++ b/test/library/draft/DistributedMap/v3/DistributedMap.chpl @@ -10,7 +10,7 @@ module DistributedMap { private use ChapelLocks; - record distributedMap { + record distributedMap : writeSerializable { type keyType; type valType; @@ -38,7 +38,7 @@ module DistributedMap { } } - class distMapInternal { + class distMapInternal : writeSerializable { type keyType; type valType; diff --git a/test/library/draft/Vector/Vector.chpl b/test/library/draft/Vector/Vector.chpl index 6b912df7130c..b104abd97e5b 100644 --- a/test/library/draft/Vector/Vector.chpl +++ b/test/library/draft/Vector/Vector.chpl @@ -65,7 +65,7 @@ module Vector { "here: ", t:string); } } - record vector { + record vector : writeSerializable, readDeserializable { /* The type of the elements contained in this vector. */ type eltType; /* If `true`, this vector will perform parallel safe operations. */ diff --git a/test/library/packages/HDF5/htable/HTable.chpl b/test/library/packages/HDF5/htable/HTable.chpl index 4a0b4412307b..5bdaaba0a813 100644 --- a/test/library/packages/HDF5/htable/HTable.chpl +++ b/test/library/packages/HDF5/htable/HTable.chpl @@ -168,7 +168,7 @@ module HTable { The `names`, `offsets`, `types` and `sizes` elements are the most relevant and may be passed on directly to the HDF5 routines. */ - record H5MetaTable { + record H5MetaTable : writeSerializable { /* The chplType of the record. */ type R; diff --git a/test/library/packages/Sort/correctness/keyPartEnding.chpl b/test/library/packages/Sort/correctness/keyPartEnding.chpl index aadad91c12a3..90bec0dfdd29 100644 --- a/test/library/packages/Sort/correctness/keyPartEnding.chpl +++ b/test/library/packages/Sort/correctness/keyPartEnding.chpl @@ -1,7 +1,7 @@ use Sort; use List; -record TwoRepeated { +record TwoRepeated : writeSerializable { var first:int; var nFirst:int; var second:int; diff --git a/test/library/packages/Yaml/basic-types.chpl b/test/library/packages/Yaml/basic-types.chpl index d4444190fcb0..1138fb176b28 100644 --- a/test/library/packages/Yaml/basic-types.chpl +++ b/test/library/packages/Yaml/basic-types.chpl @@ -52,7 +52,7 @@ record SimpleRecord { var y : real; } -record CustomizedRecord { +record CustomizedRecord : writeSerializable, initDeserializable { var x : int; var y : real; diff --git a/test/library/packages/Yaml/deserializeByRef.chpl b/test/library/packages/Yaml/deserializeByRef.chpl index cad65f1b6aa4..380e54acb09a 100644 --- a/test/library/packages/Yaml/deserializeByRef.chpl +++ b/test/library/packages/Yaml/deserializeByRef.chpl @@ -1,7 +1,7 @@ use IO, List, Map, FormatHelper; -record A { +record A : serializable { var x: int; var b: B; @@ -36,7 +36,7 @@ record A { } } -record B { +record B : serializable { var t: (int, real); proc serialize(writer, ref serializer) throws { @@ -66,7 +66,7 @@ record B { } } -record myList { +record myList : serializable { var values: list(A); proc ref deserialize(reader: fileReader(?), ref deserializer: reader.deserializerType) { @@ -98,7 +98,7 @@ record myList { writer.write(values); } -record myMap { +record myMap : serializable { var values: map(int, A); proc ref deserialize(reader: fileReader(?), ref deserializer: reader.deserializerType) { diff --git a/test/library/standard/BigInteger/nestedOn.compopts b/test/library/standard/BigInteger/nestedOn.compopts index 931ce292160f..57fe0ed264c4 100644 --- a/test/library/standard/BigInteger/nestedOn.compopts +++ b/test/library/standard/BigInteger/nestedOn.compopts @@ -1 +1 @@ ---remote-value-forwarding -sbigintInitThrows=true +--remote-value-forwarding diff --git a/test/library/standard/IO/formatted/serde_specifier.chpl b/test/library/standard/IO/formatted/serde_specifier.chpl index 292d0a91ffbb..ff028b23e294 100644 --- a/test/library/standard/IO/formatted/serde_specifier.chpl +++ b/test/library/standard/IO/formatted/serde_specifier.chpl @@ -1,6 +1,6 @@ use IO, IO.FormattedIO; -record R { +record R : writeSerializable, readDeserializable { var x: int; proc serialize(writer, ref serializer) throws { diff --git a/test/library/standard/IO/readTo/readUpToType.chpl b/test/library/standard/IO/readTo/readUpToType.chpl index e7d7c3f0bee8..495fee5f46ab 100644 --- a/test/library/standard/IO/readTo/readUpToType.chpl +++ b/test/library/standard/IO/readTo/readUpToType.chpl @@ -1,6 +1,6 @@ use IO; -record xyType { +record xyType : serializable { var x: int; var y: real; } diff --git a/test/library/standard/Map/types/ClassWithMapWithRecord.chpl b/test/library/standard/Map/types/ClassWithMapWithRecord.chpl index b91fafd879fd..2b9cdb173961 100644 --- a/test/library/standard/Map/types/ClassWithMapWithRecord.chpl +++ b/test/library/standard/Map/types/ClassWithMapWithRecord.chpl @@ -49,7 +49,7 @@ use ChapelHashtable; // To preserve this future behavior after map updates, // a snapshot of `map` was taken at the time of this future // creation -record map { +record map : writeSerializable { type keyType; type valType; diff --git a/test/library/standard/MemMove/LowLevelBuffer.chpl b/test/library/standard/MemMove/LowLevelBuffer.chpl index 309a739860f0..8a59b454b2c5 100644 --- a/test/library/standard/MemMove/LowLevelBuffer.chpl +++ b/test/library/standard/MemMove/LowLevelBuffer.chpl @@ -2,7 +2,7 @@ // Example of a low level buffer that wraps _ddata. See #16797. // -record buffer { +record buffer : writeSerializable { type eltType; // TODO: How to make "on this" equivalent to "on this._data"? diff --git a/test/modules/diten/returnClassDiffModule5.chpl b/test/modules/diten/returnClassDiffModule5.chpl index 9088a69995fb..990c71222212 100644 --- a/test/modules/diten/returnClassDiffModule5.chpl +++ b/test/modules/diten/returnClassDiffModule5.chpl @@ -3,7 +3,7 @@ module M1 { private use IO; var a = 1; - class C { + class C : writeSerializable { var b = 2; proc foo() { return a+b; diff --git a/test/multilocale/bharshbarg/onStmtInIntent.chpl b/test/multilocale/bharshbarg/onStmtInIntent.chpl index 13e6b24f7e10..dc9d0791c88c 100644 --- a/test/multilocale/bharshbarg/onStmtInIntent.chpl +++ b/test/multilocale/bharshbarg/onStmtInIntent.chpl @@ -12,7 +12,7 @@ proc alloc() { return ret; } -record R { +record R : writeSerializable { var x : c_ptr(int); var home : locale; diff --git a/test/multilocale/bradc/needMultiLocales/writeThisUsingOn.chpl b/test/multilocale/bradc/needMultiLocales/writeThisUsingOn.chpl index a42ce60f838f..db505f94fb04 100644 --- a/test/multilocale/bradc/needMultiLocales/writeThisUsingOn.chpl +++ b/test/multilocale/bradc/needMultiLocales/writeThisUsingOn.chpl @@ -1,6 +1,6 @@ use Time; -class LocC { +class LocC : writeSerializable { var id: int; override proc serialize(writer, ref serializer) throws { @@ -10,7 +10,7 @@ class LocC { } } -class C { +class C : writeSerializable { var locCs: [LocaleSpace] unmanaged LocC?; proc postinit() { diff --git a/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass1.chpl b/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass1.chpl index 924065831429..0fcf5a0f13c1 100644 --- a/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass1.chpl +++ b/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass1.chpl @@ -4,7 +4,7 @@ config const verbose: bool = true; if n < numLocales || n % numLocales != 0 then halt("the number of locales, ", numLocales, ", does not evenly divide n,", n); -class DistributedArray { +class DistributedArray : writeSerializable { var ndata: range(int); var data: [ndata] int; var others: [0..numLocales-1] unmanaged DistributedArray?; diff --git a/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass2.chpl b/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass2.chpl index eb75c1226d41..7f16f95bac14 100644 --- a/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass2.chpl +++ b/test/multilocale/deitz/needMultiLocales/privateLimitedDistributedArrayClass2.chpl @@ -4,7 +4,7 @@ config const verbose: bool = true; if n < numLocales || n % numLocales != 0 then halt("the number of locales, ", numLocales, ", does not evenly divide n,", n); -class DistributedArray { +class DistributedArray : writeSerializable { var ndata: range(int); var data: [ndata] int; var others: [0..numLocales-1] unmanaged DistributedArray?; diff --git a/test/multilocale/diten/oneOrMoreLocales/1DBlockDistributedJacobi.chpl b/test/multilocale/diten/oneOrMoreLocales/1DBlockDistributedJacobi.chpl index 1ee0b0715e56..0d89b142af54 100644 --- a/test/multilocale/diten/oneOrMoreLocales/1DBlockDistributedJacobi.chpl +++ b/test/multilocale/diten/oneOrMoreLocales/1DBlockDistributedJacobi.chpl @@ -7,7 +7,7 @@ class DistribArrayNode { var arr: [0..size-1] arrType; } -class DistribArray { +class DistribArray : writeSerializable { type arrType; const arrSize: int; const localSize:int = arrSize / numLocales; diff --git a/test/optimizations/deadCodeElimination/elliot/countDeadModules.good b/test/optimizations/deadCodeElimination/elliot/countDeadModules.good index 7f8b280a1b4f..d300456308ef 100644 --- a/test/optimizations/deadCodeElimination/elliot/countDeadModules.good +++ b/test/optimizations/deadCodeElimination/elliot/countDeadModules.good @@ -1 +1 @@ -Removed 28 dead modules. +Removed 29 dead modules. diff --git a/test/parallel/taskPar/sungeun/private.chpl b/test/parallel/taskPar/sungeun/private.chpl index 7474782cd508..7f4989a291df 100644 --- a/test/parallel/taskPar/sungeun/private.chpl +++ b/test/parallel/taskPar/sungeun/private.chpl @@ -7,7 +7,7 @@ use BlockDist, PrivateDist; use Time; -record taskPrivateData { +record taskPrivateData : writeSerializable { var tid: sync chpl_taskID_t = chpl_nullTaskID; var x: int; var y: [0..#numLocales] real; diff --git a/test/release/examples/primers/fileIO.chpl b/test/release/examples/primers/fileIO.chpl index 0f43bbdb284e..7e2974825886 100644 --- a/test/release/examples/primers/fileIO.chpl +++ b/test/release/examples/primers/fileIO.chpl @@ -309,7 +309,7 @@ if example == 0 || example == 6 { writeln("This should be a chunk: {", "\n a", "\n b", "\n}"); } - record MyThing { + record MyThing : writeSerializable { proc serialize(writer, ref serializer) throws { writer.writeln("This should be a chunk: {"); writer.writeln(" a"); diff --git a/test/release/examples/primers/iterators.chpl b/test/release/examples/primers/iterators.chpl index db2ceb9aa946..626eab9bfa4e 100644 --- a/test/release/examples/primers/iterators.chpl +++ b/test/release/examples/primers/iterators.chpl @@ -127,7 +127,7 @@ postorder // Each yield statement returns a node, or equivalently the subtree // rooted at that node. // -class Tree { +class Tree : writeSerializable { var data: string; var left, right: owned Tree?; } diff --git a/test/release/examples/primers/procedures.chpl b/test/release/examples/primers/procedures.chpl index 8352b90ae2f3..927351f75a08 100644 --- a/test/release/examples/primers/procedures.chpl +++ b/test/release/examples/primers/procedures.chpl @@ -82,7 +82,7 @@ writeln(); // we define a new type, ``Point``, and overload the definition of ``+`` // to handle that type. // -record Point { var x, y: real; } +record Point : writeSerializable { var x, y: real; } // Tell how to add two points together. operator Point.+(p1: Point, p2: Point) diff --git a/test/release/examples/primers/specialMethods.chpl b/test/release/examples/primers/specialMethods.chpl index ef2fa7d17f07..0320b60fd6e8 100644 --- a/test/release/examples/primers/specialMethods.chpl +++ b/test/release/examples/primers/specialMethods.chpl @@ -38,7 +38,7 @@ proc ExampleRecord2.secondaryMethod() { } // the corresponding interface. For the ``hash`` method we'll see below, the // appropriate interface is ``hashable``. We can mark ``R`` as implementing // ``hashable`` by including a ``: hashable`` after its name when we declare it. -record R : hashable { +record R : hashable, writeSerializable, readDeserializable { param size: int = 10; var vals: size*int; } diff --git a/test/separate_compilation/serialization/testGenLib.MyMod.good b/test/separate_compilation/serialization/testGenLib.MyMod.good index e3f6cd4db810..48d7a3d852df 100644 --- a/test/separate_compilation/serialization/testGenLib.MyMod.good +++ b/test/separate_compilation/serialization/testGenLib.MyMod.good @@ -29,6 +29,7 @@ 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelArray.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelDistribution.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelAutoLocalAccess.chpl") +2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelIOSerialize.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelHashing.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/DefaultAssociative.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/DefaultSparse.chpl") diff --git a/test/separate_compilation/serialization/testGenLib.OtherMod.good b/test/separate_compilation/serialization/testGenLib.OtherMod.good index 9ef6d7937a36..ed61937cc9d4 100644 --- a/test/separate_compilation/serialization/testGenLib.OtherMod.good +++ b/test/separate_compilation/serialization/testGenLib.OtherMod.good @@ -29,6 +29,7 @@ 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelArray.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelDistribution.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelAutoLocalAccess.chpl") +2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelIOSerialize.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelHashing.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/DefaultAssociative.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/DefaultSparse.chpl") diff --git a/test/separate_compilation/serialization/testGenLib.both.good b/test/separate_compilation/serialization/testGenLib.both.good index 714777c07bbc..cc06a3a61de1 100644 --- a/test/separate_compilation/serialization/testGenLib.both.good +++ b/test/separate_compilation/serialization/testGenLib.both.good @@ -29,6 +29,7 @@ 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelArray.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelDistribution.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelAutoLocalAccess.chpl") +2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelIOSerialize.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/ChapelHashing.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/DefaultAssociative.chpl") 2 { fileTextQuery ("$CHPL_HOME/modules/internal/DefaultSparse.chpl") diff --git a/test/studies/590o/alaska/graph.chpl b/test/studies/590o/alaska/graph.chpl index d82b5ae35669..806680aa9654 100644 --- a/test/studies/590o/alaska/graph.chpl +++ b/test/studies/590o/alaska/graph.chpl @@ -14,7 +14,7 @@ class position{ var y: int; } -class Node { +class Node : writeSerializable { var id: int; var name: string; var pos: unmanaged position = new unmanaged position(-1,-1); @@ -43,7 +43,7 @@ operator Node.<(x: borrowed Node?, y: borrowed Node?) { return x!.name < y!.name; } -class Edge { +class Edge : writeSerializable { var id: int; var src: unmanaged Node; var dst: unmanaged Node; @@ -145,7 +145,7 @@ proc Edge.read(infile: file){ } */ -class UndirectedEdge : Edge { +class UndirectedEdge : Edge, writeSerializable { override proc serialize(writer, ref serializer){ writer.write(src," -- ",dst); } diff --git a/test/studies/amr/lib/level/Level_def.chpl b/test/studies/amr/lib/level/Level_def.chpl index 92b8caee17a7..66bb3951ae96 100644 --- a/test/studies/amr/lib/level/Level_def.chpl +++ b/test/studies/amr/lib/level/Level_def.chpl @@ -22,7 +22,7 @@ private use IO; // cells that will be used by each Grid. //------------------------------------------------------------------- -class Level { +class Level : writeSerializable { var is_complete: bool = false; diff --git a/test/studies/bale/toposort/toposort.chpl b/test/studies/bale/toposort/toposort.chpl index ff8b9719ed77..70c3e8d9898a 100644 --- a/test/studies/bale/toposort/toposort.chpl +++ b/test/studies/bale/toposort/toposort.chpl @@ -394,7 +394,7 @@ class LocalDistributedWorkQueue { } } -class PermutationMap { +class PermutationMap : writeSerializable { type idxType; param rank = 2; var rowDom : domain(1); diff --git a/test/studies/champs/functions.bash b/test/studies/champs/functions.bash index a0ebcc61aca9..d1be0155c57b 100644 --- a/test/studies/champs/functions.bash +++ b/test/studies/champs/functions.bash @@ -87,7 +87,7 @@ function test_run() { local nl=$2 test_start "run $kind" - $CHPL_HOME/util/test/chpl_launchcmd.py ./bin/champs_${CHAMPS_VERSION}_$kind -nl $nl -f $CHAMPS_CFG_PATH/$kind.in 2>&1 >$kind.exec.out.tmp + $CHPL_TEST_LAUNCHCMD ./bin/champs_${CHAMPS_VERSION}_$kind -nl $nl -f $CHAMPS_CFG_PATH/$kind.in 2>&1 >$kind.exec.out.tmp local status=$? cat $kind.exec.out.tmp diff --git a/test/studies/comd/elegant/arrayOfStructs/util/AccumStencilDist.chpl b/test/studies/comd/elegant/arrayOfStructs/util/AccumStencilDist.chpl index e8b93a565cb9..e8cc0caa167a 100644 --- a/test/studies/comd/elegant/arrayOfStructs/util/AccumStencilDist.chpl +++ b/test/studies/comd/elegant/arrayOfStructs/util/AccumStencilDist.chpl @@ -46,7 +46,7 @@ config param debugAccumStencilDistBulkTransfer = false; // config param disableAccumStencilLazyRAD = defaultDisableLazyRADOpt; -class AccumStencil : BaseDist { +class AccumStencil : BaseDist, writeSerializable { param rank: int; type idxType = int; param ignoreFluff: bool; diff --git a/test/studies/hpcc/common/bradc/BradsBlock1D.chpl b/test/studies/hpcc/common/bradc/BradsBlock1D.chpl index 245c02e85ede..5b1b604c5a67 100644 --- a/test/studies/hpcc/common/bradc/BradsBlock1D.chpl +++ b/test/studies/hpcc/common/bradc/BradsBlock1D.chpl @@ -158,7 +158,7 @@ class LocBlock1DDist { // // The global domain class // -class Block1DDom { +class Block1DDom : writeSerializable { // // The index types of the global and local domain portions // @@ -245,7 +245,7 @@ class Block1DDom { // // the local domain class // -class LocBlock1DDom { +class LocBlock1DDom : writeSerializable { // // The index types of the global and local domain portions // @@ -300,7 +300,7 @@ class LocBlock1DDom { // // the global array class // -class Block1DArr { +class Block1DArr : writeSerializable { // // The index types of the global and local domain portions // @@ -404,7 +404,7 @@ class Block1DArr { // // the local array class // -class LocBlock1DArr { +class LocBlock1DArr : writeSerializable { // // The index types of the global and local domain portions // diff --git a/test/studies/hpcc/common/bradc/BradsBlock1DPar-deitzditen.chpl b/test/studies/hpcc/common/bradc/BradsBlock1DPar-deitzditen.chpl index b64b99f47e29..67d5d1abb705 100644 --- a/test/studies/hpcc/common/bradc/BradsBlock1DPar-deitzditen.chpl +++ b/test/studies/hpcc/common/bradc/BradsBlock1DPar-deitzditen.chpl @@ -148,7 +148,7 @@ class LocBlock1DDist { // // The global domain class // -class Block1DDom { +class Block1DDom : writeSerializable { // // The index types of the global and local domain portions // @@ -280,7 +280,7 @@ class Block1DDom { // // the local domain class // -class LocBlock1DDom { +class LocBlock1DDom : writeSerializable { // // The index types of the global and local domain portions // @@ -354,7 +354,7 @@ class LocBlock1DDom { // // the global array class // -class Block1DArr { +class Block1DArr : writeSerializable { // // The index types of the global and local domain portions // @@ -475,7 +475,7 @@ class Block1DArr { // // the local array class // -class LocBlock1DArr { +class LocBlock1DArr : writeSerializable { // // The index types of the global and local domain portions // diff --git a/test/studies/hpcc/common/bradc/BradsBlock1DPar-ideal.chpl b/test/studies/hpcc/common/bradc/BradsBlock1DPar-ideal.chpl index 449221ad1e8c..7253914cac90 100644 --- a/test/studies/hpcc/common/bradc/BradsBlock1DPar-ideal.chpl +++ b/test/studies/hpcc/common/bradc/BradsBlock1DPar-ideal.chpl @@ -14,7 +14,7 @@ enum IteratorType { leader, follower }; // // The distribution class // -class Block1DDist { +class Block1DDist : writeSerializable { // // The distribution's index type and domain's global index type // @@ -165,7 +165,7 @@ class Block1DDist { // // A per-locale local distribution class // -class LocBlock1DDist { +class LocBlock1DDist : writeSerializable { // // The distribution's index type and domain's global index type // @@ -220,7 +220,7 @@ class LocBlock1DDist { // // The global domain class // -class Block1DDom { +class Block1DDom : writeSerializable { // // The index types of the global and local domain portions // @@ -358,7 +358,7 @@ class Block1DDom { // // the local domain class // -class LocBlock1DDom { +class LocBlock1DDom : writeSerializable { // // The index types of the global and local domain portions // @@ -432,7 +432,7 @@ class LocBlock1DDom { // // the global array class // -class Block1DArr { +class Block1DArr : writeSerializable { // // The index types of the global and local domain portions // @@ -542,7 +542,7 @@ class Block1DArr { // // the local array class // -class LocBlock1DArr { +class LocBlock1DArr : writeSerializable { // // The index types of the global and local domain portions // diff --git a/test/studies/hpcc/common/bradc/BradsBlock1DPar.chpl b/test/studies/hpcc/common/bradc/BradsBlock1DPar.chpl index 7526019ee669..cd69e4fef80f 100644 --- a/test/studies/hpcc/common/bradc/BradsBlock1DPar.chpl +++ b/test/studies/hpcc/common/bradc/BradsBlock1DPar.chpl @@ -21,7 +21,7 @@ enum IteratorType { leader, follower }; // // The distribution class // -class Block1DDist { +class Block1DDist : writeSerializable { // GENERICS: @@ -158,7 +158,7 @@ class Block1DDist { // // A per-locale local distribution class // -class LocBlock1DDist { +class LocBlock1DDist : writeSerializable { // GENERICS: @@ -243,7 +243,7 @@ class LocBlock1DDist { // // The global domain class // -class Block1DDom { +class Block1DDom : writeSerializable { // GENERICS: @@ -420,7 +420,7 @@ class Block1DDom { // // the local domain class // -class LocBlock1DDom { +class LocBlock1DDom : writeSerializable { // GENERICS: @@ -511,7 +511,7 @@ class LocBlock1DDom { // // the global array class // -class Block1DArr { +class Block1DArr : writeSerializable { // GENERICS: @@ -636,7 +636,7 @@ class Block1DArr { // // the local array class // -class LocBlock1DArr { +class LocBlock1DArr : writeSerializable { // GENERICS: diff --git a/test/studies/nqueens/nqueens-2-par.chpl b/test/studies/nqueens/nqueens-2-par.chpl index c7be631fba5f..757990b5854c 100644 --- a/test/studies/nqueens/nqueens-2-par.chpl +++ b/test/studies/nqueens/nqueens-2-par.chpl @@ -100,7 +100,7 @@ proc tryQueenInNextRow(board: unmanaged Board): void { // // Record-style value copying can be done with Board.clone(). // -class Board { +class Board : writeSerializable { // size of the board const boardSize: int; diff --git a/test/studies/nqueens/nqueens-2-seq.chpl b/test/studies/nqueens/nqueens-2-seq.chpl index f99eec7affec..f2d504ba84a5 100644 --- a/test/studies/nqueens/nqueens-2-seq.chpl +++ b/test/studies/nqueens/nqueens-2-seq.chpl @@ -79,7 +79,7 @@ proc tryQueenInNextRow(board: unmanaged Board): void { // - remove a queen // (queens must be removed in the LIFO order). // -class Board { +class Board : writeSerializable { // size of the board const boardSize: int; diff --git a/test/studies/programs/linkedList.chpl b/test/studies/programs/linkedList.chpl index 76241d3ea08a..c587841aed75 100644 --- a/test/studies/programs/linkedList.chpl +++ b/test/studies/programs/linkedList.chpl @@ -15,7 +15,7 @@ config const listSize = 10; // Used when populating the list // // A generic linked list class // -class List { +class List : writeSerializable { type eltType; var head: unmanaged Node(eltType)?; diff --git a/test/studies/shootout/submitted/pidigits2.notest b/test/studies/shootout/submitted/pidigits2.notest new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/studies/shootout/submitted/regexredux2.notest b/test/studies/shootout/submitted/regexredux2.notest new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/studies/shootout/submitted/regexredux3.notest b/test/studies/shootout/submitted/regexredux3.notest new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/trivial/deitz/demo/sample1.chpl b/test/trivial/deitz/demo/sample1.chpl index 7e4e046f0741..f541e4be8117 100644 --- a/test/trivial/deitz/demo/sample1.chpl +++ b/test/trivial/deitz/demo/sample1.chpl @@ -1,4 +1,4 @@ -class trio { +class trio : writeSerializable { type elt_type; var x1 : elt_type; diff --git a/test/trivial/deitz/demo/sample1a.chpl b/test/trivial/deitz/demo/sample1a.chpl index 589ddc00c6b0..fafc0f150c2e 100644 --- a/test/trivial/deitz/demo/sample1a.chpl +++ b/test/trivial/deitz/demo/sample1a.chpl @@ -1,4 +1,4 @@ -class trio { +class trio : writeSerializable { var x1; var x2; var x3; diff --git a/test/trivial/deitz/demo/sample1b.chpl b/test/trivial/deitz/demo/sample1b.chpl index 471f34168312..48f5e0875fcd 100644 --- a/test/trivial/deitz/demo/sample1b.chpl +++ b/test/trivial/deitz/demo/sample1b.chpl @@ -1,4 +1,4 @@ -class trio { +class trio : writeSerializable { type elt_type; var x1 : elt_type; diff --git a/test/types/records/generic/allParamMultiInst.chpl b/test/types/records/generic/allParamMultiInst.chpl index d52615eb0f40..bb1ef0c9ee39 100644 --- a/test/types/records/generic/allParamMultiInst.chpl +++ b/test/types/records/generic/allParamMultiInst.chpl @@ -1,4 +1,4 @@ -record R { +record R : writeSerializable { param x: int; param y: int; @@ -7,7 +7,7 @@ record R { } } -record S { +record S : writeSerializable { var r: R(?); param z: int; diff --git a/test/types/tuple/deitz/recordAsTuple/test_tuple_record_implementation16.chpl b/test/types/tuple/deitz/recordAsTuple/test_tuple_record_implementation16.chpl index f9053f8c3387..b084288455ac 100644 --- a/test/types/tuple/deitz/recordAsTuple/test_tuple_record_implementation16.chpl +++ b/test/types/tuple/deitz/recordAsTuple/test_tuple_record_implementation16.chpl @@ -1,4 +1,4 @@ -record mytuple { +record mytuple : writeSerializable { type t1; type t2; var f1 : t1; diff --git a/test/types/tuple/dinan/pining_for_lisp.chpl b/test/types/tuple/dinan/pining_for_lisp.chpl index c158b64d9393..9ed8bce3b7c3 100644 --- a/test/types/tuple/dinan/pining_for_lisp.chpl +++ b/test/types/tuple/dinan/pining_for_lisp.chpl @@ -1,4 +1,4 @@ -class NilClass { } +class NilClass : writeSerializable { } override proc NilClass.serialize(writer, ref serializer) throws { writer.write("nil"); } var gNil = new owned NilClass(); diff --git a/test/types/tuple/dinan/pining_for_lisp_ver2.chpl b/test/types/tuple/dinan/pining_for_lisp_ver2.chpl index 7c5bb0d4baee..1c20a93bd774 100644 --- a/test/types/tuple/dinan/pining_for_lisp_ver2.chpl +++ b/test/types/tuple/dinan/pining_for_lisp_ver2.chpl @@ -1,4 +1,4 @@ -class NilClass { } +class NilClass : writeSerializable { } override proc NilClass.serialize(writer, ref serializer) throws { writer.write("nil"); } var gNil = new owned NilClass(); diff --git a/test/types/type_variables/deitz/part2/test_typevar_record3.chpl b/test/types/type_variables/deitz/part2/test_typevar_record3.chpl index aaf1c9d3af4f..f5f5c8e40c35 100644 --- a/test/types/type_variables/deitz/part2/test_typevar_record3.chpl +++ b/test/types/type_variables/deitz/part2/test_typevar_record3.chpl @@ -4,7 +4,7 @@ class node { var next : unmanaged node(t)?; } -record foo { +record foo : writeSerializable { type t; var length : int; diff --git a/test/types/type_variables/deitz/part2/test_typevar_record4.chpl b/test/types/type_variables/deitz/part2/test_typevar_record4.chpl index 421269b979c5..1ba249f16c0d 100644 --- a/test/types/type_variables/deitz/part2/test_typevar_record4.chpl +++ b/test/types/type_variables/deitz/part2/test_typevar_record4.chpl @@ -4,7 +4,7 @@ class node { var next : unmanaged node(t)?; } -record foo { +record foo : writeSerializable { type t; var length : int; var first : unmanaged node(t)?; diff --git a/test/types/type_variables/deitz/part2/test_typevar_record5.chpl b/test/types/type_variables/deitz/part2/test_typevar_record5.chpl index b74aee8985b1..41df0d126c77 100644 --- a/test/types/type_variables/deitz/part2/test_typevar_record5.chpl +++ b/test/types/type_variables/deitz/part2/test_typevar_record5.chpl @@ -4,7 +4,7 @@ class node { var next : unmanaged node(t)?; } -record foo { +record foo : writeSerializable { type t; var length : int; var first : unmanaged node(t)?; diff --git a/test/types/type_variables/deitz/part2/test_typevar_record6.chpl b/test/types/type_variables/deitz/part2/test_typevar_record6.chpl index 0ad6d84bfefc..fc7450b8775e 100644 --- a/test/types/type_variables/deitz/part2/test_typevar_record6.chpl +++ b/test/types/type_variables/deitz/part2/test_typevar_record6.chpl @@ -4,7 +4,7 @@ class node { var next : unmanaged node(t)?; } -record foo { +record foo : writeSerializable { type t; var length : int; var first : unmanaged node(t)?; diff --git a/test/types/type_variables/deitz/part7/test_stack.chpl b/test/types/type_variables/deitz/part7/test_stack.chpl index 3791daaf7f8a..0d1f73da64b4 100644 --- a/test/types/type_variables/deitz/part7/test_stack.chpl +++ b/test/types/type_variables/deitz/part7/test_stack.chpl @@ -4,7 +4,7 @@ class stack_elt { var next : unmanaged stack_elt(eltType)?; } -record stack { +record stack : writeSerializable { type eltType; var top : unmanaged stack_elt(eltType)?; diff --git a/test/types/type_variables/ferguson/notGenericQ-var.good b/test/types/type_variables/ferguson/notGenericQ-var.good index cf2bbb67ec56..3aa05f5cc183 100644 --- a/test/types/type_variables/ferguson/notGenericQ-var.good +++ b/test/types/type_variables/ferguson/notGenericQ-var.good @@ -1,3 +1 @@ -notGenericQ-var.chpl:4: error: invalid type specifier 'R(?)' -notGenericQ-var.chpl:1: note: type 'R' is not generic -notGenericQ-var.chpl:4: note: did you forget the 'new' keyword? +notGenericQ-var.chpl:4: error: the variable x is marked generic with (?) but the type 'R' is not generic diff --git a/test/unstable/packageModules.chpl b/test/unstable/packageModules.chpl index 162d0278aecb..69fb3c861b53 100644 --- a/test/unstable/packageModules.chpl +++ b/test/unstable/packageModules.chpl @@ -30,8 +30,6 @@ import LockFreeStack; import MPI; import MatrixMarket; import NetCDF; -import OrderedMap; -import OrderedSet; import PeekPoke; import Prefetch; import ProtobufProtocolSupport; diff --git a/test/unstable/packageModules.good b/test/unstable/packageModules.good index 840ccf4d7e9b..03214b5f854f 100644 --- a/test/unstable/packageModules.good +++ b/test/unstable/packageModules.good @@ -1,55 +1,53 @@ -packageModules.chpl:1: warning: AllLocalesBarriers is unstable -packageModules.chpl:2: warning: ArgumentParser is unstable. -packageModules.chpl:3: warning: AtomicObjects is unstable -packageModules.chpl:4: warning: BLAS is unstable -packageModules.chpl:5: warning: BinaryIO module is deprecated; please use the IO module instead -packageModules.chpl:6: warning: Buffers is unstable -packageModules.chpl:7: warning: Channel is unstable -packageModules.chpl:8: warning: ChplFormat module is considered unstable pending naming changes -packageModules.chpl:9: warning: Collection is unstable -packageModules.chpl:10: warning: ConcurrentMap is unstable -packageModules.chpl:11: warning: CopyAggregation is unstable -packageModules.chpl:12: warning: Crypto is unstable -packageModules.chpl:13: warning: Curl is unstable -packageModules.chpl:14: warning: DistributedBag is unstable -packageModules.chpl:15: warning: DistributedDeque is unstable -packageModules.chpl:16: warning: DistributedIters is unstable -packageModules.chpl:17: warning: EpochManager is unstable -packageModules.chpl:18: warning: ExplicitRefCount is unstable -packageModules.chpl:19: warning: FFTW is unstable -packageModules.chpl:20: warning: FunctionalOperations is unstable -packageModules.chpl:21: warning: Futures is unstable -packageModules.chpl:22: warning: HDF5 is unstable -packageModules.chpl:23: warning: HDFS is unstable -packageModules.chpl:24: warning: LAPACK is unstable -packageModules.chpl:25: warning: LinearAlgebra is unstable -packageModules.chpl:26: warning: LinearAlgebraJama is unstable -packageModules.chpl:27: warning: LinkedLists is unstable -packageModules.chpl:28: warning: LockFreeQueue is unstable -packageModules.chpl:29: warning: LockFreeStack is unstable -packageModules.chpl:30: warning: MPI is unstable -packageModules.chpl:31: warning: MatrixMarket is unstable -packageModules.chpl:32: warning: NetCDF is unstable -packageModules.chpl:33: warning: The OrderedMap module and the orderedMap type are deprecated in favor of SortedMap and sortedMap -packageModules.chpl:34: warning: The OrderedSet module and the orderedSet type are deprecated in favor of SortedSet and sortedMap -packageModules.chpl:35: warning: PeekPoke is unstable -packageModules.chpl:36: warning: Prefetch is unstable -packageModules.chpl:37: warning: ProtobufProtocolSupport is unstable -packageModules.chpl:38: warning: RangeChunk is unstable -packageModules.chpl:39: warning: RecordParser is unstable -packageModules.chpl:40: warning: ReplicatedVar is unstable -packageModules.chpl:41: warning: Search is unstable -packageModules.chpl:42: warning: Socket is unstable -packageModules.chpl:43: warning: Sort is unstable -packageModules.chpl:44: warning: SortedMap is unstable -packageModules.chpl:45: warning: SortedSet is unstable -packageModules.chpl:46: warning: TOML is unstable -packageModules.chpl:47: warning: URL is unstable -packageModules.chpl:48: warning: UgniPerfStats is unstable -packageModules.chpl:49: warning: UnitTest is unstable -packageModules.chpl:50: warning: UnorderedAtomics is unstable -packageModules.chpl:51: warning: UnorderedCopy is unstable -packageModules.chpl:52: warning: UnrolledLinkedList is unstable -packageModules.chpl:53: warning: VisualDebug is unstable -packageModules.chpl:54: warning: The YAML module is considered unstable pending various name and design changes. -packageModules.chpl:55: warning: ZMQ is unstable +packageModules.chpl:XX: warning: AllLocalesBarriers is unstable +packageModules.chpl:XX: warning: ArgumentParser is unstable. +packageModules.chpl:XX: warning: AtomicObjects is unstable +packageModules.chpl:XX: warning: BLAS is unstable +packageModules.chpl:XX: warning: BinaryIO module is deprecated; please use the IO module instead +packageModules.chpl:XX: warning: Buffers is unstable +packageModules.chpl:XX: warning: Channel is unstable +packageModules.chpl:XX: warning: ChplFormat module is considered unstable pending naming changes +packageModules.chpl:XX: warning: Collection is unstable +packageModules.chpl:XX: warning: ConcurrentMap is unstable +packageModules.chpl:XX: warning: CopyAggregation is unstable +packageModules.chpl:XX: warning: Crypto is unstable +packageModules.chpl:XX: warning: Curl is unstable +packageModules.chpl:XX: warning: DistributedBag is unstable +packageModules.chpl:XX: warning: DistributedDeque is unstable +packageModules.chpl:XX: warning: DistributedIters is unstable +packageModules.chpl:XX: warning: EpochManager is unstable +packageModules.chpl:XX: warning: ExplicitRefCount is unstable +packageModules.chpl:XX: warning: FFTW is unstable +packageModules.chpl:XX: warning: FunctionalOperations is unstable +packageModules.chpl:XX: warning: Futures is unstable +packageModules.chpl:XX: warning: HDF5 is unstable +packageModules.chpl:XX: warning: HDFS is unstable +packageModules.chpl:XX: warning: LAPACK is unstable +packageModules.chpl:XX: warning: LinearAlgebra is unstable +packageModules.chpl:XX: warning: LinearAlgebraJama is unstable +packageModules.chpl:XX: warning: LinkedLists is unstable +packageModules.chpl:XX: warning: LockFreeQueue is unstable +packageModules.chpl:XX: warning: LockFreeStack is unstable +packageModules.chpl:XX: warning: MPI is unstable +packageModules.chpl:XX: warning: MatrixMarket is unstable +packageModules.chpl:XX: warning: NetCDF is unstable +packageModules.chpl:XX: warning: PeekPoke is unstable +packageModules.chpl:XX: warning: Prefetch is unstable +packageModules.chpl:XX: warning: ProtobufProtocolSupport is unstable +packageModules.chpl:XX: warning: RangeChunk is unstable +packageModules.chpl:XX: warning: RecordParser is unstable +packageModules.chpl:XX: warning: ReplicatedVar is unstable +packageModules.chpl:XX: warning: Search is unstable +packageModules.chpl:XX: warning: Socket is unstable +packageModules.chpl:XX: warning: Sort is unstable +packageModules.chpl:XX: warning: SortedMap is unstable +packageModules.chpl:XX: warning: SortedSet is unstable +packageModules.chpl:XX: warning: TOML is unstable +packageModules.chpl:XX: warning: URL is unstable +packageModules.chpl:XX: warning: UgniPerfStats is unstable +packageModules.chpl:XX: warning: UnitTest is unstable +packageModules.chpl:XX: warning: UnorderedAtomics is unstable +packageModules.chpl:XX: warning: UnorderedCopy is unstable +packageModules.chpl:XX: warning: UnrolledLinkedList is unstable +packageModules.chpl:XX: warning: VisualDebug is unstable +packageModules.chpl:XX: warning: The YAML module is considered unstable pending various name and design changes. +packageModules.chpl:XX: warning: ZMQ is unstable diff --git a/test/unstable/packageModules.prediff b/test/unstable/packageModules.prediff new file mode 100755 index 000000000000..2b5a6de4a213 --- /dev/null +++ b/test/unstable/packageModules.prediff @@ -0,0 +1,4 @@ +#!/bin/bash + +sed "s/packageModules.chpl:[[:digit:]]\+:/packageModules.chpl:XX:/" $2 > $2.prediffed +mv $2.prediffed $2 diff --git a/test/users/shetag/tensor-workaround.chpl b/test/users/shetag/tensor-workaround.chpl index 2e3e7e7d7d4f..05c6ff5f5a74 100644 --- a/test/users/shetag/tensor-workaround.chpl +++ b/test/users/shetag/tensor-workaround.chpl @@ -14,7 +14,7 @@ version of the 1d example code. type elemType = real(64); -class Vector { +class Vector : writeSerializable { var n : int; var d = {1..n}; var a : [d] elemType; diff --git a/test/users/thom/itoverride.chpl b/test/users/thom/itoverride.chpl index 19f27c53be18..f5f79d755ba5 100644 --- a/test/users/thom/itoverride.chpl +++ b/test/users/thom/itoverride.chpl @@ -1,11 +1,11 @@ use IO; -class C +class C : writeSerializable { override proc serialize(writer, ref serializer) throws { writer.write("C"); } } -class SubC : C +class SubC : C, writeSerializable { override proc serialize(writer, ref serializer) throws { writer.write("SubC"); } } diff --git a/test/users/thom/returnGenericLineno/rosslyn.chpl b/test/users/thom/returnGenericLineno/rosslyn.chpl index 7c0b50c0f380..c3c4d456c0be 100644 --- a/test/users/thom/returnGenericLineno/rosslyn.chpl +++ b/test/users/thom/returnGenericLineno/rosslyn.chpl @@ -52,7 +52,7 @@ module Rosslyn } - class BenchmarkFactory + class BenchmarkFactory : writeSerializable { //abstract proc getInstance() : unmanaged Benchmark diff --git a/test/users/thom/returnGenericLineno/strassen.chpl b/test/users/thom/returnGenericLineno/strassen.chpl index 42a8571c625c..291983915366 100644 --- a/test/users/thom/returnGenericLineno/strassen.chpl +++ b/test/users/thom/returnGenericLineno/strassen.chpl @@ -7,7 +7,7 @@ module Strassen private use IO; class StrassenFactory : BenchmarkFactory - { + , writeSerializable { var n : int; override proc getInstance() : unmanaged Strassen // Error message line# wrong @@ -22,7 +22,7 @@ module Strassen } class Strassen : Benchmark - { + , writeSerializable { var n; proc serialize(writer, ref serializer) throws { diff --git a/test/variables/declareVariableGenericType.chpl b/test/variables/declareVariableGenericType.chpl new file mode 100644 index 000000000000..c1c4e2c464bf --- /dev/null +++ b/test/variables/declareVariableGenericType.chpl @@ -0,0 +1,5 @@ +var d1: domain = {1..34}; +writeln(d1); + +var d2: domain(?) = {1..34}; +writeln(d2); diff --git a/test/variables/declareVariableGenericType.good b/test/variables/declareVariableGenericType.good new file mode 100644 index 000000000000..b5405a9b8e44 --- /dev/null +++ b/test/variables/declareVariableGenericType.good @@ -0,0 +1,3 @@ +declareVariableGenericType.chpl:1: warning: please use 'domain(?)' for the type of a generic variable storing any domain +{1..34} +{1..34} diff --git a/util/cron/common-champs.bash b/util/cron/common-champs.bash index f14c973a557e..cf2046c7c01f 100644 --- a/util/cron/common-champs.bash +++ b/util/cron/common-champs.bash @@ -12,14 +12,20 @@ pushd $CHAMPS_COMMON_DIR git pull popd +echo Enabling Cray PE source $CRAY_ENABLE_PE # All CHAMPS testing is currently on a hpe-apollo + +echo Initial list of modules: module list -source $CWD/common-hpe-apollo.bash +module purge + source $CWD/common-perf-hpe-apollo-hdr.bash +module list + module load PrgEnv-gnu module load cray-pmi module load cray-mpich @@ -27,6 +33,17 @@ module load cray-hdf5-parallel module list +# note that this part is similar to common-hpe-apollo.bash, but +# we don't want the module operations in there, nor we can source it +# earlier. Because if we source load-chpl-deps.bash early, we can't +# load PrgEnv-gnu +export CHPL_HOST_PLATFORM=hpe-apollo +export CHPL_TEST_LAUNCHCMD=\$CHPL_HOME/util/test/chpl_launchcmd.py +export CHPL_LAUNCHER_TIMEOUT=pbs +source $CWD/load-base-deps.bash + +module list + # Perf configuration source $CWD/common-perf.bash CHAMPS_PERF_DIR=${CHAMPS_PERF_DIR:-$COMMON_DIR/NightlyPerformance/champs}