Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.conf.json loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Buildings 11.0.1-master/package.mo", uses=false) Using package Buildings with version 11.0.1 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Buildings 11.0.1-master/package.mo) Using package Modelica with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo) Using package Complex with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo) Using package ModelicaServices with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo) Running command: translateModel(Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="time|con.SOC|con.y|con.isDay.y",fileNamePrefix="Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl") translateModel(Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="time|con.SOC|con.y|con.isDay.y",fileNamePrefix="Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001168/0.001168, allocations: 105.5 kB / 15.98 MB, free: 6.352 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo): time 0.0016/0.001601, allocations: 195.1 kB / 16.91 MB, free: 6.191 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo): time 1.352/1.352, allocations: 222.9 MB / 240.6 MB, free: 13.75 MB / 206.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Buildings 11.0.1-master/package.mo): time 2.581/2.581, allocations: 469.4 MB / 0.7423 GB, free: 3.883 MB / 0.6075 GB Notification: Performance of FrontEnd - loaded program: time 0.001326/0.001326, allocations: 65.94 kB / 0.9083 GB, free: 14.47 MB / 0.6856 GB Notification: Performance of FrontEnd - Absyn->SCode: time 0.3578/0.3591, allocations: 159.1 MB / 1.064 GB, free: 15.36 MB / 0.8419 GB Notification: Performance of NFInst.instantiate(Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl): time 0.004072/0.3632, allocations: 2.37 MB / 1.066 GB, free: 12.97 MB / 0.8419 GB Notification: Performance of NFInst.instExpressions: time 0.001819/0.3651, allocations: 0.9428 MB / 1.067 GB, free: 12.02 MB / 0.8419 GB Notification: Performance of NFInst.updateImplicitVariability: time 0.0003376/0.3654, allocations: 11.94 kB / 1.067 GB, free: 12.01 MB / 0.8419 GB Notification: Performance of NFTyping.typeComponents: time 0.0002594/0.3657, allocations: 39.66 kB / 1.067 GB, free: 11.97 MB / 0.8419 GB Notification: Performance of NFTyping.typeBindings: time 0.0004067/0.3662, allocations: 35.78 kB / 1.067 GB, free: 11.94 MB / 0.8419 GB Notification: Performance of NFTyping.typeClassSections: time 0.0007206/0.3669, allocations: 255.7 kB / 1.067 GB, free: 11.69 MB / 0.8419 GB Notification: Performance of NFFlatten.flatten: time 0.0006158/0.3675, allocations: 0.6285 MB / 1.068 GB, free: 11.06 MB / 0.8419 GB Notification: Performance of NFFlatten.resolveConnections: time 0.0005622/0.3681, allocations: 464.4 kB / 1.068 GB, free: 10.6 MB / 0.8419 GB Notification: Performance of NFEvalConstants.evaluate: time 0.0002426/0.3683, allocations: 223.3 kB / 1.069 GB, free: 10.38 MB / 0.8419 GB Notification: Performance of NFSimplifyModel.simplify: time 0.0002415/0.3686, allocations: 227 kB / 1.069 GB, free: 10.16 MB / 0.8419 GB Notification: Performance of NFPackage.collectConstants: time 8.022e-05/0.3687, allocations: 68 kB / 1.069 GB, free: 10.09 MB / 0.8419 GB Notification: Performance of NFFlatten.collectFunctions: time 0.0001398/0.3688, allocations: 87.92 kB / 1.069 GB, free: 10 MB / 0.8419 GB Notification: Performance of NFScalarize.scalarize: time 0.0001596/0.369, allocations: 155.6 kB / 1.069 GB, free: 9.852 MB / 0.8419 GB Notification: Performance of NFVerifyModel.verify: time 0.000206/0.3692, allocations: 242.9 kB / 1.069 GB, free: 9.613 MB / 0.8419 GB Notification: Performance of NFConvertDAE.convert: time 0.0005363/0.3698, allocations: 0.5889 MB / 1.07 GB, free: 9.023 MB / 0.8419 GB Notification: Performance of FrontEnd - DAE generated: time 5.931e-06/0.3698, allocations: 4 kB / 1.07 GB, free: 9.02 MB / 0.8419 GB Notification: Performance of FrontEnd: time 1.523e-06/0.3698, allocations: 0 / 1.07 GB, free: 9.02 MB / 0.8419 GB Notification: Performance of Transformations before backend: time 9.288e-06/0.3698, allocations: 0 / 1.07 GB, free: 9.02 MB / 0.8419 GB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 128 * Number of variables: 128 Notification: Performance of Generate backend data structure: time 0.001154/0.371, allocations: 0.7331 MB / 1.071 GB, free: 8.238 MB / 0.8419 GB Notification: Performance of prepare preOptimizeDAE: time 5.294e-05/0.371, allocations: 8.625 kB / 1.071 GB, free: 8.23 MB / 0.8419 GB Notification: Performance of preOpt normalInlineFunction (simulation): time 0.0001089/0.3711, allocations: 56.28 kB / 1.071 GB, free: 8.176 MB / 0.8419 GB Notification: Performance of preOpt evaluateParameters (simulation): time 0.0003819/0.3715, allocations: 344.2 kB / 1.071 GB, free: 7.801 MB / 0.8419 GB Notification: Performance of preOpt simplifyIfEquations (simulation): time 5.586e-05/0.3716, allocations: 45.69 kB / 1.071 GB, free: 7.758 MB / 0.8419 GB Notification: Performance of preOpt expandDerOperator (simulation): time 7.575e-05/0.3717, allocations: 56.38 kB / 1.071 GB, free: 7.703 MB / 0.8419 GB Notification: Performance of preOpt clockPartitioning (simulation): time 0.0009102/0.3726, allocations: 0.5816 MB / 1.072 GB, free: 7.09 MB / 0.8419 GB Notification: Performance of preOpt findStateOrder (simulation): time 1.707e-05/0.3726, allocations: 3.938 kB / 1.072 GB, free: 7.086 MB / 0.8419 GB Notification: Performance of preOpt replaceEdgeChange (simulation): time 4.799e-05/0.3727, allocations: 23.98 kB / 1.072 GB, free: 7.062 MB / 0.8419 GB Notification: Performance of preOpt inlineArrayEqn (simulation): time 3.518e-05/0.3727, allocations: 21 kB / 1.072 GB, free: 7.039 MB / 0.8419 GB Notification: Performance of preOpt removeEqualRHS (simulation): time 0.0007031/0.3734, allocations: 427.7 kB / 1.072 GB, free: 6.625 MB / 0.8419 GB Notification: Performance of preOpt removeSimpleEquations (simulation): time 0.002227/0.3756, allocations: 1.926 MB / 1.074 GB, free: 4.617 MB / 0.8419 GB Notification: Performance of preOpt comSubExp (simulation): time 0.000589/0.3762, allocations: 405 kB / 1.074 GB, free: 4.195 MB / 0.8419 GB Notification: Performance of preOpt resolveLoops (simulation): time 0.0002914/0.3765, allocations: 198.5 kB / 1.075 GB, free: 3.992 MB / 0.8419 GB Notification: Performance of preOpt evalFunc (simulation): time 5.664e-05/0.3766, allocations: 15.94 kB / 1.075 GB, free: 3.977 MB / 0.8419 GB Notification: Performance of preOpt encapsulateWhenConditions (simulation): time 0.0004256/0.377, allocations: 273 kB / 1.075 GB, free: 3.688 MB / 0.8419 GB Notification: Performance of pre-optimization done (n=48): time 2.034e-06/0.3771, allocations: 0 / 1.075 GB, free: 3.688 MB / 0.8419 GB Notification: Performance of matching and sorting (n=48): time 0.0008938/0.378, allocations: 0.4888 MB / 1.075 GB, free: 3.195 MB / 0.8419 GB Notification: Performance of inlineWhenForInitialization (initialization): time 7.288e-05/0.378, allocations: 114.8 kB / 1.075 GB, free: 3.059 MB / 0.8419 GB Notification: Performance of selectInitializationVariablesDAE (initialization): time 0.0002081/0.3783, allocations: 243 kB / 1.076 GB, free: 2.812 MB / 0.8419 GB Notification: Performance of collectPreVariables (initialization): time 5.993e-05/0.3783, allocations: 49.7 kB / 1.076 GB, free: 2.758 MB / 0.8419 GB Notification: Performance of collectInitialEqns (initialization): time 0.0001399/0.3785, allocations: 212.8 kB / 1.076 GB, free: 2.543 MB / 0.8419 GB Notification: Performance of collectInitialBindings (initialization): time 9.547e-05/0.3786, allocations: 118.4 kB / 1.076 GB, free: 2.426 MB / 0.8419 GB Notification: Performance of simplifyInitialFunctions (initialization): time 0.0001728/0.3787, allocations: 142.3 kB / 1.076 GB, free: 2.281 MB / 0.8419 GB Notification: Performance of setup shared object (initialization): time 0.0001301/0.3789, allocations: 350.7 kB / 1.077 GB, free: 1.93 MB / 0.8419 GB Notification: Performance of preBalanceInitialSystem (initialization): time 0.0003013/0.3792, allocations: 165.2 kB / 1.077 GB, free: 1.77 MB / 0.8419 GB Notification: Performance of partitionIndependentBlocks (initialization): time 0.0003519/0.3796, allocations: 296.7 kB / 1.077 GB, free: 1.43 MB / 0.8419 GB Notification: Performance of analyzeInitialSystem (initialization): time 0.0005674/0.3801, allocations: 414.5 kB / 1.077 GB, free: 0.9805 MB / 0.8419 GB Notification: Performance of solveInitialSystemEqSystem (initialization): time 3.316e-06/0.3801, allocations: 4 kB / 1.077 GB, free: 0.9766 MB / 0.8419 GB Notification: Performance of matching and sorting (n=76) (initialization): time 0.00079/0.3809, allocations: 0.5066 MB / 1.078 GB, free: 472 kB / 0.8419 GB Notification: Performance of prepare postOptimizeDAE: time 2.143e-05/0.381, allocations: 8 kB / 1.078 GB, free: 464 kB / 0.8419 GB Notification: Performance of postOpt simplifyComplexFunction (initialization): time 9.598e-06/0.381, allocations: 8.031 kB / 1.078 GB, free: 456 kB / 0.8419 GB Notification: Performance of postOpt tearingSystem (initialization): time 1.899e-05/0.381, allocations: 4 kB / 1.078 GB, free: 452 kB / 0.8419 GB Notification: Performance of postOpt solveSimpleEquations (initialization): time 0.0002479/0.3813, allocations: 63.83 kB / 1.078 GB, free: 388 kB / 0.8419 GB Notification: Performance of postOpt calculateStrongComponentJacobians (initialization): time 1.565e-05/0.3813, allocations: 8 kB / 1.078 GB, free: 380 kB / 0.8419 GB Notification: Performance of postOpt simplifyAllExpressions (initialization): time 0.0002203/0.3815, allocations: 67.36 kB / 1.078 GB, free: 312 kB / 0.8419 GB Notification: Performance of postOpt collapseArrayExpressions (initialization): time 4.709e-05/0.3816, allocations: 27.98 kB / 1.078 GB, free: 284 kB / 0.8419 GB Notification: Model statistics after passing the back-end for initialization: * Number of independent subsystems: 16 * Number of states: 0 () * Number of discrete variables: 59 ($PRE.con.multiSwitch1.u[1],$PRE.con.multiSwitch1.u[2],$PRE.con.t1.enableFire,$PRE.con.t2.enableFire,$PRE.con.t3.enableFire,$PRE.con.t4.enableFire,con.t3.t_start,$PRE.con.t3.t_start,con.t4.t_start,$PRE.con.t4.t_start,con.stateGraphRoot.resume,con.stateGraphRoot.suspend,con.t4.enableFire,con.t4.condition,con.t3.enableFire,con.t3.condition,con.discharge.active,con.discharge.oldActive,$PRE.con.discharge.oldActive,con.discharge.newActive,$PRE.con.discharge.newActive,con.discharge.localActive,$PRE.con.discharge.localActive,con.charge.active,con.charge.oldActive,$PRE.con.charge.oldActive,con.charge.newActive,$PRE.con.charge.newActive,con.charge.localActive,$PRE.con.charge.localActive,con.t2.t_start,$PRE.con.t2.t_start,con.t2.fire,con.t2.enableFire,con.t2.condition,con.t1.t_start,$PRE.con.t1.t_start,con.t1.fire,con.t1.enableFire,con.t1.condition,con.alternative.split[2].available,con.stateGraphRoot.activeSteps,con.off.oldActive,$PRE.con.off.oldActive,con.off.newActive,$PRE.con.off.newActive,con.off.outPort[1].reset,con.off.inPort[1].set,con.off.localActive,$PRE.con.off.localActive,con.off.active,con.multiSwitch1.firstActiveIndex,con.multiSwitch1.u[2],con.multiSwitch1.u[1],con.greaterThreshold.y,con.not1.y,con.lessThreshold.y,$whenCondition1,$whenCondition2) * Number of discrete states: 0 () * Number of clocked states: 0 () * Top-level inputs: 0 Notification: Strong component statistics for initialization (76): * Single equations (assignments): 76 * Array equations: 0 * Algorithm blocks: 0 * Record equations: 0 * When equations: 0 * If-equations: 0 * Equation systems (not torn): 0 * Torn equation systems: 0 * Mixed (continuous/discrete) equation systems: 0 Notification: Performance of prepare postOptimizeDAE: time 0.0002557/0.3818, allocations: 236.8 kB / 1.078 GB, free: 36 kB / 0.8419 GB Notification: Performance of postOpt lateInlineFunction (simulation): time 5.196e-05/0.3819, allocations: 23.72 kB / 1.078 GB, free: 12 kB / 0.8419 GB Notification: Performance of postOpt wrapFunctionCalls (simulation): time 0.65/1.032, allocations: 424.5 kB / 1.079 GB, free: 22.61 MB / 0.8419 GB Notification: Performance of postOpt inlineArrayEqn (simulation): time 1.407e-05/1.032, allocations: 6.094 kB / 1.079 GB, free: 22.61 MB / 0.8419 GB Notification: Performance of postOpt constantLinearSystem (simulation): time 9.056e-06/1.032, allocations: 1.312 kB / 1.079 GB, free: 22.61 MB / 0.8419 GB Notification: Performance of postOpt simplifysemiLinear (simulation): time 1.392e-05/1.032, allocations: 8.547 kB / 1.079 GB, free: 22.61 MB / 0.8419 GB Notification: Performance of postOpt removeSimpleEquations (simulation): time 0.001854/1.034, allocations: 1.149 MB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt simplifyComplexFunction (simulation): time 6.212e-06/1.034, allocations: 1.562 kB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt solveSimpleEquations (simulation): time 0.0001847/1.034, allocations: 35.64 kB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt tearingSystem (simulation): time 8.787e-06/1.034, allocations: 5.812 kB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt inputDerivativesUsed (simulation): time 3.056e-05/1.034, allocations: 9.422 kB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt calculateStrongComponentJacobians (simulation): time 5.219e-06/1.034, allocations: 2.344 kB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt calculateStateSetsJacobians (simulation): time 5.431e-06/1.034, allocations: 6.5 kB / 1.08 GB, free: 22.23 MB / 0.8419 GB Notification: Performance of postOpt symbolicJacobian (simulation): time 0.0007592/1.035, allocations: 0.5186 MB / 1.08 GB, free: 22.05 MB / 0.8419 GB Notification: Performance of postOpt removeConstants (simulation): time 5.949e-05/1.035, allocations: 108.7 kB / 1.08 GB, free: 21.96 MB / 0.8419 GB Notification: Performance of postOpt simplifyTimeIndepFuncCalls (simulation): time 6.34e-05/1.035, allocations: 13.78 kB / 1.08 GB, free: 21.95 MB / 0.8419 GB Notification: Performance of postOpt simplifyAllExpressions (simulation): time 0.0001987/1.035, allocations: 26.77 kB / 1.081 GB, free: 21.94 MB / 0.8419 GB Notification: Performance of postOpt findZeroCrossings (simulation): time 0.0001971/1.035, allocations: 70.25 kB / 1.081 GB, free: 21.93 MB / 0.8419 GB Notification: Performance of postOpt collapseArrayExpressions (simulation): time 4.836e-05/1.035, allocations: 17.73 kB / 1.081 GB, free: 21.92 MB / 0.8419 GB Notification: Performance of sorting global known variables: time 0.0001181/1.036, allocations: 138.4 kB / 1.081 GB, free: 21.83 MB / 0.8419 GB Notification: Performance of sort global known variables: time 7.12e-07/1.036, allocations: 0 / 1.081 GB, free: 21.83 MB / 0.8419 GB Notification: Performance of remove unused functions: time 0.0005618/1.036, allocations: 120.3 kB / 1.081 GB, free: 21.8 MB / 0.8419 GB Notification: Model statistics after passing the back-end for simulation: * Number of independent subsystems: 3 * Number of states: 0 () * Number of discrete variables: 44 (con.t4.t_start,con.t3.t_start,con.t2.enableFire,con.t1.enableFire,con.discharge.active,con.discharge.localActive,con.charge.active,con.charge.localActive,con.off.localActive,$cse1,$cse2,$cse3,$cse4,$cse5,$cse6,$whenCondition2,$whenCondition1,con.lessThreshold.y,con.not1.y,con.greaterThreshold.y,con.multiSwitch1.u[1],con.multiSwitch1.u[2],con.multiSwitch1.firstActiveIndex,con.off.active,con.off.inPort[1].set,con.off.outPort[1].reset,con.off.newActive,con.off.oldActive,con.stateGraphRoot.activeSteps,con.alternative.split[2].available,con.t1.condition,con.t1.fire,con.t1.t_start,con.t2.condition,con.t2.fire,con.t2.t_start,con.charge.newActive,con.charge.oldActive,con.discharge.newActive,con.discharge.oldActive,con.t3.condition,con.t3.enableFire,con.t4.condition,con.t4.enableFire) * Number of discrete states: 5 (con.off.newActive,con.charge.newActive,con.discharge.newActive,con.t3.t_start,con.t4.t_start) * Number of clocked states: 0 () * Top-level inputs: 0 Notification: Strong component statistics for simulation (54): * Single equations (assignments): 47 * Array equations: 0 * Algorithm blocks: 0 * Record equations: 0 * When equations: 7 * If-equations: 0 * Equation systems (not torn): 0 * Torn equation systems: 0 * Mixed (continuous/discrete) equation systems: 0 Notification: Performance of Backend phase and start with SimCode phase: time 0.0002224/1.036, allocations: 144 kB / 1.081 GB, free: 21.7 MB / 0.8419 GB Notification: Performance of simCode: created initialization part: time 0.001002/1.037, allocations: 490 kB / 1.081 GB, free: 21.55 MB / 0.8419 GB Notification: Performance of simCode: created event and clocks part: time 3.156e-06/1.037, allocations: 1.438 kB / 1.081 GB, free: 21.55 MB / 0.8419 GB Notification: Performance of simCode: created simulation system equations: time 0.000385/1.038, allocations: 229.4 kB / 1.082 GB, free: 21.47 MB / 0.8419 GB Notification: Performance of simCode: created of all other equations (e.g. parameter, nominal, assert, etc): time 0.0003955/1.038, allocations: 42.42 kB / 1.082 GB, free: 21.46 MB / 0.8419 GB Notification: Performance of simCode: created linear, non-linear and system jacobian parts: time 0.001285/1.04, allocations: 0.9209 MB / 1.083 GB, free: 20.86 MB / 0.8419 GB Notification: Performance of simCode: some other stuff during SimCode phase: time 0.000286/1.04, allocations: 0.8179 MB / 1.083 GB, free: 20.16 MB / 0.8419 GB Notification: Performance of simCode: all other stuff during SimCode phase: time 0.0001368/1.04, allocations: 46.45 kB / 1.083 GB, free: 20.15 MB / 0.8419 GB Notification: Performance of SimCode: time 3.5e-07/1.04, allocations: 0 / 1.083 GB, free: 20.15 MB / 0.8419 GB Notification: Performance of Templates: time 0.01117/1.051, allocations: 5.366 MB / 1.089 GB, free: 19.56 MB / 0.8419 GB make -j1 -f Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.makefile (rm -f Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.pipe ; mkfifo Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.pipe ; head -c 1048576 < Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.pipe >> ../files/Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.sim & ./Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl -abortSlowSimulation -alarm=480 -emit_protected -lv LOG_STATS > Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.pipe 2>&1) diffSimulationResults("Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl_res.mat","/mnt/ReferenceFiles/Buildings/csv/master/Buildings_Examples_ChillerPlant_BaseClasses_Controls_Examples_BatteryControl.csv","/var/lib/jenkins1/ws/OpenModelicaLibraryTestingWork/OpenModelicaLibraryTesting/files/Buildings_latest_Buildings.Examples.ChillerPlant.BaseClasses.Controls.Examples.BatteryControl.diff",relTol=0.003,relTolDiffMinMax=0.003,rangeDelta=0.001) Reference file matches