# install as user print "install as user ---------------------------------------------------" if not os.access("./mpdroot", os.X_OK): 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
print "odd tests---------------------------------------------------" clusterHosts = ['bp4%02d' % (i) for i in range(0, 8)] print "clusterHosts=", clusterHosts 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()
# for i in range(1000,2000): testsToRun[i] = 1 # run tests for mpiexec # for i in range(2000,3000): testsToRun[i] = 1 # run MPI tests # for i in range(3000,4000): testsToRun[i] = 1 # run console pgm tests # for i in range(8000,9000): testsToRun[i] = 1 # run misc tests # 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')
import os, sys, commands, time sys.path += [os.getcwd()] # do this once print "mpd tests---------------------------------------------------" 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()
print "mpi tests---------------------------------------------------" clusterHosts = [ 'bp4%02d' % (i) for i in range(0,8) ] print "clusterHosts=", clusterHosts 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
print "console pgm tests---------------------------------------------------" clusterHosts = [ 'bp4%02d' % (i) for i in range(0,8) ] print "clusterHosts=", clusterHosts if not os.access("infloop",os.X_OK): os.system("make infloop") # test: print "TEST mpdtrace" 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'
# test: print "TEST -machinefile" PYEXT = '.py' 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'
print "clusterHosts=", clusterHosts # test: print "TEST -machinefile" PYEXT = '.py' 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()
print "odd tests---------------------------------------------------" clusterHosts = [ 'bp4%02d' % (i) for i in range(0,8) ] print "clusterHosts=", clusterHosts 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()
# install as user print "install as user ---------------------------------------------------" if not os.access("./mpdroot",os.X_OK): 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"
print "console pgm tests---------------------------------------------------" clusterHosts = ['bp4%02d' % (i) for i in range(0, 8)] print "clusterHosts=", clusterHosts if not os.access("infloop", os.X_OK): os.system("make infloop") # test: print "TEST mpdtrace" 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))