Skip to content

move logic that is not specific to gromacs into hooks functions#26

Merged
boegel merged 5 commits intoEESSI:mainfrom
smoors:move_logic_out
May 3, 2023
Merged

move logic that is not specific to gromacs into hooks functions#26
boegel merged 5 commits intoEESSI:mainfrom
smoors:move_logic_out

Conversation

@smoors
Copy link
Copy Markdown
Collaborator

@smoors smoors commented Apr 1, 2023

fixes #18

@smoors smoors requested a review from casparvl April 1, 2023 15:11
@smoors smoors changed the title move logic that is not specific to gromacs into hooks move logic that is not specific to gromacs into hooks functions Apr 2, 2023
@boegel
Copy link
Copy Markdown
Contributor

boegel commented Apr 7, 2023

@smoors README still mentions singlenode, should be changed too?

Copy link
Copy Markdown
Collaborator

@casparvl casparvl left a comment

Choose a reason for hiding this comment

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

I've put a lot of comments. I suggest that in this PR, we only change stuff that is immediately relevant for the GROMACS test (function names, arguments), or trivial fixes (double indentation of docstring).

The replacement of hardcoded strings by constants from eessi_utils.features should probably be something we do in a separate PR.

"""
filter valid_systems by device type,
unless specified with --setvar valid_systems=<comma-separated-list>
"""
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should add the meaning of the arguments, and probably name the argument required_device rather than device_type, as it is more descriptive. The current device_type argument means: the type of device that this test requires in order to run. For GROMACS, if nb.impl='gpu', it requires a GPU (of any type). Note that device_type should match with the features (i.e. the string in the reframe config that specifies a feature) that can be set on partitions, so it is probably better to only use predefined strings (something like GPU_DEV_NAME, but different - that one is reserved for known device names in a ReFrame config) as arguments.

E.g. if a test requires a generic GPU (i.e. any GPU), then, device_type should be eessi_utils.features.GPU_GENERIC or something like that. If a test requires any CUDA GPU, it could be eessi_utils.features.GPU_CUDA. (etc if we need more specific GPU models)

This means the test itself typically has to do some form of translation. I.e. suppose GROMACS would only have support for CUDA GPUs, one might need to do

# Test specific 'information', in this case an argument, that determines what device is needed
if nb.impl == 'gpu':
    # Specify the required device, as a string constant imported from utils
    required_device = eessi_utils.features.GPU_CUDA
else:
    required_device = eessi_utils.features.CPU  # eessi_utils.features.CPU = 'cpu'
filter_tests_by_device_type(self, required_device)

Then, a ReFrame config file could do

from eessi_utils import utils
...
   'features': [
       eessi_utils.features.GPU_CUDA
       eessi_utils.features.CPU
    ]

In this way, we can standardize which 'features' are 'known'.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i see your point, but required_device could be interpreted as the actual device.
let's settle on required_device_type?

for the cuda/generic features stuff, let's do that in a separate PR

is_cuda_module = utils.is_cuda_required_module(test.module_name)
valid_systems = ''

if is_cuda_module and device_type == 'gpu':
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should use eessi_utils.features.GPU_GENERIC, to make sure the same string is consistently used.

In the future, we'll probably have to make this more specific and test is_cuda_module if eessi_utils.features.GPU_CUDA (or more specific, i.e. eessi_utils.features.GPU_CUDA_A100) is requested. The 'or more specific' probably also means we need to define that hierarchy somewhere, when the time comes we can think about how to do that. But, let's worry about that later...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

let's do that in a separate PR

@smoors
Copy link
Copy Markdown
Collaborator Author

smoors commented Apr 19, 2023

issue created for replacing strings with constants #30

Copy link
Copy Markdown
Contributor

@boegel boegel left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
Collaborator

@casparvl casparvl left a comment

Choose a reason for hiding this comment

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

Lgtm now

@boegel boegel merged commit 49e1a5c into EESSI:main May 3, 2023
@boegel boegel mentioned this pull request May 3, 2023
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.

move logic out of the GROMACS test as much as possible for maximal reuse in future tests

3 participants