diff --git a/source/adios2/toolkit/transport/file/FileDaos.cpp b/source/adios2/toolkit/transport/file/FileDaos.cpp index 05b4c4ad30..ab4f20df7f 100644 --- a/source/adios2/toolkit/transport/file/FileDaos.cpp +++ b/source/adios2/toolkit/transport/file/FileDaos.cpp @@ -350,7 +350,7 @@ void FileDaos::SetParameters(const Params ¶ms) // If neither config mechanisms are available then an error is thrown { - auto param = params.find("SingleProcess"); + auto param = params.find("singleprocess"); if (param != params.end()) { std::string singleProc = param->second; diff --git a/source/adios2/toolkit/transport/file/FileIME.cpp b/source/adios2/toolkit/transport/file/FileIME.cpp index 90f979854e..0adbc6c664 100644 --- a/source/adios2/toolkit/transport/file/FileIME.cpp +++ b/source/adios2/toolkit/transport/file/FileIME.cpp @@ -124,16 +124,11 @@ void FileIME::Open(const std::string &name, const Mode openMode, void FileIME::SetParameters(const Params ¶meters) { - for (const auto &pair : parameters) + auto param = params.find("synctopfs"); + if (param != params.end()) { - const std::string key = helper::LowerCase(pair.first); - const std::string value = helper::LowerCase(pair.second); - - if (key == "synctopfs") - { - m_SyncToPFS = - helper::StringTo(value, " in Parameter key=SyncToPFS"); - } + m_SyncToPFS = + helper::StringTo(value, " in Parameter key=SyncToPFS"); } } diff --git a/source/adios2/toolkit/transportman/TransportMan.cpp b/source/adios2/toolkit/transportman/TransportMan.cpp index a243a38e6d..4c81b218fb 100644 --- a/source/adios2/toolkit/transportman/TransportMan.cpp +++ b/source/adios2/toolkit/transportman/TransportMan.cpp @@ -110,10 +110,10 @@ void TransportMan::OpenFiles(const std::vector &fileNames, { for (size_t i = 0; i < fileNames.size(); ++i) { - const Params ¶meters = parametersVector[i]; - const std::string type = parameters.at("transport"); + const Params ¶meters = helper::LowerCaseParams(parametersVector[i]); + const std::string type = helper::LowerCase(parameters.at("transport")); - if (type == "File" || type == "file") + if (type == "file") { std::shared_ptr file = OpenFileTransport( fileNames[i], openMode, parameters, profile, false, m_Comm); @@ -129,10 +129,10 @@ void TransportMan::OpenFiles(const std::vector &fileNames, { for (size_t i = 0; i < fileNames.size(); ++i) { - const Params ¶meters = parametersVector[i]; - const std::string type = parameters.at("transport"); + const Params ¶meters = helper::LowerCaseParams(parametersVector[i]); + const std::string type = helper::LowerCase(parameters.at("transport")); - if (type == "File" || type == "file") + if (type == "file") { std::shared_ptr file = OpenFileTransport( fileNames[i], openMode, parameters, profile, true, chainComm); @@ -146,7 +146,8 @@ void TransportMan::OpenFileID(const std::string &name, const size_t id, const bool profile) { std::shared_ptr file = - OpenFileTransport(name, mode, parameters, profile, false, m_Comm); + OpenFileTransport(name, mode, helper::LowerCaseParams(parameters), + profile, false, m_Comm); m_Transports.insert({id, file}); } @@ -509,7 +510,8 @@ bool TransportMan::FileExists(const std::string &name, const Params ¶meters, try { std::shared_ptr file = OpenFileTransport( - name, Mode::Read, parameters, profile, false, m_Comm); + name, Mode::Read, helper::LowerCaseParams(parameters), profile, + false, m_Comm); exists = true; file->Close(); } @@ -524,10 +526,11 @@ std::shared_ptr TransportMan::OpenFileTransport( const std::string &fileName, const Mode openMode, const Params ¶meters, const bool profile, const bool useComm, const helper::Comm &chainComm) { + // This function expects Params with lower case keys!!! + auto lf_GetBuffered = [&](const std::string bufferedDefault) -> bool { bool bufferedValue; std::string bufferedValueStr(bufferedDefault); - helper::SetParameterValue("Buffered", parameters, bufferedValueStr); helper::SetParameterValue("buffered", parameters, bufferedValueStr); { std::stringstream ss(bufferedValueStr); @@ -562,7 +565,7 @@ std::shared_ptr TransportMan::OpenFileTransport( } } #ifndef _WIN32 - else if (library == "POSIX" || library == "posix") + else if (library == "posix") { transport = std::make_shared(m_Comm); if (lf_GetBuffered("false")) @@ -574,7 +577,7 @@ std::shared_ptr TransportMan::OpenFileTransport( } #endif #ifdef ADIOS2_HAVE_DAOS - else if (library == "Daos" || library == "daos") + else if (library == "daos") { transport = std::make_shared(m_Comm); if (lf_GetBuffered("false")) @@ -586,12 +589,12 @@ std::shared_ptr TransportMan::OpenFileTransport( } #endif #ifdef ADIOS2_HAVE_IME - else if (library == "IME" || library == "ime") + else if (library == "ime") { transport = std::make_shared(m_Comm); } #endif - else if (library == "NULL" || library == "null") + else if (library == "null") { transport = std::make_shared(m_Comm); if (lf_GetBuffered("false")) @@ -612,7 +615,6 @@ std::shared_ptr TransportMan::OpenFileTransport( auto lf_GetLibrary = [](const std::string defaultLibrary, const Params ¶meters) -> std::string { std::string library(defaultLibrary); - helper::SetParameterValue("Library", parameters, library); helper::SetParameterValue("library", parameters, library); return library; }; @@ -620,7 +622,6 @@ std::shared_ptr TransportMan::OpenFileTransport( auto lf_GetTimeUnits = [&](const std::string defaultTimeUnit, const Params ¶meters) -> TimeUnit { std::string profileUnits(defaultTimeUnit); - helper::SetParameterValue("ProfileUnits", parameters, profileUnits); helper::SetParameterValue("profileunits", parameters, profileUnits); return helper::StringToTimeUnit(profileUnits); }; @@ -628,7 +629,6 @@ std::shared_ptr TransportMan::OpenFileTransport( auto lf_GetAsyncOpen = [&](const std::string defaultAsync, const Params ¶meters) -> bool { std::string AsyncOpen = defaultAsync; - helper::SetParameterValue("AsyncOpen", parameters, AsyncOpen); helper::SetParameterValue("asyncopen", parameters, AsyncOpen); return helper::StringTo(AsyncOpen, ""); }; @@ -636,14 +636,15 @@ std::shared_ptr TransportMan::OpenFileTransport( auto lf_GetDirectIO = [&](const std::string defaultValue, const Params ¶meters) -> bool { std::string directio = defaultValue; - helper::SetParameterValue("DirectIO", parameters, directio); + helper::SetParameterValue("directio", parameters, directio); return helper::StringTo(directio, ""); }; // BODY OF FUNCTION starts here std::shared_ptr transport; - lf_SetFileTransport(lf_GetLibrary(DefaultFileLibrary, parameters), - transport); + const std::string library = + helper::LowerCase(lf_GetLibrary(DefaultFileLibrary, parameters)); + lf_SetFileTransport(library, transport); // Default or user ProfileUnits in parameters if (profile)