示例#1
0
    os.system("make")
os.system("make prefix=%s install" % (USERDIR))

# test:
print "TEST mpd as user ; mpdtrace as user"
PYEXT = ''
NMPDS = 1
HFILE = 'temph'
import os, socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USERDIR, PYEXT))
os.system("%s/bin/mpdboot%s -n %d" % (USERDIR, PYEXT, NMPDS))
expout = ['%s' % (socket.gethostname())]
rv = mpdtest.run(cmd="%s/bin/mpdtrace%s -l" % (USERDIR, PYEXT),
                 grepOut=1,
                 expOut=expout)
os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USERDIR, PYEXT))

# install as root
print "install as root ---------------------------------------------------"
if not os.access("./mpdroot", os.X_OK):
    os.system("./configure")  # use prefix on makes below
    os.system("make")
os.system("sudo make prefix=%s install" % (ROOTDIR))  # sudo did not work here

# test:
print "TEST mpd as root ; mpdtrace as user"
PYEXT = ''
NMPDS = 1
HFILE = 'temph'
示例#2
0
MPIDir = "/home/rbutler/mpich"
MPI_1_Dir = "/home/rbutler/mpich1i"

# test: singleton init (cpi)
print "TEST singleton init (cpi)"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os, socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT, HFILE, NMPDS))
expout = ['Process 0 of 1', 'pi is approximately 3']
rv = mpdtest.run(cmd="%s/examples/cpi" % (MPIDir), grepOut=1, expOut=expout)
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))

# test: bnr (mpich1-compat using cpi)
print "TEST bnr (mpich1-compat using cpi)"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os, socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT, HFILE, NMPDS))
expout = [
    'Process 0 on', 'Process 1 on', 'Process 2 on', 'pi is approximately 3'
示例#3
0
# for i in range(9000,10000): testsToRun[i] = 1    # run root tests
# testsToRun[3003] = 1                               # run this one test


if 1 in testsToRun[0:1000]:
    print "mpd tests---------------------------------------------------"

if testsToRun[0]:
    # test: simple with 1 mpd (mpdboot uses mpd's -e and -d options)
    print "TEST -e -d"
    NMPDS = 1
    mpdtest = MPDTest()
    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
    os.system("mpdboot%s -n %s" % (PYEXT,NMPDS) )
    expout = 'hello\nhello\nhello\n'
    mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
    os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )

if testsToRun[1]:
    # test: simple with 2 mpds on same machine (mpdboot uses mpd's -n option)
    print "TEST -n"
    NMPDS = 2
    if NMPDS > len(clusterHosts)+1:
        print "    skipping; too few hosts"
    else:
        mpdtest = MPDTest()
        temph = open(HFILE,'w')
        for i in range(NMPDS): print >>temph, '%s' % (socket.gethostname())
        temph.close()
        os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
        os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
示例#4
0
clusterHosts = [ 'bp4%02d' % (i)  for i in range(0,8) ]
print "clusterHosts=", clusterHosts

# test: simple with 1 mpd (mpdboot uses mpd's -e and -d options)
print "TEST -e -d"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = 'hello\nhello\nhello\n'
mpdtest.run(cmd="mpiexec%s -n 3 /bin/echo hello" % (PYEXT), chkOut=1, expOut=expout )
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )

# test: simple with 2 mpds on same machine (mpdboot uses mpd's -n option)
print "TEST -n"
PYEXT = '.py'
NMPDS = 2
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
temph = open(HFILE,'w')
for i in range(NMPDS): print >>temph, '%s' % (socket.gethostname())
temph.close()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
示例#5
0
MPIDir = "/home/rbutler/mpich"

# test: cpi
print "TEST cpi"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = ['Process 0 of 3','Process 1 of 3','Process 2 of 3']
rv = mpdtest.run(cmd="mpiexec%s -n 3 %s/examples/cpi" % (PYEXT,MPIDir),
                 grepOut=1, expOut=expout )
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )

# test: spawn1
print "TEST spawn1"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = ['No Errors']
olddir = os.getcwd()
示例#6
0
PYEXT = '.py'
NMPDS = 3
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
temph = open(HFILE,'w')
for host in clusterHosts: print >>temph, host
temph.close()
os.system("mpdboot%s -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = ['%s' % (socket.gethostname()),
          '%s' % (clusterHosts[0]),
          '%s' % (clusterHosts[1])]
rv = mpdtest.run(cmd="mpdtrace%s -l" % (PYEXT), grepOut=1, expOut=expout )
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )

# test:
print "TEST mpdringtest"
PYEXT = '.py'
NMPDS = 3
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
temph = open(HFILE,'w')
for host in clusterHosts: print >>temph, host
temph.close()
示例#7
0
from mpdlib import MPDTest
temph = open(HFILE, 'w')
for host in clusterHosts:
    print >> temph, host
temph.close()
tempm = open('tempm', 'w')
for host in clusterHosts:
    print >> tempm, '%s:2 ifhn=%s' % (host, host)
tempm.close()
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT, HFILE, NMPDS))
expout = '0: bp400\n1: bp400\n2: bp401\n3: bp401\n'  # 2 per host because of :2's in tempm
mpdtest.run(cmd="mpiexec%s -l -machinefile %s -n 4 hostname" %
            (PYEXT, 'tempm'),
            chkOut=1,
            expOut=expout)
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))

# test:
print "TEST -file"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os, socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT, HFILE, NMPDS))
tempfilename = '/tmp/%s_tempin2' % (os.environ['USER'])
示例#8
0
NMPDS = 4
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
temph = open(HFILE,'w')
for host in clusterHosts: print >>temph, host
temph.close()
tempm = open('tempm','w')
for host in clusterHosts: print >>tempm, '%s:2 ifhn=%s' % (host,host)
tempm.close()
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = '0: bp400\n1: bp400\n2: bp401\n3: bp401\n'   # 2 per host because of :2's in tempm
mpdtest.run(cmd="mpiexec%s -l -machinefile %s -n 4 hostname" % (PYEXT,'tempm'), chkOut=1, expOut=expout)
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )

# test:
print "TEST -file"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
tempfilename = '/tmp/%s_tempin2' % (os.environ['USER'])
f = open(tempfilename,'w')
示例#9
0
MPIDir = "/home/rbutler/mpich"
MPI_1_Dir = "/home/rbutler/mpich1i"

# test: singleton init (cpi)
print "TEST singleton init (cpi)"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = ['Process 0 of 1','pi is approximately 3']
rv = mpdtest.run(cmd="%s/examples/cpi" % (MPIDir), grepOut=1, expOut=expout )
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )

# test: bnr (mpich1-compat using cpi)
print "TEST bnr (mpich1-compat using cpi)"
PYEXT = '.py'
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT) )
os.system("mpdboot%s -1 -f %s -n %d" % (PYEXT,HFILE,NMPDS) )
expout = ['Process 0 on','Process 1 on','Process 2 on','pi is approximately 3']
rv = mpdtest.run(cmd="mpiexec%s -bnr -n 3 %s/examples/cpi" % (PYEXT,MPI_1_Dir),
示例#10
0
    os.system("./configure")  # use prefix on makes below
    os.system("make")
os.system("make prefix=%s install" % (USERDIR) )

# test:
print "TEST mpd as user ; mpdtrace as user"
PYEXT = ''
NMPDS = 1
HFILE = 'temph'
import os,socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USERDIR,PYEXT) )
os.system("%s/bin/mpdboot%s -n %d" % (USERDIR,PYEXT,NMPDS) )
expout = ['%s' % (socket.gethostname())]
rv = mpdtest.run(cmd="%s/bin/mpdtrace%s -l" % (USERDIR,PYEXT), grepOut=1, expOut=expout )
os.system("%s/bin/mpdallexit%s 1> /dev/null 2> /dev/null" % (USERDIR,PYEXT) )

# install as root
print "install as root ---------------------------------------------------"
if not os.access("./mpdroot",os.X_OK):
    os.system("./configure")  # use prefix on makes below
    os.system("make")
os.system("sudo make prefix=%s install" % (ROOTDIR) )    # sudo did not work here

# test:
print "TEST mpd as root ; mpdtrace as user"
PYEXT = ''
NMPDS = 1
HFILE = 'temph'
import os,socket
示例#11
0
import os, socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))
temph = open(HFILE, 'w')
for host in clusterHosts:
    print >> temph, host
temph.close()
os.system("mpdboot%s -f %s -n %d" % (PYEXT, HFILE, NMPDS))
expout = [
    '%s' % (socket.gethostname()),
    '%s' % (clusterHosts[0]),
    '%s' % (clusterHosts[1])
]
rv = mpdtest.run(cmd="mpdtrace%s -l" % (PYEXT), grepOut=1, expOut=expout)
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))

# test:
print "TEST mpdringtest"
PYEXT = '.py'
NMPDS = 3
HFILE = 'temph'
import os, socket
from mpdlib import MPDTest
mpdtest = MPDTest()
os.environ['MPD_CON_EXT'] = 'testing'
os.system("mpdallexit%s 1> /dev/null 2> /dev/null" % (PYEXT))
temph = open(HFILE, 'w')
for host in clusterHosts:
    print >> temph, host