Skip to content

Commit 261ac39

Browse files
committed
Undo unnecessary whitespace changes
1 parent d08ffbb commit 261ac39

File tree

2 files changed

+50
-50
lines changed

2 files changed

+50
-50
lines changed

include/openPMD/IO/ADIOS/ADIOS2IOHandler.hpp

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,8 @@ namespace detail
13261326
*/
13271327
bool finalized = false;
13281328

1329-
void configure_IO( ADIOS2IOHandlerImpl & impl );
1329+
void
1330+
configure_IO( ADIOS2IOHandlerImpl & impl );
13301331

13311332
using AttributeLayout = ADIOS2IOHandlerImpl::AttributeLayout;
13321333
inline AttributeLayout attributeLayout() const
@@ -1337,37 +1338,35 @@ namespace detail
13371338
}
13381339
};
13391340

1340-
} // namespace detail
1341+
} // namespace detail
13411342
#endif // openPMD_HAVE_ADIOS2
13421343

1343-
class ADIOS2IOHandler : public AbstractIOHandler
1344-
{
1344+
class ADIOS2IOHandler : public AbstractIOHandler
1345+
{
13451346
#if openPMD_HAVE_ADIOS2
13461347

1347-
friend class ADIOS2IOHandlerImpl;
1348+
friend class ADIOS2IOHandlerImpl;
13481349

1349-
private:
1350-
ADIOS2IOHandlerImpl m_impl;
1350+
private:
1351+
ADIOS2IOHandlerImpl m_impl;
13511352

1352-
public:
1353-
~ADIOS2IOHandler() override
1353+
public:
1354+
~ADIOS2IOHandler( ) override
1355+
{
1356+
// we must not throw in a destructor
1357+
try
13541358
{
1355-
// we must not throw in a destructor
1356-
try
1357-
{
1358-
this->flush();
1359-
}
1360-
catch( std::exception const & ex )
1361-
{
1362-
std::cerr << "[~ADIOS2IOHandler] An error occurred: "
1363-
<< ex.what() << std::endl;
1364-
}
1365-
catch( ... )
1366-
{
1367-
std::cerr << "[~ADIOS2IOHandler] An error occurred."
1368-
<< std::endl;
1369-
}
1359+
this->flush( );
13701360
}
1361+
catch( std::exception const & ex )
1362+
{
1363+
std::cerr << "[~ADIOS2IOHandler] An error occurred: " << ex.what() << std::endl;
1364+
}
1365+
catch( ... )
1366+
{
1367+
std::cerr << "[~ADIOS2IOHandler] An error occurred." << std::endl;
1368+
}
1369+
}
13711370

13721371
#else
13731372
public:
@@ -1393,5 +1392,5 @@ namespace detail
13931392
std::string backendName() const override { return "ADIOS2"; }
13941393

13951394
std::future< void > flush() override;
1396-
}; // ADIOS2IOHandler
1397-
} // namespace openPMD
1395+
}; // ADIOS2IOHandler
1396+
} // namespace openPMD

src/IO/ADIOS/ADIOS2IOHandler.cpp

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ ADIOS2IOHandlerImpl::availableChunks(
900900
adios2::Mode
901901
ADIOS2IOHandlerImpl::adios2AccessMode( std::string const & fullPath )
902902
{
903-
switch( m_handler->m_backendAccess )
903+
switch ( m_handler->m_backendAccess )
904904
{
905905
case Access::CREATE:
906906
return adios2::Mode::Write;
@@ -2539,29 +2539,30 @@ namespace detail
25392539
ADIOS2Defaults::str_usesstepsAttribute, 1 );
25402540
switch( mode )
25412541
{
2542-
case AdvanceMode::ENDSTEP: {
2543-
/*
2544-
* Advance mode write:
2545-
* Close the current step, defer opening the new step
2546-
* until one is actually needed:
2547-
* (1) The engine is accessed in BufferedActions::flush
2548-
* (2) A new step is opened before the currently active step
2549-
* has seen an access. See the following lines: open the
2550-
* step just to skip it again.
2551-
*/
2552-
if( streamStatus == StreamStatus::OutsideOfStep )
2542+
case AdvanceMode::ENDSTEP:
25532543
{
2554-
getEngine().BeginStep();
2555-
}
2556-
flush(
2557-
[]( BufferedActions &, adios2::Engine & eng ) {
2558-
eng.EndStep();
2559-
},
2560-
/* writeAttributes = */ true,
2561-
/* flushUnconditionally = */ true );
2562-
uncommittedAttributes.clear();
2563-
streamStatus = StreamStatus::OutsideOfStep;
2564-
return AdvanceStatus::OK;
2544+
/*
2545+
* Advance mode write:
2546+
* Close the current step, defer opening the new step
2547+
* until one is actually needed:
2548+
* (1) The engine is accessed in BufferedActions::flush
2549+
* (2) A new step is opened before the currently active step
2550+
* has seen an access. See the following lines: open the
2551+
* step just to skip it again.
2552+
*/
2553+
if( streamStatus == StreamStatus::OutsideOfStep )
2554+
{
2555+
getEngine().BeginStep();
2556+
}
2557+
flush(
2558+
[]( BufferedActions &, adios2::Engine & eng ) {
2559+
eng.EndStep();
2560+
},
2561+
/* writeAttributes = */ true,
2562+
/* flushUnconditionally = */ true );
2563+
uncommittedAttributes.clear();
2564+
streamStatus = StreamStatus::OutsideOfStep;
2565+
return AdvanceStatus::OK;
25652566
}
25662567
case AdvanceMode::BEGINSTEP:
25672568
{
@@ -2604,7 +2605,7 @@ namespace detail
26042605
invalidateVariablesMap();
26052606
return res;
26062607
}
2607-
}
2608+
}
26082609
throw std::runtime_error(
26092610
"Internal error: Advance mode should be explicitly"
26102611
" chosen by the front-end." );

0 commit comments

Comments
 (0)