Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@douglasjacobsen
Copy link
Collaborator

This merge performs three tasks:

  1. Fixes the ramble workspace info command, in preparation for cross experiment variable reference expansion
  2. Re-organizes the AST logic in the expander class to prepare for cross experiment variable references (and aid further extending the AST logic in the future)
  3. Adds support into the AST logic for cross experiment variable references.

Cross experiment variable references allow an experiment to refer to a variable definition in a different experiment.

This takes the form of:

ramble:
  ...
  variables:
    n_ranks: '1'
    n_nodes: '1'
    n_threads: '1'
    processes_per_node: '1'
  applications:
    hostname:
      workloads:
        serial:
          experiments:
            test1:
              variables:
                test_var: 'my_value'
            test2:
              variables:
                other_var: test_var in hostname.serial.test1

In the above example, other_var in test2 would have a value of 'my_value'.

This commit fixes an issue in workspace info where variables that
contained the @ symbol would throw and error due to color.cprint
expecting a color identifer.

Additionally, the method is restructure to prepare for cross experiment
referneces. To aid this, all experiments are generated in the first
pass, and second (just to make printing nicer) the experiments are
generated again but only to scope variables properly.
@douglasjacobsen douglasjacobsen added the enhancement New feature or request label Mar 1, 2023
@douglasjacobsen douglasjacobsen requested a review from rfbgo March 1, 2023 03:55
@douglasjacobsen douglasjacobsen force-pushed the variable_lookup branch 2 times, most recently from 38737f9 to 785c559 Compare March 1, 2023 15:36
rfbgo
rfbgo previously approved these changes Mar 1, 2023
This commit updates the AST evaluation logic to be easier to follow.
Additionally, it splits handling of the node types out into separate
helper methods to allow them to be extended more easily in the future.
This commit adds logic into the AST evaluation code to extract a cross
experiment variable reference.

This currently takes the form of:

`var_name: other_var in experiment_namespace`

Where:
`var_name` is the name of the experiment local variable
`other_var` is the name of the remote experiment variable
`experiment_namespace` is a fully qualified experiment namespace
                       of the form
                       'application_name'.'workload_name','experiment_name'

Also, add tests for this feature
@rfbgo rfbgo merged commit d5c16d0 into GoogleCloudPlatform:develop Mar 1, 2023
@douglasjacobsen douglasjacobsen deleted the variable_lookup branch March 1, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants