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

Improve printing of MPI processes #156

Closed
MKirchen opened this issue Dec 2, 2017 · 2 comments
Closed

Improve printing of MPI processes #156

MKirchen opened this issue Dec 2, 2017 · 2 comments

Comments

@MKirchen
Copy link
Contributor

MKirchen commented Dec 2, 2017

Right now, the following code prints information about the number of MPI processes and the number of threads used:

    if comm.rank == 0:
        if use_cuda:
            message = "\nRunning fbpic-%s on GPU " %__version__
        else:
            message = "\nRunning fbpic-%s on CPU " %__version__
        message += "with %d proc" %comm.size
        if use_threading and not use_cuda:
            message += " (%d threads per proc)" %numba.config.NUMBA_NUM_THREADS
        message += ".\n"

        print( message )

We should change it to the following for better readability:
(Note that I exchanged "proc" with "MPI processes")

    if comm.rank == 0:
        if use_cuda:
            message = "\nRunning fbpic-%s on GPU " %__version__
        else:
            message = "\nRunning fbpic-%s on CPU " %__version__
        message += "with %d MPI processes" %comm.size
        if use_threading and not use_cuda:
            message += " (%d threads per MPI process)" %numba.config.NUMBA_NUM_THREADS
        message += ".\n"

        print( message )
@RemiLehe
Copy link
Member

RemiLehe commented Dec 2, 2017

I like this. I agree that the previous printed message was not very explicit.
Would you like to do a corresponding PR?

One thing to think about though is the case were we do single-proc simulation (esp. in the case where mpi4py is not installed): in this case it might be confusing for the user to see a message suggesting that MPI is used. I am wondering if the best, in the case, is to just print something like this:

  • For single-proc:
Running fbpic-0.6.2 on CPU (using 4 threads)
  • For multi-proc
Running fbpic-0.6.2 on CPU with 2 MPI processes (4 threads per MPI process)

What do you think?

@MKirchen
Copy link
Contributor Author

MKirchen commented Dec 2, 2017

yes that makes sense, I'll do a PR

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

No branches or pull requests

2 participants