From bcee062d7696a77c3ad7fe033fd298d738c4e901 Mon Sep 17 00:00:00 2001 From: "Thomas J. Otahal" Date: Wed, 3 Jan 2024 08:31:58 -0700 Subject: [PATCH] Catalyst API 2 Added support for IOSS Blob, CommSet, FaceSet, ElementSet, EdgeBlock, FaceBlock, and EdgeSet. --- .../ioss/src/catalyst/Iocatalyst_DatabaseIO.C | 206 +++++++++++++++--- .../ioss/src/catalyst/Iocatalyst_DatabaseIO.h | 58 +++-- .../ioss/src/catalyst_tests/CMakeLists.txt | 172 ++++++++++++--- 3 files changed, 353 insertions(+), 83 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.C b/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.C index 0b6499dcbe..abf75c1edb 100644 --- a/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.C +++ b/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.C @@ -121,6 +121,65 @@ namespace Iocatalyst { return new Ioss::Assembly(dbase, node["properties/name/value"].as_string()); } + template <> + Ioss::Blob *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::Blob(dbase, node["properties/name/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + + template <> + Ioss::EdgeBlock *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::EdgeBlock(dbase, node["properties/name/value"].as_string(), + node["properties/topology_type/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + + template <> + Ioss::FaceBlock *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::FaceBlock(dbase, node["properties/name/value"].as_string(), + node["properties/topology_type/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + + template <> + Ioss::ElementSet *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::ElementSet(dbase, node["properties/name/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + + template <> + Ioss::EdgeSet *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::EdgeSet(dbase, node["properties/name/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + + template <> + Ioss::FaceSet *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::FaceSet(dbase, node["properties/name/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + + template <> + Ioss::CommSet *createEntityGroup(const conduit_cpp::Node &node, + Ioss::DatabaseIO *dbase) + { + return new Ioss::CommSet(dbase, node["properties/name/value"].as_string(), + node["properties/entity_type/value"].as_string(), + node["properties/entity_count/value"].as_int64()); + } + } // namespace detail class DatabaseIO::ImplementationT @@ -168,6 +227,8 @@ namespace Iocatalyst { this->defineEntityGroup(node["elementsets"], region->get_elementsets()); this->defineEntityGroup(node["structuredblocks"], region->get_structured_blocks()); this->defineEntityGroup(node["assemblies"], region->get_assemblies()); + this->defineEntityGroup(node["blobs"], region->get_blobs()); + this->defineEntityGroup(node["commsets"], region->get_commsets()); return true; } @@ -616,8 +677,20 @@ namespace Iocatalyst { block->property_add(Ioss::Property(name, child["value"].as_string(), origin)); break; - case Ioss::Property::BasicType::VEC_INTEGER: - case Ioss::Property::BasicType::VEC_DOUBLE: abort(); // TODO: + case Ioss::Property::BasicType::VEC_INTEGER: { + std::vector v(child["value"].as_int_ptr(), + child["value"].as_int_ptr() + child["value"].number_of_elements()); + block->property_add(Ioss::Property(name, v, origin)); + break; + } + + case Ioss::Property::BasicType::VEC_DOUBLE: { + std::vector v(child["value"].as_double_ptr(), + child["value"].as_double_ptr() + + child["value"].number_of_elements()); + block->property_add(Ioss::Property(name, v, origin)); + break; + } } } return true; @@ -722,9 +795,9 @@ namespace Iocatalyst { Ioss::Region *region) { for (conduit_index_t idx = 0, max = parent.number_of_children(); idx < max; ++idx) { - auto &&child = parent[idx]; - auto block = detail::createEntityGroup(child, region->get_database()); - auto member_type = child["member_type"].as_int(); + auto &&child = parent[idx]; + auto block = detail::createEntityGroup(child, region->get_database()); + auto member_type = child["member_type"].as_int(); for (int i = 0; i < child["members"].number_of_children(); i++) { auto name = child["members"].child(i).as_string(); Ioss::GroupingEntity *ge = nullptr; @@ -851,16 +924,18 @@ namespace Iocatalyst { this->readEntityGroup(node["region"], region); this->readEntityGroup(node["nodeblocks"], region); this->readEntityGroup(node["elementblocks"], region); - // this->readEntityGroup(node["edgeblocks"], region); - // this->readEntityGroup(node["faceblocks"], region); + this->readEntityGroup(node["edgeblocks"], region); + this->readEntityGroup(node["faceblocks"], region); this->readEntityGroup(node["sideblocks"], region); this->readEntityGroup(node["sidesets"], region); this->readEntityGroup(node["nodesets"], region); - // this->readEntityGroup(node["edgesets"], region); - // this->readEntityGroup(node["facesets"], region); - // this->readEntityGroup(node["elementsets"], region); + this->readEntityGroup(node["edgesets"], region); + this->readEntityGroup(node["facesets"], region); + this->readEntityGroup(node["elementsets"], region); this->readEntityGroup(node["structuredblocks"], region); this->readEntityGroup(node["assemblies"], region); + this->readEntityGroup(node["blobs"], region); + this->readEntityGroup(node["commsets"], region); return true; } @@ -1017,8 +1092,9 @@ namespace Iocatalyst { unsigned DatabaseIO::entity_field_support() const { return Ioss::NODEBLOCK | Ioss::EDGEBLOCK | Ioss::FACEBLOCK | Ioss::ELEMENTBLOCK | - Ioss::NODESET | Ioss::EDGESET | Ioss::FACESET | Ioss::ELEMENTSET | Ioss::SIDESET | - Ioss::SIDEBLOCK | Ioss::STRUCTUREDBLOCK | Ioss::ASSEMBLY | Ioss::REGION; + Ioss::COMMSET | Ioss::NODESET | Ioss::EDGESET | Ioss::FACESET | Ioss::ELEMENTSET | + Ioss::SIDESET | Ioss::SIDEBLOCK | Ioss::STRUCTUREDBLOCK | Ioss::ASSEMBLY | Ioss::REGION | + Ioss::BLOB; } void DatabaseIO::read_meta_data__() @@ -1148,7 +1224,8 @@ namespace Iocatalyst { int64_t DatabaseIO::put_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, size_t data_size) const { - return -1; + auto &impl = (*this->Impl.get()); + return impl.putField("commsets", cs, field, data, data_size, this->deep_copy()); } int64_t DatabaseIO::put_field_internal(const Ioss::Assembly *as, const Ioss::Field &field, @@ -1158,10 +1235,11 @@ namespace Iocatalyst { return impl.putField("assemblies", as, field, data, data_size, this->deep_copy()); } - int64_t DatabaseIO::put_field_internal(const Ioss::Blob * /*bl*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const + int64_t DatabaseIO::put_field_internal(const Ioss::Blob *bl, const Ioss::Field &field, void *data, + size_t data_size) const { - return -1; + auto &impl = (*this->Impl.get()); + return impl.putField("blobs", bl, field, data, data_size, this->deep_copy()); } int64_t DatabaseIO::put_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, @@ -1287,16 +1365,17 @@ namespace Iocatalyst { auto &impl = (*this->Impl.get()); return impl.getField("elementsets", ns, field, data, data_size); } - int64_t DatabaseIO::get_field_internal(const Ioss::SideSet *fs, const Ioss::Field &field, + int64_t DatabaseIO::get_field_internal(const Ioss::SideSet *ss, const Ioss::Field &field, void *data, size_t data_size) const { auto &impl = (*this->Impl.get()); - return impl.getField("sidesets", fs, field, data, data_size); + return impl.getField("sidesets", ss, field, data, data_size); } int64_t DatabaseIO::get_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, size_t data_size) const { - return -1; + auto &impl = (*this->Impl.get()); + return impl.getField("commsets", cs, field, data, data_size); } int64_t DatabaseIO::get_field_internal(const Ioss::Assembly *as, const Ioss::Field &field, void *data, size_t data_size) const @@ -1304,10 +1383,11 @@ namespace Iocatalyst { auto &impl = (*this->Impl.get()); return impl.getField("assemblies", as, field, data, data_size); } - int64_t DatabaseIO::get_field_internal(const Ioss::Blob * /*bl*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const + int64_t DatabaseIO::get_field_internal(const Ioss::Blob *bl, const Ioss::Field &field, void *data, + size_t data_size) const { - return -1; + auto &impl = (*this->Impl.get()); + return impl.getField("blobs", bl, field, data, data_size); } int64_t DatabaseIO::get_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, void *data, size_t data_size) const @@ -1333,9 +1413,8 @@ namespace Iocatalyst { int64_t DatabaseIO::get_zc_field_internal(const Ioss::Region *reg, const Ioss::Field &field, void **data, size_t *data_size) const { - std::string blockPath = "region"; - auto &impl = (*this->Impl.get()); - return impl.getFieldZeroCopy(blockPath, reg, field, data, data_size); + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("region", reg, field, data, data_size); } int64_t DatabaseIO::get_zc_field_internal(const Ioss::NodeBlock *nb, const Ioss::Field &field, void **data, size_t *data_size) const @@ -1346,23 +1425,86 @@ namespace Iocatalyst { if (nb->is_nonglobal_nodeblock()) { blockPath = "structuredblocks/" + impl.getName(nb->contained_in()); } - return impl.getFieldZeroCopy(blockPath, nb, field, data, data_size); } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::EdgeBlock *eb, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("edgeblocks", eb, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::FaceBlock *fb, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("faceblocks", fb, field, data, data_size); + } int64_t DatabaseIO::get_zc_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void **data, size_t *data_size) const { - std::string blockPath = "elementblocks"; - auto &impl = (*this->Impl.get()); - return impl.getFieldZeroCopy(blockPath, eb, field, data, data_size); + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("elementblocks", eb, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::SideBlock *sb, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("sideblocks", sb, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("nodesets", ns, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::EdgeSet *es, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("edgesets", es, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::FaceSet *fs, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("facesets", fs, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::ElementSet *es, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("elementsets", es, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::SideSet *ss, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("sidesets", ss, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("commsets", cs, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::Assembly *as, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("assemblies", as, field, data, data_size); + } + int64_t DatabaseIO::get_zc_field_internal(const Ioss::Blob *bl, const Ioss::Field &field, + void **data, size_t *data_size) const + { + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("blobs", bl, field, data, data_size); } int64_t DatabaseIO::get_zc_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, void **data, size_t *data_size) const { - std::string blockPath = "structuredblocks"; - auto &impl = (*this->Impl.get()); - return impl.getFieldZeroCopy(blockPath, sb, field, data, data_size); + auto &impl = (*this->Impl.get()); + return impl.getFieldZeroCopy("structuredblocks", sb, field, data, data_size); } } // namespace Iocatalyst diff --git a/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.h b/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.h index 8d1bc2a2cd..03ddb11dc8 100644 --- a/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.h +++ b/packages/seacas/libraries/ioss/src/catalyst/Iocatalyst_DatabaseIO.h @@ -107,30 +107,30 @@ namespace Iocatalyst { size_t data_size) const override; int64_t get_field_internal(const Ioss::NodeBlock *nb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::EdgeBlock *nb, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::EdgeBlock *eb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::FaceBlock *nb, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::FaceBlock *fb, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t get_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::SideBlock *fb, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::SideBlock *sb, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t get_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::EdgeSet *ns, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::EdgeSet *es, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::FaceSet *ns, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::FaceSet *fs, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::ElementSet *ns, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::ElementSet *es, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::SideSet *fs, const Ioss::Field &field, void *data, + int64_t get_field_internal(const Ioss::SideSet *ss, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t get_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t get_field_internal(const Ioss::Assembly *as, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t get_field_internal(const Ioss::Blob * /*bl*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const override; + int64_t get_field_internal(const Ioss::Blob *bl, const Ioss::Field &field, + void *data, size_t data_size) const override; int64_t get_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, void *data, size_t data_size) const override; @@ -138,8 +138,30 @@ namespace Iocatalyst { size_t *data_size) const override; int64_t get_zc_field_internal(const Ioss::NodeBlock *nb, const Ioss::Field &field, void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::EdgeBlock *eb, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::FaceBlock *fb, const Ioss::Field &field, + void **data, size_t *data_size) const override; int64_t get_zc_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::SideBlock *sb, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::EdgeSet *es, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::FaceSet *fs, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::ElementSet *es, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::SideSet *ss, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::Assembly *as, const Ioss::Field &field, + void **data, size_t *data_size) const override; + int64_t get_zc_field_internal(const Ioss::Blob *bl, const Ioss::Field &field, + void **data, size_t *data_size) const override; int64_t get_zc_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, void **data, size_t *data_size) const override; @@ -147,30 +169,30 @@ namespace Iocatalyst { size_t data_size) const override; int64_t put_field_internal(const Ioss::NodeBlock *nb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::EdgeBlock *nb, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::EdgeBlock *eb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::FaceBlock *nb, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::FaceBlock *fb, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t put_field_internal(const Ioss::ElementBlock *eb, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::SideBlock *fb, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::SideBlock *sb, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t put_field_internal(const Ioss::NodeSet *ns, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::EdgeSet *ns, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::EdgeSet *es, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::FaceSet *ns, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::FaceSet *fs, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::ElementSet *ns, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::ElementSet *es, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::SideSet *fs, const Ioss::Field &field, void *data, + int64_t put_field_internal(const Ioss::SideSet *ss, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t put_field_internal(const Ioss::CommSet *cs, const Ioss::Field &field, void *data, size_t data_size) const override; int64_t put_field_internal(const Ioss::Assembly *as, const Ioss::Field &field, void *data, size_t data_size) const override; - int64_t put_field_internal(const Ioss::Blob * /*bl*/, const Ioss::Field & /*field*/, - void * /*data*/, size_t /*data_size*/) const override; + int64_t put_field_internal(const Ioss::Blob *bl, const Ioss::Field &field, + void *data, size_t data_size) const override; int64_t put_field_internal(const Ioss::StructuredBlock *sb, const Ioss::Field &field, void *data, size_t data_size) const override; diff --git a/packages/seacas/libraries/ioss/src/catalyst_tests/CMakeLists.txt b/packages/seacas/libraries/ioss/src/catalyst_tests/CMakeLists.txt index eb1f405c42..962846a95d 100644 --- a/packages/seacas/libraries/ioss/src/catalyst_tests/CMakeLists.txt +++ b/packages/seacas/libraries/ioss/src/catalyst_tests/CMakeLists.txt @@ -90,30 +90,49 @@ function(catalyst_test_ioshell_generated test_name ioshell_gen_args ioshell_output_file_name test_time - test_time_step) + test_time_step + num_procs) + +set(CATALYST_FNAME catalyst_time_${test_time_step}_np_${num_procs}_${ioshell_output_file_name}) +set(IOSHELL_FNAME ioshell_time_${test_time_step}_np_${num_procs}_${ioshell_output_file_name}) -set(CATALYST_FNAME catalyst_time_${test_time_step}_${ioshell_output_file_name}) -set(IOSHELL_FNAME ioshell_time_${test_time_step}_${ioshell_output_file_name}) +if(num_procs GREATER 1) + set(CATALYST_FNAME_EPU ${CATALYST_FNAME}.${num_procs}.0) +else() + set(CATALYST_FNAME_EPU ${CATALYST_FNAME}) +endif() TRIBITS_ADD_ADVANCED_TEST(${test_name} - TEST_0 EXEC io_shell ARGS --in_type generated ${ioshell_gen_args} ${ioshell_output_file_name} + TEST_0 EXEC io_shell ARGS --in_type generated ${ioshell_gen_args} + ${ioshell_output_file_name} DIRECTORY ../main NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_1 EXEC io_shell ARGS -out_type catalyst ${ioshell_output_file_name} ${test_time_step} - DIRECTORY ../main + TEST_1 EXEC decomp ARGS -p ${num_procs} ${ioshell_output_file_name} + DIRECTORY ../../../../scripts NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_2 EXEC io_shell ARGS -in_type catalyst ${test_time_step} ${CATALYST_FNAME} + TEST_2 EXEC io_shell ARGS -out_type catalyst ${ioshell_output_file_name} + ${test_time_step} DIRECTORY ../main NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS ${num_procs} + TEST_3 EXEC io_shell ARGS -in_type catalyst ${test_time_step} + ${CATALYST_FNAME} + DIRECTORY ../main + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS ${num_procs} + TEST_4 EXEC epu ARGS -auto ${CATALYST_FNAME_EPU} + DIRECTORY ../../../../applications/epu + NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_3 EXEC io_shell ARGS -select_times ${test_time} ${ioshell_output_file_name} - ${IOSHELL_FNAME} + TEST_5 EXEC io_shell ARGS -select_times ${test_time} + ${ioshell_output_file_name} ${IOSHELL_FNAME} DIRECTORY ../main NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_4 EXEC exodiff ARGS -pedantic ${IOSHELL_FNAME} ${CATALYST_FNAME} + TEST_6 EXEC exodiff ARGS -pedantic ${IOSHELL_FNAME} + ${CATALYST_FNAME} DIRECTORY ../../../../applications/exodiff NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 @@ -121,53 +140,135 @@ TRIBITS_ADD_ADVANCED_TEST(${test_name} ) endfunction() -catalyst_test_ioshell_generated("catalyst_ioshell_10x10x10" +foreach(NUM_PROCS 1 4) + + catalyst_test_ioshell_generated( + "catalyst_ioshell_10x10x10_np_${NUM_PROCS}" "10x10x10+times:4+variables:element,2,nodal,3" - "ioshell_10x10x10.g" "3" "3") + "ioshell_10x10x10.g" "3" "3" ${NUM_PROCS}) -catalyst_test_ioshell_generated("catalyst_ioshell_10x10x10_tets" + catalyst_test_ioshell_generated( + "catalyst_ioshell_10x10x10_tets_np_${NUM_PROCS}" "10x10x10+tets:+times:2+variables:element,2,nodal,3" - "ioshell_10x10x10_tets.g" "1" "1") + "ioshell_10x10x10_tets.g" "1" "1" ${NUM_PROCS}) -catalyst_test_ioshell_generated("catalyst_ioshell_10x10x10_pyramids" + catalyst_test_ioshell_generated( + "catalyst_ioshell_10x10x10_pyramids_np_${NUM_PROCS}" "10x10x10+pyramids:+times:2+variables:element,2,nodal,3" - "ioshell_10x10x10_pyramids.g" "1" "1") + "ioshell_10x10x10_pyramids.g" "1" "1" ${NUM_PROCS}) -catalyst_test_ioshell_generated("catalyst_ioshell_10x10x10_shell" + catalyst_test_ioshell_generated( + "catalyst_ioshell_10x10x10_shell_np_${NUM_PROCS}" "10x10x10+shell:xX:+times:2+variables:element,2,nodal,3" - "ioshell_10x10x10_shell.g" "1" "1") + "ioshell_10x10x10_shell.g" "1" "1" ${NUM_PROCS}) -catalyst_test_ioshell_generated("catalyst_ioshell_10x10x10_nodeset" + catalyst_test_ioshell_generated( + "catalyst_ioshell_10x10x10_nodeset_np_${NUM_PROCS}" "10x10x10+nodeset:xX:+times:2+variables:element,2,nodal,3,nodeset,4" - "ioshell_10x10x10_nodeset.g" "1" "1") + "ioshell_10x10x10_nodeset.g" "1" "1" ${NUM_PROCS}) -catalyst_test_ioshell_generated("catalyst_ioshell_10x10x10_sideset" + catalyst_test_ioshell_generated( + "catalyst_ioshell_10x10x10_sideset_np_${NUM_PROCS}" "10x10x10+sideset:xX:+times:2+variables:element,2,nodal,3,sideset,4" - "ioshell_10x10x10_sideset.g" "1" "1") + "ioshell_10x10x10_sideset.g" "1" "1" ${NUM_PROCS}) + +endforeach() function(catalyst_test_ioshell_exodus_file test_name input_file test_time - test_time_step) + test_time_step + num_procs) -set(CATALYST_FNAME catalyst_time_${test_time_step}_${input_file}) -set(IOSHELL_FNAME ioshell_time_${test_time_step}_${input_file}) +set(CATALYST_FNAME catalyst_time_${test_time_step}_np_${num_procs}_${input_file}) +set(IOSHELL_FNAME ioshell_time_${test_time_step}_np_${num_procs}_${input_file}) set(INPUT_FILE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../main/test/${input_file}) +if(num_procs GREATER 1) + set(CATALYST_FNAME_EPU ${CATALYST_FNAME}.${num_procs}.0) + set(CATALYST_INPUT_FNAME ${input_file}) +else() + set(CATALYST_FNAME_EPU ${CATALYST_FNAME}) + set(CATALYST_INPUT_FNAME ${INPUT_FILE_PATH}) +endif() + TRIBITS_ADD_ADVANCED_TEST(${test_name} - TEST_0 EXEC io_shell ARGS -out_type catalyst ${INPUT_FILE_PATH} ${test_time_step} + TEST_0 EXEC decomp ARGS -p + ${num_procs} ${INPUT_FILE_PATH} + DIRECTORY ../../../../scripts + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS 1 + TEST_1 EXEC io_shell ARGS -out_type catalyst + ${CATALYST_INPUT_FNAME} ${test_time_step} + DIRECTORY ../main + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS ${num_procs} + TEST_2 EXEC io_shell ARGS -in_type catalyst + ${test_time_step} ${CATALYST_FNAME} DIRECTORY ../main NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS ${num_procs} + TEST_3 EXEC epu ARGS -auto ${CATALYST_FNAME_EPU} + DIRECTORY ../../../../applications/epu + NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_1 EXEC io_shell ARGS -in_type catalyst ${test_time_step} ${CATALYST_FNAME} + TEST_4 EXEC io_shell ARGS -select_times + ${test_time} ${INPUT_FILE_PATH} ${IOSHELL_FNAME} DIRECTORY ../main NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_2 EXEC io_shell ARGS -select_times ${test_time} ${INPUT_FILE_PATH} ${IOSHELL_FNAME} + TEST_5 EXEC exodiff ARGS -pedantic + ${IOSHELL_FNAME} ${CATALYST_FNAME} + DIRECTORY ../../../../applications/exodiff + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS 1 + ENVIRONMENT CATALYST_DATA_DUMP_DIRECTORY=${CMAKE_CURRENT_BINARY_DIR}/${test_name} +) +endfunction() + +foreach(NUM_PROCS 1 4) + catalyst_test_ioshell_exodus_file( + "catalyst_ioshell_cube_g_np_${NUM_PROCS}" + "cube.g" "1" "1" ${NUM_PROCS}) + catalyst_test_ioshell_exodus_file( + "catalyst_ioshell_two_block_g_np_${NUM_PROCS}" + "two-block.g" "1" "1" ${NUM_PROCS}) + catalyst_test_ioshell_exodus_file( + "catalyst_ioshell_eight_block_g_np_${NUM_PROCS}" + "8-block.g" "0.05" "5" ${NUM_PROCS}) +endforeach() + +if ( NETCDF_NCDUMP_BINARY ) + +function(catalyst_test_ioshell_generated_exodus_file test_name + gen_exo_file_command + gen_exo_file_args + gen_exo_file_name + test_time + test_time_step) + +set(CATALYST_FNAME catalyst_time_${test_time_step}_${gen_exo_file_name}) +set(IOSHELL_FNAME ioshell_time_${test_time_step}_${gen_exo_file_name}) +set(INPUT_FILE_PATH ${gen_exo_file_name}) + +TRIBITS_ADD_ADVANCED_TEST(${test_name} + TEST_0 EXEC ${gen_exo_file_command} ARGS ${gen_exo_file_args} + DIRECTORY ../../../exodus/test + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS 1 + TEST_1 EXEC io_shell ARGS -out_type catalyst ${INPUT_FILE_PATH} ${test_time_step} + DIRECTORY ../main + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS 1 + TEST_2 EXEC io_shell ARGS -in_type catalyst ${test_time_step} ${CATALYST_FNAME} + DIRECTORY ../main + NOEXEPREFIX NOEXESUFFIX + NUM_MPI_PROCS 1 + TEST_3 EXEC io_shell ARGS -select_times ${test_time} ${INPUT_FILE_PATH} ${IOSHELL_FNAME} DIRECTORY ../main NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 - TEST_3 EXEC exodiff ARGS -pedantic ${IOSHELL_FNAME} ${CATALYST_FNAME} + TEST_4 EXEC exodiff ARGS -pedantic ${IOSHELL_FNAME} ${CATALYST_FNAME} DIRECTORY ../../../../applications/exodiff NOEXEPREFIX NOEXESUFFIX NUM_MPI_PROCS 1 @@ -175,9 +276,13 @@ TRIBITS_ADD_ADVANCED_TEST(${test_name} ) endfunction() -catalyst_test_ioshell_exodus_file("catalyst_ioshell_cube_g" "cube.g" "1" "1") -catalyst_test_ioshell_exodus_file("catalyst_ioshell_two_block_g" "two-block.g" "1" "1") -catalyst_test_ioshell_exodus_file("catalyst_ioshell_eight_block_g" "8-block.g" "0.05" "5") +catalyst_test_ioshell_generated_exodus_file("catalyst_ioshell_test_blob_exo" + "testwt-blob" "" "test-blob.exo" "0.02" "1") + +catalyst_test_ioshell_generated_exodus_file("catalyst_ioshell_test_seacas_exodus_exoIIC" + "SEACASExodus_ExoIICTests.exe" "CreateEdgeFace" "edgeFace.exo" "1" "0") + +endif() IF (TPL_ENABLE_CGNS) @@ -228,7 +333,8 @@ TRIBITS_ADD_ADVANCED_TEST(${test_name} ) endfunction() -catalyst_test_ioshell_cgns_file("catalyst_ioshell_sparc1_cgns" "sparc1.cgns" "15.992" "1") +catalyst_test_ioshell_cgns_file( + "catalyst_ioshell_sparc1_cgns" "sparc1.cgns" "15.992" "1") endif() endif()