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

Add Base.summary(ctx), primarily to show MPI state #101

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nefrathenrici
Copy link
Member

@nefrathenrici nefrathenrici commented Jan 3, 2025

This PR adds two summary functions to give more information to the user about the context. This will be useful for debugging MPI simulations.

It would be nice to add a way to get CUDA device information, but I think we may need to make an extension when both MPI and CUDA are loaded. For now, I copied the CUDADevice assignment code to show the accurate MPI state, but this should probably be spun off into its own function to avoid duplicating code

Basic script:

import MPI, ClimaComms #, CUDA
# ENV["CLIMACOMMS_DEVICE"] = "CUDA"
ctx = ClimaComms.context()
@show ctx
ClimaComms.init(ctx)
print(summary(ctx))
[nefrathe@hpc-21-14 ClimaComms.jl]$ julia --project=test test/summary.jl 
ctx = ClimaComms.SingletonCommsContext{ClimaComms.CPUSingleThreaded}(ClimaComms.CPUSingleThreaded())
Context: SingletonCommsContext
Device: ClimaComms.CPUSingleThreaded
[nefrathe@hpc-21-14 ClimaComms.jl]$ srun julia --project=test test/summary.jl 
ctx = ClimaComms.MPICommsContext{ClimaComms.CPUSingleThreaded, MPI.Comm}(ClimaComms.CPUSingleThreaded(), MPI.Comm(0x00007f3a98ef04a0))
ctx = ClimaComms.MPICommsContext{ClimaComms.CPUSingleThreaded, MPI.Comm}(ClimaComms.CPUSingleThreaded(), MPI.Comm(0x00007f119fe9c4a0))
Context: MPICommsContext
Device: ClimaComms.CPUSingleThreaded
Total Processes: 2
Rank: 0, Node: hpc-21-14.cm.cluster
Rank: 1, Node: hpc-21-14.cm.cluster
[nefrathe@hpc-21-14 ClimaComms.jl]$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant