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

num_contexts patch #1122

Merged
merged 6 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "modules/tests-sos"]
path = modules/tests-sos
url = ../../openshmem-org/tests-sos.git
branch = main
url = ../../ronawho/tests-sos.git
branch = fix_team_get_config_test
2 changes: 1 addition & 1 deletion modules/tests-sos
26 changes: 22 additions & 4 deletions src/shmem_team.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,29 @@ int shmem_internal_team_split_strided(shmem_internal_team_t *parent_team, int PE
myteam->start = global_PE_start;
myteam->stride = PE_stride;
myteam->size = PE_size;
if (config) {
myteam->config = *config;
myteam->config_mask = config_mask;

if (config_mask == 0) {
shmem_team_config_t defaults;
myteam->config_mask = 0;
myteam->contexts_len = 0;
defaults.num_contexts = 0;
memcpy(&myteam->config, &defaults, sizeof(shmem_team_config_t));
} else {
if (config_mask != SHMEM_TEAM_NUM_CONTEXTS) {
RAISE_WARN_MSG("Invalid team_split_strided config_mask (%ld)\n", config_mask);
return -1;
} else {
shmem_internal_assertp(config->num_contexts >= 0);
myteam->config = *config;
myteam->config_mask = config_mask;
myteam->contexts_len = config->num_contexts;
myteam->contexts = malloc(config->num_contexts * sizeof(shmem_transport_ctx_t*));
for (int i = 0; i < config->num_contexts; i++) {
myteam->contexts[i] = NULL;
}
}
}
myteam->contexts_len = 0;

myteam->psync_idx = -1;

shmem_internal_op_to_all(psync_pool_avail_reduced,
Expand Down
Loading