File: test_seq.py

package info (click to toggle)
mpi4py 4.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,564 kB
  • sloc: python: 35,306; ansic: 16,482; sh: 837; makefile: 618; cpp: 193; f90: 178
file content (18 lines) | stat: -rw-r--r-- 365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from seq import Seq

from mpi4py import MPI


def test():
    size = MPI.COMM_WORLD.Get_size()
    rank = MPI.COMM_WORLD.Get_rank()
    name = MPI.Get_processor_name()
    with Seq(MPI.COMM_WORLD, 1, 10):
        print(
            f"Hello, World! I am process {rank} of {size} on {name}.",
            flush=True,
        )


if __name__ == "__main__":
    test()