CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
edmTracerCompactLogViewer.TestModuleCommand Class Reference
Inheritance diagram for edmTracerCompactLogViewer.TestModuleCommand:

Public Member Functions

def setUp (self)
 
def testContainers (self)
 
def testFrameworkOnly (self)
 
def testFull (self)
 
def testModuleCentric (self)
 

Public Attributes

 tracerFile
 

Detailed Description

Definition at line 1078 of file edmTracerCompactLogViewer.py.

Member Function Documentation

◆ setUp()

def edmTracerCompactLogViewer.TestModuleCommand.setUp (   self)

Definition at line 1079 of file edmTracerCompactLogViewer.py.

1079  def setUp(self):
1080  self.tracerFile = DummyFile()
1081  t = [0]
1082  def incr(t):
1083  t[0] += 1
1084  return t[0]
1085 
1086  self.tracerFile.extend([
1087  '#R 1 Record',
1088  '#M 1 Module',
1089  '#N 1 ESModule',
1090  f'F {Phase.startTracing} 0 0 0 0 {incr(t)}',
1091  f'S {Phase.construction} 0 {incr(t)}',
1092  f's {Phase.construction} 0 {incr(t)}3',
1093  f'M {Phase.construction} 0 1 0 0 0 {incr(t)}',
1094  f'm {Phase.construction} 0 1 0 0 0 {incr(t)}',
1095  f'F {Phase.beginJob} 0 0 0 0 {incr(t)}',
1096  f'M {Phase.beginJob} 0 1 0 0 0 {incr(t)}',
1097  f'm {Phase.beginJob} 0 1 0 0 0 {incr(t)}',
1098  f'f {Phase.beginJob} 0 0 0 0 {incr(t)}',
1099  f'F {Phase.beginProcessBlock} 0 0 0 0 {incr(t)}',
1100  f'f {Phase.beginProcessBlock} 0 0 0 0 {incr(t)}',
1101  f'S {Phase.getNextTransition} {incr(t)}',
1102  f's {Phase.getNextTransition} {incr(t)}',
1103  f'F {Phase.esSyncEnqueue} -1 1 0 0 {incr(t)}',
1104  f'F {Phase.esSync} -1 1 0 0 {incr(t)}',
1105  f'f {Phase.esSync} -1 1 0 0 {incr(t)}',
1106  f'S {Phase.globalBeginRun} 0 {incr(t)}',
1107  f's {Phase.globalBeginRun} 0 {incr(t)}',
1108  f'S {Phase.getNextTransition} {incr(t)}',
1109  f's {Phase.getNextTransition} {incr(t)}',
1110  f'F {Phase.globalBeginRun} 0 1 0 0 {incr(t)}',
1111  f'P {Phase.globalBeginRun} 0 1 0 0 0 {incr(t)}',
1112  f'p {Phase.globalBeginRun} 0 1 0 0 0 {incr(t)}',
1113  f'M {Phase.globalBeginRun} 0 1 0 0 0 {incr(t)}',
1114  f'm {Phase.globalBeginRun} 0 1 0 0 0 {incr(t)}',
1115  f'f {Phase.globalBeginRun} 0 1 0 0 {incr(t)}',
1116  f'F {Phase.esSyncEnqueue} -1 1 1 0 {incr(t)}',
1117  f'F {Phase.esSync} -1 1 1 0 {incr(t)}',
1118  f'f {Phase.esSync} -1 1 1 0 {incr(t)}',
1119  f'S {Phase.getNextTransition} {incr(t)}',
1120  f's {Phase.getNextTransition} {incr(t)}',
1121  f'F {Phase.streamBeginRun} 0 1 0 0 {incr(t)}',
1122  f'M {Phase.streamBeginRun} 0 1 0 0 0 {incr(t)}',
1123  f'm {Phase.streamBeginRun} 0 1 0 0 0 {incr(t)}',
1124  f'f {Phase.streamBeginRun} 0 1 0 0 {incr(t)}',
1125  f'F {Phase.streamBeginRun} 1 1 0 0 {incr(t)}',
1126  f'M {Phase.streamBeginRun} 1 1 0 0 0 {incr(t)}',
1127  f'm {Phase.streamBeginRun} 1 1 0 0 0 {incr(t)}',
1128  f'f {Phase.streamBeginRun} 1 1 0 0 {incr(t)}',
1129  f'S {Phase.globalBeginLumi} 0 {incr(t)}',
1130  f's {Phase.globalBeginLumi} 0 {incr(t)}',
1131  f'S {Phase.getNextTransition} {incr(t)}',
1132  f's {Phase.getNextTransition} {incr(t)}',
1133  f'F {Phase.globalBeginLumi} 0 1 1 0 {incr(t)}',
1134  f'P {Phase.globalBeginLumi} 0 1 0 0 0 {incr(t)}',
1135  f'p {Phase.globalBeginLumi} 0 1 0 0 0 {incr(t)}',
1136  f'M {Phase.globalBeginLumi} 0 1 0 0 0 {incr(t)}',
1137  f'm {Phase.globalBeginLumi} 0 1 0 0 0 {incr(t)}',
1138  f'f {Phase.globalBeginLumi} 0 1 1 0 {incr(t)}',
1139  f'F {Phase.streamBeginLumi} 0 1 1 0 {incr(t)}',
1140  f'f {Phase.streamBeginLumi} 0 1 1 0 {incr(t)}',
1141  f'F {Phase.streamBeginLumi} 1 1 1 0 {incr(t)}',
1142  f'f {Phase.streamBeginLumi} 1 1 1 0 {incr(t)}',
1143  f'S {Phase.Event} 0 {incr(t)}',
1144  f's {Phase.Event} 0 {incr(t)}',
1145  f'S {Phase.getNextTransition} {incr(t)}',
1146  f's {Phase.getNextTransition} {incr(t)}',
1147  f'F {Phase.Event} 0 1 1 1 {incr(t)}',
1148  f'S {Phase.Event} 1 {incr(t)}',
1149  f's {Phase.Event} 1 {incr(t)}',
1150  f'F {Phase.Event} 1 1 1 2 {incr(t)}',
1151  f'P {Phase.Event} 0 1 0 0 0 {incr(t)}',
1152  f'p {Phase.Event} 0 1 0 0 0 {incr(t)}',
1153  f'Q {Phase.Event} 0 1 1 0 1 0 {incr(t)}',
1154  f'q {Phase.Event} 0 1 1 0 1 0 {incr(t)}',
1155  f'N {Phase.Event} 0 1 1 0 1 0 {incr(t)}',
1156  f'n {Phase.Event} 0 1 1 0 1 0 {incr(t)}',
1157  f'P {Phase.Event} 1 1 0 0 0 {incr(t)}',
1158  f'p {Phase.Event} 1 1 0 0 0 {incr(t)}',
1159  f'M {Phase.Event} 0 1 0 0 0 {incr(t)}',
1160  f'M {Phase.Event} 1 1 0 0 0 {incr(t)}',
1161  f'm {Phase.Event} 1 1 0 0 0 {incr(t)}',
1162  f'm {Phase.Event} 0 1 0 0 0 {incr(t)}',
1163  f'f {Phase.Event} 0 1 1 1 {incr(t)}',
1164  f'f {Phase.Event} 1 1 1 2 {incr(t)}'])
1165 
1166  None

◆ testContainers()

def edmTracerCompactLogViewer.TestModuleCommand.testContainers (   self)

Definition at line 1167 of file edmTracerCompactLogViewer.py.

1167  def testContainers(self):
1168  c = Containers()
1169  c.indexedGlobal(2)
1170  self.assertEqual(len(c.allGlobals()), 3)
1171  c.indexedStream(2)
1172  self.assertEqual(len(c.allStreams()), 3)
1173  slot = c.findOpenSlotInModGlobals(2, 1)
1174  self.assertEqual(len(c._modGlobals),3)
1175  self.assertEqual(len(slot),0)
1176  slot.append({"start":1, "finish":0, "id":1})
1177  def testFind(item):
1178  return item["id"]==1
1179  item,s = c.findLastInModGlobals(2, 1, testFind)
1180  self.assertEqual(item["id"],1)
1181  self.assertEqual(slot,s)
1182  slot = c.findOpenSlotInModStreams(2, 1)
1183  self.assertEqual(len(c._modStreams),3)
1184  self.assertEqual(len(slot),0)
1185  slot.append({"start":1, "finish":0, "id":1})
1186  item,s = c.findLastInModStreams(2, 1, testFind)
1187  self.assertEqual(item["id"],1)
1188  self.assertEqual(slot,s)

◆ testFrameworkOnly()

def edmTracerCompactLogViewer.TestModuleCommand.testFrameworkOnly (   self)

Definition at line 1189 of file edmTracerCompactLogViewer.py.

References edmTracerCompactLogViewer.jsonInfo(), and edmTracerCompactLogViewer.TestModuleCommand.tracerFile.

1189  def testFrameworkOnly(self):
1190  parser = TracerCompactFileParser(self.tracerFile, True, False)
1191  j = jsonInfo(parser)
1192  #print(j)
1193  self.assertEqual(len(j["modules"]), 0)
1194  self.assertEqual(len(j["esModules"]), 0)
1195  self.assertEqual(len(j['transitions']), 3)
1196  self.assertEqual(j['transitions'][0]['name'], "Global")
1197  self.assertEqual(j['transitions'][1]['name'], "Stream 0")
1198  self.assertEqual(j['transitions'][2]['name'], "Stream 1")
1199  self.assertEqual(len(j["transitions"][0]["slots"]), 1)
1200  self.assertEqual(len(j["transitions"][0]["slots"][0]), 15)
1201  self.assertEqual(len(j["transitions"][1]["slots"]), 1)
1202  self.assertEqual(len(j["transitions"][1]["slots"][0]), 5)
1203  self.assertEqual(len(j["transitions"][2]["slots"]), 1)
1204  self.assertEqual(len(j["transitions"][2]["slots"][0]), 5)

◆ testFull()

def edmTracerCompactLogViewer.TestModuleCommand.testFull (   self)

Definition at line 1205 of file edmTracerCompactLogViewer.py.

References edmTracerCompactLogViewer.jsonInfo(), and edmTracerCompactLogViewer.TestModuleCommand.tracerFile.

1205  def testFull(self):
1206  parser = TracerCompactFileParser(self.tracerFile, False, False)
1207  j = jsonInfo(parser)
1208  #print(j)
1209  self.assertEqual(len(j["modules"]), 2)
1210  self.assertEqual(len(j["esModules"]), 2)
1211  self.assertEqual(len(j['transitions']), 3)
1212  self.assertEqual(j['transitions'][0]['name'], "Global")
1213  self.assertEqual(j['transitions'][1]['name'], "Stream 0")
1214  self.assertEqual(j['transitions'][2]['name'], "Stream 1")
1215  self.assertEqual(len(j["transitions"][0]["slots"]), 2)
1216  self.assertEqual(len(j["transitions"][0]["slots"][0]), 15)
1217  self.assertEqual(len(j["transitions"][0]["slots"][1]), 6)
1218  self.assertEqual(len(j["transitions"][1]["slots"]), 2)
1219  self.assertEqual(len(j["transitions"][1]["slots"][0]), 5)
1220  self.assertEqual(len(j["transitions"][1]["slots"][1]), 5)
1221  self.assertEqual(len(j["transitions"][2]["slots"]), 2)
1222  self.assertEqual(len(j["transitions"][2]["slots"][0]), 5)
1223  self.assertEqual(len(j["transitions"][2]["slots"][1]), 3)

◆ testModuleCentric()

def edmTracerCompactLogViewer.TestModuleCommand.testModuleCentric (   self)

Definition at line 1224 of file edmTracerCompactLogViewer.py.

References edmTracerCompactLogViewer.jsonInfo(), and edmTracerCompactLogViewer.TestModuleCommand.tracerFile.

1224  def testModuleCentric(self):
1225  parser = TracerCompactFileParser(self.tracerFile, False, True)
1226  j = jsonInfo(parser)
1227  #print(j)
1228  self.assertEqual(len(j["modules"]), 2)
1229  self.assertEqual(len(j["esModules"]), 2)
1230  self.assertEqual(len(j['transitions']), 6)
1231  self.assertEqual(j['transitions'][0]['name'], "Global")
1232  self.assertEqual(j['transitions'][1]['name'], "Stream 0")
1233  self.assertEqual(j['transitions'][2]['name'], "Stream 1")
1234  self.assertEqual(j['transitions'][3]['name'], "source")
1235  self.assertEqual(j['transitions'][4]['name'], "Module")
1236  self.assertEqual(j['transitions'][5]['name'], "ESModule")
1237  self.assertEqual(len(j["transitions"][0]["slots"]), 1)
1238  self.assertEqual(len(j["transitions"][0]["slots"][0]), 15)
1239  self.assertEqual(len(j["transitions"][1]["slots"]), 1)
1240  self.assertEqual(len(j["transitions"][1]["slots"][0]), 5)
1241  self.assertEqual(len(j["transitions"][2]["slots"]), 1)
1242  self.assertEqual(len(j["transitions"][2]["slots"][0]), 5)
1243  self.assertEqual(len(j["transitions"][4]["slots"]), 2)
1244  self.assertEqual(len(j["transitions"][4]["slots"][0]), 10)
1245  self.assertEqual(len(j["transitions"][4]["slots"][1]), 2)
1246  self.assertTrue(j["transitions"][4]["slots"][1][-1]['finish'] != 0.0)
1247  self.assertEqual(len(j["transitions"][5]["slots"]), 1)
1248  self.assertEqual(len(j["transitions"][5]["slots"][0]), 2)
1249 

Member Data Documentation

◆ tracerFile

edmTracerCompactLogViewer.TestModuleCommand.tracerFile