QuantumATK Forum

QuantumATK => Installation and License Questions => Topic started by: lomlrn on April 10, 2012, 16:30

Title: MPI does not work
Post by: lomlrn 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?
Title: Re: MPI does not work
Post by: Anders Blom 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.

Title: Re: MPI does not work
Post by: Anders Blom on April 10, 2012, 21:19
Btw, where did you find the version of the "Parallel Guide" you refer to? The latest online version (http://quantumwise.com/documents/tutorials/latest/ParallelGuide/index.html/) 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.