Skip to content

Commit

Permalink
mesh bp index partition map write/save (#1051)
Browse files Browse the repository at this point in the history
* add write of mesh bp index partition pattern and partition map to write_mesh

* set bp idx part map for all meshes found

* add support for reading mesh bp with partition map

* update changelog

* add support and test for non-trival domain map case

* improve comments

* add single file test case for part map

* bp relay improve detection of root file format

* fix issue with leading slashs in has_path, and uultimately fix for load_mesh issues for non hdf5 protocols, along with new tests

* new example and sprial vs spiral spelling
  • Loading branch information
cyrush committed Dec 20, 2022
1 parent 207085e commit 96ce772
Show file tree
Hide file tree
Showing 7 changed files with 710 additions and 73 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
### Changed
#### General
- Updated to BLT v0.5.2
- Changed `Schema::has_path()` (and transitively `Node::has_path()` ) to ignore leading `/`s.

### Fixed

#### Blueprint
- Updated `conduit.relay.io.blueprint.{load_mesh|read_mesh}` to use improved logic to auto detect the format (hdf5 ,yaml, or json) of mesh blueprint root files.
- Leading `/`s in mesh tree paths no longer undermine `conduit.relay.io.blueprint.{load_mesh|read_mesh}` reading json and yaml flavored files.

#### Relay
- Leading `/`s in tree paths no longer undermine io::IOHandle reads for conduit_bin, json, conduit_json, conduit_base64_json, and yaml flavored files.

## [0.8.4] - Released 2022-08-22

Expand All @@ -33,6 +43,8 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s
- Added 1D mesh example support to `blueprint::mesh::examples::basic()`.
- Added adjacency set aware generate functions (`genearte_points()`, etc) to the non-mpi blueprint library.
- Added `generate_offsets_inline(Node &)` for cases where we want topology offsets created in an existing tree.
- Added support to write and read per-mesh blueprint index entires with `partition_pattern` and `partition_map`.



#### Relay
Expand Down
2 changes: 1 addition & 1 deletion src/docs/sphinx/blueprint_mesh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ spiral

Pseudocolor and Contour plots of the spiral example ``dist`` field.

The ``sprial()`` function generates a multi-domain mesh composed of 2D square
The ``spiral()`` function generates a multi-domain mesh composed of 2D square
domains with the area of successive fibonacci numbers. The result estimates the
`Golden spiral <https://en.wikipedia.org/wiki/Golden_spiral>`_.

Expand Down
18 changes: 15 additions & 3 deletions src/libs/conduit/conduit_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,24 @@ Schema::has_path(const std::string &path) const
if(m_dtype.id() != DataType::OBJECT_ID)
return false;

std::string p_input;

// if there is a leading slash, we want to ignore
// so check for and adjust if we have this case
if(path.size() > 0 && path[0] == '/')
{
p_input = path.substr(1,path.size()-1);
}
else
{
p_input = path;
}

std::string p_curr;
std::string p_next;
utils::split_path(path,p_curr,p_next);
utils::split_path(p_input,p_curr,p_next);

// handle parent case (..)

const std::map<std::string,index_t> &ents = object_map();

if(ents.find(p_curr) == ents.end())
Expand Down

0 comments on commit 96ce772

Please sign in to comment.