8000 Add memory check tests by mattldawson · Pull Request #34 · open-atmos/camp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add memory check tests #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Add memory check tests #34

wants to merge 14 commits into from

Conversation

mattldawson
Copy link
Collaborator

Adds memory check tests using valgrind to test suite. Also breaks up monolithic CMake build script and some minor memory leaks in MPI tests.

Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds memory check tests via Valgrind, refactors the CMake build into modular scripts, and updates Docker/CI to enable and run memory checks.

  • Removes legacy tutorial run scripts in favor of new modular tutorial examples
  • Adds a Fortran example (box_model.F90) and accompanying JSON data files for the tutorial
  • Splits the monolithic CMake script into several utility modules and integrates Valgrind tests
  • Updates Dockerfiles and GitHub Actions to install Valgrind, pass CAMP_ENABLE_MEMCHECK, and run ctest under Memcheck

Reviewed Changes

Copilot reviewed 136 out of 136 changed files in this pull request and generated no comments.

Show a summary per file
File Description
doc/camp_tutorial/boot_camp/part__code/.sh Removed legacy run_part_* scripts from all tutorial parts
doc/camp_tutorial/boot_camp/part_2_code/box_model.F90 Added a Fortran example program for tutorial memory checks
doc/camp_tutorial/boot_camp/part_1_code/*.json Added mechanism and config JSON files for the tutorial
cmake/test_util.cmake New utility for adding standard and Memcheck-enabled tests
cmake/silence_warnings.cmake New function to suppress common compiler warnings
cmake/set_defaults.cmake New defaults for C/CUDA/Fortran flags
cmake/dependencies.cmake New file to find and configure external dependencies (SUNDIALS, SuiteSparse, etc.)
cmake/cmake_uninstall.cmake.in New script for uninstall support
cmake/campConfig.cmake.in New CMake package config template
Dockerfile*, .github/workflows/main.yml, .dockerignore Installed Valgrind, enabled CAMP_ENABLE_MEMCHECK, updated CI to run Memcheck tests
Comments suppressed due to low confidence (4)

.github/workflows/main.yml:13

  • The workflow tags both debug and release images as 'camp-test', causing the debug image to be overwritten when building the release. Use distinct image names or tags (e.g., 'camp-test-debug' and 'camp-test-release') to avoid conflicts.
run: docker build -t camp-test . -f Dockerfile.debug

doc/camp_tutorial/boot_camp/part_2_code/run_part_2.sh:1

  • Removing all run_part_* scripts may break the step-by-step tutorial. Ensure you provide updated instructions or replacement scripts so users can still run each tutorial part.
#!/bin/bash

doc/camp_tutorial/boot_camp/part_1_code/my_simple_mechanism.json:48

  • [nitpick] The key "my photo label" is inconsistent with the rest of the schema. Consider using a consistent field name like "photo_label" or "label" for clarity.
"my photo label" : "NO2 photolysis"

doc/camp_tutorial/boot_camp/part_2_code/box_model.F90:82

  • Deallocating a pointer variable that wasn’t explicitly allocated may lead to runtime errors. Verify that camp_core is allocatable or consider providing a proper finalization method instead of a direct deallocate.
  deallocate( camp_core )

@mattldawson mattldawson requested a review from jcurtis2 June 10, 2025 14:58
#include "../test_common.h"
#include "../../src/Jacobian.h"
#include <camp/Jacobian.h>
#include "..//test_common.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct?

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.

2 participants
0