Skip to content
Snippets Groups Projects

Change using_mpi test

Merged Sylvia Biscoveanu requested to merge sylvia.biscoveanu/bilby:multinest_mpi into master
All threads resolved!

I've run into a new bug with the current bilby implementation of pymultinest. There is a new environment variable that comes up by default called VT_MPI, which triggers this clause to always set using_mpi to True. I've changed this clause to instead check that MPI.COMM_WORLD.Get_size()>1. I've tested this with a simple Hello World script as follows:

from mpi4py import MPI
import sys
import os

size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()
name = MPI.Get_processor_name()
using_mpi = (MPI.COMM_WORLD.Get_size()>1)
print(using_mpi)

sys.stdout.write(
    "Hello, World! I am process %d of %d on %s.\n"
    % (rank, size, name))

which produces the following output

> python test_mpi.py 
False
Hello, World! I am process 0 of 1 on ldas-pcdev3.
> mpiexec -n 4 python test_mpi.py 
True
Hello, World! I am process 1 of 4 on ldas-pcdev3.
True
Hello, World! I am process 3 of 4 on ldas-pcdev3.
True
Hello, World! I am process 2 of 4 on ldas-pcdev3.
True
Hello, World! I am process 0 of 4 on ldas-pcdev3.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sylvia Biscoveanu resolved all threads

    resolved all threads

  • added 1 commit

    Compare with previous version

  • Gregory Ashton approved this merge request

    approved this merge request

  • Michael Williams approved this merge request

    approved this merge request

  • added Bug Sampling labels

  • Colm Talbot mentioned in commit c40bf4e9

    mentioned in commit c40bf4e9

  • merged

  • Colm Talbot changed milestone to %1.1.5

    changed milestone to %1.1.5

  • Please register or sign in to reply
    Loading