@@ -408,10 +408,14 @@ class Attributable
408408 * @note As the HierarchyVisitor interface can be tedious to implement,
409409 * consider using visitHierarchyFromLambda for a more convenient
410410 * interface.
411+
412+ * @note to developers: if at any point a prefix traversal should become
413+ * necessary, consider emplacing configuration options for this inside
414+ * HierarchyVisitor to keep the interface clean.
411415 *
412416 * @param visitor Operations to run for each object.
413417 */
414- virtual void visitHierarchy (HierarchyVisitor &visitor);
418+ virtual void visitHierarchy (HierarchyVisitor &visitor, bool recursive );
415419
416420 /* *
417421 * Visitor pattern for the openPMD object hierarchy in postfix traversal,
@@ -422,42 +426,31 @@ class Attributable
422426 *
423427 * @note Definition inside include/openPMD/backend/HierarchyVisitorImpl.hpp.
424428 * @param lambda Operations to run for each object.
429+ * @param recursive Extend the operation recursively to children.
425430 */
426431 template <typename Lambda>
427- void visitHierarchyFromLambda (Lambda &&lambda);
432+ void visitHierarchyFromLambda (Lambda &&lambda, bool recursive );
428433
429- /* *
430- * Recursively freeze structural definitions made so far on the current
431- * object and all its children.
432- *
433- * This includes:
434- * 1. Explicit attribute writes
435- * 2. Implicit attributes, i.e.: Attributes defined by the openPMD standard
436- * will now be populated with sensible default values
437- * 3. Dataset creation: The Dataset declarations set by resetDataset() will
438- * now be fixed. Datasets can no longer be changed to constant components
439- * after this.
440- * 4. Hierarchy setup, i.e. creation of group paths.
441- *
442- * WARNING: this is still under development and not fully implemented yet
443- * (implementation status: only bullet 2. from above. ref.
444- * https://github.com/openPMD/openPMD-api/pull/1862 for the rest.)
445- *
446- * Uses of this include:
447- * 1. Setting up the metadata is a collective operation in some backends
448- * (read: HDF5). When interacting with a dataset non-collectively (e.g.
449- * single ranks without data contribution, variable number of blocks per
450- * rank), this call harmonizes the collective metadata setup.
451- * 2. Forcing the creation of default attributes. By default, these are
452- * written upon closing the containing Iteration / Series. Calling this
453- * soon can make data available for early readers (e.g. read while the
454- * writer is still modifying).
455- *
456- * Modifying the frozen structural setup is only possible insofar as the
457- * backend supports this, e.g. by dataset extension, attribute overwrite or
458- * group deletion.
434+ /* * Create standard defined attributes with default values now, insofar they
435+ * are still missing.
436+ *
437+ * Refer to
438+ * https://github.com/openPMD/openPMD-standard/blob/latest/STANDARD.md
439+ * for the attributes implied by this operation.
440+ *
441+ * By default, standard defined attributes are written upon closing the
442+ * containing Iteration / Series. Calling this soon can make data available
443+ * for early readers (e.g. read while the writer is still modifying). In
444+ * workflows that keep single Iterations open over an extended period of
445+ * time (e.g. back-transformed diagnostics), this can help creating readable
446+ * files earlier than without.
447+ *
448+ * Attributes may still be modified after this as usual. Attributes defined
449+ * before this call will not be modified by it.
450+ *
451+ * @param recursive Extend the operation recursively to children.
459452 */
460- void commitStructuralSetup ( );
453+ void populateMissingMetadata ( bool recursive );
461454
462455 [[nodiscard]] OpenpmdStandard openPMDStandard () const ;
463456
0 commit comments