Commit 70ca1631 authored by Jens Domke's avatar Jens Domke
Browse files

make static routing independent of ibdiag tools

multiple people had install issues with the fts toolchain
so lets remove some bloatware from it
parent 2d4e7765
......@@ -84,31 +84,27 @@ tar xzf fts.tgz
cd fault_tolerance_simulation/
rm 0001-*.patch 0002-*.patch 0003-*.patch 0004-*.patch 0005-*.patch
tar xzf $P_PATH/sar.patches.tgz
wget http://downloads.openfabrics.org/management/opensm-3.3.20.tar.gz
mv opensm-3.3.20.tar.gz opensm.tar.gz
wget http://downloads.openfabrics.org/ibutils/ibutils-1.5.7-0.2.gbd7e502.tar.gz
mv ibutils-1.5.7-0.2.gbd7e502.tar.gz ibutils.tar.gz
wget http://downloads.openfabrics.org/management/infiniband-diags-1.6.7.tar.gz
mv infiniband-diags-1.6.7.tar.gz infiniband-diags.tar.gz
wget https://www.openfabrics.org/downloads/management/libibmad-1.3.12.tar.gz
mv libibmad-1.3.12.tar.gz libibmad.tar.gz
wget https://www.openfabrics.org/downloads/management/libibumad-1.3.10.2.tar.gz
mv libibumad-1.3.10.2.tar.gz libibumad.tar.gz
patch -p1 < $P_PATH/fts.patch
./simuate.py -s
./simulate.py -s
2. Add LFT creating scripts to the fall-in-place toolchain.
cd $HOME/simulation/scripts
patch -p1 < $P_PATH/lft.patch
chmod +x post_process_*
chmod +x create_static_lft.sh
chmod +x create_static_lft.sh
3. Choose a routing algorithm which should be used by OpenSM
(possible options: updn, dnup, ftree, lash, dor, torus-2QoS, dfsssp, sssp)
export OSM_ROUTING="ftree"
export OSM_ROUTING="ftree"
~/simulation/scripts/create_static_lft.sh routing_folder dot_file
(here routing_folder and dot_file should be same as the one used during the run used to dump the topology)
......
......@@ -626,13 +626,109 @@ diff -Nur scripts.orig/createIBNet.py scripts/createIBNet.py
+ #sys.exit('\nFinish!')
+ sys.exit(0)
diff -Nur scripts.orig/simulate.py scripts/simulate.py
--- scripts.orig/simulate.py 2016-08-17 14:02:19.306717000 -0700
+++ scripts/simulate.py 2016-08-17 13:10:45.369042000 -0700
@@ -724,21 +724,23 @@
os.system("sed -i -e 's#\"/usr/bin\":##g' %s/bin/ibdiagnet" % ofeddir)
diff -u scripts/simulate.py scripts/simulate.py
--- scripts/simulate.py 2016-08-17 13:10:45.369042000 -0700
+++ scripts/simulate.py 2017-04-25 19:24:20.959463076 +0900
@@ -610,24 +610,24 @@
os.mkdir(os.path.join(instdir, 'libibmad'))
if not os.path.exists(os.path.join(instdir, 'opensm')):
os.mkdir(os.path.join(instdir, 'opensm'))
- if not os.path.exists(os.path.join(instdir, 'infiniband-diags')):
- os.mkdir(os.path.join(instdir, 'infiniband-diags'))
+ #if not os.path.exists(os.path.join(instdir, 'infiniband-diags')):
+ # os.mkdir(os.path.join(instdir, 'infiniband-diags'))
if not os.path.exists(os.path.join(instdir, 'ibsim')):
os.mkdir(os.path.join(instdir, 'ibsim'))
- if not os.path.exists(os.path.join(instdir, 'ibutils')):
- os.mkdir(os.path.join(instdir, 'ibutils'))
- if not os.path.exists(os.path.join(instdir, 'omnet')):
- os.mkdir(os.path.join(instdir, 'omnet'))
- if not os.path.exists(os.path.join(instdir, 'ibmodel')):
- os.mkdir(os.path.join(instdir, 'ibmodel'))
+ #if not os.path.exists(os.path.join(instdir, 'ibutils')):
+ # os.mkdir(os.path.join(instdir, 'ibutils'))
+ #if not os.path.exists(os.path.join(instdir, 'omnet')):
+ # os.mkdir(os.path.join(instdir, 'omnet'))
+ #if not os.path.exists(os.path.join(instdir, 'ibmodel')):
+ # os.mkdir(os.path.join(instdir, 'ibmodel'))
os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'libibumad'), 'libibumad'))
os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'libibmad'), 'libibmad'))
os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'opensm'), 'opensm'))
- os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'infiniband-diags'), 'infiniband-diags'))
+ #os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'infiniband-diags'), 'infiniband-diags'))
os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'ibsim'), 'ibsim'))
- os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'ibutils'), 'ibutils'))
- os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'omnet'), 'omnet'))
- os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'ibmodel'), 'ibmodel'))
+ #os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'ibutils'), 'ibutils'))
+ #os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'omnet'), 'omnet'))
+ #os.system('tar xzf %s.tar.gz -C %s --strip-components 1' % (os.path.join(currdir, 'ibmodel'), 'ibmodel'))
# patching opensm
for root, dirs, files in os.walk(currdir):
@@ -681,64 +681,70 @@
os.system('make install >install.log 2>&1')
os.chdir(instdir)
- print "Step 4..."
- os.chdir(os.path.join(instdir, 'infiniband-diags'))
- os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
- os.system('./autogen.sh >autogen.log 2>&1')
- os.system('./configure %s --with-perl-installdir=%s >configure.log 2>&1' % (glob_config_opts, os.path.join(ofeddir, 'perl')))
- os.system('./autogen.sh >autogen.log 2>&1')
- os.system('./configure %s --with-perl-installdir=%s >configure.log 2>&1' % (glob_config_opts, os.path.join(ofeddir, 'perl')))
- os.system('make >make.log 2>&1')
- os.system('make install >install.log 2>&1')
- os.chdir(instdir)
+ print '...... skipping step 4 .....'
+ if 0:
+ print "Step 4..."
+ os.chdir(os.path.join(instdir, 'infiniband-diags'))
+ os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
+ os.system('./autogen.sh >autogen.log 2>&1')
+ os.system('./configure %s --with-perl-installdir=%s >configure.log 2>&1' % (glob_config_opts, os.path.join(ofeddir, 'perl')))
+ os.system('./autogen.sh >autogen.log 2>&1')
+ os.system('./configure %s --with-perl-installdir=%s >configure.log 2>&1' % (glob_config_opts, os.path.join(ofeddir, 'perl')))
+ os.system('make >make.log 2>&1')
+ os.system('make install >install.log 2>&1')
+ os.chdir(instdir)
print "Step 5..."
os.chdir(os.path.join(instdir, 'ibsim'))
os.system('make IB_DEV_DIR=%s prefix=%s all install >make.log 2>&1' % (instdir, ofeddir))
os.chdir(instdir)
- print "Step 6..."
- #os.chdir(os.path.join(instdir, 'ibutils'))
+ print '...... skipping step 6 .....'
+ if 0:
+ print "Step 6..."
+ #os.chdir(os.path.join(instdir, 'ibutils'))
# if socket.gethostname().find("t2a") >= 0:
# os.system("for x in `grep -R 2.2.6 . | cut -d ':' -f1 | sort -u`; do sed -i -e 's/2.2.6b/2.2.6/g' $x; done")
# os.system("for x in `grep -R Debian-2.2.6-2ubuntu1 . | cut -d ':' -f1 | sort -u`; do sed -i -e 's/ Debian-2.2.6-2ubuntu1//g' $x; done")
# os.system("for x in `grep -R 1.3017 . | cut -d ':' -f1 | sort -u`; do sed -i -e 's/1.3017/1.3012/g' $x; done")
# elif socket.gethostname().find("rc0") >= 0:
- os.chdir(os.path.join(instdir, 'ibutils', 'ibdiag'))
- os.system('(aclocal; libtoolize --force; autoconf) >/dev/null 2>&1')
- os.chdir(os.path.join(instdir, 'ibutils', 'ibdm'))
- os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
- os.chdir(os.path.join(instdir, 'ibutils', 'ibis'))
- os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
- os.chdir(os.path.join(instdir, 'ibutils', 'ibmgtsim'))
- os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
- os.chdir(os.path.join(instdir, 'ibutils'))
- os.system('(aclocal; libtoolize --force; autoconf) >/dev/null 2>&1')
- os.system('./autogen.sh >autogen.log 2>&1')
- os.system('./configure %s --with-osm=%s >configure.log 2>&1' % (glob_config_opts, ofeddir))
- os.system('./autogen.sh >autogen.log 2>&1')
- os.system('./configure %s --with-osm=%s >configure.log 2>&1' % (glob_config_opts, ofeddir))
- os.system('make >make.log 2>&1')
- os.system('make check >check.log 2>&1')
- os.system('make install >install.log 2>&1')
- os.system("sed -i -e 's#\"/usr/bin\":##g' %s/bin/ibdiagnet" % ofeddir)
- os.chdir(instdir)
-
- print "Step 7..."
- os.chdir(os.path.join(instdir, 'omnet'))
- os.environ['PATH'] = '%s:%s' % (os.path.join(instdir, 'omnet', 'bin'), os.getenv('PATH'))
......@@ -648,6 +744,26 @@ diff -Nur scripts.orig/simulate.py scripts/simulate.py
- os.environ['LD_LIBRARY_PATH'] = '%s:%s' % (os.path.join(instdir, 'omnet', 'lib'), os.getenv('LD_LIBRARY_PATH'))
- os.system('opp_makemake -f --deep -O out')
- os.system('make MODE=release')
+ os.chdir(os.path.join(instdir, 'ibutils', 'ibdiag'))
+ os.system('(aclocal; libtoolize --force; autoconf) >/dev/null 2>&1')
+ os.chdir(os.path.join(instdir, 'ibutils', 'ibdm'))
+ os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
+ os.chdir(os.path.join(instdir, 'ibutils', 'ibis'))
+ os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
+ os.chdir(os.path.join(instdir, 'ibutils', 'ibmgtsim'))
+ os.system('(aclocal; libtoolize --force; autoheader; autoconf) >/dev/null 2>&1')
+ os.chdir(os.path.join(instdir, 'ibutils'))
+ os.system('(aclocal; libtoolize --force; autoconf) >/dev/null 2>&1')
+ os.system('./autogen.sh >autogen.log 2>&1')
+ os.system('./configure %s --with-osm=%s >configure.log 2>&1' % (glob_config_opts, ofeddir))
+ os.system('./autogen.sh >autogen.log 2>&1')
+ os.system('./configure %s --with-osm=%s >configure.log 2>&1' % (glob_config_opts, ofeddir))
+ os.system('make >make.log 2>&1')
+ os.system('make check >check.log 2>&1')
+ os.system('make install >install.log 2>&1')
+ os.system("sed -i -e 's#\"/usr/bin\":##g' %s/bin/ibdiagnet" % ofeddir)
+ os.chdir(instdir)
+
+ print '...... skipping omnet install .....'
+ if 0:
+ print "Step 7..."
......@@ -668,10 +784,124 @@ diff -Nur scripts.orig/simulate.py scripts/simulate.py
print "Step 9..."
os.system('cp %s/*.py %s/' % (currdir, scriptdir))
@@ -925,39 +927,40 @@
log.close()
@@ -832,24 +838,26 @@
routing_failed = True
osm_log.close()
- print "Scan fabric..."
- scanlog = os.path.join(ofedoutdir, 'scan.log')
- cmd = '%s %s %s >%s 2>&1 &' % (os.path.join(scriptdir, 'scanFabric.sh' ), instdir, ofedoutdir, scanlog)
- log.write('%s %s\n' % (time.asctime(), cmd))
- os.system(cmd)
- while True:
- if os.path.exists(scanlog):
- break
- time.sleep(1)
- scan_log = open(scanlog, 'r')
- gstr = ''
- while True:
- str = scan_log.read()
- gstr = gstr + str
- if gstr.find('SUBNET SCANNED') != -1:
- break
- time.sleep(1)
- scan_log.close()
+ # doesnt work in this mode since we removed ibdiagnet/ibnetdiscover
+ if 0:
+ print "Scan fabric..."
+ scanlog = os.path.join(ofedoutdir, 'scan.log')
+ cmd = '%s %s %s >%s 2>&1 &' % (os.path.join(scriptdir, 'scanFabric.sh' ), instdir, ofedoutdir, scanlog)
+ log.write('%s %s\n' % (time.asctime(), cmd))
+ os.system(cmd)
+ while True:
+ if os.path.exists(scanlog):
+ break
+ time.sleep(1)
+ scan_log = open(scanlog, 'r')
+ gstr = ''
+ while True:
+ str = scan_log.read()
+ gstr = gstr + str
+ if gstr.find('SUBNET SCANNED') != -1:
+ break
+ time.sleep(1)
+ scan_log.close()
print "Stop ibsim/opensm..."
toKill = [['startOpenSM.pid', signal.SIGTERM], ['startSIM.pid', signal.SIGTERM], ['opensm.pid', signal.SIGKILL], ['ibsim.pid', signal.SIGKILL]]
@@ -867,6 +875,9 @@
return
if routing.find('tofu') > -1:
+ log.write( '\nERROR: tofu not supported in this modus!\n' )
+ log.close()
+ return
print "Replace with tofu routing..."
LFTtoFDBSlog = os.path.join(testdir, 'LFTtoFDBSlog.log')
cmd = '%s --lft %s --ibnd %s --fdbs %s >%s 2>&1 &' % (os.path.join(scriptdir, 'IBNetLFTtoFDBS.py'), os.path.join(ofedoutdir, 'topo.lft'), os.path.join(ofedoutdir, 'ibnetdiscover.log'), os.path.join(ofedoutdir, 'ibdiagnet.fdbs'), LFTtoFDBSlog)
@@ -896,68 +907,71 @@
log.close()
return
- print "Check the connectivity of the system..."
- checklog = os.path.join(testdir, 'checkConnectivity.log')
- cmd = '%s %s >%s 2>&1 &' % (os.path.join(scriptdir, 'checkConnectivity.py'), ofedoutdir, checklog)
- log.write('%s %s\n' % (time.asctime(), cmd))
- os.system(cmd)
- while True:
- if os.path.exists(checklog):
- break
- time.sleep(1)
- check_log = open(checklog, 'r')
- gstr = ''
- while True:
- str = check_log.read()
- gstr = gstr + str
- if gstr.find('Finish') != -1 or gstr.find('Usage') != -1 or gstr.find('Error') != -1:
- break
- time.sleep(1)
- routing_failed = False
- gstr = gstr.splitlines()
- for line in gstr:
- if line.find('Error') != -1 or line.find('Usage') != -1:
- log.write( '%s\n' % (line) )
- routing_failed = True
- check_log.close()
- if routing_failed:
- log.write( '\nERROR: routing failed, connectivity broken!\n' )
- log.close()
- return
+ # doesnt work in this mode since we removed ibdiagnet/ibnetdiscover
+ if 0:
+ print "Check the connectivity of the system..."
+ checklog = os.path.join(testdir, 'checkConnectivity.log')
+ cmd = '%s %s >%s 2>&1 &' % (os.path.join(scriptdir, 'checkConnectivity.py'), ofedoutdir, checklog)
+ log.write('%s %s\n' % (time.asctime(), cmd))
+ os.system(cmd)
+ while True:
+ if os.path.exists(checklog):
+ break
+ time.sleep(1)
+ check_log = open(checklog, 'r')
+ gstr = ''
+ while True:
+ str = check_log.read()
+ gstr = gstr + str
+ if gstr.find('Finish') != -1 or gstr.find('Usage') != -1 or gstr.find('Error') != -1:
+ break
+ time.sleep(1)
+ routing_failed = False
+ gstr = gstr.splitlines()
+ for line in gstr:
+ if line.find('Error') != -1 or line.find('Usage') != -1:
+ log.write( '%s\n' % (line) )
+ routing_failed = True
+ check_log.close()
+ if routing_failed:
+ log.write( '\nERROR: routing failed, connectivity broken!\n' )
+ log.close()
+ return
- print "Transform fabric into omnet++ format..."
- omnetfiles = os.path.join(testdir, 'omnet')
- translog = os.path.join(testdir, 'ibsim2omnet.log')
......@@ -742,23 +972,21 @@ diff -Nur scripts.orig/simulate.py scripts/simulate.py
log.write('\nFinished!\n')
log.close()
@@ -1138,5 +1141,6 @@
else:
parser.print_help()
@@ -1140,3 +1154,4 @@
- sys.exit('\nFinish!')
+ #sys.exit('\nFinish!')
+ sys.exit(0)
diff -Nur scripts.orig/startOpenSM.sh scripts/startOpenSM.sh
--- scripts.orig/startOpenSM.sh 2016-08-17 14:02:30.943729000 -0700
+++ scripts/startOpenSM.sh 2016-08-17 13:59:43.760997000 -0700
diff -u scripts/startOpenSM.sh scripts/startOpenSM.sh
--- scripts/startOpenSM.sh 2016-08-17 13:59:43.760997000 -0700
+++ scripts/startOpenSM.sh 2017-04-25 18:59:13.484892065 +0900
@@ -39,7 +39,10 @@
DEBUG=""
if [ -n $2 ]; then
- DEBUG="-D ${2}"
+ DEBUG="-D ${2} -d2"
+ DEBUG="-D 0x43 -d2 --once"
+fi
+if [ -f ${4}/../batch_jobs.conf ]; then
+ DEBUG="${DEBUG} --batch_job_file ${4}/../batch_jobs.conf"
......
diff -Nur scripts.orig/create_static_lft.sh scripts/create_static_lft.sh
--- scripts.orig/create_static_lft.sh 1969-12-31 16:00:00.000000000 -0800
+++ scripts/create_static_lft.sh 2016-08-16 11:08:06.058810000 -0700
diff -u scripts/create_static_lft.sh 2016-08-16 11:08:06.058810000 -0700 scripts/create_static_lft.sh
--- scripts/create_static_lft.sh 2016-08-16 11:08:06.058810000 -0700
+++ scripts/create_static_lft.sh 2017-04-25 19:59:16.977561809 +0900
@@ -0,0 +1,47 @@
+#!/bin/bash
+
......@@ -37,21 +37,21 @@ diff -Nur scripts.orig/create_static_lft.sh scripts/create_static_lft.sh
+$HOME/simulation/scripts/simulate.py -n ${SIM_DIR} -r ${OSM_ROUTING} -p exchange
+if [ "x$?" != "x0" ]; then exit -1; fi
+
+mv ${SIM_DIR}/ofedout/ibdiagnet.fdbs ${SIM_DIR}/
+mv ${SIM_DIR}/ofedout/opensm.fdbs ${SIM_DIR}/
+mv ${SIM_DIR}/ofedout/opensm-subnet.lst ${SIM_DIR}/
+echo "running post_process_lfts.py"
+$HOME/simulation/scripts/post_process_lfts.py ${SIM_DIR}/ibdiagnet.fdbs ${SIM_DIR}/opensm-subnet.lst ${SIM_DIR}/
+$HOME/simulation/scripts/post_process_lfts.py ${SIM_DIR}/opensm.fdbs ${SIM_DIR}/opensm-subnet.lst ${SIM_DIR}/
+if [ "x$?" != "x0" ]; then exit -1; fi
+echo "Done with script"
+
+#if [ -z ${KEEP_INTERMEDIATE} ]; then
+# rm -rf ./checkConnectivity.log ./log.txt ./ofedout/ ./${WRITE_TOPOLOGY_DOT_FILE}.dot ./topo.* ./ibdiagnet.fdbs ./opensm-subnet.lst
+# rm -rf ./log.txt ./ofedout/ ./${WRITE_TOPOLOGY_DOT_FILE}.dot ./topo.* ./opensm.fdbs ./opensm-subnet.lst
+#fi
+
+exit 0
diff -Nur scripts.orig/get_static_lft_for_codes.sh scripts/get_static_lft_for_codes.sh
--- scripts.orig/get_static_lft_for_codes.sh 1969-12-31 16:00:00.000000000 -0800
+++ scripts/get_static_lft_for_codes.sh 2016-08-16 11:08:06.058810000 -0700
diff -u scripts/get_static_lft_for_codes.sh scripts/get_static_lft_for_codes.sh
--- scripts/get_static_lft_for_codes.sh 2016-08-16 11:08:06.058810000 -0700
+++ scripts/get_static_lft_for_codes.sh 2017-04-25 19:59:39.901542081 +0900
@@ -0,0 +1,36 @@
+#!/bin/bash
+
......@@ -79,13 +79,13 @@ diff -Nur scripts.orig/get_static_lft_for_codes.sh scripts/get_static_lft_for_co
+$HOME/simulation/scripts/simulate.py -n ${SIM_DIR} -r ${OSM_ROUTING} -p exchange
+if [ "x$?" != "x0" ]; then exit -1; fi
+
+mv ${SIM_DIR}/ofedout/ibdiagnet.fdbs ${SIM_DIR}/
+mv ${SIM_DIR}/ofedout/opensm.fdbs ${SIM_DIR}/
+mv ${SIM_DIR}/ofedout/opensm-subnet.lst ${SIM_DIR}/
+$HOME/simulation/scripts/post_process_lfts.py ${SIM_DIR}/ibdiagnet.fdbs ${SIM_DIR}/opensm-subnet.lst ${SIM_DIR}/
+$HOME/simulation/scripts/post_process_lfts.py ${SIM_DIR}/opensm.fdbs ${SIM_DIR}/opensm-subnet.lst ${SIM_DIR}/
+if [ "x$?" != "x0" ]; then exit -1; fi
+
+#if [ -z ${KEEP_INTERMEDIATE} ]; then
+# rm -rf ./checkConnectivity.log ./log.txt ./ofedout/ ./${WRITE_TOPOLOGY_DOT_FILE}.dot ./topo.* ./ibdiagnet.fdbs ./opensm-subnet.lst
+# rm -rf ./log.txt ./ofedout/ ./${WRITE_TOPOLOGY_DOT_FILE}.dot ./topo.* ./opensm.fdbs ./opensm-subnet.lst
+#fi
+
+exit 0
......@@ -117,9 +117,9 @@ diff -Nur scripts.orig/post_process_dot.sh scripts/post_process_dot.sh
+rm -f ${PATH_TO_DOT}.dot.*
+
+exit 0
diff -Nur scripts.orig/post_process_lfts.py scripts/post_process_lfts.py
--- scripts.orig/post_process_lfts.py 1969-12-31 16:00:00.000000000 -0800
+++ scripts/post_process_lfts.py 2016-08-15 15:41:29.189179000 -0700
diff -u scripts/post_process_lfts.py scripts/post_process_lfts.py
--- scripts/post_process_lfts.py 2016-08-15 15:41:29.189179000 -0700
+++ scripts/post_process_lfts.py 2017-04-25 19:12:03.552153747 +0900
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
......@@ -136,7 +136,7 @@ diff -Nur scripts.orig/post_process_lfts.py scripts/post_process_lfts.py
+
+ outdir = os.path.normpath(sys.argv[3])
+except:
+ sys.exit('Usage: post_process_lfts.py ./ibdiagnet.fdbs ./opensm-subnet.lst')
+ sys.exit('Usage: post_process_lfts.py ./opensm.fdbs ./opensm-subnet.lst')
+
+if not os.path.exists(fdbsFile) or not os.path.exists(lstFile):
+ sys.exit('ERR: file %s or %s does not exist' % (fdbsFile, lstFile))
......@@ -183,3 +183,1943 @@ diff -Nur scripts.orig/post_process_lfts.py scripts/post_process_lfts.py
+out.close()
+
+sys.exit(0)
only in patch2:
unchanged:
--- scripts.orig/checkConnectivity.py 2017-04-25 16:23:23.472601516 +0900
+++ scripts/checkConnectivity.py 1970-01-01 09:00:00.000000000 +0900
@@ -1,165 +0,0 @@
-#!/usr/bin/env python
-
-import sys, re, os, random, operator, colorsys, math
-
-class showUnicastForwarding(object):
- subnet = {}
- hcaTable = []
- disconn = 0
-
- def parse_lstFile(self, fileName=''):
- lstFile = open( fileName, 'r' )
-
- network = {}
- for line in lstFile:
- p = re.compile('{\s+([a-zA-Z0-9_-]+)\s+Ports:(\w+)\s+SystemGUID:(\w+)\s+NodeGUID:(\w+)\s+PortGUID:(\w+)\s+VenID:(\w+)\s+DevID:(\w+)\s+Rev:(\w+)\s+{(.+)}\s+LID:(\w+)\s+PN:(\w+)\s+}\s+{\s+([a-zA-Z0-9_-]+)\s+Ports:(\w+)\s+SystemGUID:(\w+)\s+NodeGUID:(\w+)\s+PortGUID:(\w+)\s+VenID:(\w+)\s+DevID:(\w+)\s+Rev:(\w+)\s+{(.+)}\s+LID:(\w+)\s+PN:(\w+)\s+}\s+.+')
- if p.match(line):
- m = p.match(line)
- node1, ports1, sguid1, nguid1, pguid1, vid1, did1, rev1, name1, lid1, pn1 = m.group(1), int(m.group(2),16), m.group(3), m.group(4), m.group(5), \
- m.group(6), m.group(7), m.group(8), m.group(9), int(m.group(10),16), int(m.group(11),16)
- node2, ports2, sguid2, nguid2, pguid2, vid2, did2, rev2, name2, lid2, pn2 = m.group(12), int(m.group(13),16), m.group(14), m.group(15), m.group(16), \
- m.group(17), m.group(18), m.group(19), m.group(20), int(m.group(21),16), int(m.group(22),16)
-
- nguid1, nguid2 = nguid1.lower(), nguid2.lower()
-
- if node1.find('CA') > -1:
- node1, ports1, sguid1, nguid1, pguid1, vid1, did1, rev1, name1, lid1, pn1, node2, ports2, sguid2, nguid2, pguid2, vid2, did2, rev2, name2, lid2, pn2 = \
- node2, ports2, sguid2, nguid2, pguid2, vid2, did2, rev2, name2, lid2, pn2, node1, ports1, sguid1, nguid1, pguid1, vid1, did1, rev1, name1, lid1, pn1
- if node2.find('CA') > -1:
- #nguid2 = name2
- self.hcaTable.append([nguid2, pn2])
-
- if network.has_key(nguid1):
- network[nguid1][pn1] = {'rnguid':nguid2, 'rpn':pn2}
- else:
- network[nguid1] = {'lid':lid1}
- network[nguid1][pn1] = {'rnguid':nguid2, 'rpn':pn2}
-
- if network.has_key(nguid2):
- network[nguid2][pn2] = {'rnguid':nguid1, 'rpn':pn1}
- else:
- network[nguid2] = {'lid':lid2}
- network[nguid2][pn2] = {'rnguid':nguid1, 'rpn':pn1}
-
- self.subnet = network
- lstFile.close()
-
-
- def parse_fdbsFile(self, fileName=''):
- network = self.subnet
- nguid = None
- lft = {}
-
- fdbsFile = open( fileName, 'r' )
- for line in fdbsFile:
- p = re.compile('osm_ucast_mgr_dump_ucast_routes: Switch 0x(\w+)')
- if p.match(line):
- if nguid:
- network[nguid]['lft'] = lft
- lft = {}
- nguid = p.match(line).group(1).lower()
-
- p = re.compile('0x(\w+)\s+:\s+(\d+)\s+.*')
- if p.match(line):
- lid, port = int(p.match(line).group(1), 16), int(p.match(line).group(2))
- lft[lid] = port
-
- if nguid:
- network[nguid]['lft'] = lft
-
- fdbsFile.close()
-
-
- def calc_connectivity(self):
- network = self.subnet
-
- hopMatrix = {}
- for hcaSrc, portSrc in self.hcaTable:
-
- srcLid = network[hcaSrc]['lid']
- hopMatrix[srcLid] = {}
-
- for hcaDest, portDest in self.hcaTable:
- if hcaSrc == hcaDest:
- continue
-
- curr = network[hcaSrc][portSrc]['rnguid']
- destLid = network[hcaDest]['lid']
- hop = 1
-
- while (curr != hcaDest):
- if not network[curr]['lft'].has_key(destLid):
- print "No connection between: ", hcaSrc, hcaDest
- self.disconn += 1
- break
- exitPort = network[curr]['lft'][destLid]
- curr = network[curr][exitPort]['rnguid']
- hop += 1
- if hop > 64:
- print 'Error: hop count bigger than 64 => there is something wrong with the LFTs!'
- return
-
- hopMatrix[srcLid][destLid] = hop
-
- if self.disconn > 0:
- print 'Error: %s Hca<->Hca routes are disconnected due to faults in the routing table (out of %s connections in total)' % (self.disconn, len(self.hcaTable)*(len(self.hcaTable)-1))
- else:
- minHop = 2^32-1
- maxHop, sumHop, count, sumSqare = 0, 0, 0, 0
- for srcLid in hopMatrix.keys():
- for dstLid in hopMatrix[srcLid].keys():
- hop = hopMatrix[srcLid][dstLid]
- sumHop += hop
- sumSqare += hop*hop
- count += 1
- if minHop > hop:
- minHop = hop
- if maxHop < hop:
- maxHop = hop
-
- print 'Hop Count for the Network [min, max, avg, stddev]: [', minHop, maxHop, (1.0*sumHop)/count, math.sqrt(((1.0*sumSqare)/count)-math.pow((1.0*sumHop)/count, 2)), ']'
-
-
- def __init__(self):
- if len(sys.argv) == 2:
- path = os.path.normpath(sys.argv[1])
- if not os.path.exists(path):
- print "Error: input directory does not exist or is not accessable"
- print ""
- self.printHelp()
- self.inputDir = os.path.join(path)
-
- lstFile = os.path.join(self.inputDir, 'ibdiagnet.lst')
- if not os.path.exists(lstFile):
- print "Error: %s file does not exist or is not accessable" % lstFile
- print ""
- self.printHelp()
-
- fdbsFile = os.path.join(self.inputDir, 'ibdiagnet.fdbs')
- if not os.path.exists(fdbsFile):
- print "Error: %s file does not exist or is not accessable" % fdbsFile
- print ""
- self.printHelp()
-
- else:
- self.printHelp()
-
- self.parse_lstFile(lstFile)
- self.parse_fdbsFile(fdbsFile)
- self.calc_connectivity()
-
-
- def printHelp(self):
- print "Usage: ", sys.argv[0], " <path-to-ib-output>"
- print ""
- print " Example:"
- print " ", sys.argv[0], " $OSM_CACHE_DIR/ibdiagnetout"
- print ""
- print " Hint to generate *.lst and *.fdbs outpout:"
- print " ibdiagnet [-r] -o <path-to-ib-output>"
- sys.exit('')
-
-if __name__ == "__main__":
- app = showUnicastForwarding()
- sys.exit('\nFinish!')
-
only in patch2:
unchanged:
--- scripts.orig/IBNetLFTtoFDBS.py 2017-04-25 16:23:23.640601410 +0900
+++ scripts/IBNetLFTtoFDBS.py 1970-01-01 09:00:00.000000000 +0900
@@ -1,161 +0,0 @@
-#!/usr/bin/env python
-
-import sys, re, os
-from optparse import OptionParser
-
-class IBNetLFTtoFDBS(object):
- maxLID = 0
-
- def read_ibnetdiscoverFile(self, fileName):
- if not os.path.exists(fileName):
- sys.exit("Error: file specified by '-ibnd' not found; check your config")
-
- # parse ibnetdiscover.log to get the topology of the network
- network = {}
- guid = 0
- ibnetFile = open(fileName, 'r')
- for line in ibnetFile:
- p = re.compile('^sysimgguid=.*')
- if p.match(line):
- guid = 0
- p = re.compile('^Switch\s+(\d+)\s"S-(\w+)"\s+.*#\s+"(.*)".*\s+lid\s+(\d+)\s*.*$')
- if p.match(line):
- m = p.match(line)
- guid, numPorts, name, lid = int(m.group(2), 16), int(m.group(1)), m.group(3), int(m.group(4))
- if network.has_key(guid):
- print "Error: same switch guid found multiple times in ibnetdiscover.log"
- else:
- network[guid] = {'lid':lid, 'name':name, 'numPorts':numPorts, 'ports':{}}
- if lid > self.maxLID: self.maxLID = lid
- p = re.compile('^\[(\d+)\]\s+"(\w)-(\w+)"\[(\d+)\].*#\s+"(.*)"\s+lid\s+(\d+).*')
- if guid != 0 and p.match(line):
- # ibnetdiscover OR ibnetdiscover -s
- m = p.match(line)
- lport, rtype, rguid, rport, rname, rlid = int(m.group(1)), m.group(2), int(m.group(3), 16), int(m.group(4)), m.group(5), int(m.group(6))
- if network[guid]['ports'].has_key(lport):
- print "Error: same port of one switch found multiple times in ibnetdiscover.log"
- else:
- network[guid]['ports'][lport] = {'type':rtype, 'guid':rguid, 'port':rport, 'name':rname, 'lid':rlid}
- if rlid > self.maxLID: self.maxLID = rlid
- ibnetFile.close()
- return network
-
-
- def read_lftFile(self, fileName):
- if not os.path.exists(fileName):
- sys.exit("Error: file specified by '-lft' not found; check your config")
-
- # names are unique if they come out of createIBNet.py
- lft = {}
- swname = ''
- lftFile = open(fileName, 'r')