Author Topic: MPI does not work  (Read 7461 times)

0 Members and 1 Guest are viewing this topic.

Offline lomlrn

  • New QuantumATK user
  • *
  • Posts: 3
  • Country: de
  • Reputation: 0
    • View Profile
MPI does not work
« on: April 10, 2012, 16:30 »
Hi there,

im following your "Parallel Tutorial" but it seems to be a bit outdated.

The script

from ATK.MPI import *
 
if processIsMaster():
    print '# Master node'
else:
    print '# Slave node'


produces only:


Traceback (most recent call last):
  File "test_mpi.py", line 1, in <module>
    from ATK.MPI import *
ImportError: No module named ATK.MPI


Can you give an updated example?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: MPI does not work
« Reply #1 on: April 10, 2012, 21:17 »
Sorry about that! You can just ignore that line. Here is a much more informative script example:
Code: python
import socket
if processIsMaster():
    print 'Master node:',
else:
    print 'Slave node:',
print socket.gethostname()
In addition to writing out master/slave it also writes on which host each process runs; the allows you to also see how the different machines are allocated, to ensure you use all machines as intended and not piling all MPI process onto the same node.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: MPI does not work
« Reply #2 on: April 10, 2012, 21:19 »
Btw, where did you find the version of the "Parallel Guide" you refer to? The latest online version has the correct (simpler) script without the "from ATK.MPI import *" statement which dates back to 2008.10 - a version which is not longer in circulation officially...

I just want to know, so we can remove any old reference to wrong tutorials if they are found on our website.