openshmem-org / tests-sos

Sandia OpenSHMEM unit tests and performance testing suite
Other
6 stars 11 forks source link

Fix config_mask for shmem_team_split_strided in shmem_team_get_config.c #37

Closed ronawho closed 4 months ago

ronawho commented 4 months ago

The team creation in shmem_team_get_config.c used 0 for config_mask, but expected the team to be created with the user supplied config. However, the spec says "A config_mask value of 0 indicates that the team should be created with the default values for all configuration parameters" and the default value for the number of contexts is 0.

Update the test to use SHMEM_TEAM_NUM_CONTEXTS for the mask and add another test to validate that a mask of 0 defaults to 0 contexts.

davidozog commented 4 months ago

Thanks for the correction, I'm surprised this hasn't come up until now.

It looks like SOS is simply not considering the config_mask. I have a provisional patch for SOS ready that should resolve the issue.

Yes, my understanding of the spec is that if config_mask is 0, then the library sets config.num_contexts to zero regardless. I think we can/should test that scenario in this PR as well, assuming you agree. In other words, if the user sets config.num_contexts = 3 but passes a config_mask of 0, then shmem_team_get_config should return an object with new_config.num_contexts == 0. Would you also please add that case to this test?

ronawho commented 4 months ago

Added the config_mask=0 test case and updated PR description.