exasim-project / OBR

A runner for OpenFOAM benchmarks
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Add statepoint filter #187

Closed greole closed 6 months ago

greole commented 6 months ago

Currently, during the case generation can only be filtered depending on environment variable and simple arithmetic filters. This prohibits creating cases only if the parent cases fulfill certain requirements. This PR introduces a simple additional type of if statement in the config yaml that checks if a matching key value is in the statepoint dictionary.

Example: The following block checks if the key value pair partition: CPU exists and will only create a case if it evaluates to true. This way we can have for example different GPU and CPU decompositions and not create many unneeded cases.

- if: [{partition: CPU, predicate: "=="}, {mesh: 500, predicate: "!="}]
  set: solvers/p
  solver: PCG
  preconditioner: DIC
  executor: CPU

We could discuss if we can simplify the if block further by removing the statepoint key i.e. if: {key: partition, value: CPU } but perhaps we can use that for different filters that cannot evaluated in the first yaml parse.

Not implemented: At the moment this is implemented quick and dirty. For example the predicates are not used, also this might fails for things other than strings. I think we can improve that in separate PR however.