Skip to content

Use standard library foundations - #28

Draft
stanbot8 wants to merge 1 commit into
fix/external-math-dependency-96c079d76e6af463af36a9b1c2c81205from
fix/standard-library-foundations-f16d84706002addf671c13e675883104
Draft

Use standard library foundations#28
stanbot8 wants to merge 1 commit into
fix/external-math-dependency-96c079d76e6af463af36a9b1c2c81205from
fix/standard-library-foundations-f16d84706002addf671c13e675883104

Conversation

@stanbot8

Copy link
Copy Markdown
Owner

Use standard library runtime foundations.

  • Core runtime utilities depended on external implementations for standard facilities. Replace those facilities with standard library owners. src/core/environment/uniform_grid_environment.h, src/core/execution_context/execution_context.h, src/core/gpu/cuda_error_chk.h, src/core/gpu/cuda_timer.h, src/core/gpu/opencl_state.h, src/core/interaction_force.cc, src/core/memory/memory_manager.cc, src/core/memory/memory_manager.h, src/core/operation/default_ops.cc, src/core/real_t.h, src/core/util/spinlock.h, src/core/util/thread_info.h, test/unit/core/environment/custom_environment_test.h, test/unit/core/util/thread_info_test.cc
  • Runtime behavior depended on dynamically generated type metadata. Replace dynamic metadata with explicit typed definitions. demo/analytic_continuum/src/continuum_model.h, demo/analytic_continuum/src/my_agent.h, demo/analytic_continuum/src/my_behavior.h, demo/cell_division_enhanced/src/cell_division_enhanced.h, demo/flocking/src/boid.h, demo/mars/src/CelestialObjects.h, demo/monolayer_growth/src/behaviours.h, demo/monolayer_growth/src/cell_cell_force.cc, demo/monolayer_growth/src/cycling_cell.h, demo/monolayer_growth/src/evaluate.h, demo/newtons_law_test/src/CelestialObjects.h, demo/parameters/src/parameters.h, demo/pyramidal_cell/src/pyramidal_cell.h, demo/regulatory_networks/src/bdm_ex1.h, demo/regulatory_networks/src/bdm_ex2.h, demo/regulatory_networks/src/lorenz.h, demo/regulatory_networks/src/oscillator.h, demo/regulatory_networks/src/sine.h, demo/sbml_integration/src/sbml_integration.h, demo/solar_system/src/CelestialObjects.h, demo/solar_system/src/solar_system.h, demo/soma_clustering/src/my_cell.h, demo/tumor_concept/src/tumor_concept.h, doc/user_guide/tumor_concept.md, src/core/agent/agent.cc, src/core/agent/agent.h, src/core/agent/agent_handle.h, src/core/agent/agent_pointer.h, src/core/agent/agent_uid.h, src/core/agent/agent_uid_generator.h, src/core/agent/cell.h, src/core/agent/spherical_agent.h, src/core/analysis/reduce.h, src/core/behavior/behavior.h, src/core/behavior/chemotaxis.h, src/core/behavior/gene_regulation.h, src/core/behavior/growth_division.h, src/core/behavior/regulatory_network.h, src/core/behavior/secretion.h, src/core/behavior/stateless_behavior.h, src/core/container/inline_vector.h, src/core/container/parallel_resize_vector.h, src/core/container/shared_data.h, src/core/diffusion/continuum_interface.h, src/core/diffusion/diffusion_grid.h, src/core/diffusion/euler_depletion_grid.h, src/core/diffusion/euler_grid.h, src/core/type_index.cc, src/core/type_index.h, src/core/util/log.h, src/core/util/timing_aggregator.h, src/neuroscience/neurite_element.cc, src/neuroscience/neurite_element.h, src/neuroscience/neuron_soma.cc, src/neuroscience/neuron_soma.h, src/neuroscience/param.h, test/unit/core/agent/agent_pointer_test.h, test/unit/core/agent/agent_test.h, test/unit/core/agent/agent_uid_generator_test.cc, test/unit/core/agent/agent_uid_test.cc, test/unit/core/agent/cell_test.cc, test/unit/core/agent/cell_test.h, test/unit/core/analysis/reduce_test.cc, test/unit/core/behavior/stateless_behavior_test.cc, test/unit/core/container/inline_vector_test.cc, test/unit/core/container/inline_vector_test.h, test/unit/core/container/parallel_resize_vector_test.h, test/unit/core/container/shared_data_test.cc, test/unit/core/container/shared_data_test.h, test/unit/core/diffusion_init_test.cc, test/unit/core/diffusion_init_test.h, test/unit/core/diffusion_test.cc, test/unit/test_util/test_agent.h, src/core/container/math_array.h, src/core/util/random.h
  • An allocation escaped the scope that owned its release. Keep the allocation with its matching cleanup path. src/core/execution_context/in_place_exec_ctxt.cc, src/core/execution_context/in_place_exec_ctxt.h, src/core/resource_manager.cc, src/core/resource_manager.h, test/unit/core/resource_manager_test.cc, test/unit/core/resource_manager_test.h, test/unit/core/execution_context/in_place_exec_ctxt_test.cc
  • util/valgrind.sh ignored util/valgrind-bdm.supp, so libgomp worker-thread TLS retained until process exit was reported as an application leak. Route Memcheck through --suppressions with only the exact libgomp worker TLS stack. util/valgrind-bdm.supp, util/valgrind.sh
  • BDM_REGISTER_OP and BDM_REGISTER_TEMPLATE_OP constructed operation implementations during static initialization, so MechanicalForcesOp and ReductionOp initialized ThreadInfo before simulation runtime. Register OperationImplFactory callbacks and instantiate them in OperationRegistry::NewOperation. src/core/operation/operation_registry.cc, src/core/operation/operation_registry.h
  • ReductionOp::Clone shallow-copied two manually owned functor pointers, so multiple destructors could release the same objects. Retain both functors in typed std::shared_ptr owners. src/core/operation/reduction_op.h, test/unit/core/operation/operation_test.cc
  • MechanicalForcesOp copied, replaced, and deleted its InteractionForce through a manually owned raw pointer. Retain the force in std::unique_ptr<InteractionForce>. src/core/operation/mechanical_forces_op.h
  • Visualization data extraction depended on dynamic runtime services. Replace dynamic extraction with explicit typed data access. cli/view_command.py, paraview_plugin/CMakeLists.txt, paraview_plugin/Plugin/CMakeLists.txt, src/core/visualization/paraview/adaptor.cc, src/core/visualization/paraview/adaptor.h, src/core/visualization/paraview/helper.h, src/core/visualization/paraview/jit_helper.h, src/core/visualization/paraview/mapped_data_array.h, src/core/visualization/paraview/parallel_vti_writer.cc, src/core/visualization/paraview/parallel_vtu_writer.cc, src/core/visualization/paraview/parallel_vtu_writer.h, src/core/visualization/paraview/vtk_agents.cc, src/core/visualization/paraview/vtk_agents.h, src/core/visualization/paraview/vtu_writer.cc, src/core/visualization/paraview/vtu_writer.h, src/core/visualization/visualization_adaptor.cc, test/unit/core/visualization/paraview/adaptor_test.h, test/unit/core/visualization/paraview/integration_test.cc, test/unit/core/visualization/paraview/mapped_data_array_test.cc
  • The build still discovered, generated, linked, and packaged an unused dependency. Remove its build, packaging, and setup integration. .devcontainer/Dockerfile, .devcontainer/paraview-wrapper.sh, .github/workflows/README.md, .github/workflows/macos-ci.yml, .github/workflows/macos-system-ci.yml, .github/workflows/repository-checks.yml, .github/workflows/singularity-integration.yml, .github/workflows/ubuntu-ci.yml, .github/workflows/ubuntu-system-ci.yml, CMakeLists.txt, CONTRIBUTING.md, Singularity, cli/config_command.py, cmake/BioDynaMo.cmake, cmake/FindROOT.cmake, cmake/FindTBB.cmake, cmake/Findtcmalloc.cmake, cmake/Installation.cmake, cmake/Notebooks.cmake, cmake/RootUseFile.cmake, cmake/UseBioDynaMo.cmake.in, cmake/Versioning.cmake, cmake/Website.cmake, cmake/bdm-dictionary, cmake/env/bdm-config.in, cmake/env/launcher.sh, cmake/env/sh_functions/paraview, cmake/env/sh_functions/pvbatch, cmake/env/sh_functions/pvpython, cmake/env/sh_functions/root, cmake/env/thisbdm.fish, cmake/env/thisbdm.sh, cmake/external/ParaView.cmake, cmake/external/Qt.cmake, cmake/external/ROOT.cmake, cmake/external/SHA256Digests.cmake, cmake/selection-libVisualizationAdaptor.xml, cmake/selection-libbiodynamo.xml, cmake/selection.xml, cmake/utils.cmake, demo/binding_cells/CMakeLists.txt, demo/binding_cells/analysis.ipynb, demo/binding_cells/bdm.toml, demo/binding_cells/params.json, demo/binding_cells/run.sh, demo/binding_cells/src/agents/monocyte.h, demo/binding_cells/src/agents/t_cell.h, demo/binding_cells/src/binding_cells.cc, demo/binding_cells/src/binding_cells.h, demo/binding_cells/src/biology_modules/connect_within_radius_module.h, demo/binding_cells/src/biology_modules/constant_displacement_module.h, demo/binding_cells/src/biology_modules/inhibitation_module.h, demo/binding_cells/src/biology_modules/physical_bond_module.h, demo/binding_cells/src/biology_modules/random_walk_module.h, demo/binding_cells/src/biology_modules/spring_force_module.h, demo/binding_cells/src/biology_modules/stokes_velocity_module.h, demo/binding_cells/src/macro.C, demo/binding_cells/src/plot_graph.h, demo/epidemiology/CMakeLists.txt, demo/epidemiology/measles.json, demo/epidemiology/optim.json, demo/epidemiology/plot-style.json, demo/epidemiology/render.py, demo/epidemiology/run.sh, demo/epidemiology/src/analytical-solution.cc, demo/epidemiology/src/analytical-solution.h, demo/epidemiology/src/behavior.h, demo/epidemiology/src/epidemiology.cc, demo/epidemiology/src/epidemiology.h, demo/epidemiology/src/evaluate.h, demo/epidemiology/src/person.h, demo/epidemiology/src/sim-param.h, demo/epidemiology/test.sh, demo/epidemiology/visualize.sh, demo/makefile_project/Makefile, demo/makefile_project/README.md, demo/multiple_simulations/src/multiple_simulations.h, doc/dev_guide/build.md, doc/sidebars/userguide.yaml, doc/user_guide/Singularity.md, doc/user_guide/docs/notebooks.md, doc/user_guide/installation.md, doc/user_guide/multi_simulation.md, doc/user_guide/parameter.md, doc/user_guide/prerequisites.md, doc/user_guide/simulation_parameter_tutorial.md, etc/bdm.rootrc, notebook/ST01-model-initializer.ipynb, notebook/ST02-user-defined-random-number-distribution.ipynb, notebook/ST03-agent-reproduction-mortality.ipynb, notebook/ST04-agent-reproduction-with-behaviors.ipynb, notebook/ST05-agent-reproduction-advanced.ipynb, notebook/ST06-environment-search.ipynb, notebook/ST07-multi-scale-simulation.ipynb, notebook/ST08-histograms.ipynb, notebook/ST09-timeseries-plotting-basic.ipynb, notebook/ST10-timeseries-plotting-and-analysis.ipynb, notebook/ST11-multiple-experiments-statistical-analysis.ipynb, notebook/ST12-hierarchical-model.ipynb, notebook/ST13-dynamic-scheduling.ipynb, notebook/ST14-randomize-iteration-order.ipynb, notebook/ST15-replace-interaction-force.ipynb, src/biodynamo.h, src/core/analysis/line_graph.cc, src/core/analysis/line_graph.h, src/core/analysis/style.cc, src/core/analysis/style.h, src/core/analysis/time_series.cc, src/core/analysis/time_series.h, src/core/multi_simulation/algorithm/algorithm.h, src/core/multi_simulation/algorithm/algorithm_registry.cc, src/core/multi_simulation/algorithm/algorithm_registry.h, src/core/multi_simulation/algorithm/parameter_sweep.cc, src/core/multi_simulation/algorithm/particle_swarm.cc, src/core/multi_simulation/database.h, src/core/multi_simulation/dynamic_loop.h, src/core/multi_simulation/experiment.h, src/core/multi_simulation/mpi_helper.h, src/core/multi_simulation/multi_simulation.cc, src/core/multi_simulation/multi_simulation.h, src/core/multi_simulation/multi_simulation_manager.cc, src/core/multi_simulation/multi_simulation_manager.h, src/core/multi_simulation/optimization_param.h, src/core/multi_simulation/optimization_param_type/log_range_param.h, src/core/multi_simulation/optimization_param_type/optimization_param_type.h, src/core/multi_simulation/optimization_param_type/particle_swarm_param.h, src/core/multi_simulation/optimization_param_type/range_param.h, src/core/multi_simulation/optimization_param_type/set_param.h, src/core/param/command_line_options.cc, src/core/param/command_line_options.h, src/core/param/param.cc, src/core/param/param.h, src/core/param/param_group.h, src/core/scheduler.cc, src/core/scheduler.h, src/core/simulation.cc, src/core/simulation.h, src/core/simulation_backup.cc, src/core/simulation_backup.h, src/core/util/io.cc, src/core/util/io.h, src/core/util/jit.cc, src/core/util/jit.h, src/core/util/plot_memory_layout.cc, src/core/util/plot_memory_layout.h, src/core/util/root.cc, src/core/util/root.h, src/core/visualization/root/adaptor.h, src/core/visualization/root/notebook_util.h, test/installation-test.sh, test/system/backup_restore.sh, test/system/backup_restore/CMakeLists.txt, test/system/backup_restore/src/backup_restore.cc, test/system/backup_restore/src/backup_restore.h, test/system/multi_simulation.sh, test/system/multi_simulation/CMakeLists.txt, test/system/multi_simulation/optim.json, test/system/multi_simulation/src/multi_simulation_test.cc, test/system/multi_simulation/src/multi_simulation_test.h, test/system/multi_simulation/src/test_algorithm.cc, test/unit/core/analysis/time_series_test.cc, test/unit/core/command_line_options_test.cc, test/unit/core/multi_simulation/algorithm_test.cc, test/unit/core/multi_simulation/dynamic_loop_test.cc, test/unit/core/multi_simulation/optimization_param_type_test.cc, test/unit/core/param/param_test.cc, test/unit/core/param/test.json, test/unit/core/scheduler_test.cc, test/unit/core/scheduler_test.h, test/unit/core/simulation_backup_test.cc, test/unit/core/simulation_test.cc, test/unit/core/util/io_test.cc, test/unit/test_util/io_test.h, test/util.inc, third_party/OptionParser.h, third_party/cpptoml/cpptoml.h, util/build-third-party/build-all.sh, util/build-third-party/build-paraview.sh, util/build-third-party/build-qt.sh, util/build-third-party/build-root.sh, util/build-third-party/paraview/build.sh, util/build-third-party/paraview/checkout-code.sh, util/build-third-party/paraview/env.sh, util/build-third-party/paraview/make_macos_pvsdk_relocatable.py, util/build-third-party/paraview/package.sh, util/build-third-party/paraview/paraview-superbuild-openmp.v5.9.0.patch, util/build-third-party/paraview/prerequisites.sh, util/build-third-party/qt-silent-install-linux.js, util/build-third-party/qt-silent-install-macos.js, util/build-third-party/third-party-prerequisites.sh, util/clean-build-dir.sh, util/demo_to_notebook.py, util/git/pr_checklist.md, util/install, util/installation/centos-7/Dockerfile, util/installation/osx/package_list_required, util/installation/osx/prerequisites.sh, util/installation/ubuntu-18.04/Dockerfile, util/installation/ubuntu-20.04/Dockerfile, util/installation/ubuntu-22.04/Dockerfile, util/installation/ubuntu-24.04/Dockerfile, util/makefile-build/bdm-code-generation
  • CTest could run biodynamo-unit-tests and valgrind_biodynamo-unit-tests concurrently even though both registrations share the suite's output state. Enforce RUN_SERIAL on valgrind_biodynamo-unit-tests. cmake/Testing.cmake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant