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

MPI-4: Add support for MPI Sessions #9097

Merged
merged 2 commits into from
Feb 2, 2022
Merged

Conversation

hppritcha
Copy link
Member

@hppritcha hppritcha commented Jun 24, 2021

The PR contains changes to Open MPI to support the MPI 4 Sessions API (see chapter 11 sections 3 and 4, and chapter 7 sections 3.2 and 4.2, and parts of chapter 9 concerning errorhandlers). The MPI 4 standard is available at https://www.mpi-forum.org/docs/mpi-4.0/mpi40-report.pdf.

A set of sessions tests has been added to the OMPI public tests repo:https://github.com/open-mpi/ompi-tests-public.
A set of issues concerning this PR are at https://github.com/hpc/ompi/issues

Major changes associated with this PR are:

  • replacement of a single ompi/opal core initialize/finalize with a notion of instances and use of destructor callbacks to clean up rather than relying on an instance finalize procedure tightly coupled with the instance initialization procedure
  • use of an extended CID (exCID) concept for handling Communicator IDs (this is conditional depending on whether a PML supports this). The OB1 and CM/OFI PML's have been modified as part of this PR to support exCIDs.
  • support for calling functions included in Table 11.1 of the MPI 4 standard before calling MPI_Init and friends and after calling MPI_Finalize and friends.

A paper describing the prototype (at least at an early stage) is available at https://ieeexplore.ieee.org/abstract/document/8891002

There will be extensive squashing of commits prior to merging so it would probably be best to focus on the changes introduced by this PR as a whole rather than reviewing individual commits.

@hppritcha hppritcha marked this pull request as draft June 24, 2021 16:30
examples/ring_c.c Outdated Show resolved Hide resolved
@@ -406,13 +411,24 @@ typedef struct attribute_value_t {
int av_sequence;
} attribute_value_t;

/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary ? As far as I see there is still a single global object to handle the attributes ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it was done to use opal-object reference counting. The last one to tear down attributes calls the destructor. At some point Open MPI should really stop using globals and and this change is a step in the right direction.

Copy link
Member

@bosilca bosilca Jun 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not arguing against avoiding globals (where and when it makes sense), but such a change deserve its own PR instead of being part of a very large one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No argument there. Up to @hppritcha to decide whether to move it to another PR.

ompi/attribute/attribute.c Outdated Show resolved Hide resolved
@@ -198,15 +207,45 @@ int ompi_comm_set_nb ( ompi_communicator_t **ncomm,
}

newcomm->c_flags |= OMPI_COMM_INTER;
newcomm->c_index_vec = malloc(remote_size * sizeof(int));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one sneaky change, with drastic implications in terms of latency, scalability and memory usage. It need to be carefully assessed and discusses before being merged.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes agreed. There's an issue to address this in a different way - hpc#65

@@ -2032,3 +2404,28 @@ static int ompi_comm_copy_topo(ompi_communicator_t *oldcomm,
newcomm->c_flags |= newcomm->c_topo->type;
return OMPI_SUCCESS;
}

char *ompi_comm_print_cid (const ompi_communicator_t *comm)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This thread-local 2 correct values function begs for documentation !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I thought I documented this somewhere.... Guess not. Should add documentation to the header declaration.

break;
}

PMIX_INFO_LOAD(&pinfo, PMIX_GROUP_ASSIGN_CONTEXT_ID, NULL, PMIX_BOOL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How scalable is the construction of the PMIx group ? What process is calling this function ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses the same PRRTE communication collective as the "modex" operation. All processes that are to be members of the group must call it. It basically is a data-less "modex" (aka barrier) that returns a unique context ID.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other words, slightly less scalable than MPI collectives on the local costs (because of the need to construct and destruct the group), then delegated to a different software that uses some communication capabilities, to finally be delegated to a RM with or without efficient support for collectives. Hopefully this CID selection is only rarely used and most calls are outside the critical path. Right ?


OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_communicators;
OMPI_DECLSPEC extern opal_hash_table_t ompi_comm_hash;
OMPI_DECLSPEC extern opal_pointer_array_t ompi_comm_array;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the name change ? The old name was clear enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjelmn any reason not to go back to ompi_mpi_communicators?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember why I changed the name. There probably was a reason at one point during the evolution of this branch. Most likely I was making the name consistent with ompi_comm_hash to make it clear that one is an array of communicators where the lookup is by index where the other one is a hash where the lookup is by exCID.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove this name change, the PR is getting more self-contained (aka. smaller and easier to understand).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switched back to the old variable name

@ibm-ompi
Copy link

The IBM CI (GNU/Scale) build failed! Please review the log, linked below.

Gist: https://gist.github.com/ibm-ompi/88b480fb98dfd2bdac939f023e1f8fe6

@ibm-ompi
Copy link

The IBM CI (XL) build failed! Please review the log, linked below.

Gist: https://gist.github.com/ibm-ompi/88b480fb98dfd2bdac939f023e1f8fe6

@hppritcha
Copy link
Member Author

bot:ibm:retest

@ibm-ompi
Copy link

The IBM CI (XL) build failed! Please review the log, linked below.

Gist: https://gist.github.com/ibm-ompi/88b480fb98dfd2bdac939f023e1f8fe6

@ibm-ompi
Copy link

The IBM CI (PGI) build failed! Please review the log, linked below.

Gist: https://gist.github.com/ibm-ompi/88b480fb98dfd2bdac939f023e1f8fe6

@ibm-ompi
Copy link

The IBM CI (GNU/Scale) build failed! Please review the log, linked below.

Gist: https://gist.github.com/ibm-ompi/88b480fb98dfd2bdac939f023e1f8fe6

@hppritcha
Copy link
Member Author

bot:ibm:retest

@ibm-ompi
Copy link

ibm-ompi commented Jul 1, 2021

The IBM CI (GNU/Scale) build failed! Please review the log, linked below.

Gist: https://gist.github.com/2175efaa13b971835186c294806b0001

@ibm-ompi
Copy link

ibm-ompi commented Jul 1, 2021

The IBM CI (XL) build failed! Please review the log, linked below.

Gist: https://gist.github.com/61a0a9029bfafb0c95f43f60957a65d5

@ibm-ompi
Copy link

ibm-ompi commented Jul 1, 2021

The IBM CI (PGI) build failed! Please review the log, linked below.

Gist: https://gist.github.com/52e26384a669f512dad96ba55ceaa81f

@hppritcha
Copy link
Member Author

hmm aws seems to have gone bonkers rerun that first
bot:aws:retest

@hppritcha
Copy link
Member Author

I suspect the git commit checker is experiencing some kind of scalability melt down. will ignore going forward with this PR. @jsquyres

@jsquyres
Copy link
Member

jsquyres commented Jul 2, 2021

I suspect the git commit checker is experiencing some kind of scalability melt down. will ignore going forward with this PR. @jsquyres

It looks like the git commit checker is not running at all. I've seen this before -- rarely, but I have seen it. I haven't been able to figure out the root cause. Perhaps it doesn't run if there's a conflict on the PR...?

@ibm-ompi
Copy link

The IBM CI (GNU/Scale) build failed! Please review the log, linked below.

Gist: https://gist.github.com/c6fe74035df169e07a5eb531a01cf04d

@ibm-ompi
Copy link

The IBM CI (XL) build failed! Please review the log, linked below.

Gist: https://gist.github.com/77e50f876685171598bd552c135adaf2

@ibm-ompi
Copy link

The IBM CI (PGI) build failed! Please review the log, linked below.

Gist: https://gist.github.com/358a6ff4065920a662e408d5032d02e7

@hppritcha hppritcha marked this pull request as ready for review August 17, 2021 18:41
@hppritcha
Copy link
Member Author

Leaving all the commits as is for now. Will squash down to a much smaller set of commits once this PR is reviewd.

@ibm-ompi
Copy link

The IBM CI (GNU/Scale) build failed! Please review the log, linked below.

Gist: https://gist.github.com/5993530c5eb1eb4702834c6595aef513

gpaulsen pushed a commit to hppritcha/ompi that referenced this pull request Mar 31, 2022
dependencies array.

If this is not done, then when using a non-ob1 PML, the stages of finalization
have the SMSC framework closed before the btl framework is closed or del_procs invoked
for the btl(s).

When using the --enable-mca_dso this results in a segfault as the code section for the SMSC
framework/components has been dlclosed.

Moving the opal_smc_base_framework from the opal_init_frameworks to the
ompi_framework_dependencies fixes this problem.

Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit ec21585)
gpaulsen pushed a commit to hppritcha/ompi that referenced this pull request Mar 31, 2022
Fix a memory leak in ofi mtl add_comm method.

Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit 3626d64)
gpaulsen pushed a commit to hppritcha/ompi that referenced this pull request Mar 31, 2022
when MPI_Session_create_errhandler blows up.

Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit e514ce1)
gpaulsen pushed a commit to hppritcha/ompi that referenced this pull request Mar 31, 2022
more complex test cases for sessions and world model showed
a problem when creating sessions before calling mpi_init.

This patch addresses this problem.

Related to PR open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit 4848109)
hppritcha added a commit to hppritcha/ompi that referenced this pull request Mar 31, 2022
hppritcha added a commit to hppritcha/ompi that referenced this pull request Apr 22, 2022
hppritcha added a commit to hppritcha/ompi that referenced this pull request Apr 26, 2022
wckzhang pushed a commit to wckzhang/ompi that referenced this pull request May 2, 2022
hppritcha added a commit to hppritcha/ompi that referenced this pull request May 5, 2022
related to open-mpi#9097

test https://github.com/open-mpi/ompi-tests-public/blob/master/sessions/sessions_test16.c
now passes.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit 01c2233)
wckzhang pushed a commit to wckzhang/ompi that referenced this pull request May 10, 2022
wckzhang pushed a commit to wckzhang/ompi that referenced this pull request May 10, 2022
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jun 2, 2022
somehow managed to not get into the original sessions pr.
also do some cleanup of the use mpi_f08 profiling functions.

Related to open-mpi#10388

Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jun 21, 2022
comms.

related to open-mpi#10449
related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jun 21, 2022
The sessions attribute functionality was never approved as part of the MPI-4 sessions feature.
Remove a vestige of this from Open MPI.

Related to open-mpi#10388
Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jun 22, 2022
comms.

related to open-mpi#10449
related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit bfffe99)
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jun 22, 2022
The sessions attribute functionality was never approved as part of the MPI-4 sessions feature.
Remove a vestige of this from Open MPI.

Related to open-mpi#10388
Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit c488c60)
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jun 24, 2022
somehow managed to not get into the original sessions pr.
also do some cleanup of the use mpi_f08 profiling functions.

Related to open-mpi#10388

Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
hppritcha added a commit to hppritcha/ompi that referenced this pull request Jul 11, 2022
somehow managed to not get into the original sessions pr.
also do some cleanup of the use mpi_f08 profiling functions.

Related to open-mpi#10388

Related to open-mpi#9097

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
(cherry picked from commit e5c3795)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IBM tool/init_after_finalize failures
8 participants