@@ -94,7 +94,6 @@ import HpcOmTaskGraph;
9494import SerializeModelInfo ;
9595import TaskSystemDump ;
9696import SerializeInitXML ;
97- import Serializer ;
9897import SimCodeDump ;
9998import SimCodeUtil ;
10099import StackOverflow ;
@@ -276,7 +275,7 @@ algorithm
276275 ExecStat . execStat("SimCode" );
277276
278277 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
279- serializeNotify(simCode, filenamePrefix, "simCode " );
278+ serializeNotify(simCode, "SimCode " );
280279 ExecStat . execStat("Serialize simCode" );
281280 end if ;
282281
@@ -741,6 +740,7 @@ public function translateModel "
741740 output String outFileDir;
742741 output list< tuple< String , Values . Value >> resultValues;
743742protected
743+ FCore . Cache inCache = cache;
744744 Boolean generateFunctions = false ;
745745 Real timeSimCode= 0 . 0 , timeTemplates= 0 . 0 , timeBackend= 0 . 0 , timeFrontend= 0 . 0 ;
746746 type State = enumeration(frontend, backend, templates, simcode);
@@ -777,10 +777,13 @@ algorithm
777777 SOME (dae) := odae;
778778
779779 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
780- serializeNotify(dae, filenameprefix, "dae" );
781- serializeNotify(graph, filenameprefix, "graph" );
782- serializeNotify(cache, filenameprefix, "cache" );
783- serializeNotify(SymbolTable . get(), filenameprefix, "st" );
780+ serializeNotify(dae, "FrontEnd DAE" );
781+ serializeNotify(graph, "FCore.Graph" );
782+ serializeNotify((graph,inEnv), "FCore.Graph + Old graph" );
783+ serializeNotify(cache, "FCore.Cache" );
784+ serializeNotify((cache,inCache), "FCore.Cache + Old cache" );
785+ serializeNotify(SymbolTable . get(), "Symbol Table (Absyn and SCode)" );
786+ serializeNotify((SymbolTable . get(),dae,graph,inEnv,cache,inCache), "Symbol Table, DAE, Graph, OldGraph, Cache, OldCache" );
784787 ExecStat . execStat("Serialize FrontEnd" );
785788 end if ;
786789
@@ -792,7 +795,7 @@ algorithm
792795 ExecStat . execStat("Transformations before backend" );
793796
794797 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
795- serializeNotify(dae, filenameprefix, "dae2 " );
798+ serializeNotify(dae, "FrontEnd DAE after transformations " );
796799 ExecStat . execStat("Serialize DAE (2)" );
797800 end if ;
798801
@@ -809,7 +812,7 @@ algorithm
809812 GC . free(dae);
810813
811814 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
812- serializeNotify(dlow, filenameprefix, "dlow " );
815+ serializeNotify(dlow, "BackendDAECreate.lower " );
813816 ExecStat . execStat("Serialize dlow" );
814817 end if ;
815818
@@ -836,9 +839,11 @@ algorithm
836839 state := State . simcode;
837840
838841 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
839- serializeNotify(dlow, filenameprefix, "simDAE" );
840- serializeNotify(initDAE, filenameprefix, "initDAE" );
841- serializeNotify(removedInitialEquationLst, filenameprefix, "removedInitialEquationLst" );
842+ serializeNotify(dlow, "BackendDAE (simulation)" );
843+ serializeNotify(initDAE, "BackendDAE (initialization)" );
844+ serializeNotify(initDAE_lambda0, "BackendDAE (lambda0)" );
845+ serializeNotify((dlow,initDAE,initDAE_lambda0), "BackendDAE (simulation+initialization+lambda0)" );
846+ serializeNotify(removedInitialEquationLst, "removedInitialEquationLst" );
842847 ExecStat . execStat("Serialize solved system" );
843848 end if ;
844849
@@ -941,9 +946,9 @@ algorithm
941946 ExecStat . execStat("FrontEnd" );
942947
943948 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
944- serializeNotify(dae, filenameprefix, "dae" );
945- serializeNotify(graph, filenameprefix, "graph" );
946- serializeNotify(outCache, filenameprefix, "cache" );
949+ serializeNotify(dae, "dae" );
950+ serializeNotify(graph, "graph" );
951+ serializeNotify(outCache, "cache" );
947952 ExecStat . execStat("Serialize FrontEnd" );
948953 end if ;
949954
@@ -954,7 +959,7 @@ algorithm
954959 ExecStat . execStat("Transformations before backend" );
955960
956961 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
957- serializeNotify(dae, filenameprefix, "dae2" );
962+ serializeNotify(dae, "dae2" );
958963 ExecStat . execStat("Serialize DAE (2)" );
959964 end if ;
960965
@@ -971,7 +976,7 @@ algorithm
971976 GC . free(dae);
972977
973978 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
974- serializeNotify(dlow, filenameprefix, "dlow" );
979+ serializeNotify(dlow, "dlow" );
975980 ExecStat . execStat("Serialize dlow" );
976981 end if ;
977982
@@ -982,9 +987,9 @@ algorithm
982987 timeBackend := System . realtimeTock(ClockIndexes . RT_CLOCK_BACKEND );
983988
984989 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
985- serializeNotify(bdae, filenameprefix, "simDAE" );
986- serializeNotify(initDAE, filenameprefix, "initDAE" );
987- serializeNotify(removedInitialEquationLst, filenameprefix, "removedInitialEquationLst" );
990+ serializeNotify(bdae, "simDAE" );
991+ serializeNotify(initDAE, "initDAE" );
992+ serializeNotify(removedInitialEquationLst, "removedInitialEquationLst" );
988993 ExecStat . execStat("Serialize solved system" );
989994 end if ;
990995
@@ -1275,7 +1280,7 @@ algorithm
12751280 ExecStat . execStat("SimCode" );
12761281
12771282 if Flags . isSet(Flags . SERIALIZED_SIZE ) then
1278- serializeNotify(simCode, filenamePrefix, "simCode " );
1283+ serializeNotify(simCode, "SimCode " );
12791284 ExecStat . execStat("Serialize simCode" );
12801285 end if ;
12811286
@@ -1300,14 +1305,9 @@ end generateModelCodeDAE;
13001305
13011306protected function serializeNotify< T >
13021307 input T data;
1303- input String prefix;
13041308 input String name;
1305- protected
1306- Real fsize;
13071309algorithm
1308- Serializer . outputFile(data, prefix + "_" + name+ ".bin" );
1309- (,fsize,) := System . stat(prefix + "_" + name+ ".bin" );
1310- Error . addMessage(Error . SERIALIZED_SIZE , {name, StringUtil . bytesToReadableUnit(fsize)});
1310+ Error . addMessage(Error . SERIALIZED_SIZE , {name, StringUtil . bytesToReadableUnit(System . getSizeOfData(data))});
13111311end serializeNotify;
13121312
13131313annotation(__OpenModelica_Interface= "backend" );
0 commit comments