Skip to content
Snippets Groups Projects
Commit 5dbd252d authored by William F Godoy's avatar William F Godoy
Browse files

Fixing a bug in BP1Base root name

parent 1a94a9a4
No related branches found
No related tags found
1 merge request!233Fixing a bug in BP1Base root name
......@@ -11,6 +11,9 @@
#include "BP1Base.h"
#include "BP1Base.tcc"
#include <iostream>
#include "adios2/ADIOSTypes.h" //PathSeparator
#include "adios2/helper/adiosFunctions.h" //CreateDirectory, StringToTimeUnit
namespace adios2
......@@ -111,10 +114,15 @@ BP1Base::GetBPNames(const std::vector<std::string> &baseNames) const noexcept
const int rank) -> std::string {
const std::string bpBaseName = AddExtension(baseName, ".bp");
// path/root.bp.dir/root.bp.rank
const std::string bpRootName =
bpBaseName.substr(bpBaseName.find_last_of(PathSeparator));
std::string bpRootName = bpBaseName;
const auto lastPathSeparator(bpBaseName.find_last_of(PathSeparator));
if (lastPathSeparator != std::string::npos)
{
bpRootName = bpBaseName.substr(lastPathSeparator);
}
const std::string bpName(bpBaseName + ".dir/" + bpRootName + "." +
std::to_string(rank));
return bpName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment