diff --git a/doc/API_design/API_example_use.cpp b/doc/API_design/API_example_use.cpp index cdac31541c54370a9a9982b41224cf53b1049dd8..a35146935cf564dea610accee6ad67efdfbe6ce6 100644 --- a/doc/API_design/API_example_use.cpp +++ b/doc/API_design/API_example_use.cpp @@ -6,8 +6,8 @@ void cb_AsyncWriteAdvanceCompleted(std::shared_ptr<adios::Engine> writer) { - std::cout - << "AdvanceAsync() completed. We can modify our zero-copy variables\n"; + std::cout << "AdvanceAsync() completed. We can modify our zero-copy " + "variables\n"; } void cb_AsyncReadAdvanceCompleted(std::shared_ptr<adios::Engine> writer) @@ -73,9 +73,9 @@ int main(int argc, char *argv[]) auto &varNproc = adios.DefineVariable<int>( "nproc", adios::Dims{adios::GLOBAL_VALUE}); // same def for global value adios::Variable<int> &varNparts = adios.DefineVariable<int>( - "Nparts", - adios::Dims{ - adios::LOCAL_VALUE}); // a single-value different on every process + "Nparts", adios::Dims{adios::LOCAL_VALUE}); // a single-value + // different on every + // process adios::Variable<double> &var2D = adios.DefineVariable<double>( "Temperature", adios::Dims{nproc, NX}); // 2D global array, 1D decomposition @@ -215,8 +215,9 @@ int main(int argc, char *argv[]) struct adios::BlockInfo blocks = reader.InquiryVariableBlockInfo( reader, var2D); // get per-writer size info // this is adios1 ADIOS_VARBLOCK - struct adios::Statistics stats = reader.InquiryVariableStat( - reader, var2D, perstepstat, perblockstat); // get min/max statistics + struct adios::Statistics stats = + reader.InquiryVariableStat(reader, var2D, perstepstat, + perblockstat); // get min/max statistics // this is adios1 ADIOS_VARSTAT while (true) @@ -242,9 +243,9 @@ int main(int argc, char *argv[]) reader->Release(); // want to move on to the next available step/item - reader->Advance(adios::NEXT_AVAILABLE); // default - reader->Advance( - adios::LATEST_AVAILABLE); // interested only in the latest data + reader->Advance(adios::NEXT_AVAILABLE); // default + reader->Advance(adios::LATEST_AVAILABLE); // interested only in the + // latest data } // Close file/stream reader->Close(); diff --git a/examples/groupless/basic/reader.cpp b/examples/groupless/basic/reader.cpp index 8ffdbf3e309ca7e7d8f0aa8bd4fa99a2bca70712..1e91476b27d48444819de5f303b1f1dcdf82f576 100644 --- a/examples/groupless/basic/reader.cpp +++ b/examples/groupless/basic/reader.cpp @@ -89,9 +89,9 @@ int main(int argc, char *argv[]) // selection => read whole array std::vector<int> partsV; - bpReader->Read<int>( - "Nparts", - partsV); // read with string name, no selection => read whole array + bpReader->Read<int>("Nparts", + partsV); // read with string name, no selection => + // read whole array (Nwriters == partsV.size()) /* Nice */ @@ -100,8 +100,8 @@ int main(int argc, char *argv[]) varNice = bpReader.InquiryVariable("Nice"); if (varNice == nullptr) - throw std::ios_base::failure( - "ERROR: failed to find variable 'myDoubles' in input file\n"); + throw std::ios_base::failure("ERROR: failed to find variable " + "'myDoubles' in input file\n"); // ? how do we know about the type? std::string varNice->m_Type uint64_t gdim = diff --git a/examples/groupless/basic/writer.cpp b/examples/groupless/basic/writer.cpp index e5e2d620cde5ff20add6f42f2b9df2c70cade226..cbd556ccc1cabf313b470b22fd84da2ca8ca9409 100644 --- a/examples/groupless/basic/writer.cpp +++ b/examples/groupless/basic/writer.cpp @@ -54,9 +54,11 @@ int main(int argc, char *argv[]) "NX"); // global single-value across processes adios::Variable<int> &varNproc = adios.DefineVariable<int>( "nproc", adios::GLOBAL_VALUE); // same def for global value - adios::Variable<int> &varNparts = adios.DefineVariable<int>( - "Nparts", - adios::LOCAL_VALUE); // a single-value different on every process + adios::Variable<int> &varNparts = + adios.DefineVariable<int>("Nparts", + adios::LOCAL_VALUE); // a single-value + // different on + // every process adios::Variable<double> &varNice = adios.DefineVariable<double>( "Nice", {nproc * Nx}); // 1D global array adios::Variable<float> &varRagged = adios.DefineVariable<float>( @@ -74,8 +76,9 @@ int main(int argc, char *argv[]) // if not defined by user, we can change the default settings bpWriterSettings.SetEngine("BP"); // BP is the default engine bpWriterSettings.AddTransport( - "File", "lucky=yes"); // ISO-POSIX file is the default transport - // Passing parameters to the transport + "File", + "lucky=yes"); // ISO-POSIX file is the default transport + // Passing parameters to the transport bpWriterSettings.SetParameters( "have_metadata_file", "yes"); // Passing parameters to the engine diff --git a/examples/groupless/compound/reader.cpp b/examples/groupless/compound/reader.cpp index 31cb19c29ac8d380f06fd350c01f67e327d84802..58a0e1fd69bb18293f1445ab082d2631683132b1 100644 --- a/examples/groupless/compound/reader.cpp +++ b/examples/groupless/compound/reader.cpp @@ -96,9 +96,9 @@ int main(int argc, char *argv[]) // selection => read whole array std::vector<int> partsV; - bpReader->Read<int>( - "Nparts", - partsV); // read with string name, no selection => read whole array + bpReader->Read<int>("Nparts", + partsV); // read with string name, no selection => + // read whole array (Nwriters == partsV.size()) /* Nice */ @@ -123,8 +123,8 @@ int main(int argc, char *argv[]) bpReader.InquiryVariable("Nice", mtype); if (varNice == nullptr) - throw std::ios_base::failure( - "ERROR: failed to find variable 'myDoubles' in input file\n"); + throw std::ios_base::failure("ERROR: failed to find variable " + "'myDoubles' in input file\n"); // ? how do we know about the type? std::string varNice->m_Type uint64_t gdim = diff --git a/examples/groupless/compound/writer.cpp b/examples/groupless/compound/writer.cpp index ae128de75cb2fcd2cca690560c36d982972973cb..f8c105e2f0508cccdf3d5322342afe0dc50c4286 100644 --- a/examples/groupless/compound/writer.cpp +++ b/examples/groupless/compound/writer.cpp @@ -64,9 +64,11 @@ int main(int argc, char *argv[]) "NX"); // global single-value across processes adios::Variable<int> &varNproc = adios.DefineVariable<int>( "nproc", adios::GLOBAL_VALUE); // same def for global value - adios::Variable<int> &varNparts = adios.DefineVariable<int>( - "Nparts", - adios::LOCAL_VALUE); // a single-value different on every process + adios::Variable<int> &varNparts = + adios.DefineVariable<int>("Nparts", + adios::LOCAL_VALUE); // a single-value + // different on + // every process // GSE === template necessary or useful here? Extra argument for // previously-built compound type information */ @@ -85,8 +87,9 @@ int main(int argc, char *argv[]) // if not defined by user, we can change the default settings bpWriterSettings.SetEngine("BP"); // BP is the default engine bpWriterSettings.AddTransport( - "File", "lucky=yes"); // ISO-POSIX file is the default transport - // Passing parameters to the transport + "File", + "lucky=yes"); // ISO-POSIX file is the default transport + // Passing parameters to the transport bpWriterSettings.SetParameters( "have_metadata_file", "yes"); // Passing parameters to the engine diff --git a/examples/groupless/multistep/reader_allsteps.cpp b/examples/groupless/multistep/reader_allsteps.cpp index 94e1d7cc970e19a98c87e4c4cd7b095c00c352a3..1b28a82c72d71e1438c077f6b00ae88aa837a1f6 100644 --- a/examples/groupless/multistep/reader_allsteps.cpp +++ b/examples/groupless/multistep/reader_allsteps.cpp @@ -118,8 +118,8 @@ int main(int argc, char *argv[]) bpReader.InquiryVariable("Nice"); if (varNice == nullptr) - throw std::ios_base::failure( - "ERROR: failed to find variable 'myDoubles' in input file\n"); + throw std::ios_base::failure("ERROR: failed to find variable " + "'myDoubles' in input file\n"); // ? how do we know about the type? std::string varNice->m_Type unsigned long long int gdim = diff --git a/examples/groupless/multistep/reader_stepping.cpp b/examples/groupless/multistep/reader_stepping.cpp index 36f4f7b6bb395a4f3486e677ea301d5f29665993..5328408da4249e62be66d2157a3cdb43a57ae703 100644 --- a/examples/groupless/multistep/reader_stepping.cpp +++ b/examples/groupless/multistep/reader_stepping.cpp @@ -85,8 +85,8 @@ int main(int argc, char *argv[]) // ? how do we know about the type? std::string varNice->m_Type unsigned long long int gdim = - varMyDoubles - ->m_GlobalDimensions[0]; // ?member var or member func? + varMyDoubles->m_GlobalDimensions[0]; // ?member var or + // member func? unsigned long long int ldim = gdim / nproc; unsigned long long int offs = rank * ldim; if (rank == nproc - 1) @@ -114,14 +114,14 @@ int main(int argc, char *argv[]) adios::VARYING_DIMENSION) { throw std::ios_base::failure( - "Unexpected condition: Ragged array's fast dimension " + "Unexpected condition: Ragged array's fast " + "dimension " "is supposed to be VARYING_DIMENSION\n"); } // We have here varRagged->sum_nblocks, nsteps, nblocks[], // global - if (rank < - varRagged - ->nblocks[0]) // same as rank < Nwriters in this example + if (rank < varRagged->nblocks[0]) // same as rank < Nwriters in + // this example { // get per-writer size information varRagged->InquiryBlocks(); @@ -148,7 +148,8 @@ int main(int argc, char *argv[]) 1); // contains the largest std::vector<int> raggedDims = varRagged->GetVaryingGlobalDimensions( - 1); // contains all individual sizes in that dimension + 1); // contains all individual sizes in that + // dimension // promise to not read more from this step bpReader->Release(); diff --git a/examples/groupless/multistep/writer_multistep.cpp b/examples/groupless/multistep/writer_multistep.cpp index 00b4da5da2142803b0eb0cd9f762f294e536074f..696d4bdb636ed422d4872ae043505551a84e05a9 100644 --- a/examples/groupless/multistep/writer_multistep.cpp +++ b/examples/groupless/multistep/writer_multistep.cpp @@ -51,9 +51,11 @@ int main(int argc, char *argv[]) "NX"); // global single-value across processes adios::Variable<int> &varNproc = adios.DefineVariable<int>( "nproc", adios::GLOBAL_VALUE); // same def for global value - adios::Variable<int> &varNparts = adios.DefineVariable<int>( - "Nparts", - adios::LOCAL_VALUE); // a single-value different on every process + adios::Variable<int> &varNparts = + adios.DefineVariable<int>("Nparts", + adios::LOCAL_VALUE); // a single-value + // different on + // every process adios::Variable<double> &varNice = adios.DefineVariable<double>( "Nice", {nproc * Nx}); // 1D global array adios::Variable<float> &varRagged = adios.DefineVariable<float>( @@ -71,8 +73,9 @@ int main(int argc, char *argv[]) // if not defined by user, we can change the default settings bpWriterSettings.SetEngine("BP"); // BP is the default engine bpWriterSettings.AddTransport( - "File", "lucky=yes"); // ISO-POSIX file is the default transport - // Passing parameters to the transport + "File", + "lucky=yes"); // ISO-POSIX file is the default transport + // Passing parameters to the transport bpWriterSettings.SetParameters( "have_metadata_file", "yes"); // Passing parameters to the engine diff --git a/examples/heatTransfer/IO_adios2.cpp b/examples/heatTransfer/IO_adios2.cpp index 846dc912390a5da78f753a9ebca74e18bf7f76ed..ac0567820549d3300ca410c9686fe8552fb9578f 100644 --- a/examples/heatTransfer/IO_adios2.cpp +++ b/examples/heatTransfer/IO_adios2.cpp @@ -71,17 +71,13 @@ IO::~IO() delete ad; } -#if 1 - -void IO::write(int step, const HeatTransfer &ht, const Settings &s, - MPI_Comm comm) +void /*IO::*/ old_style_write(int step, const HeatTransfer &ht, + const Settings &s, MPI_Comm comm) { bpWriter->Write<double>(*varT, ht.data_noghost().data()); bpWriter->Advance(); } -#else - void IO::write(int step, const HeatTransfer &ht, const Settings &s, MPI_Comm comm) { @@ -116,5 +112,3 @@ void IO::write(int step, const HeatTransfer &ht, const Settings &s, bpWriter->Write<double>(*varT, ht.data()); bpWriter->Advance(); } - -#endif // 1 diff --git a/include/ADIOS.h b/include/ADIOS.h index 5086153a2b98aab533e0d8515afcb42d5779cc88..be624488c96a3fb1c8baf00abf41dcbd2d0eecef 100644 --- a/include/ADIOS.h +++ b/include/ADIOS.h @@ -307,8 +307,9 @@ protected: // no const to allow default empty and copy constructors // Variables std::map<std::string, std::pair<std::string, unsigned int>> - m_Variables; ///< Makes variable name unique, key: variable name, value: - /// pair.first = type, pair.second = index in corresponding + m_Variables; ///< Makes variable name unique, key: variable name, + /// value: + /// pair.first = type, pair.second = index in corresponding /// vector of Variable std::vector<std::shared_ptr<Transform>> @@ -324,7 +325,7 @@ protected: // no const to allow default empty and copy constructors */ std::map<std::string, Method> m_Methods; std::set<std::string> m_EngineNames; ///< set used to check Engine name - ///uniqueness in debug mode + /// uniqueness in debug mode /** * @brief Checks for group existence in m_Groups, if failed throws @@ -362,10 +363,10 @@ protected: // no const to allow default empty and copy constructors template <class T> unsigned int GetVariableIndex(const std::string &name) { auto itVariable = m_Variables.find(name); - CheckVariableName( - itVariable, name, - "in call to GetVariable<" + GetType<T>() + - ">, or call to GetVariableCompound if <T> = <compound>\n"); + CheckVariableName(itVariable, name, + "in call to GetVariable<" + GetType<T>() + + ">, or call to GetVariableCompound if <T> = " + "<compound>\n"); return itVariable->second.second; } }; diff --git a/include/capsule/shmem/ShmSystemV.h b/include/capsule/shmem/ShmSystemV.h index 3122ae783559c5ec23063463342b1d3e60fbef78..2e3a14c5b804736b5c2f8d4d5890bc49efde2eba 100644 --- a/include/capsule/shmem/ShmSystemV.h +++ b/include/capsule/shmem/ShmSystemV.h @@ -39,7 +39,7 @@ public: private: char *m_Data = nullptr; ///< reference to a shared memory data buffer - ///created with shmget + /// created with shmget const size_t m_DataSize; ///< size of the allocated shared memory segment key_t m_DataKey; ///< key associated with the data buffer, created with ftok int m_DataShmID; ///< data shared memory buffer id diff --git a/include/core/Method.h b/include/core/Method.h index 58a67348b1e51b73869be3dd4a5239545d486f9d..0576703b6999fed3eea947642f614297c9d8771c 100644 --- a/include/core/Method.h +++ b/include/core/Method.h @@ -51,7 +51,7 @@ public: std::map<std::string, std::string> m_Parameters; ///< method parameters std::vector<std::map<std::string, std::string>> m_TransportParameters; ///< each is a separate Transport containing - ///their + /// their /// own parameters /** diff --git a/include/core/Support.h b/include/core/Support.h index 321f96641e3a3da6c1de5b57d664339898e49f5d..a36476660fb7bf34603aab6d907957ebdf606e32 100644 --- a/include/core/Support.h +++ b/include/core/Support.h @@ -23,9 +23,10 @@ namespace adios struct Support { - static const std::string Version; ///< current ADIOS version - static const std::set<std::string> - HostLanguages; ///< supported languages: C, C++, Fortran, Python, Java + static const std::string Version; ///< current ADIOS version + static const std::set<std::string> HostLanguages; ///< supported languages: + /// C, C++, Fortran, + /// Python, Java static const std::set<std::string> Numbers; static const std::set<std::string> Transports; ///< supported transport methods @@ -35,7 +36,8 @@ struct Support Datatypes; ///< supported data types, key: host language, value: all /// supported types static const std::map<std::string, std::set<std::string>> - DatatypesAliases; ///< all supported int aliases, key: C++ type (e.g. + DatatypesAliases; ///< all supported int aliases, key: C++ type + ///(e.g. /// int), value: aliases to type in key (e.g. int, /// integer) diff --git a/include/core/Variable.h b/include/core/Variable.h index 212dc0da48436fa9e53451d28465634e86cad48f..93acbfc9fe94a05bef0ecc607efad4272fc50f58 100644 --- a/include/core/Variable.h +++ b/include/core/Variable.h @@ -29,7 +29,7 @@ struct TransformData Transform &Operation; ///< pointer to transform object std::map<std::string, std::string> Parameters; ///< transforms parameters std::vector<std::size_t> Size; ///< vector that carries the sizes after a - ///transformation is applied + /// transformation is applied }; /** diff --git a/include/engine/adios1/ADIOS1Writer.h b/include/engine/adios1/ADIOS1Writer.h index 04d70cf5806b4150b03b3e7217076987cca3e5a5..8f41ed432d566e370110775b13e90c051f51a531 100644 --- a/include/engine/adios1/ADIOS1Writer.h +++ b/include/engine/adios1/ADIOS1Writer.h @@ -110,9 +110,9 @@ private: /// when we re-open in ADIOS1 bool m_initialized = false; ///< set to true after calling adios_init() - int64_t m_adios_file = 0; ///< ADIOS1 file handler returned by adios_open() - int64_t m_adios_group = - 0; ///< ADIOS1 group pointer that holds the ADIOS1 variable definitions + int64_t m_adios_file = 0; ///< ADIOS1 file handler returned by adios_open() + int64_t m_adios_group = 0; ///< ADIOS1 group pointer that holds the ADIOS1 + /// variable definitions bool m_IsFileOpen = false; void Init(); diff --git a/include/format/BP1.h b/include/format/BP1.h index 78f67cc056fe7633028ea46e11f9af1487314426..518325ecdbabfa44403bb3306853a101fccdaa82 100644 --- a/include/format/BP1.h +++ b/include/format/BP1.h @@ -36,8 +36,8 @@ namespace format struct BP1Index { std::vector<char> Buffer; ///< metadata variable index, start with 100Kb - std::uint64_t Count = - 0; ///< number of characteristics sets (time and spatial aggregation) + std::uint64_t Count = 0; ///< number of characteristics sets (time and + /// spatial aggregation) const std::uint32_t MemberID; BP1Index(const std::uint32_t memberID) : MemberID{memberID} @@ -59,8 +59,10 @@ struct BP1MetadataSet BP1Index PGIndex = BP1Index(0); ///< single buffer for PGIndex // no priority for now - std::unordered_map<std::string, BP1Index> - VarsIndices; ///< key: variable name, value: bp metadata variable index + std::unordered_map<std::string, BP1Index> VarsIndices; ///< key: variable + /// name, value: bp + /// metadata variable + /// index std::unordered_map<std::string, BP1Index> AttributesIndices; ///< key: /// attribute /// name, value: diff --git a/include/format/BP1Writer.h b/include/format/BP1Writer.h index 3deb008cefe81facf48e7f4925a55eb68727567b..765961978bcb4c5a15040981e342b87ac865e996 100644 --- a/include/format/BP1Writer.h +++ b/include/format/BP1Writer.h @@ -34,12 +34,12 @@ class BP1Writer : public BP1 { public: - unsigned int m_Threads = - 1; ///< number of threads for thread operations in large array (min,max) - unsigned int m_Verbosity = - 0; ///< statistics verbosity, can change if redefined in Engine method. + unsigned int m_Threads = 1; ///< number of threads for thread operations in + /// large array (min,max) + unsigned int m_Verbosity = 0; ///< statistics verbosity, can change if + /// redefined in Engine method. float m_GrowthFactor = 1.5; ///< memory growth factor, can change if - ///redefined in Engine method. + /// redefined in Engine method. const std::uint8_t m_Version = 3; ///< BP format version /** @@ -306,7 +306,8 @@ private: noexcept { const std::size_t characteristicsCountPosition = - buffer.size(); // very important to track as writer is going back to + buffer.size(); // very important to track as writer is going + // back to // this position buffer.insert(buffer.end(), 5, 0); // skip characteristics count(1) + length (4) @@ -355,8 +356,8 @@ private: &characteristicsCounter); // count (1) const std::uint32_t characteristicsLength = buffer.size() - characteristicsCountPosition - 4 - - 1; // remove its own length (4 bytes) + characteristic counter ( 1 - // byte + 1; // remove its own length (4 bytes) + characteristic counter ( + // 1 byte // ) CopyToBuffer(buffer, characteristicsCountPosition + 1, &characteristicsLength); // length diff --git a/source/core/Method.cpp b/source/core/Method.cpp index 1bcd3893358e321ba4706372ea23697642185387..02d1750344feb7fa6b2a5154394a7cb08cb396fd 100644 --- a/source/core/Method.cpp +++ b/source/core/Method.cpp @@ -62,9 +62,9 @@ void Method::AddTransportParameters(const std::string type, { if (mapParameters.count("transport") == 1) { - std::invalid_argument( - "ERROR: transport can't be redefined with \"transport=type\", " - "type must be the first argument\n"); + std::invalid_argument("ERROR: transport can't be redefined with " + "\"transport=type\", " + "type must be the first argument\n"); } } diff --git a/source/engine/adios1/ADIOS1Reader.cpp b/source/engine/adios1/ADIOS1Reader.cpp index 6f8fd564a959a147fe436a0f888651fe0ba8bac8..817b1467cd20482bfc81aca0862f3b71c4600140 100644 --- a/source/engine/adios1/ADIOS1Reader.cpp +++ b/source/engine/adios1/ADIOS1Reader.cpp @@ -27,6 +27,7 @@ ADIOS1Reader::ADIOS1Reader(ADIOS &adios, const std::string name, { Init(); adios_read_init_method(read_method, m_MPIComm, ""); + } ADIOS1Reader::~ADIOS1Reader() { adios_read_finalize_method(read_method); } @@ -173,4 +174,5 @@ void ADIOS1Reader::Init() } } + } // end namespace diff --git a/source/transport/file/FileDescriptor.cpp b/source/transport/file/FileDescriptor.cpp index b95896c93725ee4ca845bb5c6331a5fbfc5f257b..e1c3df9ab69d0ecd027a9ea3af072674e084e5ec 100644 --- a/source/transport/file/FileDescriptor.cpp +++ b/source/transport/file/FileDescriptor.cpp @@ -63,8 +63,8 @@ void FileDescriptor::Open(const std::string name, const std::string accessMode) m_Profiler.m_Timers[0].SetInitialTime(); } - m_FileDescriptor = - open(m_Name.c_str(), O_WRONLY | O_APPEND); // we need to change this + m_FileDescriptor = open(m_Name.c_str(), + O_WRONLY | O_APPEND); // we need to change this if (m_Profiler.m_IsActive == true) {