Skip to content

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
philipwjones committed Oct 3, 2024
1 parent 8d8afce commit 7516da1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions components/omega/src/infra/IOStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int IOStream::finalize(

std::string StreamName = Iter->first;
std::shared_ptr<IOStream> ThisStream = Iter->second;
bool ForceWrite = false;
bool ForceWrite = false;

int Err1 = 0;
if (ThisStream->OnShutdown)
Expand Down Expand Up @@ -237,8 +237,8 @@ bool IOStream::validateAll() {
int IOStream::read(
const std::string &StreamName, // [in] Name of stream
const Clock &ModelClock, // [in] Model clock for time info
Metadata &ReqMetadata, // [inout] global metadata requested from file
bool ForceRead // [in] optional: read even if not time
Metadata &ReqMetadata, // [inout] global metadata requested from file
bool ForceRead // [in] optional: read even if not time
) {
int Err = 0; // default return code

Expand Down
2 changes: 1 addition & 1 deletion components/omega/src/infra/IOStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class IOStream {
int writeStream(
const Clock &ModelClock, ///< [in] Model clock for alarms, time stamp
bool ForceWrite = false, ///< [in] Optional: write even if not time
bool FinalCall = false ///< [in] Optional flag for shutdown
bool FinalCall = false ///< [in] Optional flag for shutdown
);

/// Write all metadata associated with a field
Expand Down
17 changes: 9 additions & 8 deletions components/omega/test/infra/IOStreamTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ int main(int argc, char **argv) {
TestEval("Initialize IOStream test", Err1, ErrRef, Err);

// Retrieve dimension lengths and some mesh info
I4 NCellsSize = Dimension::getDimLengthLocal("NCells");
I4 NVertLevels = Dimension::getDimLengthLocal("NVertLevels");
I4 NCellsSize = Dimension::getDimLengthLocal("NCells");
I4 NVertLevels = Dimension::getDimLengthLocal("NVertLevels");
Decomp *DefDecomp = Decomp::getDefault();
I4 NCellsOwned = DefDecomp->NCellsOwned;
Array1DI4 CellID = DefDecomp->CellID;
Expand Down Expand Up @@ -228,10 +228,11 @@ int main(int argc, char **argv) {

// Overwrite salinity array with values associated with global cell
// ID to test proper indexing of IO
parallelFor( {NCellsSize, NVertLevels}, KOKKOS_LAMBDA(int Cell, int K) {
Salt(Cell, K) = 0.0001_Real*(CellID(Cell) + K);
Test(Cell, K) = Salt(Cell, K);
});
parallelFor(
{NCellsSize, NVertLevels}, KOKKOS_LAMBDA(int Cell, int K) {
Salt(Cell, K) = 0.0001_Real * (CellID(Cell) + K);
Test(Cell, K) = Salt(Cell, K);
});

// Create a stop alarm at 1 year for time stepping
TimeInstant StopTime(&CalGreg, 0002, 1, 1, 0, 0, 0.0);
Expand All @@ -256,13 +257,13 @@ int main(int argc, char **argv) {
Err1 = IOStream::read("RestartRead", *ModelClock, ReqMetadata, ForceRead);
TestEval("Restart force read", Err1, ErrRef, Err);

Err1 = 0;
Err1 = 0;
auto DataReducer = Kokkos::Sum<I4>(Err1);

parallelReduce(
{NCellsOwned, NVertLevels},
KOKKOS_LAMBDA(int Cell, int K, I4 &Err1) {
if (Salt(Cell,K) != Test(Cell,K))
if (Salt(Cell, K) != Test(Cell, K))
++Err1;
},
DataReducer);
Expand Down

0 comments on commit 7516da1

Please sign in to comment.