Skip to content
Snippets Groups Projects
Commit ea69cc96 authored by FKHals's avatar FKHals
Browse files

Implement a pre-pass-version of agent-rank-setting

which contacts the agent server, so that it can create the mapping
between the jobid, vpid and the desired rank/vpid (since the vpid
actually gets used as the rank) before the actual assignment takes
place. This is necessary because the assignment must be in ascending
order since it writes into an array of process-pointers of the current
group which will cause problems if the first (0th) field in the array
has not yet been initialized but another (already initialized) process
wants to contact it.
parent 94652988
No related branches found
No related tags found
No related merge requests found
......@@ -163,14 +163,20 @@ int ompi_comm_init(void)
group->grp_proc_pointers = (ompi_proc_t **) calloc (size, sizeof (ompi_proc_t *));
group->grp_proc_count = size;
// transfer the infos about the current processes to the agent
for (size_t i = 0 ; i < size ; ++i) {
opal_process_name_t name = {.vpid = i, .jobid = OMPI_PROC_MY_NAME->jobid};
// call without return just to gain knowledge about the processes
getProcessAgentRank(name.jobid, name.vpid, size);
}
for (size_t i = 0 ; i < size ; ++i) {
opal_process_name_t name = {.vpid = i, .jobid = OMPI_PROC_MY_NAME->jobid};
/* get desired rank from agent (must be within size!)*/
// TODO: Change int to size_t
size_t desired_rank = getProcessAgentRank(name.jobid, name.vpid, size);
printf("INIT Loop Rank: %zu\n", desired_rank);
name.vpid = getProcessAgentRank(name.jobid, name.vpid, size);
printf("INIT Loop Rank: %u\n", name.vpid);
/* look for existing ompi_proc_t that matches this name */
group->grp_proc_pointers[desired_rank] = (ompi_proc_t *) ompi_proc_lookup (name);
group->grp_proc_pointers[i] = (ompi_proc_t *) ompi_proc_lookup (name);
if (NULL == group->grp_proc_pointers[i]) {
/* set sentinel value */
group->grp_proc_pointers[i] = (ompi_proc_t *) ompi_proc_name_to_sentinel (name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment