Open naveen-rn opened 3 years ago
The mask is for ABI compatibility.
1 and 3 are still not clear from the specification.
Agree that these should be clarified.
I understand that config_mask
is used for ABI compatibility at team creation (i.e., only user-explicitly-set parameters will be used by the library). But I don't get why it is useful for shmem_team_get_config
. Why can't the library just return all config parameters associated with the team?
There is also a potential ABI compatibility issue with shmem_team_get_config
. For example, consider an application compiled using this type:
typedef struct {
int a;
} shmem_team_t;
And then run with an updated SHMEM library that uses this type:
typedef struct {
int a;
int b;
} shmem_team_t;
The library should not try to fill in b
since the binary has not allocated space for it.
How about the following addition...? (new text in bold)
API Description
shmem_team_get_config
returns through theconfig
argument the configuration parameters as described by the mask, which were assigned according to input configuration parameters when the team was created. Ifteam
compares equal toSHMEM_TEAM_INVALID
, then no operation is performed. Ifteam
is otherwise invalid, the behavior is undefined. Ifconfig_mask
is 0, thenconfig
is not modified. Ifconfig_mask
is nonzero andconfig
is a null pointer, the behavior is undefined.Return Values
If
team
does not compare equal toSHMEM_TEAM_INVALID
, thenshmem_team_get_config
returns 0; otherwise, it returns nonzero.
That said, I'm not sure I understand the third issue @naveen-rn raised.
@nspark et al. - Is there a common use-case for not modifying config
if config_mask
is 0? I'm wondering if it might be more helpful for users if the routine simply returns all the configuration parameters according to how the team was created (i.e., a "copy" of config
). This might make it easier to duplicate a team and might better reflect the "team_split" config_mask
, "A config_mask
value of 0 indicates that the team should be created with the default values for all configuration parameters."
Either way, I agree this should be clarified - I was trying to implement shmem_team_get_config
in SOS and was thoroughly confused by the spec, then ran across this issue ;)
What was the rationale behind adding a
config_mask
inshmem_team_get_config
. Why would the user specifically ask for a config parameter that was not initially used during the team creation?