Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.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 3.2.3+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica_Synchronous 0.93.0-master/package.mo", uses=false) Using package Modelica_Synchronous with version 0.93.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica_Synchronous 0.93.0-master/package.mo) Using package Modelica with version 3.2.3 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+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(Modelica_Synchronous.Examples.Systems.EngineThrottleControl,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="Time|angleSensor.phi|speedControl.Theta",fileNamePrefix="Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl") translateModel(Modelica_Synchronous.Examples.Systems.EngineThrottleControl,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="Time|angleSensor.phi|speedControl.Theta",fileNamePrefix="Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.0007644/0.0007643, allocations: 102.3 kB / 16.07 MB, free: 32 kB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo): time 0.0007379/0.000738, allocations: 182 kB / 16.96 MB, free: 6.879 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo): time 1.189/1.189, allocations: 205.4 MB / 223.1 MB, free: 5.516 MB / 174.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica_Synchronous 0.93.0-master/package.mo): time 0.05738/0.05738, allocations: 12.6 MB / 284 MB, free: 8.582 MB / 238.1 MB Notification: Modelica requested package Complex of version 3.2.3. Complex 4.0.0 is used instead which states that it is fully compatible without conversion script needed. Notification: Modelica requested package ModelicaServices of version 3.2.3. ModelicaServices 4.0.0 is used instead which states that it is fully compatible without conversion script needed. Notification: Modelica_Synchronous requested package ModelicaServices of version 3.2.3. ModelicaServices 4.0.0 is used instead which states that it is fully compatible without conversion script needed. Notification: Performance of FrontEnd - loaded program: time 0.000642/0.000642, allocations: 24 kB / 345.2 MB, free: 20.9 MB / 254.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 0.07418/0.07483, allocations: 50.38 MB / 395.5 MB, free: 2.434 MB / 286.1 MB Notification: Performance of NFInst.instantiate(Modelica_Synchronous.Examples.Systems.EngineThrottleControl): time 0.0034/0.07827, allocations: 2.841 MB / 398.4 MB, free: 15.57 MB / 302.1 MB Notification: Performance of NFInst.instExpressions: time 0.001302/0.0796, allocations: 0.6775 MB / 399.1 MB, free: 14.89 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0003223/0.07995, allocations: 19.88 kB / 399.1 MB, free: 14.88 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.000168/0.08013, allocations: 35.58 kB / 399.1 MB, free: 14.84 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.0002264/0.08036, allocations: 55.56 kB / 399.2 MB, free: 14.79 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.0006798/0.08105, allocations: 287.7 kB / 399.5 MB, free: 14.5 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.0006805/0.08174, allocations: 0.6052 MB / 400.1 MB, free: 13.89 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0005321/0.08228, allocations: 374.4 kB / 400.4 MB, free: 13.52 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.0002235/0.08252, allocations: 163.2 kB / 400.6 MB, free: 13.36 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0002712/0.0828, allocations: 202.8 kB / 400.8 MB, free: 13.16 MB / 302.1 MB Notification: Performance of NFPackage.collectConstants: time 5.11e-05/0.08286, allocations: 20 kB / 400.8 MB, free: 13.14 MB / 302.1 MB Notification: Performance of NFFlatten.collectFunctions: time 4.533e-05/0.08291, allocations: 16 kB / 400.8 MB, free: 13.12 MB / 302.1 MB Notification: Performance of NFScalarize.scalarize: time 7.886e-05/0.08299, allocations: 83.55 kB / 400.9 MB, free: 13.04 MB / 302.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0002041/0.08321, allocations: 260.2 kB / 401.1 MB, free: 12.78 MB / 302.1 MB Notification: Performance of NFConvertDAE.convert: time 0.000575/0.08379, allocations: 0.7668 MB / 401.9 MB, free: 12.01 MB / 302.1 MB Notification: Performance of FrontEnd - DAE generated: time 3.496e-06/0.0838, allocations: 0 / 401.9 MB, free: 12.01 MB / 302.1 MB Notification: Performance of FrontEnd: time 1.022e-06/0.08381, allocations: 0 / 401.9 MB, free: 12.01 MB / 302.1 MB Notification: Performance of Transformations before backend: time 1.984e-05/0.08383, allocations: 0 / 401.9 MB, free: 12.01 MB / 302.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 148 * Number of variables: 148 Notification: Performance of Generate backend data structure: time 0.001265/0.0851, allocations: 0.7795 MB / 402.7 MB, free: 11.17 MB / 302.1 MB Notification: Performance of prepare preOptimizeDAE: time 3.227e-05/0.08514, allocations: 12.03 kB / 402.7 MB, free: 11.16 MB / 302.1 MB Notification: Performance of preOpt normalInlineFunction (simulation): time 0.0001247/0.08527, allocations: 60.28 kB / 402.8 MB, free: 11.1 MB / 302.1 MB Notification: Performance of preOpt evaluateParameters (simulation): time 0.0004623/0.08574, allocations: 410.2 kB / 403.2 MB, free: 10.66 MB / 302.1 MB Notification: Performance of preOpt simplifyIfEquations (simulation): time 0.0001021/0.08585, allocations: 105.2 kB / 403.3 MB, free: 10.54 MB / 302.1 MB Notification: Performance of preOpt expandDerOperator (simulation): time 8.811e-05/0.08595, allocations: 60.38 kB / 403.3 MB, free: 10.48 MB / 302.1 MB Notification: Performance of preOpt clockPartitioning (simulation): time 0.001691/0.08765, allocations: 1.026 MB / 404.4 MB, free: 9.418 MB / 302.1 MB Notification: Performance of preOpt findStateOrder (simulation): time 2.605e-05/0.08769, allocations: 7.922 kB / 404.4 MB, free: 9.41 MB / 302.1 MB Notification: Performance of preOpt replaceEdgeChange (simulation): time 5.583e-05/0.08775, allocations: 24 kB / 404.4 MB, free: 9.387 MB / 302.1 MB Notification: Performance of preOpt inlineArrayEqn (simulation): time 1.131e-05/0.08777, allocations: 12 kB / 404.4 MB, free: 9.375 MB / 302.1 MB Notification: Performance of preOpt removeEqualRHS (simulation): time 0.0008787/0.08865, allocations: 415.7 kB / 404.8 MB, free: 8.973 MB / 302.1 MB Notification: Performance of preOpt removeSimpleEquations (simulation): time 0.00229/0.09095, allocations: 1.712 MB / 406.5 MB, free: 7.172 MB / 302.1 MB Notification: Performance of preOpt comSubExp (simulation): time 0.001437/0.0924, allocations: 0.6038 MB / 407.1 MB, free: 6.531 MB / 302.1 MB Notification: Performance of preOpt resolveLoops (simulation): time 0.0004963/0.09291, allocations: 291.3 kB / 407.4 MB, free: 6.234 MB / 302.1 MB Notification: Performance of preOpt evalFunc (simulation): time 4.718e-05/0.09297, allocations: 24.45 kB / 407.4 MB, free: 6.211 MB / 302.1 MB Notification: Performance of preOpt encapsulateWhenConditions (simulation): time 0.0004014/0.09338, allocations: 230.7 kB / 407.7 MB, free: 5.961 MB / 302.1 MB Notification: Performance of pre-optimization done (n=68): time 3.056e-06/0.09339, allocations: 0 / 407.7 MB, free: 5.961 MB / 302.1 MB Notification: Performance of matching and sorting (n=68): time 0.00138/0.09478, allocations: 0.6929 MB / 408.3 MB, free: 5.262 MB / 302.1 MB Notification: Performance of inlineWhenForInitialization (initialization): time 0.0001293/0.09492, allocations: 219.8 kB / 408.6 MB, free: 5.004 MB / 302.1 MB Notification: Performance of selectInitializationVariablesDAE (initialization): time 0.0002724/0.0952, allocations: 274.9 kB / 408.8 MB, free: 4.719 MB / 302.1 MB Notification: Performance of collectPreVariables (initialization): time 4.441e-05/0.09525, allocations: 37.7 kB / 408.9 MB, free: 4.676 MB / 302.1 MB Notification: Performance of collectInitialEqns (initialization): time 0.0001365/0.09539, allocations: 221.1 kB / 409.1 MB, free: 4.453 MB / 302.1 MB Notification: Performance of collectInitialBindings (initialization): time 0.0001129/0.09551, allocations: 138.2 kB / 409.2 MB, free: 4.316 MB / 302.1 MB Notification: Performance of simplifyInitialFunctions (initialization): time 7.831e-05/0.0956, allocations: 61.69 kB / 409.3 MB, free: 4.25 MB / 302.1 MB Notification: Performance of setup shared object (initialization): time 0.0001331/0.09574, allocations: 362.7 kB / 409.6 MB, free: 3.887 MB / 302.1 MB Notification: Performance of preBalanceInitialSystem (initialization): time 0.0003392/0.09608, allocations: 169.9 kB / 409.8 MB, free: 3.723 MB / 302.1 MB Notification: Performance of partitionIndependentBlocks (initialization): time 0.0005347/0.09663, allocations: 478.6 kB / 410.3 MB, free: 3.121 MB / 302.1 MB Notification: Performance of analyzeInitialSystem (initialization): time 0.0008328/0.09747, allocations: 0.6201 MB / 410.9 MB, free: 2.375 MB / 302.1 MB Notification: Performance of solveInitialSystemEqSystem (initialization): time 6.422e-06/0.09749, allocations: 4 kB / 410.9 MB, free: 2.371 MB / 302.1 MB Notification: Performance of matching and sorting (n=86) (initialization): time 0.001076/0.09857, allocations: 0.6611 MB / 411.6 MB, free: 1.703 MB / 302.1 MB Notification: Performance of prepare postOptimizeDAE: time 2.614e-05/0.0986, allocations: 8 kB / 411.6 MB, free: 1.695 MB / 302.1 MB Notification: Performance of postOpt simplifyComplexFunction (initialization): time 1.486e-05/0.09862, allocations: 12 kB / 411.6 MB, free: 1.684 MB / 302.1 MB Notification: Performance of postOpt tearingSystem (initialization): time 2.323e-05/0.09865, allocations: 15.94 kB / 411.6 MB, free: 1.668 MB / 302.1 MB Notification: Performance of postOpt solveSimpleEquations (initialization): time 0.0004741/0.09913, allocations: 151.7 kB / 411.7 MB, free: 1.52 MB / 302.1 MB Notification: Performance of postOpt calculateStrongComponentJacobians (initialization): time 2.029e-05/0.09916, allocations: 19.94 kB / 411.8 MB, free: 1.5 MB / 302.1 MB Notification: Performance of postOpt simplifyAllExpressions (initialization): time 0.0003243/0.09949, allocations: 67.58 kB / 411.8 MB, free: 1.434 MB / 302.1 MB Notification: Performance of postOpt collapseArrayExpressions (initialization): time 4.845e-05/0.09955, allocations: 39.98 kB / 411.9 MB, free: 1.395 MB / 302.1 MB Notification: Model statistics after passing the back-end for initialization: * Number of independent subsystems: 41 * Number of states: 0 () * Number of discrete variables: 20 (rotationalClock.rotationalClock.changed.y,$CLKPRE.rotationalClock.rotationalClock.changed.u,rotationalClock.rotationalClock.changed.u,rotationalClock.rotationalClock.cast.y,rotationalClock.rotationalClock.direction_changed,rotationalClock.rotationalClock.direction,rotationalClock.direction_changed,rotationalClock.direction,engine.crankshaftPositionEvent.rotationalClock.changed.y,$CLKPRE.engine.crankshaftPositionEvent.rotationalClock.changed.u,engine.crankshaftPositionEvent.rotationalClock.changed.u,engine.crankshaftPositionEvent.rotationalClock.cast.y,engine.crankshaftPositionEvent.rotationalClock.direction_changed,engine.crankshaftPositionEvent.rotationalClock.direction,engine.crankshaftPositionEvent.direction_changed,engine.crankshaftPositionEvent.direction,$whenCondition2,$whenCondition1,engine.crankshaftPositionEvent.rotationalClock.less.y,rotationalClock.rotationalClock.less.y) * Number of discrete states: 0 () * Number of clocked states: 6 (rotationalClock.rotationalClock.changed.u,speedControl.x_d,speedControl.N,speedControl.N_des,engine.inductionToPowerDelay.m_a_sampled,engine.crankshaftPositionEvent.rotationalClock.changed.u) * Top-level inputs: 0 Notification: Strong component statistics for initialization (86): * Single equations (assignments): 86 * 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.0002569/0.09981, allocations: 229.5 kB / 412.1 MB, free: 1.164 MB / 302.1 MB Notification: Performance of postOpt lateInlineFunction (simulation): time 0.0004275/0.1002, allocations: 269.8 kB / 412.3 MB, free: 0.8945 MB / 302.1 MB Notification: Performance of postOpt wrapFunctionCalls (simulation): time 0.0006615/0.1009, allocations: 352.7 kB / 412.7 MB, free: 0.5469 MB / 302.1 MB Notification: Performance of postOpt inlineArrayEqn (simulation): time 7.554e-06/0.1009, allocations: 8 kB / 412.7 MB, free: 0.5391 MB / 302.1 MB Notification: Performance of postOpt constantLinearSystem (simulation): time 5.931e-06/0.1009, allocations: 0 / 412.7 MB, free: 0.5391 MB / 302.1 MB Notification: Performance of postOpt simplifysemiLinear (simulation): time 8.005e-06/0.101, allocations: 3.984 kB / 412.7 MB, free: 0.5352 MB / 302.1 MB Notification: Performance of postOpt removeSimpleEquations (simulation): time 0.001248/0.1022, allocations: 0.9818 MB / 413.7 MB, free: 15.5 MB / 318.1 MB Notification: Performance of postOpt simplifyComplexFunction (simulation): time 4.168e-06/0.1022, allocations: 0 / 413.7 MB, free: 15.5 MB / 318.1 MB Notification: Performance of postOpt solveSimpleEquations (simulation): time 0.0005429/0.1028, allocations: 119.9 kB / 413.8 MB, free: 15.38 MB / 318.1 MB Notification: Performance of postOpt tearingSystem (simulation): time 7.494e-06/0.1028, allocations: 7.938 kB / 413.8 MB, free: 15.37 MB / 318.1 MB Notification: Performance of postOpt inputDerivativesUsed (simulation): time 4.181e-05/0.1028, allocations: 19.98 kB / 413.8 MB, free: 15.35 MB / 318.1 MB Notification: Performance of postOpt calculateStrongComponentJacobians (simulation): time 5.47e-06/0.1029, allocations: 7.938 kB / 413.8 MB, free: 15.34 MB / 318.1 MB Notification: Performance of postOpt calculateStateSetsJacobians (simulation): time 1.212e-06/0.1029, allocations: 4 kB / 413.8 MB, free: 15.34 MB / 318.1 MB Notification: Performance of postOpt symbolicJacobian (simulation): time 0.00146/0.1043, allocations: 0.9169 MB / 414.8 MB, free: 14.4 MB / 318.1 MB Notification: Performance of postOpt removeConstants (simulation): time 8.616e-05/0.1044, allocations: 128.5 kB / 414.9 MB, free: 14.26 MB / 318.1 MB Notification: Performance of postOpt simplifyTimeIndepFuncCalls (simulation): time 6.915e-05/0.1045, allocations: 16 kB / 414.9 MB, free: 14.24 MB / 318.1 MB Notification: Performance of postOpt simplifyAllExpressions (simulation): time 0.0002777/0.1048, allocations: 39.91 kB / 414.9 MB, free: 14.2 MB / 318.1 MB Notification: Performance of postOpt findZeroCrossings (simulation): time 7.018e-05/0.1049, allocations: 27.91 kB / 415 MB, free: 14.18 MB / 318.1 MB Notification: Performance of postOpt collapseArrayExpressions (simulation): time 3.628e-05/0.1049, allocations: 19.98 kB / 415 MB, free: 14.16 MB / 318.1 MB Notification: Performance of sorting global known variables: time 0.0001748/0.1051, allocations: 190 kB / 415.2 MB, free: 13.97 MB / 318.1 MB Notification: Performance of sort global known variables: time 1.423e-06/0.1051, allocations: 0 / 415.2 MB, free: 13.97 MB / 318.1 MB Notification: Performance of remove unused functions: time 0.0004674/0.1056, allocations: 127.6 kB / 415.3 MB, free: 13.85 MB / 318.1 MB Notification: Model statistics after passing the back-end for simulation: * Number of independent subsystems: 4 * Number of states: 5 (engine.throttleBody.m_ai,engine.intakeManifold.P_m,engine.cylinderAirCharge.m_a_total,engine.inertia1.w,derivative.u) * Number of discrete variables: 18 (engine.crankshaftPositionEvent.direction,engine.crankshaftPositionEvent.direction_changed,engine.crankshaftPositionEvent.rotationalClock.direction,engine.crankshaftPositionEvent.rotationalClock.direction_changed,engine.crankshaftPositionEvent.rotationalClock.cast.y,engine.crankshaftPositionEvent.rotationalClock.changed.u,engine.crankshaftPositionEvent.rotationalClock.changed.y,rotationalClock.direction,rotationalClock.direction_changed,rotationalClock.rotationalClock.direction,rotationalClock.rotationalClock.direction_changed,rotationalClock.rotationalClock.cast.y,rotationalClock.rotationalClock.changed.u,rotationalClock.rotationalClock.changed.y,engine.crankshaftPositionEvent.rotationalClock.less.y,rotationalClock.rotationalClock.less.y,$whenCondition1,$whenCondition2) * Number of discrete states: 0 () * Number of clocked states: 6 (engine.crankshaftPositionEvent.rotationalClock.changed.u,engine.inductionToPowerDelay.m_a_sampled,speedControl.N_des,speedControl.N,speedControl.x_d,rotationalClock.rotationalClock.changed.u) * Top-level inputs: 0 Notification: Strong component statistics for simulation (68): * Single equations (assignments): 68 * 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 Backend phase and start with SimCode phase: time 0.0001282/0.1057, allocations: 123.3 kB / 415.4 MB, free: 13.71 MB / 318.1 MB Notification: Performance of simCode: created initialization part: time 0.0008974/0.1066, allocations: 0.5085 MB / 415.9 MB, free: 13.21 MB / 318.1 MB Notification: Performance of simCode: created event and clocks part: time 2.625e-06/0.1066, allocations: 0 / 415.9 MB, free: 13.21 MB / 318.1 MB Notification: Performance of simCode: created simulation system equations: time 0.0002825/0.1069, allocations: 161.2 kB / 416.1 MB, free: 13.05 MB / 318.1 MB Notification: Performance of simCode: created of all other equations (e.g. parameter, nominal, assert, etc): time 0.0006867/0.1076, allocations: 201.4 kB / 416.3 MB, free: 12.85 MB / 318.1 MB Notification: Performance of simCode: created linear, non-linear and system jacobian parts: time 0.001724/0.1093, allocations: 1.242 MB / 417.5 MB, free: 11.57 MB / 318.1 MB Notification: Performance of simCode: some other stuff during SimCode phase: time 0.0004083/0.1098, allocations: 0.86 MB / 418.4 MB, free: 10.69 MB / 318.1 MB Notification: Performance of simCode: alias equations: time 0.0002406/0.11, allocations: 55.39 kB / 418.4 MB, free: 10.63 MB / 318.1 MB Notification: Performance of simCode: all other stuff during SimCode phase: time 0.0001236/0.1101, allocations: 39.42 kB / 418.5 MB, free: 10.59 MB / 318.1 MB Notification: Performance of SimCode: time 2.1e-07/0.1101, allocations: 0 / 418.5 MB, free: 10.59 MB / 318.1 MB Notification: Performance of Templates: time 0.008177/0.1183, allocations: 4.303 MB / 422.8 MB, free: 6.289 MB / 318.1 MB make -j1 -f Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.makefile Environment - environmentSimulation: (rm -f Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.pipe ; mkfifo Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.pipe ; head -c 1048576 < Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.pipe >> ../files/Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.sim & ./Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl -abortSlowSimulation -alarm=480 -emit_protected -lv LOG_STATS > Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.pipe 2>&1) Environment - environmentSimulation: diffSimulationResults("Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl_res.mat","/var/lib/jenkins/ws/OpenModelicaLibraryTestingWork/OpenModelica/testsuite/ReferenceFiles/Modelica_Synchronous/Modelica_Synchronous.Examples.Systems.EngineThrottleControl.mat","../files/Modelica_Synchronous_Modelica_Synchronous.Examples.Systems.EngineThrottleControl.diff",relTol=0.003,relTolDiffMinMax=0.003,rangeDelta=0.001) Reference file matches