Skip to content

Commit 80786d8

Browse files
committed
Only run SSC tests if ADIOS2 has been built with SSC
To do this, add .ssc as a possible file ending and enlist it under the file endings.
1 parent 376790f commit 80786d8

8 files changed

Lines changed: 44 additions & 18 deletions

File tree

include/openPMD/IO/Format.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace openPMD
3333
ADIOS1,
3434
ADIOS2,
3535
ADIOS2_SST,
36+
ADIOS2_SSC,
3637
JSON,
3738
DUMMY
3839
};

src/Format.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ namespace openPMD {
5555
}
5656
if (auxiliary::ends_with(filename, ".sst"))
5757
return Format::ADIOS2_SST;
58+
if (auxiliary::ends_with(filename, ".ssc"))
59+
return Format::ADIOS2_SSC;
5860
if (auxiliary::ends_with(filename, ".json"))
5961
return Format::JSON;
6062
if (std::string::npos != filename.find('.') /* extension is provided */ )
@@ -73,6 +75,8 @@ namespace openPMD {
7375
return ".bp";
7476
case Format::ADIOS2_SST:
7577
return ".sst";
78+
case Format::ADIOS2_SSC:
79+
return ".ssc";
7680
case Format::JSON:
7781
return ".json";
7882
default:

src/IO/AbstractIOHandlerHelper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ namespace openPMD
5757
case Format::ADIOS2_SST:
5858
return std::make_shared< ADIOS2IOHandler >(
5959
path, access, comm, std::move( optionsJson ), "sst" );
60+
case Format::ADIOS2_SSC:
61+
return std::make_shared< ADIOS2IOHandler >(
62+
path, access, comm, std::move( optionsJson ), "ssc" );
6063
default:
6164
throw std::runtime_error(
6265
"Unknown file format! Did you specify a file ending?" );
@@ -89,6 +92,9 @@ namespace openPMD
8992
case Format::ADIOS2_SST:
9093
return std::make_shared< ADIOS2IOHandler >(
9194
path, access, std::move( optionsJson ), "sst" );
95+
case Format::ADIOS2_SSC:
96+
return std::make_shared< ADIOS2IOHandler >(
97+
path, access, std::move( optionsJson ), "ssc" );
9298
#endif // openPMD_HAVE_ADIOS2
9399
case Format::JSON:
94100
return std::make_shared< JSONIOHandler >( path, access );

src/Series.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,7 @@ namespace
11871187
case Format::ADIOS1:
11881188
case Format::ADIOS2:
11891189
case Format::ADIOS2_SST:
1190+
case Format::ADIOS2_SSC:
11901191
case Format::JSON:
11911192
return auxiliary::replace_last(filename, suffix(f), "");
11921193
default:
@@ -1238,6 +1239,16 @@ namespace
12381239
nameReg += + ")" + postfix + ".sst$";
12391240
return buildMatcher(nameReg);
12401241
}
1242+
case Format::ADIOS2_SSC:
1243+
{
1244+
std::string nameReg = "^" + prefix + "([[:digit:]]";
1245+
if( padding != 0 )
1246+
nameReg += "{" + std::to_string(padding) + "}";
1247+
else
1248+
nameReg += "+";
1249+
nameReg += + ")" + postfix + ".ssc$";
1250+
return buildMatcher(nameReg);
1251+
}
12411252
case Format::JSON: {
12421253
std::string nameReg = "^" + prefix + "([[:digit:]]";
12431254
if (padding != 0)

src/config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ openPMD::getFileExtensions()
5252
#ifdef ADIOS2_HAVE_SST
5353
fext.emplace_back("sst");
5454
#endif
55+
#ifdef ADIOS2_HAVE_SSC
56+
fext.emplace_back("ssc");
57+
#endif
5558
#if openPMD_HAVE_HDF5
5659
fext.emplace_back("h5");
5760
#endif

test/ParallelIOTest.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,13 @@ TEST_CASE( "parallel_adios2_json_config", "[parallel][adios2]" )
10221022
void
10231023
adios2_ssc()
10241024
{
1025+
auto const extensions = openPMD::getFileExtensions();
1026+
if( std::find( extensions.begin(), extensions.end(), "ssc" ) ==
1027+
extensions.end() )
1028+
{
1029+
// SSC engine not available in ADIOS2
1030+
return;
1031+
}
10251032
int global_size{ -1 };
10261033
int global_rank{ -1 };
10271034
MPI_Comm_size( MPI_COMM_WORLD, &global_size );
@@ -1047,23 +1054,13 @@ adios2_ssc()
10471054

10481055
constexpr size_t extent = 10;
10491056

1050-
std::string options = R"(
1051-
{
1052-
"adios2": {
1053-
"engine": {
1054-
"type": "ssc"
1055-
}
1056-
}
1057-
})";
1058-
10591057
if( color == 0 )
10601058
{
10611059
// write
10621060
Series writeSeries(
1063-
"../samples/adios2_stream.bp",
1061+
"../samples/adios2_stream.ssc",
10641062
Access::CREATE,
1065-
local_comm,
1066-
options );
1063+
local_comm );
10671064
auto iterations = writeSeries.writeIterations();
10681065
for( size_t i = 0; i < 10; ++i )
10691066
{
@@ -1082,10 +1079,9 @@ adios2_ssc()
10821079
{
10831080
// read
10841081
Series readSeries(
1085-
"../samples/adios2_stream.bp",
1082+
"../samples/adios2_stream.ssc",
10861083
Access::READ_ONLY,
1087-
local_comm,
1088-
options );
1084+
local_comm );
10891085

10901086
size_t last_iteration_index = 0;
10911087
for( auto iteration : readSeries.readIterations() )

test/SerialIOTest.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ using namespace openPMD;
3030
std::vector< std::string > testedFileExtensions()
3131
{
3232
auto allExtensions = getFileExtensions();
33-
auto newEnd =
34-
std::remove( allExtensions.begin(), allExtensions.end(), "sst" );
33+
auto newEnd = std::remove_if(
34+
allExtensions.begin(),
35+
allExtensions.end(),
36+
[]( std::string const & ext )
37+
{ return ext == "sst" || ext == "ssc"; } );
3538
return { allExtensions.begin(), newEnd };
3639
}
3740

test/python/unittest/API/APITest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323

2424
from TestUtilities.TestUtilities import generateTestFilePath
2525

26-
tested_file_extensions = [ext for ext in io.file_extensions if ext != 'sst']
26+
tested_file_extensions = [
27+
ext for ext in io.file_extensions if ext != 'sst' and ext != 'ssc'
28+
]
2729

2830

2931
class APITest(unittest.TestCase):

0 commit comments

Comments
 (0)