Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2110

pymongo segfaults when running with mpi4py

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.10.1
    • 4.2
    • Internal
    • None
    • Suse Enterprise Linux 15
      mpi4py 3.0.2
      cray xc40

    Description

      I'm trying to connect to mongodb from within a python program that uses mpi. The program below segfaults when using MPI:

      $ srun -n 1 python -m mpi4py.futures mongo_mpi.py

      Any ideas? Thanks, Ralph

      1 from mpi4py import MPI
      2 from mpi4py.futures import MPIPoolExecutor
      3
      4 from pymongo import MongoClient
      5
      6 import string
      7 import random
      8
      9
      10 def main():
      11
      12 rank = MPI.COMM_WORLD.Get_rank()
      13 print(f"rank = {rank}")
      14
      15 rand = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(5))
      16
      17 client = MongoClient("dbserver.host", username="user", password="pass")18 db = client.get_database()
      19 db.test_analysis.insert_one({rand: 'says hello'})
      20 client.close()
      21
      22 if _name_ == "_main_":
      23 main()

      Attachments

        Activity

          People

            ben.warner@mongodb.com Ben Warner (Inactive)
            rkube@pppl.gov Ralph Kube
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: