Skip to content

Make ramble consider '' as unset and error correctly - #1713

Merged
douglasjacobsen merged 2 commits into
GoogleCloudPlatform:developfrom
rfbgo:exp_err
Aug 12, 2026
Merged

Make ramble consider '' as unset and error correctly#1713
douglasjacobsen merged 2 commits into
GoogleCloudPlatform:developfrom
rfbgo:exp_err

Conversation

@rfbgo

@rfbgo rfbgo commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Setting n_ranks: '' (which is sometimes down by workspace manage experiments) used to give this misleading error:

  File "/Users/robertbird/ramble/var/ramble/repos/builtin/base_classes/application-base/base_class.py", line 1298, in run_phase
    phase_func(workspace, app_inst=self)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/robertbird/ramble/var/ramble/repos/builtin/base_applications/hpl/base_application.py", line 363, in _calculate_values
    nNodes = int(expander.expand_var_name("n_nodes"))
ValueError: invalid literal for int() with base 10: ''
Processing phase calculate_values (2/7):  29%|===========>

This PR means that value is no ignored so the appropriate instruction to the user is issued requiring a valid value:

==> Error: Invalid number of required variables defined.
Two or more of the following are required to be defined.
  - n_ranks
  - processes_per_node
  - n_nodes
Experiment hpl.standard.generated only has:
  - processes_per_node
  - ```

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the MPI variable definition logic in base_class.py to prevent empty or None variables from being incorrectly marked as defined, and corrects the logic for tracking missing MPI variables. The review feedback suggests enhancing the validation of MPI variables by stripping whitespace to robustly handle whitespace-only strings.

@rfbgo
rfbgo requested a review from douglasjacobsen August 10, 2026 20:12
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ramble-pr-bot

ramble-pr-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 2b7218e

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.0713 2.1005 (de4ccce) 2.0984
test_large_template_expansion passed 1.6883 1.6327 (de4ccce) 1.6532
test_many_experiments passed 25.2698 24.6595 (de4ccce) 25.4157
test_many_objects_defaults passed 14.5563 14.4773 (de4ccce) 14.4945
test_matrix_filter_perf passed 1.1682 1.1632 (de4ccce) 1.1704

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.48%. Comparing base (de4ccce) to head (2b7218e).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1713   +/-   ##
========================================
  Coverage    93.48%   93.48%           
========================================
  Files          367      367           
  Lines        35916    35918    +2     
========================================
+ Hits         33575    33577    +2     
  Misses        2341     2341           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@douglasjacobsen
douglasjacobsen merged commit eda7195 into GoogleCloudPlatform:develop Aug 12, 2026
30 checks passed
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