|
11 | 11 | #include "conduit.hpp" |
12 | 12 | #include "conduit_blueprint.hpp" |
13 | 13 | #include "conduit_log.hpp" |
| 14 | +#include "conduit_annotations.hpp" |
14 | 15 |
|
15 | 16 | #include <algorithm> |
16 | 17 | #include <vector> |
@@ -1251,3 +1252,81 @@ TEST(conduit_blueprint_mesh_matset_xforms, mesh_util_renumber_mat_ids) |
1251 | 1252 | EXPECT_FALSE(matset.diff(baseline, info, CONDUIT_EPSILON, true)); |
1252 | 1253 | } |
1253 | 1254 | } |
| 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