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/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 ff803455bea4..c7c27ac26b7c 100644 --- a/modules/dists/PrivateDist.chpl +++ b/modules/dists/PrivateDist.chpl @@ -72,7 +72,7 @@ do not provide some standard domain/array functionality. This distribution may perform unnecessary communication between locales. */ -class Private: BaseDist { +class Private: 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/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/internal/ChapelIOSerialize.chpl b/modules/internal/ChapelIOSerialize.chpl new file mode 100644 index 000000000000..0cb32d560c7f --- /dev/null +++ b/modules/internal/ChapelIOSerialize.chpl @@ -0,0 +1,44 @@ +/* + * 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, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// 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 { + } + +} 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/NetworkAtomics.chpl b/modules/internal/NetworkAtomics.chpl index 04d2d9007be6..a998830e440b 100644 --- a/modules/internal/NetworkAtomics.chpl +++ b/modules/internal/NetworkAtomics.chpl @@ -32,7 +32,7 @@ module NetworkAtomics { pragma "atomic type" pragma "ignore noinit" - record RAtomicBool { + record RAtomicBool : writeSerializable { proc type valType type { return bool; } proc valType type { return bool; } @@ -149,7 +149,7 @@ module NetworkAtomics { pragma "atomic type" pragma "ignore noinit" - record RAtomicT { + record RAtomicT : writeSerializable { type valType; var _v: valType; diff --git a/modules/internal/OwnedObject.chpl b/modules/internal/OwnedObject.chpl index f4894e2e5e37..8d13518772cd 100644 --- a/modules/internal/OwnedObject.chpl +++ b/modules/internal/OwnedObject.chpl @@ -37,7 +37,7 @@ module OwnedObject { pragma "no copy" pragma "copy mutates" pragma "managed pointer" - record _owned { + record _owned : writeSerializable, readDeserializable { type chpl_t; // contained type (class type) // contained pointer (class type) diff --git a/modules/internal/SharedObject.chpl b/modules/internal/SharedObject.chpl index 70a453e63bf0..bd9aa6f1c8f3 100644 --- a/modules/internal/SharedObject.chpl +++ b/modules/internal/SharedObject.chpl @@ -116,7 +116,7 @@ module SharedObject { This is currently implemented with task-safe reference counting. */ pragma "managed pointer" - record _shared { + record _shared : writeSerializable, readDeserializable { type chpl_t; // contained type (class type) // contained pointer (class type) @@ -754,7 +754,7 @@ Weak pointers are implemented using task-safe reference counting. module WeakPointer { use Errors, Atomics, ChapelBase; - record weak { + record weak : writeSerializable { /* The shared class type referenced by this pointer */ type classType; diff --git a/modules/internal/String.chpl b/modules/internal/String.chpl index db62e46d1d26..e15ebed4a91e 100644 --- a/modules/internal/String.chpl +++ b/modules/internal/String.chpl @@ -76,7 +76,7 @@ module String { pragma "plain old data" @chpldoc.nodoc - record byteIndex { + record byteIndex : writeSerializable { @chpldoc.nodoc var _bindex : int; @@ -101,7 +101,7 @@ module String { pragma "plain old data" @chpldoc.nodoc - record codepointIndex { + record codepointIndex : writeSerializable { @chpldoc.nodoc var _cpindex : int; @@ -927,7 +927,7 @@ module String { pragma "ignore noinit" pragma "no default functions" // avoid the default (read|write)This routines @chpldoc.nodoc - record _string { + record _string : writeSerializable { var buffLen: int = 0; // length of string in bytes var buffSize: int = 0; // size of the buffer we own var cachedNumCodepoints: int = 0; diff --git a/modules/internal/localeModels/apu/LocaleModel.chpl b/modules/internal/localeModels/apu/LocaleModel.chpl index e4f1ba7fd480..8220226eb20a 100644 --- a/modules/internal/localeModels/apu/LocaleModel.chpl +++ b/modules/internal/localeModels/apu/LocaleModel.chpl @@ -51,7 +51,7 @@ module LocaleModel { return execution_subloc; // no info needed from full sublocale } - class CPULocale : AbstractLocaleModel { + class CPULocale : AbstractLocaleModel, writeSerializable { const sid: chpl_sublocID_t; const name_: string; diff --git a/modules/internal/localeModels/flat/LocaleModel.chpl b/modules/internal/localeModels/flat/LocaleModel.chpl index 929d8510152d..6bb3c68f25b1 100644 --- a/modules/internal/localeModels/flat/LocaleModel.chpl +++ b/modules/internal/localeModels/flat/LocaleModel.chpl @@ -138,7 +138,7 @@ module LocaleModel { // may overwrite this instance or any of its children to establish a more customized // representation of the system resources. // - class RootLocale : AbstractRootLocale { + class RootLocale : AbstractRootLocale, writeSerializable { const myLocaleSpace: domain(1) = {0..numLocales-1}; pragma "unsafe" diff --git a/modules/internal/localeModels/gpu/LocaleModel.chpl b/modules/internal/localeModels/gpu/LocaleModel.chpl index a5cbc142fedb..284a8e85d33c 100644 --- a/modules/internal/localeModels/gpu/LocaleModel.chpl +++ b/modules/internal/localeModels/gpu/LocaleModel.chpl @@ -211,7 +211,7 @@ module LocaleModel { return execution_subloc; // no info needed from full sublocale } - class GPULocale : AbstractLocaleModel { + class GPULocale : AbstractLocaleModel, writeSerializable { const sid: chpl_sublocID_t; override proc chpl_id() do return try! (parent._value:LocaleModel)._node_id; // top-level node id @@ -376,7 +376,7 @@ module LocaleModel { // may overwrite this instance or any of its children to establish a more customized // representation of the system resources. // - class RootLocale : AbstractRootLocale { + class RootLocale : AbstractRootLocale, writeSerializable { const myLocaleSpace: domain(1) = {0..numLocales-1}; pragma "unsafe" diff --git a/modules/internal/localeModels/numa/LocaleModel.chpl b/modules/internal/localeModels/numa/LocaleModel.chpl index ba14393c2827..8b4dd3c98e24 100644 --- a/modules/internal/localeModels/numa/LocaleModel.chpl +++ b/modules/internal/localeModels/numa/LocaleModel.chpl @@ -56,7 +56,7 @@ module LocaleModel { // // The NUMA sublocale model // - class NumaDomain : AbstractLocaleModel { + class NumaDomain : AbstractLocaleModel, writeSerializable { const sid: chpl_sublocID_t; const ndName: string; // note: locale provides `proc name` @@ -225,7 +225,7 @@ module LocaleModel { // may overwrite this instance or any of its children to establish a more customized // representation of the system resources. // - class RootLocale : AbstractRootLocale { + class RootLocale : AbstractRootLocale, writeSerializable { const myLocaleSpace: domain(1) = {0..numLocales-1}; pragma "unsafe" diff --git a/modules/packages/AtomicObjects.chpl b/modules/packages/AtomicObjects.chpl index 93d6415e5f21..03831d09b1c1 100644 --- a/modules/packages/AtomicObjects.chpl +++ b/modules/packages/AtomicObjects.chpl @@ -351,7 +351,7 @@ prototype module AtomicObjects { should be created by LocalAtomicObject. The object protected by this ABA wrapper can be extracted via 'getObject'. */ - record ABA { + record ABA : serializable { type __ABA_objType; @chpldoc.nodoc var __ABA_ptr : uint(64); @@ -464,7 +464,7 @@ prototype module AtomicObjects { return aba1.__ABA_cnt != aba2.__ABA_cnt || aba1.__ABA_ptr != aba2.__ABA_ptr; } - record AtomicObject { + record AtomicObject : serializable { type objType; // If this atomic instance provides ABA support param hasABASupport : bool; diff --git a/modules/packages/DistributedBag.chpl b/modules/packages/DistributedBag.chpl index 2481dcffddca..31767bde0f50 100644 --- a/modules/packages/DistributedBag.chpl +++ b/modules/packages/DistributedBag.chpl @@ -223,7 +223,7 @@ module DistributedBag { the data structure for maximized performance. */ pragma "always RVF" - record DistBag { + record DistBag : serializable { type eltType; // This is unused, and merely for documentation purposes. See '_value'. diff --git a/modules/packages/EpochManager.chpl b/modules/packages/EpochManager.chpl index 654efc3a88c5..7a307281685d 100644 --- a/modules/packages/EpochManager.chpl +++ b/modules/packages/EpochManager.chpl @@ -421,7 +421,7 @@ module EpochManager { config param VectorGrowthRate : real = 1.5; - class Vector { + class Vector : serializable { type eltType; const growthRate : real; var dom = {0..-1}; diff --git a/modules/packages/LinkedLists.chpl b/modules/packages/LinkedLists.chpl index 516c3ffc1fb9..f51cf75fdd0e 100644 --- a/modules/packages/LinkedLists.chpl +++ b/modules/packages/LinkedLists.chpl @@ -70,7 +70,7 @@ class listNode { :proc:`~LinkedList.destroy` must be called to reclaim any memory used by the list. */ -record LinkedList { +record LinkedList : serializable { /* The type of the data stored in every node. */ diff --git a/modules/packages/Socket.chpl b/modules/packages/Socket.chpl index c07d2e4388e1..40ad6033ead8 100644 --- a/modules/packages/Socket.chpl +++ b/modules/packages/Socket.chpl @@ -116,7 +116,7 @@ proc sys_sockaddr_t.init(in other: sys_sockaddr_t) { IPv4 and IPv6 addresses. ipAddr can be compared using `==` and `!=` operators. */ -record ipAddr { +record ipAddr : writeSerializable { @chpldoc.nodoc var _addressStorage:sys_sockaddr_t; @@ -614,7 +614,7 @@ var event_loop_base:c_ptr(event_base); A record holding reference to a tcp socket bound and listening for connections. */ -record tcpListener { +record tcpListener : writeSerializable { /* File Descriptor Associated with instance */ @@ -998,7 +998,7 @@ proc connect(in host: string, in port: uint(16), family: IPFamily = IPFamily.IPU A record holding reference to a udp socket bound to any available port. */ -record udpSocket { +record udpSocket : writeSerializable { /* File Descriptor Associated with instance */ diff --git a/modules/packages/Sort.chpl b/modules/packages/Sort.chpl index 8b4f6ff07deb..0833043e6ec1 100644 --- a/modules/packages/Sort.chpl +++ b/modules/packages/Sort.chpl @@ -1446,7 +1446,7 @@ module SampleSortHelp { - record SampleBucketizer { + record SampleBucketizer : writeSerializable { type eltType; // filled from 1 to num_buckets_ @@ -2214,7 +2214,7 @@ module TwoArrayPartitioning { } } - record TwoArrayDistSortTask { + record TwoArrayDistSortTask : writeSerializable { var tasks: list(TwoArrayDistSortPerBucketTask); // Create an empty one diff --git a/modules/packages/SortedMap.chpl b/modules/packages/SortedMap.chpl index 19977cfef739..af673bbced34 100644 --- a/modules/packages/SortedMap.chpl +++ b/modules/packages/SortedMap.chpl @@ -86,7 +86,7 @@ module SortedMap { var val; } - record sortedMap { + record sortedMap : writeSerializable { /* Type of sortedMap keys. */ type keyType; /* Type of sortedMap values. */ diff --git a/modules/packages/SortedSet.chpl b/modules/packages/SortedSet.chpl index c962d9ecd7dc..cd63d73655df 100644 --- a/modules/packages/SortedSet.chpl +++ b/modules/packages/SortedSet.chpl @@ -43,7 +43,7 @@ module SortedSet { private use IO; public use Sort only defaultComparator; - record sortedSet { + record sortedSet : writeSerializable { /* The type of the elements contained in this sortedSet. */ type eltType; diff --git a/modules/packages/SortedSet/Treap.chpl b/modules/packages/SortedSet/Treap.chpl index d13a00e8dafd..135e009c52f8 100644 --- a/modules/packages/SortedSet/Treap.chpl +++ b/modules/packages/SortedSet/Treap.chpl @@ -129,7 +129,7 @@ module Treap { } } - record treap { + record treap : writeSerializable { /* The type of the elements contained in this sortedSet.*/ type eltType; diff --git a/modules/packages/TOML.chpl b/modules/packages/TOML.chpl index af1bef55b01e..c23ac6fe005e 100644 --- a/modules/packages/TOML.chpl +++ b/modules/packages/TOML.chpl @@ -578,7 +578,7 @@ module TomlParser { Class to hold various types parsed from input used to recursively hold tables and respective values */ - class Toml { + class Toml : writeSerializable { @chpldoc.nodoc var i: int, @@ -1319,7 +1319,7 @@ module TomlReader { /* Array wrapper */ - class Tokens { + class Tokens : serializable { var A: list(string); proc init(A: list(string)) { diff --git a/modules/packages/UnrolledLinkedList.chpl b/modules/packages/UnrolledLinkedList.chpl index 26f4920c4e9c..6ec2e2577227 100644 --- a/modules/packages/UnrolledLinkedList.chpl +++ b/modules/packages/UnrolledLinkedList.chpl @@ -110,7 +110,7 @@ module UnrolledLinkedList { } }; - record unrolledLinkedList { + record unrolledLinkedList : writeSerializable { /* The type of the elements contained in this unrolledLinkedList. */ type eltType; diff --git a/modules/packages/YAML.chpl b/modules/packages/YAML.chpl index 0f0174e9206e..2f880e1ee965 100644 --- a/modules/packages/YAML.chpl +++ b/modules/packages/YAML.chpl @@ -849,7 +849,7 @@ module YAML { @chpldoc.nodoc var _dummy_yaml_value = new owned YamlValue(); - class YamlValue { + class YamlValue : writeSerializable { @chpldoc.nodoc /* index into a YAML mapping by string */ @@ -925,7 +925,7 @@ module YAML { } } - class YamlMapping: YamlValue { + class YamlMapping: YamlValue, writeSerializable { // TODO: get map(YamlValue, YamlValue) working... @chpldoc.nodoc var _map: map(string, (shared YamlValue, shared YamlValue)); @@ -1017,7 +1017,7 @@ module YAML { } } - class YamlSequence: YamlValue { + class YamlSequence: YamlValue, writeSerializable { @chpldoc.nodoc var _seq: list(shared YamlValue); @@ -1088,7 +1088,7 @@ module YAML { } } - class YamlScalar: YamlValue { + class YamlScalar: YamlValue, writeSerializable { @chpldoc.nodoc var yamlType: YamlScalarType; @chpldoc.nodoc @@ -1207,7 +1207,7 @@ module YAML { } } - class YamlAlias: YamlValue { + class YamlAlias: YamlValue, writeSerializable { @chpldoc.nodoc var _alias: string; @@ -1624,7 +1624,7 @@ module YAML { // Emitter wrapper // ---------------------------------------------------- - class LibYamlEmitter { + class LibYamlEmitter : writeSerializable { var seqStyle: YamlSequenceStyle; var mapStyle: YamlMappingStyle; var scalarStyle: YamlScalarStyle; @@ -1909,7 +1909,7 @@ module YAML { // Parser Wrapper // ---------------------------------------------------- - class LibYamlParser { + class LibYamlParser : writeSerializable { var parser: yaml_parser_t; var event: yaml_event_t; diff --git a/modules/standard/BigInteger.chpl b/modules/standard/BigInteger.chpl index 41ca7efdeac9..3768a012b522 100644 --- a/modules/standard/BigInteger.chpl +++ b/modules/standard/BigInteger.chpl @@ -170,7 +170,7 @@ module BigInteger { } pragma "ignore noinit" - record bigint { + record bigint : writeSerializable { // The underlying GMP C structure pragma "no init" @chpldoc.nodoc diff --git a/modules/standard/CTypes.chpl b/modules/standard/CTypes.chpl index cde556a850e3..fad2cc2433ab 100644 --- a/modules/standard/CTypes.chpl +++ b/modules/standard/CTypes.chpl @@ -150,7 +150,7 @@ module CTypes { pragma "no default functions" pragma "no wide class" pragma "c_ptr class" - class c_ptr { + class c_ptr : writeSerializable { // Similar to _ddata from ChapelBase, but differs // from _ddata because it can never be wide. @@ -203,7 +203,7 @@ module CTypes { pragma "no wide class" pragma "c_ptr class" pragma "c_ptrConst class" - class c_ptrConst { + class c_ptrConst : writeSerializable { /* The type that this pointer points to, which can be queried like so: @@ -258,7 +258,7 @@ module CTypes { */ pragma "c_array record" pragma "default intent is ref if modified" - record c_array { + record c_array : writeSerializable { /* The array element type, which can be queried like so: diff --git a/modules/standard/ChapelIO.chpl b/modules/standard/ChapelIO.chpl index 828448ee01ed..9064cc9cfb03 100644 --- a/modules/standard/ChapelIO.chpl +++ b/modules/standard/ChapelIO.chpl @@ -668,6 +668,7 @@ module ChapelIO { proc locale.serialize(writer, ref serializer) throws { writer.write(this._instance); } + locale implements writeSerializable; @chpldoc.nodoc proc _ddata.writeThis(f) throws { @@ -680,6 +681,7 @@ module ChapelIO { compilerWarning("printing _ddata class"); writer.write("<_ddata class cannot be printed>"); } + 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,7 @@ module ChapelIO { } ser.endTuple(); } + implements writeSerializable(_tuple); // Moved here to avoid circular dependencies in ChapelRange // Write implementation for ranges @@ -831,6 +835,7 @@ module ChapelIO { proc range.serialize(writer, ref serializer) throws { writeThis(writer); } + implements writeSerializable(range); @chpldoc.nodoc proc ref range.readThis(f) throws { @@ -874,6 +879,7 @@ module ChapelIO { proc ref range.deserialize(reader, ref deserializer) throws { readThis(reader); } + implements readDeserializable(range); @chpldoc.nodoc proc range.init(type idxType = int, @@ -884,6 +890,7 @@ module ChapelIO { this.init(idxType, bounds, strides); this.readThis(reader); } + implements initDeserializable(range); @chpldoc.nodoc override proc LocaleModel.writeThis(f) throws { @@ -895,6 +902,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 +917,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..da474b62ea98 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/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/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/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/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 {