Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HUGE update to SVN with *a lot* of changes: DO MAKE CLEAN!
========================================================== - The DAE.ExpType is *no more* - The BackendDAE.Type is *no more* Both got replaced by DAE.Type! - The DAE.ExpVar is *no more* It got replaced by DAE.Var! Now we have *ONLY ONE* type in the compiler: DAE.Type! Just to know why I got this done: BEFORE, the model HumMod took 6m51 seconds to instantiate adrpo@ida-liu050 ~/dev/OpenModelica/doc/performance/benchmarks/tests $ time /c/OpenModelica1.8.0-r10584/bin/omc instHumMod.mos > trace.txt 2>&1 real 6m51.354s user 0m0.000s sys 0m0.015s AFTER, the model HumMod takes 47 seconds to instantiate adrpo@ida-liu050 ~/dev/OpenModelica/doc/performance/benchmarks/tests $ time ../../../../build/bin/omc instHumMod.mos > mytrace.txt 2>&1 real 0m47.248s user 0m0.000s sys 0m0.000s Is about 8,74468085106383 times faster now. Basically, before, we were doing DAE.T_* -> DAE.ET_* translation for 6 minutes! I started this work on Friday after the OpenModelica 1.8.0 got released, so for 4+ days of work I think the result is quite OK. Crash course into the new types (actually old ones from DAE.Type): ================================================================== 1. DAE.Type is not a tuple anymore, instead the optional path became DAE.TypeSource which is a list of paths and is now part of *all* the records in DAE.Type. The needed types from DAE.ExpType got merged into DAE.Type: DAE.ET_METATYPE -> DAE.T_METATYPE DAE.ET_FUNCTION_REFERENCE_VAR -> DAE.T_FUNCTION_REFERENCE_VAR DAE.ET_FUNCTION_REFERENCE_FUNC -> DAE.T_FUNCTION_REFERENCE_FUNC Some DAE.Type types got split: DAE.T_COMPLEX split into DAE.T_COMPLEX for types not extending basic types and DAE.T_SUBTYPE_BASIC is now used for types extending basic types. Some DAE.Type types changed name: DAE.T_NOTYPE -> DAE.T_UNKNOWN Renamed also the meta-types a bit to make them more homogeneous. Some DAE.ExpType are gone: DAE.ET_OTHER is gone, use DAE.T_UNKNOWN instead! Some DAE.Type types changed structure (besides the DAE.TypeSource addition): (DAE.T_ARRAY(dim, ty), optPath) -> DAE.T_ARRAY(ty, list<dim>, list<Path>) so we now have similar structure for DAE.T_ARRAY and the previous DAE.ET_ARRAY. 2. In cases, when matching: Instead of | Use now: ------------------------------------------------------- DAE.ET_INT() | DAE.T_INTEGER(source = _) DAE.ET_REAL() | DAE.T_REAL(source = _) DAE.ET_BOOL() | DAE.T_BOOL(source = _) DAE.ET_STRING() | DAE.T_STRING(source = _) DAE.ET_ENUMERATION(...) | DAE.T_ENUMERATION(...) DAE.ET_COMPLEX(...) | DAE.T_COMPLEX(...) DAE.ET_OTHER(...) | DAE.T_UNKNOWN(source = _) DAE.ET_ARRAY(...) | DAE.T_ARRAY(...) ------------------------------------------------------- 3. When constructing values, in the then part or in right hand side in equations: Instead of | Use now: ------------------------------------------------------- DAE.ET_INT() | DAE.T_INTEGER_DEFAULT DAE.ET_REAL() | DAE.T_REAL_DEFAULT DAE.ET_BOOL() | DAE.T_BOOL_DEFAULT DAE.ET_STRING() | DAE.T_STRING_DEFAULT DAE.ET_ENUMERATION(...) | DAE.T_ENUMERATION(...) DAE.ET_COMPLEX(...) | DAE.T_COMPLEX(...) DAE.ET_OTHER(...) | DAE.T_UNKNOWN(source = _) DAE.ET_ARRAY(...) | DAE.T_ARRAY(...) ------------------------------------------------------- 4. Types.elabType got renamed to Types.simplifyType and does some type simplification (instead of the previous DAE.T_* -> DAE.ET_* translation). Feel free to ask me anything if something is unclear. The code can be further improved (we need better handling of DAE.T_ARRAY that has several dimensions instead of one) by getting rid of Types.simplifyType/Types.expTypetoTypesType, but for now is good enough. Also, functionality for the old DAE.ET_* handling from Expression*.mo can be merged with the DAE.T_ handling from Types so we can get rid of duplicate code too. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk/doc@10604 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
- Loading branch information