Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
178 changes: 178 additions & 0 deletions configs/heavy-models.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
{
"BuildingSystems": {
"BuildingSystems.Applications.DistrictSimulation.DistrictBerlinKreuzberg": 7.01,
"BuildingSystems.Applications.DistrictSimulation.HCBC_DHN": 7.01,
"BuildingSystems.HAM.HeatConduction.Examples.HeatConduction1DArray": 6.97
},
"Buildings_11": {
"Buildings.Controls.DemandResponse.Examples.ClientLBNL90": 6.51,
"Buildings.DHC.Examples.Combined.SeriesConstantFlow": 4.7,
"Buildings.DHC.Examples.Combined.SeriesVariableFlow": 4.71
},
"Buildings_12": {
"Buildings.Controls.DemandResponse.Examples.ClientLBNL90": 6.09,
"Buildings.DHC.Examples.Combined.SeriesConstantFlow": 4.65,
"Buildings.DHC.Examples.Combined.SeriesVariableFlow": 4.66
},
"Buildings_latest": {
"Buildings.Controls.DemandResponse.Examples.ClientLBNL90": 6.21,
"Buildings.DHC.Examples.Combined.SeriesConstantFlow": 4.73,
"Buildings.DHC.Examples.Combined.SeriesVariableFlow": 4.75,
"Buildings.DHC.Plants.Combined.Examples.AllElectricCWStorage": 4.03,
"Buildings.Fluid.HeatPumps.ModularReversible.Validation.TableData2DLoadDepSHC": 7.86
},
"ClaRa": {
"ClaRa.Basics.ControlVolumes.SolidVolumes.Check.Validation_NTUparallel_DiscrPipes": 4.9,
"ClaRa.Examples.SteamPowerPlant_01": 4.79,
"ClaRa.Examples.SteamPowerPlant_CombinedComponents_01": 5.65
},
"ClaRa_dev": {
"ClaRa.Basics.ControlVolumes.SolidVolumes.Check.Validation_NTUparallel_DiscrPipes": 8.23,
"ClaRa.Components.Furnace.Check.Test_burner_adiabatic_fuelDrying": 5.44,
"ClaRa.Components.HeatExchangers.Check.Test_RegenerativeAirPreheater": 6.23,
"ClaRa.Components.Mills.PhysicalMills.Check.TestMillBox_1": 5.28,
"ClaRa.Components.Mills.PhysicalMills.Check.TestMillBox_1_measurementInput": 5.04,
"ClaRa.Components.Mills.PhysicalMills.Check.TestMillBox_2": 4.41,
"ClaRa.Components.VolumesValvesFittings.Valves.Check.Test_GasValves": 4.84,
"ClaRa.Examples.SteamPowerPlant_01": 5.04,
"ClaRa.Examples.SteamPowerPlant_CombinedComponents_01": 5.79
},
"Greenhouses": {
"Greenhouses.Examples.GlobalSystem_1": 4.29
},
"IDEAS": {
"IDEAS.Buildings.Components.Examples.AirflowBoxModel": 7.01,
"IDEAS.Buildings.Components.Examples.FacadeShadeExample": 4.66,
"IDEAS.Buildings.Components.Examples.LightingControl": 7.01,
"IDEAS.Buildings.Components.Examples.NumberOccupants": 7.01,
"IDEAS.Buildings.Components.Examples.RectangularZone": 4.66,
"IDEAS.Buildings.Components.Examples.RectangularZoneEmbedded": 4.64,
"IDEAS.Buildings.Components.Examples.RectangularZoneExternalSurfaces": 4.64,
"IDEAS.Buildings.Components.Examples.RectangularZoneRedeclarationWindows": 4.51,
"IDEAS.Buildings.Components.Examples.RectangularZoneTemplateFloor": 4.68,
"IDEAS.Buildings.Components.Examples.ScalingWindow": 6.97,
"IDEAS.Buildings.Components.Examples.TwoStoreyBoxes": 4.61,
"IDEAS.Buildings.Components.InterzonalAirFlow.Examples.InterzonalAirFlow": 7.01,
"IDEAS.Buildings.Examples.OpenDoorComparison": 7.01,
"IDEAS.Buildings.Examples.ScreenComparison": 4.59,
"IDEAS.Buildings.Validation.BESTEST": 6.2,
"IDEAS.Examples.DetailedResidentialNoHeating": 7.01,
"IDEAS.Examples.PPD12.Heating": 7.01,
"IDEAS.Examples.PPD12.Structure": 7.01,
"IDEAS.Examples.PPD12.VentilationMPC": 7.01,
"IDEAS.Examples.PPD12.VentilationRBC": 7.01,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse10": 4.65,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse5": 4.54,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse6": 4.74,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse7": 4.75,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse8": 4.74,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse9": 4.73,
"IDEAS.Examples.TwinHouses.BuildingN2_Exp1": 7.01,
"IDEAS.Examples.TwinHouses.BuildingN2_Exp2": 7.01,
"IDEAS.Examples.TwinHouses.BuildingN2_Exp2_Tset": 7.01,
"IDEAS.Examples.TwinHouses.BuildingO5_Exp1_1Port": 7.01,
"IDEAS.Examples.TwinHouses.BuildingO5_Exp1_2Port": 7.01,
"IDEAS.Fluid.HeatExchangers.RadiantSlab.Examples.EmbeddedPipeNDiscr": 6.86
},
"IDEAS_dev": {
"IDEAS.Buildings.Components.Examples.AirflowBoxModel": 7.01,
"IDEAS.Buildings.Components.Examples.FacadeShadeExample": 4.66,
"IDEAS.Buildings.Components.Examples.LightingControl": 7.01,
"IDEAS.Buildings.Components.Examples.NumberOccupants": 7.01,
"IDEAS.Buildings.Components.Examples.RectangularZone": 4.66,
"IDEAS.Buildings.Components.Examples.RectangularZoneEmbedded": 4.64,
"IDEAS.Buildings.Components.Examples.RectangularZoneExternalSurfaces": 4.64,
"IDEAS.Buildings.Components.Examples.RectangularZoneRedeclarationWindows": 4.51,
"IDEAS.Buildings.Components.Examples.RectangularZoneTemplateFloor": 4.61,
"IDEAS.Buildings.Components.Examples.ScalingWindow": 6.96,
"IDEAS.Buildings.Components.Examples.TwoStoreyBoxes": 4.61,
"IDEAS.Buildings.Components.InterzonalAirFlow.Examples.InterzonalAirFlow": 7.01,
"IDEAS.Buildings.Examples.OpenDoorComparison": 7.01,
"IDEAS.Buildings.Examples.ScreenComparison": 4.59,
"IDEAS.Buildings.Validation.BESTEST": 6.41,
"IDEAS.Examples.DetailedResidentialNoHeating": 7.01,
"IDEAS.Examples.PPD12.Heating": 7.01,
"IDEAS.Examples.PPD12.Structure": 7.01,
"IDEAS.Examples.PPD12.VentilationMPC": 7.01,
"IDEAS.Examples.PPD12.VentilationRBC": 7.01,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse10": 4.66,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse5": 4.69,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse6": 4.75,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse7": 4.76,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse8": 4.74,
"IDEAS.Examples.Tutorial.DetailedHouse.DetailedHouse9": 4.74,
"IDEAS.Examples.TwinHouses.BuildingN2_Exp1": 7.01,
"IDEAS.Examples.TwinHouses.BuildingN2_Exp2": 7.01,
"IDEAS.Examples.TwinHouses.BuildingN2_Exp2_Tset": 7.01,
"IDEAS.Examples.TwinHouses.BuildingO5_Exp1": 7.01,
"IDEAS.Examples.TwinHouses.BuildingO5_Exp1_1Port": 7.01,
"IDEAS.Examples.TwinHouses.BuildingO5_Exp1_2Port": 7.01,
"IDEAS.Fluid.HeatExchangers.RadiantSlab.Examples.EmbeddedPipeNDiscr": 6.86
},
"Modelica_3.2.3": {
"Modelica.Blocks.Examples.Rectifier12pulseFFT": 5.31,
"Modelica.Blocks.Examples.Rectifier6pulseFFT": 5.58
},
"OpenIPSL_2.0.0": {
"OpenIPSL.Examples.DAEMode.N44_Base_Case_Systems.Nordic44_Base_Case_StateEvents": 4.45,
"OpenIPSL.Examples.DAEMode.N44_Base_Case_Systems.Nordic44_Base_Case_StateEvents2": 4.45,
"OpenIPSL.Examples.DAEMode.N44_Base_Case_Systems.Nordic44_Base_Case_StateEvents3": 4.63,
"OpenIPSL.Examples.DAEMode.N44_Original_Systems.Nordic44_Original_Case_Bus_Fault": 4.0,
"OpenIPSL.Examples.DAEMode.N44_Original_Systems.Nordic44_Original_Case_Line_Opening": 4.1,
"OpenIPSL.Examples.N44.Base_Case.Nordic44_Base_Case": 4.41,
"OpenIPSL.Examples.N44.Original.Nordic44_Original_Case": 4.2
},
"ScalableTestGrids_noopt": {
"ScalableTestGrids.Models.Type1.Type1_N_3_M_4": 4.85,
"ScalableTestGrids.Models.Type1.Type1_N_4_M_4": 5.64,
"ScalableTestGrids.Models.Type1.Type1_N_6_M_4": 6.67,
"ScalableTestGrids.Models.Type1.Type1_N_8_M_4": 10.43,
"ScalableTestGrids.Models.Type1.Type1_reduced_N_3_M_4": 4.85,
"ScalableTestGrids.Models.Type1.Type1_reduced_N_4_M_4": 6.4,
"ScalableTestGrids.Models.Type1.Type1_reduced_N_6_M_4": 6.68,
"ScalableTestGrids.Models.Type2.Type2_noTap___N_3_M_4": 4.85,
"ScalableTestGrids.Models.Type2.Type2_noTap___N_4_M_4": 7.79,
"ScalableTestGrids.Models.Type2.Type2_noTap___N_6_M_4": 6.65,
"ScalableTestGrids.Models.Type2.Type2_tapEv___N_3_M_4": 4.77,
"ScalableTestGrids.Models.Type2.Type2_tapEv___N_4_M_4": 8.05,
"ScalableTestGrids.Models.Type2.Type2_tapEv___N_6_M_4": 5.89,
"ScalableTestGrids.Models.Type2.Type2_tapNoEv_N_3_M_4": 4.77,
"ScalableTestGrids.Models.Type2.Type2_tapNoEv_N_4_M_4": 8.06,
"ScalableTestGrids.Models.Type2.Type2_tapNoEv_N_6_M_4": 10.47
},
"ScalableTestSuite": {
"ScalableTestSuite.Electrical.BreakerCircuits.ScaledExperiments.BreakerNetworkDelayed_N_1280_M_10": 5.73,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinearIndividual_N_40_M_40": 6.13,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinearIndividual_N_56_M_56": 10.46,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_20_M_20": 4.29,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_40_M_40": 7.39,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_56_M_56": 10.37,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelicaActiveLoads_N_56_M_56": 4.51,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelicaActiveLoads_N_80_M_80": 7.07,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelicaIndividual_N_80_M_80": 8.33,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelica_N_112_M_112": 7.7,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelica_N_56_M_56": 4.39,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelica_N_80_M_80": 7.3,
"ScalableTestSuite.Elementary.ParameterArrays.ScaledExperiments.Table_N_140_M_140": 9.54,
"ScalableTestSuite.Elementary.ParameterArrays.ScaledExperiments.Table_N_200_M_200": 11.92,
"ScalableTestSuite.Thermal.Advection.ScaledExperiments.SimpleAdvection_N_12800": 4.97
},
"ScalableTestSuite_noopt": {
"ScalableTestSuite.Electrical.BreakerCircuits.ScaledExperiments.BreakerNetworkDelayed_N_1280_M_10": 5.73,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinearIndividual_N_40_M_40": 6.17,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinearIndividual_N_56_M_56": 8.33,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_20_M_20": 4.29,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_28_M_28": 8.15,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_40_M_40": 6.34,
"ScalableTestSuite.Electrical.DistributionSystemAC.ScaledExperiments.DistributionSystemLinear_N_56_M_56": 7.07,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelicaActiveLoads_N_56_M_56": 4.49,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelicaActiveLoads_N_80_M_80": 8.59,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelicaIndividual_N_80_M_80": 7.28,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelica_N_112_M_112": 7.77,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelica_N_56_M_56": 4.39,
"ScalableTestSuite.Electrical.DistributionSystemDC.ScaledExperiments.DistributionSystemModelica_N_80_M_80": 8.4,
"ScalableTestSuite.Elementary.ParameterArrays.ScaledExperiments.Table_N_140_M_140": 9.54,
"ScalableTestSuite.Elementary.ParameterArrays.ScaledExperiments.Table_N_200_M_200": 11.99,
"ScalableTestSuite.Thermal.Advection.ScaledExperiments.SimpleAdvection_N_12800": 4.96
}
}
120 changes: 120 additions & 0 deletions heavy-models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/usr/bin/env python3
"""
Propose the models for configs/heavy-models.json, from the memory the database
has seen them use.

./heavy-models.py --db postgresql://omread@localhost/omdb
./heavy-models.py --db postgresql://omread@localhost/omdb --threshold 2 > configs/heavy-models.json

It prints the file and never writes it: the list is meant to be read and edited
before it is used. What it proposes is the most a model has been measured at
over the newest runs of every branch given, because a model that dies early on
one branch reports what it had reached rather than what it needs - the several
dozen models that report 7.01 GiB on the C branches are all sitting on the
8 GB `ulimit -v`, not asking for 7 GiB. So the maximum over branches is a lower
bound worth believing, and a single branch is not.

Runs older than the maxrss column read 0 and are skipped; a model that has never
completed anywhere cannot be proposed at all, and is reported instead.
"""

import argparse, collections, sys
import simplejson as json
import resultsdb, shared

GiB = float(1 << 30)

# Right at a ulimit -v is where a translation died, not what it wanted.
ULIMIT_WALL_GiB = [7.01, 15.01]
ULIMIT_WALL_TOLERANCE = 0.02


def atUlimitWall(gib):
return any(abs(gib - wall) < ULIMIT_WALL_TOLERANCE for wall in ULIMIT_WALL_GiB)


def peaks(cursor, db, branches, runs):
"""The most every model has been seen to use, and which branch saw it."""
best = {}
for branch in branches:
dates = [row[0] for row in cursor.execute(
"SELECT DISTINCT date FROM %s ORDER BY date DESC LIMIT %d" % (db.quote(branch), runs))]
if not dates:
print("No results for branch %s" % branch)
continue
holes = ",".join("?" * len(dates))
for (libname, model, maxrss) in cursor.execute(
"SELECT libname, model, MAX(maxrss) FROM %s WHERE date IN (%s) AND maxrss > 0 "
"GROUP BY libname, model" % (db.quote(branch), holes), tuple(dates)):
key = (libname, model)
if maxrss / GiB > best.get(key, (0.0, None))[0]:
best[key] = (maxrss / GiB, branch)
return best


def unmeasured(cursor, db, branches, runs):
"""Models no run has ever reported memory for: killed before they could, or
only ever tested before the column existed."""
seen = set()
measured = set()
for branch in branches:
dates = [row[0] for row in cursor.execute(
"SELECT DISTINCT date FROM %s ORDER BY date DESC LIMIT %d" % (db.quote(branch), runs))]
if not dates:
continue
holes = ",".join("?" * len(dates))
for (libname, model, maxrss) in cursor.execute(
"SELECT libname, model, MAX(maxrss) FROM %s WHERE date IN (%s) AND finalphase >= 0 "
"GROUP BY libname, model" % (db.quote(branch), holes), tuple(dates)):
seen.add((libname, model))
if maxrss:
measured.add((libname, model))
return seen - measured


def main():
parser = argparse.ArgumentParser(
description="Propose the heavy-model list from measured memory use",
formatter_class=argparse.RawDescriptionHelpFormatter, epilog=__doc__)
parser.add_argument("--branch", default="master wasm-jit cpp newInst-newBackend",
help="Branches whose results are read, separated by spaces. Each model is "
"credited with the most any of them used.")
parser.add_argument("--runs", type=int, default=20,
help="How many of the newest runs of each branch to read (default 20)")
parser.add_argument("--threshold", type=float, default=4.0,
help="How many GiB a model has to have used to be proposed (default 4)")
resultsdb.addArgument(parser)
args = parser.parse_args()

db = resultsdb.connect(args.db)
cursor = db.cursor()
branches = [shared.resultTable(b) for b in args.branch.split(" ") if b]

best = peaks(cursor, db, branches, args.runs)
out = collections.defaultdict(dict)
walls = []
for ((libname, model), (gib, branch)) in best.items():
if gib < args.threshold:
continue
if atUlimitWall(gib):
walls.append((libname, model, gib))
out[libname][model] = round(gib, 2)

print(json.dumps(dict((lib, dict(sorted(models.items()))) for (lib, models) in sorted(out.items())),
indent=1, sort_keys=True))

# The report goes to stderr, so that stdout is the file.
heavy = sum(len(models) for models in out.values())
report = ["%d models over %g GiB in %d libraries" % (heavy, args.threshold, len(out))]
for (libname, model, gib) in sorted(walls):
report.append(" ! %s %s stopped at %.2f GiB, which is a ulimit -v rather than what it needs"
% (libname, model, gib))
never = unmeasured(cursor, db, branches, args.runs)
if never:
report.append(" ? %d models have never reported memory (killed before writing, or only "
"tested before the column existed); they are scheduled as light ones" % len(never))
sys.stderr.write("\n".join(report) + "\n")


if __name__ == "__main__":
main()
Loading
Loading