Skip to content
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

Add an feature to export parameters by default #5

Open
antoine-morvan opened this issue Dec 8, 2023 · 3 comments
Open

Add an feature to export parameters by default #5

antoine-morvan opened this issue Dec 8, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@antoine-morvan
Copy link

antoine-morvan commented Dec 8, 2023

Hello,

My current input looks like this :

parameterset:
  - name: build_parameters
    parameter: 
    - {name: COMPILER,      export: true, _: "gcc:13.2.0,llvm:17.0.6"}
    - {name: BUILD_FLAG,    export: true, _: "default"}
    - {name: MPI,           export: true, _: "openmpi:4.1.6"}
    - {name: KOKKOS,        export: true, _: "kokkos:4.1.0"}
    - {name: HDF5_PARALLEL, export: true, _: "hdf5-parallel:1.14.3"}
  - name: run_parameters
    parameter: 
    - {name: testcase,  export: true, _: "short"}
    - {name: bindings,  export: true, _: "socket:off:any"}
    - {name: FREQ,      export: true, _: "NOMINAL"}

Is there a way to export all the parameters by default (and not copy/paste the export: true everywhere) ? I could not find anything related to this in the documentation. Though, I tried moving the export: true higher in the tree, this did not help.

Best,
Antoine.

@thobreuer
Copy link
Collaborator

There is no export attribute available for the parameterset.
Can you describe your use case? Does your application/setup require all these parameters as environment variables?

@antoine-morvan
Copy link
Author

antoine-morvan commented Dec 13, 2023

Hello,

Typically, I prepare build & exec scripts tu be used interactively, with default values :

########################
# Build parameters
########################

COMPILER=${COMPILER:-gcc:13.2.0}
BUILD_FLAG=${BUILD_FLAG:-default}
MPI=${MPI:-openmpi:4.1.6}
KOKKOS=${KOKKOS:-kokkos:4.1.0}
HDF5_PARALLEL=${HDF5_PARALLEL:-hdf5-parallel:1.14.3}

while true; do
  case "$1" in
    --compiler) shift && COMPILER="$1" ;;
    --flags)    shift && BUILD_FLAG="$1" ;;
    --mpi)      shift && MPI="$1" ;;
    --kokkos)   shift && KOKKOS="$1" ;;
    --hdf5)     shift && HDF5_PARALLEL="$1" ;;
    *) echo "ERROR unkown flag $1" && exit 1 ;;
  esac
  shift
done

# logic to setup build env, and call build system with proper flags

########################
# Execution parameters
########################

# reuse build parameter set

TESTCASE=${TESTCASE:-short1}
BINDINGS=${BINDINGS:-socket:off:ddr}
FREQ=${KOKKOS:-NOMINAL}
while true; do
  case "$1" in
    --testcase) shift && TESTCASE="$1" ;;
    --bindings) shift && BINDINGS="$1" ;;
    --freq)     shift && FREQ="$1" ;;
    *) echo "ERROR unkown flag $1" && exit 1 ;;
  esac
  shift
done

# logic to setup libraries env, setup system (freq), and properly launch the app

This way I can easily explore the various parameters. The idea is to use the same script with JUBE. So either I specify all in the command line, like build.sh --compiler $COMPILER --flags $FLAGS etc.; or I just export the variables and they are automatically read.

This example is reduced for the sake of readability, but you can imagine how large the set of build and exec parameters can be. Thus, if there was a way to simply export all the variables at once, that would make the JUBE input file more readable and maintainable :)

Best.

@thobreuer
Copy link
Collaborator

Thank you for explaining the background to your request. I think your suggestion is a sensible extension and we will look into how we can best implement it.

@thobreuer thobreuer added the enhancement New feature or request label Dec 15, 2023
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

No branches or pull requests

2 participants