Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | # Inital test of MPI module 'pypar' for Python |
---|
3 | # |
---|
4 | # Run as |
---|
5 | # python test_init.py |
---|
6 | # or |
---|
7 | # mpirun -np 2 test_init.py |
---|
8 | # (perhaps try number of processors more than 2) |
---|
9 | # |
---|
10 | # To verify bandwidth of your architecture please run pytiming (and ctiming) |
---|
11 | # |
---|
12 | # OMN April 2002 |
---|
13 | |
---|
14 | |
---|
15 | import pypar |
---|
16 | |
---|
17 | myid = pypar.rank() |
---|
18 | numproc = pypar.size() |
---|
19 | node = pypar.Get_processor_name() |
---|
20 | |
---|
21 | print "I am processor %d of %d on node %s" %(myid, numproc, node) |
---|
22 | if myid == 0: |
---|
23 | print 'Maximal tag is %d' %pypar.max_tag |
---|
24 | pypar.Finalize() |
---|
25 | |
---|
Note: See
TracBrowser
for help on using the repository browser.