[sundials-users] Would it be possible to make the SUNContext object creation optional?

12 views
Skip to first unread message

Raymond Langer

unread,
Jul 15, 2022, 11:57:09 AM7/15/22
to SUNDIAL...@listserv.llnl.gov
SUNDIALS release v6.0.0 made the use of the SUNContext object mandatory.
The construction of a SUNContext object in MPI-enabled SUNDIALS
installations requires MPI function calls. As a result, starting with
v6.0.0, projects that do not use MPI can no longer be linked against
MPI-enabled SUNDIALS installations. This makes it more challenging to
use SUNDIALS installations from a package manager, as some of these
installations make MPI mandatory (e.g., homebrew).

A possible solution would be to make creating a SUNContext object
optional in SUNDIALS. Neither package manager nor SUNDIALS-consuming
projects would have to handle breaking changes. Please let me know what
you think.

Best regards,
Raymond Langer

--
Raymond Langer
Wissenschaftlicher Angestellter

Fakultät für Maschinenwesen
Institut für Technische Verbrennung
RWTH Aachen University
Templergraben 64
52062 Aachen
Tel: +49 241 80-91835
Fax: +49 241 80-92923
r.la...@itv.rwth-aachen.de
https://urldefense.us/v3/__http://www.itv.rwth-aachen.de__;!!G2kpM7uM-TzIFchu!l_WAeX4c6kKACzch_NtmCOMVbU4AlLRru5SQR3FS1oHXOKl-3i8f9xxEFqtcQeRUXgybMw$

############################

To unsubscribe from the SUNDIALS-USERS list:
write to: mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV

Balos, Cody Joe

unread,
Jul 15, 2022, 12:13:54 PM7/15/22
to SUNDIAL...@listserv.llnl.gov
Hi Raymond,

The SUNContext itself should not require MPI when SUNDIALS is built with MPI. It is actually the enabling of the profiling that causes MPI to be required. It would be best if the package managers did not enable profiling (which defaults to off) in the normal build as it can have a small impact performance too.  Profiling is enabled/disabled with the CMake option SUNDIALS_BUILD_WITH_PROFILING. 

We will consider making the SUNContext optional, but I don't think it is necessary for this particular issue.

Cody

From: sundials-users <sundial...@llnl.gov> on behalf of Raymond Langer <r.la...@ITV.RWTH-AACHEN.DE>
Sent: Friday, July 15, 2022 8:29 AM
To: sundials-users <sundial...@llnl.gov>
Subject: [sundials-users] Would it be possible to make the SUNContext object creation optional?
 

Raymond Langer

unread,
Jul 18, 2022, 3:00:43 PM7/18/22
to SUNDIAL...@listserv.llnl.gov
Hi Cody,

That's great. So we should be able to link the brew-installed sundials
to our project unless logging was somehow enabled. I think there might
be a problem with the CMake options in SUNDIALS. The SUNDIALS
installation from Homebrew does not seem to enable logging:

https://urldefense.us/v3/__https://github.com/Homebrew/homebrew-core/blob/master/Formula/sundials.rb__;!!G2kpM7uM-TzIFchu!krUfYoYwDgaUGWWeruTpSInCe3WLKsvmvLKT5SDAjLKiqE-saelNjWxoPyoUNd3gUy1fDw$

It does not set SUNDIALS_BUILD_WITH_PROFILING to true as far as I can
tell. The only MPI-related CMake option being used seems to be
-DMPI_ENABLE=ON. When I try to link the CVODE library from the brew
installation of sundials on my macOS, I see linker errors that mean
SUNDIALS_LOGGING_ENABLE_MPI must have been set to true during the
homebrew compilation. Is it possible that the following line in SUNDIALS
might explain this:

sundials_option(SUNDIALS_LOGGING_ENABLE_MPI BOOL "${DOCSTR}"
"${ENABLE_MPI}" DEPENDS_ON ENABLE_MPI)

(from cmake/SundialsBuildOptionsPre.cmake, lines 88-89)

It seems to me that the deprecated MPI_ENABLE=ON enables ENABLE_MPI=ON,
which then, in turn, enables SUNDIALS_LOGGING_ENABLE_MPI. If this
happens, the default value of SUNDIALS_LOGGING_ENABLE_MPI would not be
correct.

Best regards,
Raymond

On 15.07.22 18:13, Balos, Cody Joe wrote:
> Hi Raymond,
>
> The SUNContext itself should not require MPI when SUNDIALS is built with
> MPI. It is actually the enabling of the profiling that causes MPI to be
> required. It would be best if the package managers did not enable
> profiling (which defaults to off) in the normal build as it can have a
> small impact performance too.  Profiling is enabled/disabled with the
> CMake option SUNDIALS_BUILD_WITH_PROFILING.
>
> We will consider making the SUNContext optional, but I don't think it is
> necessary for this particular issue.
>
> Cody
> ------------------------------------------------------------------------
> *From:* sundials-users <sundial...@llnl.gov> on behalf of Raymond
> Langer <r.la...@ITV.RWTH-AACHEN.DE>
> *Sent:* Friday, July 15, 2022 8:29 AM
> *To:* sundials-users <sundial...@llnl.gov>
> *Subject:* [sundials-users] Would it be possible to make the SUNContext
> <mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV>
>
> ------------------------------------------------------------------------
>
> To unsubscribe from the SUNDIALS-USERS list: write to:
> mailto:SUNDIALS-USERS-...@LISTSERV.LLNL.GOV
>

--
Raymond Langer
Wissenschaftlicher Angestellter

Fakultät für Maschinenwesen
Institut für Technische Verbrennung
RWTH Aachen University
Templergraben 64
52062 Aachen
Tel: +49 241 80-91835
Fax: +49 241 80-92923
r.la...@itv.rwth-aachen.de
https://urldefense.us/v3/__http://www.itv.rwth-aachen.de__;!!G2kpM7uM-TzIFchu!krUfYoYwDgaUGWWeruTpSInCe3WLKsvmvLKT5SDAjLKiqE-saelNjWxoPyoUNd1JklKlVg$

Balos, Cody Joe

unread,
Jul 18, 2022, 3:04:03 PM7/18/22
to SUNDIAL...@listserv.llnl.gov

Hi Raymond,

 

Yes, you are right that line is the explanation for the linking errors. Perhaps we should change it to

 

sundials_option(SUNDIALS_LOGGING_ENABLE_MPI BOOL "${DOCSTR}"
"OFF" DEPENDS_ON ENABLE_MPI)

and require that it is explicitly set to ON to use the MPI logging capabilities. I will look into this a bit more, but I think that is probably a reasonable change to make.

 

Thanks,

Cody

Reply all
Reply to author
Forward
0 new messages