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

set_var_default not working (on Isambard3) #352

Open
tkoskela opened this issue Dec 2, 2024 · 8 comments
Open

set_var_default not working (on Isambard3) #352

tkoskela opened this issue Dec 2, 2024 · 8 comments
Assignees

Comments

@tkoskela
Copy link
Member

tkoskela commented Dec 2, 2024

self.set_var_default(
'num_cpus_per_task',
(self.current_partition.processor.num_cpus or 1) //
min(1, (self.current_partition.processor.num_cpus_per_core or 1)))

print(self.num_cpus_per_task) prints None. Replacing it with

self.num_cpus_per_task = (self.current_partition.processor.num_cpus or 1) // min(1, (self.current_partition.processor.num_cpus_per_core or 1))

works (ie, prints the correct number of cpus, 144)

@giordano
Copy link
Member

giordano commented Dec 2, 2024

Replacing it with

self.num_cpus_per_task = (self.current_partition.processor.num_cpus or 1) // min(1, (self.current_partition.processor.num_cpus_per_core or 1))

That'd override values set on the command line. I don't see how self.num_cpus_per_task can be None, at very least you should get None for the other attributes used to set its default value.

@tkoskela
Copy link
Member Author

tkoskela commented Dec 2, 2024

As far as I can tell, the code to compute the value of num_cpus_per_task is working correctly, but the value doesn't get assigned by set_var_default()

self.current_partition.processor.num_cpus: 144
current_partition.processor.num_cpus_per_core: 1
(self.current_partition.processor.num_cpus or 1) // min(1, (self.current_partition.processor.num_cpus_per_core or 1)): 144
self.num_cpus_per_task: None

@giordano
Copy link
Member

giordano commented Dec 2, 2024

Uhm, this needs some debugging then, sounds like a potential bug in set_var_default. Version of reframe?

@tkoskela
Copy link
Member Author

tkoskela commented Dec 2, 2024

I'm guessing the value None has been assigned to it previously so this check in ReFrame returns True

https://github.com/reframe-hpc/reframe/blob/7930201e4c9c227e70ae94d70d5ae4b101abcbd7/reframe/core/pipeline.py#L1396C2-L1397C39

@tkoskela
Copy link
Member Author

tkoskela commented Dec 2, 2024

I'm on ReFrame 4.7.0

@giordano
Copy link
Member

giordano commented Dec 2, 2024

I've been trying to look into this, I updated to ReFrame v4.7.0 but set_var_default seems to do the job for me in the stream benchmark. But I'm testing this locally, I don't have access to Isambard 3.

@tkoskela
Copy link
Member Author

tkoskela commented Dec 2, 2024

Sigh, issue with python versions then?

@giordano
Copy link
Member

giordano commented Dec 2, 2024

For what is worth locally I have Python 3.12.7.

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

No branches or pull requests

2 participants