Skip to content

Commit 99b47cd

Browse files
timings
1 parent deaf623 commit 99b47cd

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

src/libs/blueprint/conduit_blueprint_mesh_matset_xforms.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//-----------------------------------------------------------------------------
1212
// std lib includes
13+
//-----------------------------------------------------------------------------
1314
#include <algorithm>
1415
#include <cmath>
1516
#include <string>
@@ -25,6 +26,7 @@
2526
#include "conduit_blueprint_o2mrelation_iterator.hpp"
2627
#include "conduit_blueprint_o2mrelation_index.hpp"
2728
#include "conduit_blueprint_mesh_matset_accessor.hpp"
29+
#include "conduit_annotations.hpp"
2830

2931
using namespace conduit;
3032
// access conduit blueprint mesh utilities
@@ -769,6 +771,8 @@ to_silo(const conduit::Node &matset,
769771
conduit::Node &dest,
770772
const float64 epsilon)
771773
{
774+
CONDUIT_ANNOTATE_MARK_FUNCTION;
775+
772776
// output includes the following:
773777
// for matsets:
774778
// - topology

src/tests/blueprint/t_blueprint_mesh_matset_xforms.cpp

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "conduit.hpp"
1212
#include "conduit_blueprint.hpp"
1313
#include "conduit_log.hpp"
14+
#include "conduit_annotations.hpp"
1415

1516
#include <algorithm>
1617
#include <vector>
@@ -1251,3 +1252,81 @@ TEST(conduit_blueprint_mesh_matset_xforms, mesh_util_renumber_mat_ids)
12511252
EXPECT_FALSE(matset.diff(baseline, info, CONDUIT_EPSILON, true));
12521253
}
12531254
}
1255+
1256+
//-----------------------------------------------------------------------------
1257+
TEST(conduit_blueprint_mesh_matset_xforms, mesh_util_venn_to_silo_speed_test)
1258+
{
1259+
auto to_silo_timings = [](int nx, int ny)
1260+
{
1261+
Node full_mesh, sbe_mesh, sbm_mesh;
1262+
const double radius = 0.25;
1263+
1264+
blueprint::mesh::examples::venn("full", nx, ny, radius, full_mesh);
1265+
blueprint::mesh::examples::venn("sparse_by_element", nx, ny, radius, sbe_mesh);
1266+
blueprint::mesh::examples::venn("sparse_by_material", nx, ny, radius, sbm_mesh);
1267+
1268+
const Node &full_mset = full_mesh["matsets/matset"];
1269+
const Node &full_field = full_mesh["fields/importance"];
1270+
1271+
Node cali_opts;
1272+
cali_opts["config"] = "runtime-report";
1273+
1274+
CONDUIT_INFO("full")
1275+
{
1276+
annotations::initialize(cali_opts);
1277+
1278+
Node mset_silo, mset_silo_field;
1279+
blueprint::mesh::matset::to_silo(full_mset, mset_silo);
1280+
blueprint::mesh::field::to_silo(full_field,
1281+
full_mset,
1282+
mset_silo_field);
1283+
1284+
annotations::flush();
1285+
annotations::finalize();
1286+
}
1287+
1288+
const Node &sbe_mset = sbe_mesh["matsets/matset"];
1289+
const Node &sbe_field = sbe_mesh["fields/importance"];
1290+
1291+
CONDUIT_INFO("sparse_by_element")
1292+
{
1293+
annotations::initialize(cali_opts);
1294+
1295+
Node mset_silo, mset_silo_field;
1296+
blueprint::mesh::matset::to_silo(sbe_mset, mset_silo);
1297+
blueprint::mesh::field::to_silo(sbe_field,
1298+
sbe_mset,
1299+
mset_silo_field);
1300+
1301+
annotations::flush();
1302+
annotations::finalize();
1303+
}
1304+
1305+
const Node &sbm_mset = sbm_mesh["matsets/matset"];
1306+
const Node &sbm_field = sbm_mesh["fields/importance"];
1307+
1308+
CONDUIT_INFO("sparse_by_material")
1309+
{
1310+
annotations::initialize(cali_opts);
1311+
1312+
Node mset_silo, mset_silo_field;
1313+
blueprint::mesh::matset::to_silo(sbm_mset, mset_silo);
1314+
blueprint::mesh::field::to_silo(sbm_field,
1315+
sbm_mset,
1316+
mset_silo_field);
1317+
1318+
annotations::flush();
1319+
annotations::finalize();
1320+
}
1321+
};
1322+
1323+
1324+
CONDUIT_INFO("venn to silo 10x10");
1325+
to_silo_timings(10, 10);
1326+
1327+
CONDUIT_INFO("venn to silo 100x100");
1328+
to_silo_timings(100, 100);
1329+
1330+
CONDUIT_INFO("venn to silo 1000x1000");
1331+
to_silo_timings(1000, 1000);
1332+
}

0 commit comments

Comments
 (0)