On Thu, 4 Aug 2022, Leah Leshchinsky wrote: > The run report produced at the end of a run does not contain information > on load and measurement thread locations. > > Adjust MakeReport() functions of LoadModules and MeasurementModules > class so that new properties with number of loads and cpu information > are added to the XML report and can be read by rteval_text.xsl. > > Signed-off-by: Leah Leshchinsky <lleshchi@xxxxxxxxxx> > > diff --git a/rteval/modules/loads/__init__.py b/rteval/modules/loads/__init__.py > index 2c2105efa964..5e5a5d85b616 100644 > --- a/rteval/modules/loads/__init__.py > +++ b/rteval/modules/loads/__init__.py > @@ -30,6 +30,7 @@ import libxml2 > from rteval.Log import Log > from rteval.rtevalConfig import rtevalCfgSection > from rteval.modules import RtEvalModules, rtevalModulePrototype > +from rteval.systopology import collapse_cpulist, SysTopology add CpuList, and you might not need collapse_cpulist, and SysTopology > > class LoadThread(rtevalModulePrototype): > def __init__(self, name, config, logger=None): > @@ -131,6 +132,12 @@ class LoadModules(RtEvalModules): > def MakeReport(self): > rep_n = RtEvalModules.MakeReport(self) > rep_n.newProp("load_average", str(self.GetLoadAvg())) > + rep_n.newProp("loads", str(self.ModulesLoaded())) > + cpulist = self._cfg.GetSection(self._module_config).cpulist The above value is either going to be all cpus, or the value of --loads-cpulist=LIST or the inverse of --measurement-cpulist=LIST I don't think it can be empty, so the following code after if not cpulist is deadcode > + if not cpulist: > + st = SysTopology() > + cpulist = collapse_cpulist(st.online_cpus()) If the above code were to run it would just be a list of all online cpus Admitedly the systopology api is a bit confusing but since it does a lot, I think all you really need is cpulist = CpuList(self._cfg.GetSection(self._module_config).cpulist) rep_n.newProp("loadcpus", str(cpulist)) And that's it. You need to do something similar to the measurement section too. > + rep_n.newProp("loadcpus", cpulist) > > return rep_n > > diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py > index 318248bd7e35..371fc5d08f44 100644 > --- a/rteval/modules/measurement/__init__.py > +++ b/rteval/modules/measurement/__init__.py > @@ -24,7 +24,7 @@ > > import libxml2 > from rteval.modules import RtEvalModules, ModuleContainer > - > +from rteval.systopology import collapse_cpulist, SysTopology > > class MeasurementProfile(RtEvalModules): > """Keeps and controls all the measurement modules with the same measurement profile""" > @@ -189,6 +189,12 @@ measurement profiles, based on their characteristics""" > > # Get the reports from all meaurement modules in all measurement profiles > rep_n = libxml2.newNode("Measurements") > + cpulist = self.__cfg.GetSection("measurement").cpulist > + if not cpulist: > + st = SysTopology() > + cpulist = collapse_cpulist(st.online_cpus()) > + rep_n.newProp("measurecpus", cpulist) > + > for mp in self.__measureprofiles: > mprep_n = mp.MakeReport() > if mprep_n: > diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl > index c40063e3dd19..7ecfac6b6140 100644 > --- a/rteval/rteval_text.xsl > +++ b/rteval/rteval_text.xsl > @@ -13,6 +13,14 @@ > <xsl:value-of select="run_info/date"/><xsl:text> </xsl:text><xsl:value-of select="run_info/time"/> > <xsl:text> </xsl:text> > > + <xsl:text> Loads: </xsl:text> > + <xsl:value-of select="loads/@loads"/><xsl:text> loads run on cores </xsl:text><xsl:value-of select="loads/@loadcpus"/> > + <xsl:text> </xsl:text> > + > + <xsl:text> Measurement: </xsl:text> > + <xsl:text>measurement threads run on cores </xsl:text><xsl:value-of select="Measurements/@measurecpus"/> > + <xsl:text> </xsl:text> > + > <xsl:text> Run time: </xsl:text> > <xsl:value-of select="run_info/@days"/><xsl:text> days </xsl:text> > <xsl:value-of select="run_info/@hours"/><xsl:text>h </xsl:text> > -- > 2.31.1 > > Something in the xsl code is not working, I'm not picking up any values in the reports for "Measurements/@measurecpus" for example. Thanks