Changeset 25506


Ignore:
Timestamp:
09/01/20 13:22:48 (5 years ago)
Author:
Mathieu Morlighem
Message:

NEW: new way of Marshalling femmodel

Location:
issm/trunk-jpl/src/c
Files:
152 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.cpp

    r25471 r25506  
    7474/*}}}*/
    7575void Cfdragcoeffabsgrad::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
     76        _error_("not implemented yet!");
     77}
     78/*}}}*/
     79void Cfdragcoeffabsgrad::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
    7680        _error_("not implemented yet!");
    7781}
  • issm/trunk-jpl/src/c/classes/Cfdragcoeffabsgrad.h

    r25471 r25506  
    3535                int Id(void);
    3636                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void Marshall2(MarshallHandle* marshallhandle);
    3738                int ObjectEnum(void);
    3839               
  • issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.cpp

    r25471 r25506  
    7878}
    7979/*}}}*/
     80void Cfsurfacelogvel::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     81        _error_("not implemented yet!");
     82}
     83/*}}}*/
    8084int Cfsurfacelogvel::ObjectEnum(void){/*{{{*/
    8185        return CfsurfacelogvelEnum;
  • issm/trunk-jpl/src/c/classes/Cfsurfacelogvel.h

    r25471 r25506  
    3535                int Id(void);
    3636                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void Marshall2(MarshallHandle* marshallhandle);
    3738                int ObjectEnum(void);
    3839               
  • issm/trunk-jpl/src/c/classes/Cfsurfacesquare.cpp

    r25471 r25506  
    8383/*}}}*/
    8484void Cfsurfacesquare::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
     85        _error_("not implemented yet!");
     86}
     87/*}}}*/
     88void Cfsurfacesquare::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
    8589        _error_("not implemented yet!");
    8690}
  • issm/trunk-jpl/src/c/classes/Cfsurfacesquare.h

    r25471 r25506  
    4040                int Id(void);
    4141                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     42                void Marshall2(MarshallHandle* marshallhandle);
    4243                int ObjectEnum(void);
    4344               
  • issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp

    r23588 r25506  
    8585}
    8686/*}}}*/
     87void    SpcDynamic::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     88
     89        int object_enum = SpcDynamicEnum;
     90        marshallhandle->call(object_enum);
     91
     92        marshallhandle->call(this->id);
     93        marshallhandle->call(this->nodeid);
     94        marshallhandle->call(this->dof);
     95        marshallhandle->call(this->value);
     96        marshallhandle->call(this->analysis_type);
     97        marshallhandle->call(this->isset);
     98        marshallhandle->call(this->penalty);
     99
     100}
     101/*}}}*/
    87102int     SpcDynamic::ObjectEnum(void){/*{{{*/
    88103
  • issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.h

    r23588 r25506  
    3535                int     Id();
    3636                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void    Marshall2(MarshallHandle* marshallhandle);
    3738                int     ObjectEnum();
    3839
  • issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp

    r25468 r25506  
    8383        MARSHALLING(analysis_type);
    8484        MARSHALLING(penalty);
     85
     86}
     87/*}}}*/
     88void    SpcStatic::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     89
     90        int object_enum = SpcStaticEnum;
     91        marshallhandle->call(object_enum);
     92
     93        marshallhandle->call(this->id);
     94        marshallhandle->call(this->nodeid);
     95        marshallhandle->call(this->dof);
     96        marshallhandle->call(this->value);
     97        marshallhandle->call(this->analysis_type);
     98        marshallhandle->call(this->penalty);
    8599
    86100}
  • issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.h

    r25468 r25506  
    3333                void  Echo();
    3434                int   Id();
    35                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     35                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     36                void  Marshall2(MarshallHandle* marshallhandle);
    3637                int   ObjectEnum();
    3738                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.cpp

    r23588 r25506  
    100100}
    101101/*}}}*/
     102void    SpcTransient::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     103
     104        int object_enum = SpcTransientEnum;
     105        marshallhandle->call(object_enum);
     106
     107        marshallhandle->call(this->id);
     108        marshallhandle->call(this->nodeid);
     109        marshallhandle->call(this->dof);
     110        marshallhandle->call(this->analysis_type);
     111        marshallhandle->call(this->penalty);
     112        marshallhandle->call(this->nsteps);
     113        if(nsteps){
     114                marshallhandle->call(this->values,nsteps);
     115                marshallhandle->call(this->times,nsteps);
     116        }
     117        else{
     118                this->values=NULL;
     119                this->times=NULL;
     120        }
     121}/*}}}*/
    102122int     SpcTransient::ObjectEnum(void){/*{{{*/
    103123
  • issm/trunk-jpl/src/c/classes/Constraints/SpcTransient.h

    r23588 r25506  
    3636                int     Id();
    3737                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     38                void    Marshall2(MarshallHandle* marshallhandle);
    3839                int     ObjectEnum();
    3940                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Contour.h

    r20810 r25506  
    8383                }
    8484                /*}}}*/
     85                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     86                        _error_("not implemented yet!");
     87                }
     88                /*}}}*/
    8589                int ObjectEnum(void){/*{{{*/
    8690                        return ContourEnum;
  • issm/trunk-jpl/src/c/classes/DependentObject.h

    r22587 r25506  
    3434                int   Id();
    3535                int   ObjectEnum();
    36                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){_error_("not implemented yet!"); };
     36                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){_error_("not implemented yet!"); };
     37                void  Marshall2(MarshallHandle* marshallhandle){_error_("not implemented yet!"); };
    3738
    3839                /*DependentObject methods: */
  • issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r25497 r25506  
    22542254        MARSHALLING(element_type);
    22552255        MARSHALLING_DYNAMIC(element_type_list,int,numanalyses);
     2256}
     2257/*}}}*/
     2258void       Element::MarshallElement2(MarshallHandle* marshallhandle,int numanalyses){/*{{{*/
     2259
     2260        _assert_(this);
     2261        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     2262                this->nodes = NULL;
     2263        }
     2264
     2265        int object_enum = ElementEnum;
     2266        marshallhandle->call(object_enum);
     2267
     2268        marshallhandle->call(this->id);
     2269        marshallhandle->call(this->sid);
     2270        marshallhandle->call(this->lid);
     2271        marshallhandle->call(this->element_type);
     2272        marshallhandle->call(this->element_type_list,numanalyses);
    22562273}
    22572274/*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r25486 r25506  
    148148                void               MantlePlumeGeothermalFlux();
    149149                void               MarshallElement(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction,int numanalyses);
     150                void               MarshallElement2(MarshallHandle* marshallhandle,int numanalyses);
    150151                void               MigrateGroundingLine(IssmDouble* sheet_ungrounding);
    151152                void               MismipFloatingiceMeltingRate();
     
    291292                virtual void       JacobianDeterminantTop(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
    292293                virtual void       Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction)=0;
     294                virtual void       Marshall2(MarshallHandle* marshallhandle)=0;
    293295                virtual IssmDouble Masscon(IssmDouble* levelset)=0;
    294296                virtual IssmDouble MassFlux(IssmDouble* segment)=0;
  • issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp

    r25497 r25506  
    124124}
    125125/*}}}*/
     126void ElementHook::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     127
     128        int i;
     129        bool* hnodesi_null=NULL; /*intermediary needed*/
     130        bool  hnodes_null=true; /*this could be NULL on empty constructor*/
     131        bool  hneighbors_null=true; /*don't deal with hneighbors, unless explicitely asked to*/
     132
     133        _assert_(this);
     134
     135        /*preliminary, before marshall starts: */
     136        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
     137                if(this->hneighbors)hneighbors_null=false;
     138                if(this->hnodes){
     139                        hnodes_null=false;
     140                        hnodesi_null=xNew<bool>(numanalyses);
     141                        for(i=0;i<numanalyses;i++){
     142                                if(this->hnodes[i])hnodesi_null[i]=false;
     143                                else hnodesi_null[i]=true;
     144                        }
     145                }
     146        }
     147
     148        /*ok, marshall operations: */
     149        int object_enum = ElementHookEnum;
     150        marshallhandle->call(object_enum);
     151        marshallhandle->call(this->numanalyses);
     152        marshallhandle->call(hneighbors_null);
     153        marshallhandle->call(hnodes_null);
     154        marshallhandle->call(hnodesi_null,numanalyses);
     155
     156        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     157
     158                if (!hnodes_null)this->hnodes = new Hook*[numanalyses];
     159                else this->hnodes=NULL;
     160                this->hvertices   = new Hook();
     161                this->hmaterial   = new Hook();
     162                if(!hneighbors_null)this->hneighbors  = new Hook();
     163                else this->hneighbors=NULL;
     164
     165                /*Initialize hnodes: */
     166                if (this->hnodes){
     167                        for(int i=0;i<this->numanalyses;i++){
     168                                if(!hnodesi_null[i])this->hnodes[i]=new Hook();
     169                                else this->hnodes[i]=NULL;
     170                        }
     171                }
     172        }
     173
     174        if (this->hnodes){
     175                for (i=0;i<numanalyses;i++) if(this->hnodes[i])this->hnodes[i]->Marshall2(marshallhandle);
     176        }
     177        this->hvertices->Marshall2(marshallhandle);
     178        this->hmaterial->Marshall2(marshallhandle);
     179        if(this->hneighbors)this->hneighbors->Marshall2(marshallhandle);
     180
     181        /*Free ressources: */
     182        if(hnodesi_null) xDelete<bool>(hnodesi_null);
     183
     184}
     185/*}}}*/
    126186
    127187void ElementHook::DeepEcho(){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Elements/ElementHook.h

    r23644 r25506  
    2323                ~ElementHook();
    2424                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     25                void Marshall2(MarshallHandle* marshallhandle);
    2526               
    2627                void DeepEcho();
  • issm/trunk-jpl/src/c/classes/Elements/Elements.h

    r25379 r25506  
    2929                void   SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters);
    3030                void   ResetHooks();
    31 
    3231};
    3332
  • issm/trunk-jpl/src/c/classes/Elements/Penta.cpp

    r25488 r25506  
    158158}
    159159/*}}}*/
     160void Penta::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     161
     162        int object_enum = PentaEnum;
     163   marshallhandle->call(object_enum);
     164        marshallhandle->call(this->isonsurface);
     165        marshallhandle->call(this->isonbase);
     166
     167        /*Call parent classes: */
     168        ElementHook::Marshall2(marshallhandle);
     169        Element::MarshallElement2(marshallhandle,this->numanalyses);
     170        PentaRef::Marshall2(marshallhandle);
     171
     172        vertices = (Vertex**)this->hvertices->deliverp();
     173        material = (Material*)this->hmaterial->delivers();
     174        verticalneighbors = (Penta**)this->hneighbors->deliverp();
     175}/*}}}*/
    160176
    161177/*Other*/
  • issm/trunk-jpl/src/c/classes/Elements/Penta.h

    r25442 r25506  
    4141                Object *copy();
    4242                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     43                void    Marshall2(MarshallHandle* marshallhandle);
    4344                int     ObjectEnum();
    4445                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/PentaRef.h

    r21714 r25506  
    3030                void VerticalSegmentIndicesBase(int** pindices,int* pnumseg,int finiteelement);
    3131                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */};
     32                void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */};
    3233                int  NumberofNodes(int finiteelement);
    3334                int  PressureInterpolation(int fe_stokes);
  • issm/trunk-jpl/src/c/classes/Elements/Seg.cpp

    r25379 r25506  
    139139}
    140140/*}}}*/
     141void Seg::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     142
     143        int object_enum = SegEnum;
     144   marshallhandle->call(object_enum);
     145
     146        marshallhandle->call(this->iscollapsed);
     147        marshallhandle->call(this->isonsurface);
     148        marshallhandle->call(this->isonbase);
     149        marshallhandle->call(this->collapsed_ids[0]);
     150        marshallhandle->call(this->collapsed_ids[1]);
     151
     152        /*Call parent classes: */
     153        ElementHook::Marshall2(marshallhandle);
     154        Element::MarshallElement2(marshallhandle,this->numanalyses);
     155        SegRef::Marshall2(marshallhandle);
     156
     157        vertices = (Vertex**)this->hvertices->deliverp();
     158        material = (Material*)this->hmaterial->delivers();
     159
     160}
     161/*}}}*/
    141162
    142163IssmDouble Seg::CharacteristicLength(void){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Elements/Seg.h

    r25442 r25506  
    3939                Object *copy();
    4040                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     41                void    Marshall2(MarshallHandle* marshallhandle);
    4142                int     ObjectEnum();
    4243                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/SegRef.h

    r20810 r25506  
    2525                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussSeg* gauss,int finiteelement);
    2626                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */};
     27                void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */};
    2728                int  NumberofNodes(int finiteelement);
    2829};
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp

    r25379 r25506  
    128128        Element::MarshallElement(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses);
    129129        TetraRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     130
     131        vertices = (Vertex**)this->hvertices->deliverp();
     132        material = (Material*)this->hmaterial->delivers();
     133
     134}
     135/*}}}*/
     136void Tetra::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     137
     138        int object_enum = TetraEnum;
     139   marshallhandle->call(object_enum);
     140
     141        marshallhandle->call(this->isonsurface);
     142        marshallhandle->call(this->isonbase);
     143
     144        /*Call parent classes: */
     145        ElementHook::Marshall2(marshallhandle);
     146        Element::MarshallElement2(marshallhandle,this->numanalyses);
     147        TetraRef::Marshall2(marshallhandle);
    130148
    131149        vertices = (Vertex**)this->hvertices->deliverp();
  • issm/trunk-jpl/src/c/classes/Elements/Tetra.h

    r25442 r25506  
    3737                Object *copy();
    3838                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void    Marshall2(MarshallHandle* marshallhandle);
    3940                int     ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/TetraRef.h

    r20810 r25506  
    2626                void GetNodalFunctionsDerivativesReference(IssmDouble* dbasis,GaussTetra* gauss,int finiteelement);
    2727                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */};
     28                void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */};
    2829                int  NumberofNodes(int finiteelement);
    2930                int  PressureInterpolation(int fe_stokes);
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r25445 r25506  
    155155        Element::MarshallElement(pmarshalled_data,pmarshalled_data_size,marshall_direction,this->numanalyses);
    156156        TriaRef::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     157
     158        vertices = (Vertex**)this->hvertices->deliverp();
     159        material = (Material*)this->hmaterial->delivers();
     160
     161}
     162/*}}}*/
     163void Tria::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     164
     165        int object_enum = TriaEnum;
     166   marshallhandle->call(object_enum);
     167
     168        marshallhandle->call(this->iscollapsed);
     169        marshallhandle->call(this->isonsurface);
     170        marshallhandle->call(this->isonbase);
     171
     172        /*Call parent classes: */
     173        ElementHook::Marshall2(marshallhandle);
     174        Element::MarshallElement2(marshallhandle,this->numanalyses);
     175        TriaRef::Marshall2(marshallhandle);
    157176
    158177        vertices = (Vertex**)this->hvertices->deliverp();
  • issm/trunk-jpl/src/c/classes/Elements/Tria.h

    r25442 r25506  
    4040                Object *copy();
    4141                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     42                void    Marshall2(MarshallHandle* marshallhandle);
    4243                int     ObjectEnum();
    4344                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Elements/TriaRef.h

    r24131 r25506  
    2929                void GetSegmentNodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list_tria,Gauss* gauss, int index1,int index2,int finiteelement);
    3030                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*do nothing */};
     31                void Marshall2(MarshallHandle* marshallhandle){ /*do nothing */};
    3132                void NodeOnEdgeIndices(int* pnumindices,int** pindices,int index,int finiteelement);
    3233                int  NumberofNodes(int finiteelement);
  • issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h

    r25497 r25506  
    171171                }
    172172                /*}}}*/
     173                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     174                        _error_("not implemented yet!");
     175                }
     176                /*}}}*/
    173177
    174178                /*GenericExternalResult management: */
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r25497 r25506  
    250250
    251251        /*Initialize: */
    252         femmodel_size=0;
     252        femmodel_size=this->Size();
     253        _assert_(femmodel_size);
    253254
    254255        /*Create buffer to hold marshalled femmodel: */
    255         this->Marshall(NULL,&femmodel_size,MARSHALLING_SIZE);
    256256        femmodel_buffer=xNew<char>(femmodel_size);
     257
    257258        /*Keep track of initial position of femmodel_buffer: */
    258259        femmodel_buffer_ini=femmodel_buffer;
    259260
    260261        /*Marshall:*/
    261         this->Marshall(&femmodel_buffer,NULL,MARSHALLING_WRITE);
     262        //this->Marshall(&femmodel_buffer,NULL,MARSHALLING_WRITE);
     263   WriteCheckpointFunctor* marshallhandle = new WriteCheckpointFunctor(&femmodel_buffer);
     264   this->Marshall2(marshallhandle);
     265        delete marshallhandle;
    262266
    263267        /*Reset position of buffer: */
     
    273277        xDelete<char>(femmodel_buffer);
    274278        xDelete<char>(restartfilename);
    275 
    276279}
    277280/*}}}*/
     
    567570}
    568571/*}}}*/
     572void FemModel::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     573
     574        /*Allocate new fields if necessary*/
     575        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     576                delete this->materials;
     577                delete this->parameters;
     578                delete this->inputs;
     579                if(this->constraints_list && this->nummodels){
     580                        for(int i=0;i<this->nummodels;i++) delete this->constraints_list[i];
     581                        xDelete<Constraints*>(constraints_list);
     582                }
     583                if(this->loads_list && this->nummodels){
     584                        for(int i=0;i<this->nummodels;i++) delete this->loads_list[i];
     585                        xDelete<Loads*>(loads_list);
     586                }
     587                if(this->nodes_list && this->nummodels){
     588                        for(int i=0;i<this->nummodels;i++) delete this->nodes_list[i];
     589                        xDelete<Nodes*>(nodes_list);
     590                }
     591                delete this->results;
     592                delete this->vertices;
     593                delete this->elements;
     594                xDelete<int>(this->analysis_type_list);
     595
     596                this->materials   = new Materials();
     597                this->parameters  = new Parameters();
     598                this->inputs      = new Inputs();
     599                this->results     = new Results();
     600                this->vertices    = new Vertices();
     601                this->elements    = new Elements();
     602        }
     603
     604        int obj_enum = FemModelEnum;
     605        marshallhandle->call(obj_enum);
     606
     607        marshallhandle->call(this->solution_type);
     608        marshallhandle->call(this->analysis_counter);
     609        marshallhandle->call(this->nummodels);
     610        marshallhandle->call(this->analysis_type_list,nummodels);
     611
     612        this->materials->Marshall2(marshallhandle);
     613        this->parameters->Marshall2(marshallhandle);
     614        this->inputs->Marshall2(marshallhandle);
     615        this->results->Marshall2(marshallhandle);
     616        this->vertices->Marshall2(marshallhandle);
     617        this->elements->Marshall2(marshallhandle);
     618
     619        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     620                this->constraints_list = xNew<Constraints*>(this->nummodels);
     621                for(int i=0;i<nummodels;i++) this->constraints_list[i] = new Constraints();
     622                this->loads_list = xNew<Loads*>(this->nummodels);
     623                for(int i=0;i<nummodels;i++) this->loads_list[i] = new Loads();
     624                this->nodes_list = xNew<Nodes*>(this->nummodels);
     625                for(int i=0;i<nummodels;i++) this->nodes_list[i] = new Nodes();
     626        }
     627
     628        for(int i=0;i<nummodels;i++){
     629                this->constraints_list[i]->Marshall2(marshallhandle);
     630                this->loads_list[i]->Marshall2(marshallhandle);
     631                this->nodes_list[i]->Marshall2(marshallhandle);
     632        }
     633        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     634                /*reset hooks for elements, loads and nodes:*/
     635                this->elements->ResetHooks();
     636                this->materials->ResetHooks();
     637
     638                /*do the post-processing of the datasets to get an FemModel that can actually run analyses:*/
     639                for(int i=0;i<nummodels;i++){
     640                        this->loads_list[i]->ResetHooks();
     641                        int analysis_type=this->analysis_type_list[i];
     642                        SetCurrentConfiguration(analysis_type);
     643                        SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters);
     644                        NodesDofx(this->nodes_list[i],this->parameters);
     645                        ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes_list[i],this->vertices,this->materials,this->parameters,this->inputs);
     646                }
     647
     648                /*Reset current configuration*/
     649                SetCurrentConfiguration(this->analysis_type_list[this->analysis_counter]);
     650        }
     651}
     652/*}}}*/
    569653void FemModel::Restart(){ /*{{{*/
    570654
     
    609693
    610694        /*Create new FemModel by demarshalling the buffer: */
    611         this->Marshall(&femmodel_buffer,NULL,MARSHALLING_LOAD);
     695        //this->Marshall(&femmodel_buffer,NULL,MARSHALLING_LOAD);
     696   LoadCheckpointFunctor* marshallhandle = new LoadCheckpointFunctor(&femmodel_buffer);
     697   this->Marshall2(marshallhandle);
     698        delete marshallhandle;
    612699
    613700        /*Reset position of buffer: */
     
    677764/*}}}*/
    678765int  FemModel::Size(){ /*{{{*/
    679         int   femmodel_size;
    680 
    681         this->Marshall(NULL,&femmodel_size,MARSHALLING_SIZE);
    682 
     766
     767        SizeCheckpointFunctor* marshallhandle = new SizeCheckpointFunctor();
     768        this->Marshall2(marshallhandle);
     769        int femmodel_size = marshallhandle->MarshalledSize();
     770
     771        /*Cleanup and return*/
     772        delete marshallhandle;
    683773        return femmodel_size;
    684774}
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r25489 r25506  
    8282                void InitFromFids(char* rootpath, FILE* IOMODEL, FILE* toolkitsoptionsfid, int in_solution_type, bool trace, IssmPDouble* X=NULL);
    8383                void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction);
     84                void Marshall2(MarshallHandle* marshallhandle);
    8485                void Restart(void);
    8586                void RestartAD(int step);
  • issm/trunk-jpl/src/c/classes/Hook.cpp

    r25497 r25506  
    137137                MARSHALLING_DYNAMIC(offsets,int,num);
    138138                MARSHALLING_DYNAMIC(objects,Object*,num);
     139        }
     140
     141}
     142/*}}}*/
     143void Hook::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     144
     145        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD) reset();
     146
     147        int object_enum = HookEnum;
     148        marshallhandle->call(object_enum);
     149        marshallhandle->call(this->num);
     150        if (num<=0){
     151                /*Empty hook*/
     152                this->ids     = NULL;
     153                this->objects = NULL;
     154                this->offsets = NULL;
     155                this->num = 0;
     156        }
     157        else{
     158                marshallhandle->call(this->ids,num);
     159                marshallhandle->call(this->offsets,num);
     160                marshallhandle->call(this->objects,num);
    139161        }
    140162
  • issm/trunk-jpl/src/c/classes/Hook.h

    r20810 r25506  
    3434                void       DeepEcho(void);
    3535                void       Echo(void);
    36                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     36                void       Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void       Marshall2(MarshallHandle* marshallhandle);
    3738                /*}}}*/
    3839                /*Hook management: {{{*/
  • issm/trunk-jpl/src/c/classes/Inputs/ArrayInput.cpp

    r25379 r25506  
    9595}
    9696/*}}}*/
     97void ArrayInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     98
     99        int object_enum = ArrayInputEnum;
     100        marshallhandle->call(object_enum);
     101        marshallhandle->call(this->numberofelements_local);
     102        if(this->numberofelements_local){
     103                marshallhandle->call(this->N,this->numberofelements_local);
     104                for(int i=0;i<this->numberofelements_local;i++){
     105                        if(this->values[i]){
     106                                marshallhandle->call(this->values[i],this->N[i]);
     107                        }
     108                }
     109        }
     110        else{
     111                this->N      = NULL;
     112                this->values = NULL;
     113        }
     114
     115}
     116/*}}}*/
    97117int  ArrayInput::ObjectEnum(void){/*{{{*/
    98118        return ArrayInputEnum;
  • issm/trunk-jpl/src/c/classes/Inputs/ArrayInput.h

    r25379 r25506  
    2424                int     Id();
    2525                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     26                void    Marshall2(MarshallHandle* marshallhandle);
    2627                int     ObjectEnum();
    2728                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/BoolInput.cpp

    r25379 r25506  
    6666}
    6767/*}}}*/
     68void BoolInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     69
     70        int object_enum = BoolInputEnum;
     71   marshallhandle->call(object_enum);
     72
     73        marshallhandle->call(this->size);
     74        if(this->size > 0){
     75                marshallhandle->call(this->values,this->size);
     76        }
     77        else this->values = NULL;
     78
     79}
     80/*}}}*/
    6881int  BoolInput::ObjectEnum(void){/*{{{*/
    6982
  • issm/trunk-jpl/src/c/classes/Inputs/BoolInput.h

    r25379 r25506  
    2323                int     Id();
    2424                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     25                void    Marshall2(MarshallHandle* marshallhandle);
    2526                int     ObjectEnum();
    2627                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/ControlInput.cpp

    r25406 r25506  
    121121
    122122        MARSHALLING_ENUM(ControlInputEnum);
     123        _error_("Not implemented");
     124}
     125/*}}}*/
     126void ControlInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     127
     128        int object_enum = ControlInputEnum;
     129   marshallhandle->call(object_enum);
    123130        _error_("Not implemented");
    124131}
  • issm/trunk-jpl/src/c/classes/Inputs/ControlInput.h

    r25406 r25506  
    3737                int    Id();
    3838                void   Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void   Marshall2(MarshallHandle* marshallhandle);
    3940                int    ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp

    r25497 r25506  
    9595}
    9696/*}}}*/
     97void DatasetInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     98
     99        int object_enum = DatasetInputEnum;
     100   marshallhandle->call(object_enum);
     101
     102        marshallhandle->call(this->numids);
     103        marshallhandle->call(this->numberofelements_local);
     104        marshallhandle->call(this->numberofvertices_local);
     105        marshallhandle->call(this->ids,numids);
     106        //if (marshallhandle->OperationNumber() == MARSHALLING_LOAD) inputs = new Inputs();
     107        //inputs->Marshall2(marshallhandle);
     108        _error_("not implemented");
     109
     110}
     111/*}}}*/
    97112int  DatasetInput::ObjectEnum(void){/*{{{*/
    98113        return DatasetInputEnum;
  • issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.h

    r25379 r25506  
    3535                int     Id();
    3636                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void    Marshall2(MarshallHandle* marshallhandle);
    3738                int     ObjectEnum();
    3839                void    SetTriaInput(int interp_in,int numinds,int* rows,IssmDouble* values_in);
  • issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.cpp

    r25379 r25506  
    6666}
    6767/*}}}*/
     68void DoubleInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     69
     70        int object_enum = DoubleInputEnum;
     71   marshallhandle->call(object_enum);
     72
     73        marshallhandle->call(this->size);
     74        if(this->size > 0){
     75                marshallhandle->call(this->values,this->size);
     76        }
     77        else this->values = NULL;
     78
     79}
     80/*}}}*/
    6881int  DoubleInput::ObjectEnum(void){/*{{{*/
    6982
  • issm/trunk-jpl/src/c/classes/Inputs/DoubleInput.h

    r25379 r25506  
    2323                int     Id();
    2424                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     25                void    Marshall2(MarshallHandle* marshallhandle);
    2526                int     ObjectEnum();
    2627                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/ElementInput.h

    r25379 r25506  
    3030                virtual int     Id()=0;
    3131                virtual void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction)=0;
     32                virtual void    Marshall2(MarshallHandle* marshallhandle)=0;
    3233                virtual int     ObjectEnum()=0;
    3334                /*Other*/
  • issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp

    r25497 r25506  
    144144}
    145145/*}}}*/
     146void Inputs::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     147
     148        int num_inputs=0;
     149        int index;
     150
     151        int object_enum = ArrayInputEnum;
     152   marshallhandle->call(object_enum);
     153
     154        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
     155
     156                /*Marshall num_inputs first*/
     157                for(int i=0;i<NUMINPUTS;i++){
     158                        if(this->inputs[i]) num_inputs++;
     159                }
     160                marshallhandle->call(num_inputs);
     161
     162                /*Marshall Parameters one by one now*/
     163                for(int i=0;i<NUMINPUTS;i++){
     164                        if(this->inputs[i]){
     165                                object_enum = this->inputs[i]->ObjectEnum();
     166                                marshallhandle->call(i);
     167                                marshallhandle->call(object_enum);
     168                                this->inputs[i]->Marshall2(marshallhandle);
     169                        }
     170                }
     171        }
     172        else{
     173
     174                /*Get number of inputs marshalled*/
     175                marshallhandle->call(num_inputs);
     176
     177                /*Recover input2eters one by one*/
     178                for(int i=0;i<num_inputs;i++){
     179
     180                        /*Recover enum of object first: */
     181                        marshallhandle->call(index);
     182                        marshallhandle->call(object_enum);
     183
     184                        if(object_enum==BoolInputEnum){
     185                                BoolInput* boolinput2=new BoolInput();
     186                                boolinput2->Marshall2(marshallhandle);
     187                                this->inputs[index]=boolinput2;
     188                        }
     189                        else if(object_enum==IntInputEnum){
     190                                IntInput* intinput2=new IntInput();
     191                                intinput2->Marshall2(marshallhandle);
     192                                this->inputs[index]=intinput2;
     193                        }
     194                        else if(object_enum==TriaInputEnum){
     195                                TriaInput* triainput2=new TriaInput();
     196                                triainput2->Marshall2(marshallhandle);
     197                                this->inputs[index]=triainput2;
     198                        }
     199                        else if(object_enum==PentaInputEnum){
     200                                PentaInput* pentainput2=new PentaInput();
     201                                pentainput2->Marshall2(marshallhandle);
     202                                this->inputs[index]=pentainput2;
     203                        }
     204                        else{
     205                                _error_("input "<<EnumToStringx(object_enum)<<" not supported");
     206                        }
     207                }
     208        }
     209}
     210/*}}}*/
    146211
    147212void Inputs::AddInput(Input* newinput){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Inputs/Inputs.h

    r25406 r25506  
    6464                ControlInput*   GetControlInput(int enum_type);
    6565                void  Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction);
     66                void  Marshall2(MarshallHandle* marshallhandle);
    6667                int   GetInputObjectEnum(int enum_type);
    6768                void  GetInputValue(bool* pvalue,int enum_in,int index);
  • issm/trunk-jpl/src/c/classes/Inputs/IntInput.cpp

    r25379 r25506  
    6666}
    6767/*}}}*/
     68void IntInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     69
     70        int object_enum = IntInputEnum;
     71   marshallhandle->call(object_enum);
     72
     73        marshallhandle->call(this->size);
     74        if(this->size > 0){
     75                marshallhandle->call(this->values,this->size);
     76        }
     77        else this->values = NULL;
     78
     79}
     80/*}}}*/
    6881int  IntInput::ObjectEnum(void){/*{{{*/
    6982
  • issm/trunk-jpl/src/c/classes/Inputs/IntInput.h

    r25379 r25506  
    2323                int     Id();
    2424                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     25                void    Marshall2(MarshallHandle* marshallhandle);
    2526                int     ObjectEnum();
    2627                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp

    r25497 r25506  
    146146}
    147147/*}}}*/
     148void PentaInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     149
     150        int object_enum = PentaInputEnum;
     151        marshallhandle->call(object_enum);
     152
     153        marshallhandle->call(this->numberofelements_local);
     154        marshallhandle->call(this->numberofvertices_local);
     155        marshallhandle->call(this->interpolation);
     156        marshallhandle->call(this->M);
     157        marshallhandle->call(this->N);
     158        this->isserved = false;
     159        this->isserved_collapsed = 0;
     160        if(this->M*this->N){
     161                marshallhandle->call(this->values,this->M*this->N);
     162        }
     163        else this->values = NULL;
     164
     165        if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
     166                this->element_values = xNewZeroInit<IssmDouble>(PentaRef::NumberofNodes(this->interpolation));
     167        }
     168}
     169/*}}}*/
    148170int  PentaInput::ObjectEnum(void){/*{{{*/
    149171        return PentaInputEnum;
  • issm/trunk-jpl/src/c/classes/Inputs/PentaInput.h

    r25379 r25506  
    2222                int     Id();
    2323                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     24                void    Marshall2(MarshallHandle* marshallhandle);
    2425                int     ObjectEnum();
    2526                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/SegInput.cpp

    r25497 r25506  
    128128}
    129129/*}}}*/
     130void SegInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     131
     132        int object_enum = SegInputEnum;
     133   marshallhandle->call(object_enum);
     134
     135        marshallhandle->call(this->numberofelements_local);
     136        marshallhandle->call(this->numberofvertices_local);
     137        marshallhandle->call(this->interpolation);
     138        marshallhandle->call(this->M);
     139        marshallhandle->call(this->N);
     140        this->isserved = false;
     141        if(this->M*this->N){
     142                marshallhandle->call(this->values,this->M*this->N);
     143        }
     144        else this->values = NULL;
     145
     146        if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
     147                this->element_values = xNewZeroInit<IssmDouble>(SegRef::NumberofNodes(this->interpolation));
     148        }
     149
     150}
     151/*}}}*/
    130152int  SegInput::ObjectEnum(void){/*{{{*/
    131153        return SegInputEnum;
  • issm/trunk-jpl/src/c/classes/Inputs/SegInput.h

    r25379 r25506  
    2020                int     Id();
    2121                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     22                void    Marshall2(MarshallHandle* marshallhandle);
    2223                int     ObjectEnum();
    2324                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp

    r25497 r25506  
    130130        MARSHALLING_DYNAMIC(this->timesteps,IssmDouble,numtimesteps);
    131131        //inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     132        _error_("not implemented");
     133}
     134/*}}}*/
     135void TransientInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     136
     137        if (marshallhandle->OperationNumber() == MARSHALLING_LOAD){
     138                _error_("not implmented");
     139                //inputs = new Inputs();
     140        }
     141
     142        int object_enum = TransientInputEnum;
     143   marshallhandle->call(object_enum);
     144
     145        marshallhandle->call(this->enum_type);
     146        marshallhandle->call(this->numtimesteps);
     147        marshallhandle->call(this->timesteps,numtimesteps);
     148        //inputs->Marshall2(marshallhandle);
    132149        _error_("not implemented");
    133150}
  • issm/trunk-jpl/src/c/classes/Inputs/TransientInput.h

    r25406 r25506  
    4444                int     Id();
    4545                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     46                void    Marshall2(MarshallHandle* marshallhandle);
    4647                int     ObjectEnum();
    4748                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp

    r25497 r25506  
    133133}
    134134/*}}}*/
     135void TriaInput::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     136
     137        int object_enum = TriaInputEnum;
     138   marshallhandle->call(object_enum);
     139
     140        marshallhandle->call(this->numberofelements_local);
     141        marshallhandle->call(this->numberofvertices_local);
     142        marshallhandle->call(this->interpolation);
     143        marshallhandle->call(this->M);
     144        marshallhandle->call(this->N);
     145        this->isserved = false;
     146        this->isserved_collapsed = 0;
     147        if(this->M*this->N){
     148                marshallhandle->call(this->values,this->M*this->N);
     149        }
     150        else this->values = NULL;
     151
     152        if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
     153                this->element_values = xNewZeroInit<IssmDouble>(TriaRef::NumberofNodes(this->interpolation));
     154        }
     155
     156}
     157/*}}}*/
    135158int  TriaInput::ObjectEnum(void){/*{{{*/
    136159        return TriaInputEnum;
  • issm/trunk-jpl/src/c/classes/Inputs/TriaInput.h

    r25379 r25506  
    2323                int     Id();
    2424                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     25                void    Marshall2(MarshallHandle* marshallhandle);
    2526                int     ObjectEnum();
    2627                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Channel.cpp

    r25497 r25506  
    170170        element  =(Element*)this->helement->delivers();
    171171
     172}
     173/*}}}*/
     174void    Channel::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     175
     176        _assert_(this);
     177
     178        /*ok, marshall operations: */
     179        int object_enum;
     180        marshallhandle->call(object_enum);
     181        marshallhandle->call(this->id);
     182        marshallhandle->call(this->S);
     183
     184        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     185                this->hnodes      = new Hook();
     186                this->hvertices   = new Hook();
     187                this->helement    = new Hook();
     188        }
     189
     190        this->hnodes->Marshall2(marshallhandle);
     191        this->helement->Marshall2(marshallhandle);
     192        this->hvertices->Marshall2(marshallhandle);
     193
     194        /*corresponding fields*/
     195        nodes    =(Node**)this->hnodes->deliverp();
     196        vertices =(Vertex**)this->hvertices->deliverp();
     197        element  =(Element*)this->helement->delivers();
    172198}
    173199/*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Channel.h

    r25386 r25506  
    4949                void    Echo();
    5050                int     Id();
    51                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     51                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     52                void    Marshall2(MarshallHandle* marshallhandle);
    5253                int     ObjectEnum();
    5354                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Loads.cpp

    r24630 r25506  
    8282
    8383        DataSet::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     84}
     85/*}}}*/
     86void  Loads::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     87
     88        int object_enum = LoadsEnum;
     89        marshallhandle->call(object_enum);
     90        marshallhandle->call(this->numrifts);
     91        marshallhandle->call(this->numpenalties);
     92
     93        DataSet::Marshall2(marshallhandle);
    8494}
    8595/*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Loads.h

    r24630 r25506  
    2828                Loads* Copy();
    2929                void   Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     30                void   Marshall2(MarshallHandle* marshallhandle);
    3031
    3132                /*numerics*/
  • issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp

    r25497 r25506  
    126126        this->hvertex->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
    127127        this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     128
     129        /*corresponding fields*/
     130        node   =(Node*)this->hnode->delivers();
     131        vertex =(Vertex*)this->hvertex->delivers();
     132        element=(Element*)this->helement->delivers();
     133}
     134/*}}}*/
     135void    Moulin::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     136
     137        _assert_(this);
     138
     139        /*ok, marshall operations: */
     140        int object_enum = MoulinEnum;
     141        marshallhandle->call(object_enum);
     142        marshallhandle->call(this->id);
     143
     144        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     145                this->hnode    = new Hook();
     146                this->hvertex  = new Hook();
     147                this->helement = new Hook();
     148        }
     149
     150        this->hnode->Marshall2(marshallhandle);
     151        this->hvertex->Marshall2(marshallhandle);
     152        this->helement->Marshall2(marshallhandle);
    128153
    129154        /*corresponding fields*/
  • issm/trunk-jpl/src/c/classes/Loads/Moulin.h

    r25386 r25506  
    4949                void  Echo();
    5050                int   Id();
    51                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     51                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     52                void  Marshall2(MarshallHandle* marshallhandle);
    5253                int   ObjectEnum();
    5354                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp

    r25497 r25506  
    142142        this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
    143143        this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     144
     145        /*corresponding fields*/
     146        nodes    =(Node**)this->hnodes->deliverp();
     147        vertices =(Vertex**)this->hvertices->deliverp();
     148        element  =(Element*)this->helement->delivers();
     149
     150}
     151/*}}}*/
     152void    Neumannflux::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     153
     154        _assert_(this);
     155
     156        /*ok, marshall operations: */
     157        int object_enum=NeumannfluxEnum;
     158        marshallhandle->call(object_enum);
     159        marshallhandle->call(this->id);
     160
     161        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     162                this->hnodes      = new Hook();
     163                this->hvertices   = new Hook();
     164                this->helement    = new Hook();
     165        }
     166
     167        this->hnodes->Marshall2(marshallhandle);
     168        this->helement->Marshall2(marshallhandle);
     169        this->hvertices->Marshall2(marshallhandle);
    144170
    145171        /*corresponding fields*/
  • issm/trunk-jpl/src/c/classes/Loads/Neumannflux.h

    r25386 r25506  
    4242                void    Echo();
    4343                int     Id();
    44                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     44                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     45                void    Marshall2(MarshallHandle* marshallhandle);
    4546                int     ObjectEnum();
    4647                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp

    r25497 r25506  
    220220        this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
    221221        this->hvertices->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     222
     223        /*corresponding fields*/
     224        nodes    =(Node**)this->hnodes->deliverp();
     225        vertices =(Vertex**)this->hvertices->deliverp();
     226        element  =(Element*)this->helement->delivers();
     227
     228}
     229/*}}}*/
     230void    Numericalflux::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     231
     232        _assert_(this);
     233
     234        /*ok, marshall operations: */
     235        int object_enum = NumericalfluxEnum;
     236        marshallhandle->call(object_enum);
     237        marshallhandle->call(this->id);
     238        marshallhandle->call(this->flux_type);
     239        marshallhandle->call(this->flux_degree);
     240
     241        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     242                this->hnodes      = new Hook();
     243                this->hvertices   = new Hook();
     244                this->helement    = new Hook();
     245        }
     246
     247        this->hnodes->Marshall2(marshallhandle);
     248        this->helement->Marshall2(marshallhandle);
     249        this->hvertices->Marshall2(marshallhandle);
    222250
    223251        /*corresponding fields*/
  • issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h

    r25386 r25506  
    4444                void    Echo();
    4545                int     Id();
    46                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     46                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     47                void    Marshall2(MarshallHandle* marshallhandle);
    4748                int     ObjectEnum();
    4849                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp

    r25497 r25506  
    144144}
    145145/*}}}*/
     146void    Pengrid::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     147
     148        _assert_(this);
     149
     150        /*ok, marshall operations: */
     151        int object_enum = PengridEnum;
     152        marshallhandle->call(object_enum);
     153        marshallhandle->call(this->id);
     154
     155        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     156                this->hnode    = new Hook();
     157                this->helement = new Hook();
     158        }
     159
     160        this->hnode->Marshall2(marshallhandle);
     161        this->helement->Marshall2(marshallhandle);
     162
     163        /*corresponding fields*/
     164        node   =(Node*)this->hnode->delivers();
     165        element=(Element*)this->helement->delivers();
     166
     167        marshallhandle->call(this->active);
     168        marshallhandle->call(this->zigzag_counter);
     169}/*}}}*/
    146170int     Pengrid::ObjectEnum(void){/*{{{*/
    147171
  • issm/trunk-jpl/src/c/classes/Loads/Pengrid.h

    r25386 r25506  
    5151                void  Echo();
    5252                int   Id();
    53                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     53                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     54                void  Marshall2(MarshallHandle* marshallhandle);
    5455                int   ObjectEnum();
    5556                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp

    r25497 r25506  
    100100        nodes = (Node**)this->hnodes->deliverp();
    101101
     102}
     103/*}}}*/
     104void    Penpair::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     105
     106        _assert_(this);
     107
     108        /*ok, marshall operations: */
     109        int object_enum = PenpairEnum;
     110        marshallhandle->call(object_enum);
     111        marshallhandle->call(this->id);
     112
     113        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     114                this->hnodes = new Hook();
     115        }
     116        this->hnodes->Marshall2(marshallhandle);
     117
     118        /*corresponding fields*/
     119        nodes = (Node**)this->hnodes->deliverp();
    102120}
    103121/*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Penpair.h

    r25386 r25506  
    3030                /*}}}*/
    3131                /*Object virtual functions definitions:{{{ */
    32                 Object* copy();
     32                Object*  copy();
    3333                void     DeepEcho();
    3434                void     Echo();
    3535                int      Id();
    36                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     36                void     Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void     Marshall2(MarshallHandle* marshallhandle);
    3738                int      ObjectEnum();
    3839                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp

    r25497 r25506  
    229229}
    230230/*}}}*/
     231void    Riftfront::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     232
     233        _assert_(this);
     234
     235        /*ok, marshall operations: */
     236        int object_enum = RiftfrontEnum;
     237        marshallhandle->call(object_enum);
     238        marshallhandle->call(this->id);
     239        marshallhandle->call(this->type);
     240        marshallhandle->call(this->fill);
     241        marshallhandle->call(this->friction);
     242        marshallhandle->call(this->fractionincrement);
     243        marshallhandle->call(this->shelf);
     244
     245        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     246                this->hnodes     = new Hook();
     247                this->hvertices  = new Hook();
     248                this->helements  = new Hook();
     249        }
     250
     251        this->hnodes->Marshall2(marshallhandle);
     252        this->hvertices->Marshall2(marshallhandle);
     253        this->helements->Marshall2(marshallhandle);
     254
     255        /*corresponding fields*/
     256        nodes     =(Node**)this->hnodes->deliverp();
     257        vertices  =(Vertex**)this->hvertices->deliverp();
     258        elements  =(Element**)this->helements->deliverp();
     259
     260        marshallhandle->call(this->penalty_lock);
     261        marshallhandle->call(this->active);
     262        marshallhandle->call(this->frozen);
     263        marshallhandle->call(this->state);
     264        marshallhandle->call(this->counter);
     265        marshallhandle->call(this->prestable);
     266        marshallhandle->call(this->material_converged);
     267        marshallhandle->call(this->normal[0]);
     268        marshallhandle->call(this->normal[1]);
     269        marshallhandle->call(this->length);
     270        marshallhandle->call(this->fraction);
     271}/*}}}*/
    231272int     Riftfront::ObjectEnum(void){/*{{{*/
    232273
  • issm/trunk-jpl/src/c/classes/Loads/Riftfront.h

    r25386 r25506  
    6161                int      Id();
    6262                void            Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     63                void            Marshall2(MarshallHandle* marshallhandle);
    6364                int      ObjectEnum();
    6465                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Masscon.h

    r20810 r25506  
    7777                }
    7878                /*}}}*/
     79                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     80                        _error_("not implemented yet!");
     81                }
     82                /*}}}*/
    7983                int ObjectEnum(void){/*{{{*/
    8084                        return MassconEnum;
  • issm/trunk-jpl/src/c/classes/Massconaxpby.h

    r20810 r25506  
    8888                }
    8989                /*}}}*/
     90                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     91                        _error_("not implemented yet!");
     92                }
     93                /*}}}*/
    9094                int ObjectEnum(void){/*{{{*/
    9195                        return MassconaxpbyEnum;
  • issm/trunk-jpl/src/c/classes/Massfluxatgate.h

    r21808 r25506  
    127127                }
    128128                /*}}}*/
     129                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     130
     131                        int object_enum = MassfluxatgateEnum;
     132                        marshallhandle->call(object_enum);
     133
     134                        marshallhandle->call(this->definitionenum);
     135                        marshallhandle->call(this->name);
     136                        marshallhandle->call(this->numsegments);
     137                        marshallhandle->call(this->x1,this->numsegments);
     138                        marshallhandle->call(this->x2,this->numsegments);
     139                        marshallhandle->call(this->y1,this->numsegments);
     140                        marshallhandle->call(this->y2,this->numsegments);
     141                        marshallhandle->call(this->elements,this->numsegments);
     142                }
     143                /*}}}*/
    129144                /*Definition virtual function resolutoin: */
    130145                int DefinitionEnum(){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Materials/Matestar.cpp

    r25497 r25506  
    108108        MARSHALLING(mid);
    109109        this->helement->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
     110        this->element=(Element*)this->helement->delivers();
     111
     112}
     113/*}}}*/
     114void      Matestar::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     115
     116        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD)helement=new Hook();
     117
     118        int object_enum = MatestarEnum;
     119        marshallhandle->call(object_enum);
     120
     121        marshallhandle->call(this->mid);
     122        this->helement->Marshall2(marshallhandle);
    110123        this->element=(Element*)this->helement->delivers();
    111124
  • issm/trunk-jpl/src/c/classes/Materials/Matestar.h

    r25379 r25506  
    4141                void  Echo();
    4242                int   Id();
    43                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     43                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     44                void  Marshall2(MarshallHandle* marshallhandle);
    4445                int   ObjectEnum();
    4546                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Materials/Matice.cpp

    r25497 r25506  
    172172}
    173173/*}}}*/
     174void      Matice::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     175
     176        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD)helement=new Hook();
     177
     178        int object_enum = MaticeEnum;
     179        marshallhandle->call(object_enum);
     180
     181        marshallhandle->call(this->mid);
     182        marshallhandle->call(this->isdamaged);
     183        marshallhandle->call(this->isenhanced);
     184        this->helement->Marshall2(marshallhandle);
     185        this->element=(Element*)this->helement->delivers();
     186}/*}}}*/
    174187int       Matice::ObjectEnum(void){/*{{{*/
    175188
  • issm/trunk-jpl/src/c/classes/Materials/Matice.h

    r25379 r25506  
    4545                void  Echo();
    4646                int   Id();
    47                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     47                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     48                void  Marshall2(MarshallHandle* marshallhandle);
    4849                int   ObjectEnum();
    4950                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Materials/Matlitho.cpp

    r23524 r25506  
    175175}
    176176/*}}}*/
     177void Matlitho::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     178
     179        int object_enum = MatlithoEnum;
     180        marshallhandle->call(object_enum);
     181
     182        marshallhandle->call(this->numlayers);
     183        if(numlayers) {
     184                marshallhandle->call(this->radius,numlayers+1);
     185                marshallhandle->call(this->viscosity,numlayers);
     186                marshallhandle->call(this->lame_lambda,numlayers);
     187                marshallhandle->call(this->lame_mu,numlayers);
     188                marshallhandle->call(this->burgers_viscosity,numlayers);
     189                marshallhandle->call(this->burgers_mu,numlayers);
     190                marshallhandle->call(this->density,numlayers);
     191                marshallhandle->call(this->isburgers,numlayers);
     192                marshallhandle->call(this->issolid,numlayers);
     193        }
     194        else{
     195                radius            = NULL;
     196                viscosity         = NULL;
     197                lame_lambda       = NULL;
     198                lame_mu           = NULL;
     199                burgers_viscosity = NULL;
     200                burgers_mu        = NULL;
     201                density           = NULL;
     202                isburgers         = NULL;
     203                issolid           = NULL;
     204        }
     205
     206}
     207/*}}}*/
    177208int  Matlitho::ObjectEnum(void){/*{{{*/
    178209
  • issm/trunk-jpl/src/c/classes/Materials/Matlitho.h

    r25379 r25506  
    3737                void    Echo();
    3838                int     Id();
    39                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     40                void    Marshall2(MarshallHandle* marshallhandle);
    4041                int     ObjectEnum();
    4142                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Misfit.cpp

    r25471 r25506  
    9393}
    9494/*}}}*/
     95void Misfit::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     96        _error_("not implemented yet!");
     97}
     98/*}}}*/
    9599int Misfit::ObjectEnum(void){/*{{{*/
    96100        return MisfitEnum;
  • issm/trunk-jpl/src/c/classes/Misfit.h

    r22441 r25506  
    3939                int Id(void);
    4040                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     41                void Marshall2(MarshallHandle* marshallhandle);
    4142                int ObjectEnum(void);
    4243               
  • issm/trunk-jpl/src/c/classes/Nodalvalue.cpp

    r24379 r25506  
    6767}
    6868/*}}}*/
     69void Nodalvalue::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     70        _error_("not implemented yet!");
     71}
     72/*}}}*/
    6973int Nodalvalue::ObjectEnum(void){/*{{{*/
    7074        return NodalvalueEnum;
  • issm/trunk-jpl/src/c/classes/Nodalvalue.h

    r22441 r25506  
    2323                char*       name;
    2424                int         node;
    25                
     25
    2626                /*Nodalvalue constructors, destructors :*/
    27 Nodalvalue();
    28 Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node);
    29 ~Nodalvalue();
     27                Nodalvalue();
     28                Nodalvalue(char* in_name, int in_definitionenum, int in_model_enum, int in_node);
     29                ~Nodalvalue();
    3030
    31 /*Object virtual function resolutoin: */
    32 Object* copy();
    33 void DeepEcho(void);
    34 void Echo(void);
    35 int Id(void);
    36 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    37 int ObjectEnum(void);
     31                /*Object virtual function resolutoin: */
     32                Object* copy();
     33                void DeepEcho(void);
     34                void Echo(void);
     35                int Id(void);
     36                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     37                void Marshall2(MarshallHandle* marshallhandle);
     38                int ObjectEnum(void);
    3839
    39 /*Definition virtual function resolutoin: */
    40 int DefinitionEnum();
    41 char* Name();
    42 IssmDouble Response(FemModel* femmodel);
     40                /*Definition virtual function resolutoin: */
     41                int DefinitionEnum();
     42                char* Name();
     43                IssmDouble Response(FemModel* femmodel);
    4344};
    4445
  • issm/trunk-jpl/src/c/classes/Node.cpp

    r25481 r25506  
    6868                this->svalues        = xNew<IssmDouble>(this->gsize);
    6969                this->gdoflist       = xNew<int>(this->gsize);
    70                 this->gdoflist_local = xNew<int>(this->gsize);
     70                this->gdoflist_local = xNewZeroInit<int>(this->gsize);
    7171                this->fsize          = -1;
    7272                this->ssize          = -1;
     
    277277        MARSHALLING_DYNAMIC(fdoflist_local,int,fsize);
    278278        MARSHALLING_DYNAMIC(sdoflist_local,int,ssize);
     279} /*}}}*/
     280void Node::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     281
     282        int object_enum = NodeEnum;
     283        marshallhandle->call(object_enum);
     284
     285        marshallhandle->call(this->id);
     286        marshallhandle->call(this->sid);
     287        marshallhandle->call(this->lid);
     288        marshallhandle->call(this->pid);
     289        marshallhandle->call(this->indexingupdate);
     290        marshallhandle->call(this->analysis_enum);
     291
     292        for(int k=0;k<3;k++) for(int l=0;l<3;l++) marshallhandle->call(this->coord_system[k][l]);
     293
     294        marshallhandle->call(this->gsize);
     295        marshallhandle->call(this->fsize);
     296        marshallhandle->call(this->ssize);
     297        marshallhandle->call(this->clone);
     298        marshallhandle->call(this->active);
     299        marshallhandle->call(this->freeze);
     300        marshallhandle->call(this->f_set,gsize);
     301        marshallhandle->call(this->s_set,gsize);
     302        marshallhandle->call(this->svalues,gsize);
     303        marshallhandle->call(this->doftype,gsize);
     304        marshallhandle->call(this->gdoflist,gsize);
     305        marshallhandle->call(this->fdoflist,fsize);
     306        marshallhandle->call(this->sdoflist,ssize);
     307        marshallhandle->call(this->gdoflist_local,gsize);
     308        marshallhandle->call(this->fdoflist_local,fsize);
     309        marshallhandle->call(this->sdoflist_local,ssize);
    279310} /*}}}*/
    280311
  • issm/trunk-jpl/src/c/classes/Node.h

    r23642 r25506  
    7777                int     Id();
    7878                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     79                void    Marshall2(MarshallHandle* marshallhandle);
    7980                int     ObjectEnum();
    8081
  • issm/trunk-jpl/src/c/classes/Nodes.cpp

    r25497 r25506  
    134134                if(this->common_recv[i]) MARSHALLING_DYNAMIC(this->common_recv_ids[i],int,this->common_recv[i]);
    135135                if(this->common_send[i]) MARSHALLING_DYNAMIC(this->common_send_ids[i],int,this->common_send[i]);
     136        }
     137}
     138/*}}}*/
     139void  Nodes::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     140
     141        int object_enum = NodesEnum;
     142        marshallhandle->call(object_enum);
     143
     144        marshallhandle->call(numberofnodes);
     145        marshallhandle->call(numberofnodes_local);
     146        marshallhandle->call(numberofmasters_local);
     147
     148        /*Check that restart is compatible!*/
     149        int num_procs=IssmComm::GetSize();
     150        int test = num_procs;
     151        marshallhandle->call(test);
     152        if(test!=num_procs) _error_("number of cores is not the same as before");
     153
     154        DataSet::Marshall2(marshallhandle);
     155
     156        if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
     157                this->common_recv_ids = xNew<int*>(num_procs);
     158                this->common_send_ids = xNew<int*>(num_procs);
     159                for(int i=0;i<num_procs;i++){
     160                        this->common_recv_ids[i] = NULL;
     161                        this->common_send_ids[i] = NULL;
     162                }
     163        }
     164
     165        /*Stop here if no nodes*/
     166        if(this->Size()==0) return;
     167
     168        marshallhandle->call(this->common_recv,num_procs);
     169        marshallhandle->call(this->common_send,num_procs);
     170        for(int i=0;i<num_procs;i++){
     171                if(this->common_recv[i]) marshallhandle->call(this->common_recv_ids[i],this->common_recv[i]);
     172                if(this->common_send[i]) marshallhandle->call(this->common_send_ids[i],this->common_send[i]);
    136173        }
    137174}
  • issm/trunk-jpl/src/c/classes/Nodes.h

    r23926 r25506  
    1010class Nodes;
    1111class Materials;
     12class MarshallHandle;
    1213
    1314/*!\brief Declaration of Nodes class.
     
    3637                Nodes* Copy();
    3738                void   Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void   Marshall2(MarshallHandle* marshallhandle);
    3840
    3941                /*numerics*/
  • issm/trunk-jpl/src/c/classes/Numberedcostfunction.cpp

    r25426 r25506  
    9090}
    9191/*}}}*/
     92void Numberedcostfunction::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     93        _error_("not implemented yet!");
     94}
     95/*}}}*/
    9296int Numberedcostfunction::ObjectEnum(void){/*{{{*/
    9397        return NumberedcostfunctionEnum;
  • issm/trunk-jpl/src/c/classes/Numberedcostfunction.h

    r22441 r25506  
    1515class Numberedcostfunction: public Object, public Definition{
    1616
    17 public:
     17        public:
    1818
    19 int   definitionenum;
    20 char* name;
    21 int   number_cost_functions;
    22 int*  cost_functions_list;
     19                int   definitionenum;
     20                char* name;
     21                int   number_cost_functions;
     22                int*  cost_functions_list;
    2323
    24 /*Numberedcostfunction constructors, destructors :*/
    25 Numberedcostfunction();
    26 Numberedcostfunction(char* in_name, int in_definitionenum,int number_cost_functions_in,int* cost_functions_list_in);
    27 ~Numberedcostfunction();
     24                /*Numberedcostfunction constructors, destructors :*/
     25                Numberedcostfunction();
     26                Numberedcostfunction(char* in_name, int in_definitionenum,int number_cost_functions_in,int* cost_functions_list_in);
     27                ~Numberedcostfunction();
    2828
    29 /*Object virtual function resolutoin: */
    30 Object* copy();
    31 void            DeepEcho(void);
    32 void            Echo(void);
    33 int             Id(void);
    34 void            Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    35 int             ObjectEnum(void);
     29                /*Object virtual function resolutoin: */
     30                Object* copy();
     31                void            DeepEcho(void);
     32                void            Echo(void);
     33                int             Id(void);
     34                void            Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     35                void            Marshall2(MarshallHandle* marshallhandle);
     36                int             ObjectEnum(void);
    3637
    37 /*Definition virtual function resolutoin: */
    38 int             DefinitionEnum();
    39 char*           Name();
    40 IssmDouble Response(FemModel* femmodel);
     38                /*Definition virtual function resolutoin: */
     39                int             DefinitionEnum();
     40                char*           Name();
     41                IssmDouble Response(FemModel* femmodel);
    4142};
    4243
  • issm/trunk-jpl/src/c/classes/Options/Option.h

    r23649 r25506  
    2626                int           Id(){_error_("Not implemented yet"); };
    2727                void          Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     28                void          Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    2829                int           ObjectEnum(){return OptionEnum;};
    2930
  • issm/trunk-jpl/src/c/classes/Params/BoolParam.cpp

    r23066 r25506  
    5757}
    5858/*}}}*/
     59void BoolParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     60
     61        int object_enum = BoolParamEnum;
     62        marshallhandle->call(object_enum);
     63        marshallhandle->call(this->enum_type);
     64        marshallhandle->call(this->value);
     65
     66}/*}}}*/
    5967int BoolParam::ObjectEnum(void){/*{{{*/
    6068
  • issm/trunk-jpl/src/c/classes/Params/BoolParam.h

    r22628 r25506  
    3636                int   Id();
    3737                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     38                void Marshall2(MarshallHandle* marshallhandle);
    3839                int   ObjectEnum();
    3940                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/DataSetParam.cpp

    r25497 r25506  
    6262}
    6363/*}}}*/
     64void DataSetParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     65
     66        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD)value=new DataSet();
     67
     68        int object_enum=DataSetParamEnum;
     69        marshallhandle->call(object_enum);
     70        marshallhandle->call(this->enum_type);
     71        value->Marshall2(marshallhandle);
     72
     73}
     74/*}}}*/
    6475int DataSetParam::ObjectEnum(void){/*{{{*/
    6576
  • issm/trunk-jpl/src/c/classes/Params/DataSetParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void Marshall2(MarshallHandle* marshallhandle);
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp

    r25497 r25506  
    138138}
    139139/*}}}*/
     140void DoubleMatArrayParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     141
     142        int object_enum = DoubleMatArrayParamEnum;
     143        marshallhandle->call(object_enum);
     144
     145        marshallhandle->call(this->enum_type);
     146        marshallhandle->call(this->M);
     147        if(M){
     148                marshallhandle->call(this->mdim_array,M);
     149                marshallhandle->call(this->ndim_array,M);
     150                if(marshallhandle->OperationNumber()==MARSHALLING_LOAD && M) array=xNew<IssmDouble*>(M);
     151                for(int i=0;i<M;i++){
     152                        marshallhandle->call(this->array[i],mdim_array[i]*ndim_array[i]);
     153                }
     154        }
     155        else{
     156                array=NULL;
     157                mdim_array=NULL;
     158                ndim_array=NULL;
     159        }
     160}
     161/*}}}*/
    140162int DoubleMatArrayParam::ObjectEnum(void){/*{{{*/
    141163
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h

    r22628 r25506  
    3939                int   Id();
    4040                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     41                void Marshall2(MarshallHandle* marshallhandle);
    4142                int   ObjectEnum();
    4243                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.cpp

    r23066 r25506  
    8383}
    8484/*}}}*/
     85void DoubleMatParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     86
     87        int object_enum = DoubleMatParamEnum;
     88   marshallhandle->call(object_enum);
     89
     90        marshallhandle->call(this->enum_type);
     91        marshallhandle->call(this->M);
     92        marshallhandle->call(this->N);
     93        marshallhandle->call(this->value,M*N);
     94}
     95/*}}}*/
    8596
    8697/*DoubleMatParam virtual functions definitions: */
  • issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.h

    r22628 r25506  
    3939                Param* copy();
    4040                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     41                void Marshall2(MarshallHandle* marshallhandle);
    4142                /*}}}*/
    4243                /*Param vritual function definitions: {{{*/
  • issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp

    r20827 r25506  
    5555}
    5656/*}}}*/
     57void DoubleParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     58
     59        int object_enum = DoubleParamEnum;
     60   marshallhandle->call(object_enum);
     61        marshallhandle->call(this->enum_type);
     62        marshallhandle->call(this->value);
     63
     64}
     65/*}}}*/
    5766int  DoubleParam::ObjectEnum(void){/*{{{*/
    5867
  • issm/trunk-jpl/src/c/classes/Params/DoubleParam.h

    r22643 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void Marshall2(MarshallHandle* marshallhandle);
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.cpp

    r23066 r25506  
    6969}
    7070/*}}}*/
     71void DoubleVecParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     72
     73        int object_enum = DoubleVecParamEnum;
     74   marshallhandle->call(object_enum);
     75
     76        marshallhandle->call(this->enum_type);
     77        marshallhandle->call(this->M);
     78        marshallhandle->call(this->values,this->M);
     79
     80}
     81/*}}}*/
    7182int DoubleVecParam::ObjectEnum(void){/*{{{*/
    7283
  • issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void Marshall2(MarshallHandle* marshallhandle);
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/FileParam.cpp

    r25497 r25506  
    5959}
    6060/*}}}*/
     61void FileParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     62
     63        int object_enum = FileParamEnum;
     64   marshallhandle->call(object_enum);
     65
     66        marshallhandle->call(this->enum_type);
     67        marshallhandle->call(this->value);
     68
     69        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     70                this->value=NULL; //meaningless file pointer!
     71        }
     72
     73}
     74/*}}}*/
    6175int  FileParam::ObjectEnum(void){/*{{{*/
    6276
  • issm/trunk-jpl/src/c/classes/Params/FileParam.h

    r22628 r25506  
    3636                int   Id();
    3737                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     38                void Marshall2(MarshallHandle* marshallhandle);
    3839                int   ObjectEnum();
    3940                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/GenericParam.h

    r22628 r25506  
    5656                                                 /*Nothing for now*/
    5757                                         }
     58                                         void Marshall2(MarshallHandle* marshallhandle){
     59                                                 _printf_("   WARNING: parameter "<<EnumToStringx(this->myEnumVal)<<" is a GenericParam and cannot be marshalled\n");
     60                                                 /*Nothing for now*/
     61                                         }
    5862                int   ObjectEnum() {return GenericParamEnum;};
    5963
  • issm/trunk-jpl/src/c/classes/Params/IntMatParam.cpp

    r20827 r25506  
    7777}
    7878/*}}}*/
     79void IntMatParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     80
     81        int object_enum = IntMatParamEnum;
     82   marshallhandle->call(object_enum);
     83
     84        marshallhandle->call(this->enum_type);
     85        marshallhandle->call(this->M);
     86        marshallhandle->call(this->N);
     87        marshallhandle->call(this->value,M*N);
     88}
     89/*}}}*/
    7990int  IntMatParam::ObjectEnum(void){/*{{{*/
    8091
  • issm/trunk-jpl/src/c/classes/Params/IntMatParam.h

    r22628 r25506  
    3838                int   Id();
    3939                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     40                void Marshall2(MarshallHandle* marshallhandle);
    4041                int   ObjectEnum();
    4142                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/IntParam.cpp

    r23066 r25506  
    5858}
    5959/*}}}*/
     60void IntParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     61
     62        int object_enum = IntParamEnum;
     63   marshallhandle->call(object_enum);
     64
     65        marshallhandle->call(this->enum_type);
     66        marshallhandle->call(this->value);
     67}/*}}}*/
    6068int  IntParam::ObjectEnum(void){/*{{{*/
    6169
  • issm/trunk-jpl/src/c/classes/Params/IntParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void Marshall2(MarshallHandle* marshallhandle);
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/IntVecParam.cpp

    r22557 r25506  
    8383}
    8484/*}}}*/
     85void IntVecParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     86
     87        int object_enum = IntVecParamEnum;
     88   marshallhandle->call(object_enum);
     89
     90        marshallhandle->call(this->enum_type);
     91        marshallhandle->call(this->M);
     92        if(M){
     93                marshallhandle->call(this->values,M);
     94        }
     95        else{
     96                this->values=NULL;
     97        }
     98
     99}
     100/*}}}*/
    85101int  IntVecParam::ObjectEnum(void){/*{{{*/
    86102
  • issm/trunk-jpl/src/c/classes/Params/IntVecParam.h

    r22628 r25506  
    3838                int   Id();
    3939                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     40                void Marshall2(MarshallHandle* marshallhandle);
    4041                int   ObjectEnum();
    4142                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/MatrixParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     39                void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/Param.h

    r22628 r25506  
    4545                virtual void  GetParameterValue(DataSet** pdataset)=0;
    4646                virtual int   InstanceEnum()=0;
    47                 virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0;
     47                virtual void  Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0;
     48                virtual void  Marshall2(MarshallHandle* marshallhandle)=0;
    4849                virtual int   ObjectEnum()=0;
    4950
  • issm/trunk-jpl/src/c/classes/Params/Parameters.cpp

    r25497 r25506  
    239239}
    240240/*}}}*/
     241void Parameters::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     242
     243        int num_params=0;
     244        int obj_enum= ParametersEnum;
     245        marshallhandle->call(obj_enum);
     246
     247        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
     248
     249                /*Marshall num_params first*/
     250                for(int i=0;i<NUMPARAMS;i++){
     251                        if(this->params[i]) num_params++;
     252                }
     253                marshallhandle->call(num_params);
     254
     255                /*Marshall Parameters one by one now*/
     256                for(int i=0;i<NUMPARAMS;i++){
     257                        if(this->params[i]){
     258                                obj_enum = this->params[i]->ObjectEnum();
     259                                marshallhandle->call(obj_enum);
     260                                this->params[i]->Marshall2(marshallhandle);
     261                        }
     262                }
     263
     264        }
     265        else{
     266
     267                /*Get number of params marshalled*/
     268                marshallhandle->call(num_params);
     269
     270                /*Recover parameters one by one*/
     271                for(int i=0;i<num_params;i++){
     272
     273                        /*Recover enum of object first: */
     274                        marshallhandle->call(obj_enum);
     275
     276                        if(obj_enum==DoubleParamEnum){
     277                                DoubleParam* doubleparam=NULL;
     278                                doubleparam=new DoubleParam();
     279                                doubleparam->Marshall2(marshallhandle);
     280                                this->AddObject(doubleparam);
     281                        }
     282                        else if(obj_enum==IntParamEnum){
     283                                IntParam* intparam=NULL;
     284                                intparam=new IntParam();
     285                                intparam->Marshall2(marshallhandle);
     286                                this->AddObject(intparam);
     287                        }
     288                        else if(obj_enum==IntMatParamEnum){
     289                                IntMatParam* intmparam=NULL;
     290                                intmparam=new IntMatParam();
     291                                intmparam->Marshall2(marshallhandle);
     292                                this->AddObject(intmparam);
     293                        }
     294                        else if(obj_enum==IntVecParamEnum){
     295                                IntVecParam* intvparam=NULL;
     296                                intvparam=new IntVecParam();
     297                                intvparam->Marshall2(marshallhandle);
     298                                this->AddObject(intvparam);
     299                        }
     300                        else if(obj_enum==BoolParamEnum){
     301                                BoolParam* boolparam=NULL;
     302                                boolparam=new BoolParam();
     303                                boolparam->Marshall2(marshallhandle);
     304                                this->AddObject(boolparam);
     305                        }
     306                        else if(obj_enum==DataSetParamEnum){
     307                                DataSetParam* dsparam=NULL;
     308                                dsparam=new DataSetParam();
     309                                dsparam->Marshall2(marshallhandle);
     310                                this->AddObject(dsparam);
     311                        }
     312                        else if(obj_enum==DoubleMatArrayParamEnum){
     313                                DoubleMatArrayParam* dmaparam=NULL;
     314                                dmaparam=new DoubleMatArrayParam();
     315                                dmaparam->Marshall2(marshallhandle);
     316                                this->AddObject(dmaparam);
     317                        }
     318                        else if(obj_enum==DoubleMatParamEnum){
     319                                DoubleMatParam* dmparam=NULL;
     320                                dmparam=new DoubleMatParam();
     321                                dmparam->Marshall2(marshallhandle);
     322                                this->AddObject(dmparam);
     323                        }
     324                        else if(obj_enum==DoubleVecParamEnum){
     325                                DoubleVecParam* dvparam=NULL;
     326                                dvparam=new DoubleVecParam();
     327                                dvparam->Marshall2(marshallhandle);
     328                                this->AddObject(dvparam);
     329                        }
     330                        else if(obj_enum==FileParamEnum){
     331                                FileParam* fileparam=NULL;
     332                                fileparam=new FileParam();
     333                                fileparam->Marshall2(marshallhandle);
     334                                delete fileparam;
     335                                /* FIXME: No need to add this object, the pointer is not valid
     336                                        The FemModel should reset all FileParams in the restart function */
     337                        }
     338                        else if(obj_enum==StringParamEnum){
     339                                StringParam* sparam=NULL;
     340                                sparam=new StringParam();
     341                                sparam->Marshall2(marshallhandle);
     342                                this->AddObject(sparam);
     343                        }
     344                        else if(obj_enum==StringArrayParamEnum){
     345                                StringArrayParam* saparam=NULL;
     346                                saparam=new StringArrayParam();
     347                                saparam->Marshall2(marshallhandle);
     348                                this->AddObject(saparam);
     349                        }
     350                        else if(obj_enum==TransientParamEnum){
     351                                TransientParam* transparam=NULL;
     352                                transparam=new TransientParam();
     353                                transparam->Marshall2(marshallhandle);
     354                                this->AddObject(transparam);
     355                        }
     356                        else if(obj_enum==TransientArrayParamEnum){
     357                                TransientArrayParam* transarrayparam=NULL;
     358                                transarrayparam=new TransientArrayParam();
     359                                transarrayparam->Marshall2(marshallhandle);
     360                                this->AddObject(transarrayparam);
     361                        }
     362                        else if(obj_enum==GenericParamEnum){
     363                                /*Skip for now (we don't want to Marhsall Comms)*/
     364                        }
     365                }
     366        }
     367}
     368/*}}}*/
    241369
    242370/*Object management*/
  • issm/trunk-jpl/src/c/classes/Params/Parameters.h

    r24152 r25506  
    3636                bool  Exist(int enum_type);
    3737                void  Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction);
     38                void  Marshall2(MarshallHandle* marshallhandle);
    3839
    3940                void  FindParam(bool* pinteger,int enum_type);
  • issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp

    r25497 r25506  
    9999}
    100100/*}}}*/
     101void StringArrayParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     102
     103        int* sizes=NULL;
     104
     105        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
     106                if(this->numstrings)sizes=xNew<int>(this->numstrings);
     107                for(int i=0;i<numstrings;i++)sizes[i]=strlen(this->value[i])+1;
     108        }       
     109
     110        int object_enum = StringArrayParamEnum;
     111   marshallhandle->call(object_enum);
     112
     113        marshallhandle->call(this->enum_type);
     114        marshallhandle->call(this->numstrings);
     115
     116        if(this->numstrings){
     117                marshallhandle->call(sizes,this->numstrings);
     118                if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     119                        this->value=xNew<char*>(this->numstrings);
     120                }
     121                for(int i=0;i<numstrings;i++){
     122                        marshallhandle->call(this->value[i],sizes[i]);
     123                }
     124        }
     125        else{
     126                value=NULL;
     127        }
     128
     129        //cleanup sizes array
     130        if(sizes) xDelete<int>(sizes);
     131
     132}
     133/*}}}*/
    101134int StringArrayParam::ObjectEnum(void){/*{{{*/
    102135
  • issm/trunk-jpl/src/c/classes/Params/StringArrayParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void Marshall2(MarshallHandle* marshallhandle);
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/StringParam.cpp

    r25497 r25506  
    6363}
    6464/*}}}*/
     65void StringParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     66
     67        int size = 0;
     68        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber() == MARSHALLING_SIZE){
     69                size=strlen(value)+1;
     70        }
     71
     72        int object_enum = StringParamEnum;
     73   marshallhandle->call(object_enum);
     74
     75        marshallhandle->call(this->enum_type);
     76        marshallhandle->call(size);
     77        marshallhandle->call(this->value,size);
     78}
     79/*}}}*/
    6580int StringParam::ObjectEnum(void){/*{{{*/
    6681
  • issm/trunk-jpl/src/c/classes/Params/StringParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     39                void Marshall2(MarshallHandle* marshallhandle);
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp

    r25497 r25506  
    8989
    9090}/*}}}*/
     91void TransientArrayParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     92
     93        int object_enum = TransientArrayParamEnum;
     94   marshallhandle->call(object_enum);
     95
     96        marshallhandle->call(this->enum_type);
     97        marshallhandle->call(this->interpolation);
     98        marshallhandle->call(this->M);
     99        marshallhandle->call(this->N);
     100        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     101                values    = xNew<IssmDouble>(M*N);
     102                timesteps = xNew<IssmDouble>(N);
     103        }
     104        marshallhandle->call(this->values,M*N);
     105        marshallhandle->call(this->timesteps,N);
     106
     107}/*}}}*/
    91108int  TransientArrayParam::ObjectEnum(void){/*{{{*/
    92109
  • issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.h

    r22628 r25506  
    4040                int   Id();
    4141                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     42                void Marshall2(MarshallHandle* marshallhandle);
    4243                int   ObjectEnum();
    4344                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp

    r25497 r25506  
    8484}
    8585/*}}}*/
     86void TransientParam::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     87
     88        int object_enum = TransientParamEnum;
     89   marshallhandle->call(object_enum);
     90
     91        marshallhandle->call(this->enum_type);
     92        marshallhandle->call(this->interpolation);
     93        marshallhandle->call(this->N);
     94        if(marshallhandle->OperationNumber()==MARSHALLING_LOAD){
     95                values=xNew<IssmDouble>(N);
     96                timesteps=xNew<IssmDouble>(N);
     97        }
     98        marshallhandle->call(this->values,N);
     99        marshallhandle->call(this->timesteps,N);
     100
     101}
     102/*}}}*/
    86103int  TransientParam::ObjectEnum(void){/*{{{*/
    87104
  • issm/trunk-jpl/src/c/classes/Params/TransientParam.h

    r22628 r25506  
    3939                int   Id();
    4040                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     41                void Marshall2(MarshallHandle* marshallhandle);
    4142                int   ObjectEnum();
    4243                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/VectorParam.cpp

    r20827 r25506  
    5858}
    5959/*}}}*/
    60 int    VectorParam::Id(void){ return -1; }/*{{{*/
     60int  VectorParam::Id(void){ return -1; }/*{{{*/
    6161/*}}}*/
    6262int VectorParam::ObjectEnum(void){/*{{{*/
  • issm/trunk-jpl/src/c/classes/Params/VectorParam.h

    r22628 r25506  
    3737                int   Id();
    3838                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     39                void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    3940                int   ObjectEnum();
    4041                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Profiler.cpp

    r23221 r25506  
    8080
    8181} /*}}}*/
     82void Profiler::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     83
     84        IssmPDouble* pointer = NULL;
     85        bool*       bpointer = NULL;
     86
     87        int object_enum = ProfilerEnum;
     88        marshallhandle->call(object_enum);
     89        pointer = &this->time[0];
     90        marshallhandle->call(pointer,MAXPROFSIZE);
     91        pointer = &this->flops[0];
     92        marshallhandle->call(pointer,MAXPROFSIZE);
     93        pointer = &this->memory[0];
     94        marshallhandle->call(pointer,MAXPROFSIZE);
     95        bpointer = &this->running[0];
     96        marshallhandle->call(bpointer,MAXPROFSIZE);
     97
     98} /*}}}*/
    8299int  Profiler::ObjectEnum(void){/*{{{*/
    83100        return ProfilerEnum;
  • issm/trunk-jpl/src/c/classes/Profiler.h

    r23473 r25506  
    5353                int     Id();
    5454                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     55                void    Marshall2(MarshallHandle* marshallhandle);
    5556                int     ObjectEnum();
    5657
  • issm/trunk-jpl/src/c/classes/Radar.cpp

    r25379 r25506  
    5959/*}}}*/
    6060void Radar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
     61        _error_("not implemented yet!");
     62}
     63/*}}}*/
     64void Radar::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
    6165        _error_("not implemented yet!");
    6266}
  • issm/trunk-jpl/src/c/classes/Radar.h

    r24211 r25506  
    2828                void DeepEcho(void);
    2929                void Echo(void);
    30                 int Id(void);
     30                int  Id(void);
    3131                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     32                void Marshall2(MarshallHandle* marshallhandle);
    3233                int ObjectEnum(void);
    3334               
  • issm/trunk-jpl/src/c/classes/Regionaloutput.cpp

    r23066 r25506  
    6464/*}}}*/
    6565void Regionaloutput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){/*{{{*/
     66        _error_("not implemented yet!");
     67}
     68/*}}}*/
     69void Regionaloutput::Marshall2(MarshallHandle* marshallhandle){/*{{{*/
    6670        _error_("not implemented yet!");
    6771}
  • issm/trunk-jpl/src/c/classes/Regionaloutput.h

    r22441 r25506  
    2222        IssmDouble* mask;
    2323        int         M;
    24        
    25 /*Regionalicevolume: constructors, destructors :*/
    26 Regionaloutput();
    27 Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min);
    28 ~Regionaloutput();
    2924
    30 /*Object virtual function resolutoin: */
    31 Object* copy();
    32 void DeepEcho(void);
    33 void Echo(void);
    34 int Id(void);
    35 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
    36 int ObjectEnum(void);
     25        /*Regionalicevolume: constructors, destructors :*/
     26        Regionaloutput();
     27        Regionaloutput(char* in_name, int in_definitionenum, char* in_outputname, IssmDouble* maskin, int Min);
     28        ~Regionaloutput();
    3729
    38 /*Definition virtual function resolutoin: */
    39 int DefinitionEnum();
    40 char* Name();
    41 IssmDouble Response(FemModel* femmodel);
     30        /*Object virtual function resolutoin: */
     31        Object* copy();
     32        void DeepEcho(void);
     33        void Echo(void);
     34        int Id(void);
     35        void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     36        void Marshall2(MarshallHandle* marshallhandle);
     37        int ObjectEnum(void);
     38
     39        /*Definition virtual function resolutoin: */
     40        int DefinitionEnum();
     41        char* Name();
     42        IssmDouble Response(FemModel* femmodel);
    4243};
    4344#endif  /* _REGIONALOUTPUT_H_ */
  • issm/trunk-jpl/src/c/classes/Segment.h

    r20810 r25506  
    6969                }
    7070                /*}}}*/
     71                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     72                        _error_("not implemented yet!");
     73                }
     74                /*}}}*/
    7175                int ObjectEnum(void){/*{{{*/
    7276
  • issm/trunk-jpl/src/c/classes/Vertex.cpp

    r23640 r25506  
    128128        MARSHALLING(sigma);
    129129        MARSHALLING(connectivity);
     130
     131}
     132/*}}}*/
     133void Vertex::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     134
     135        int object_enum = VertexEnum;
     136        marshallhandle->call(object_enum);
     137
     138        marshallhandle->call(this->clone);
     139        marshallhandle->call(this->domaintype);
     140        marshallhandle->call(this->id);
     141        marshallhandle->call(this->sid);
     142        marshallhandle->call(this->pid);
     143        marshallhandle->call(this->lid);
     144        marshallhandle->call(this->x);
     145        marshallhandle->call(this->y);
     146        marshallhandle->call(this->z);
     147        marshallhandle->call(this->sigma);
     148        marshallhandle->call(this->connectivity);
    130149
    131150}
  • issm/trunk-jpl/src/c/classes/Vertex.h

    r23640 r25506  
    4747                Object* copy();
    4848                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     49                void Marshall2(MarshallHandle* marshallhandle);
    4950
    5051                /*}}}*/
  • issm/trunk-jpl/src/c/classes/Vertices.cpp

    r25497 r25506  
    133133}
    134134/*}}}*/
     135void Vertices::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     136
     137        int object_enum = VerticesEnum;
     138        marshallhandle->call(object_enum);
     139
     140        /*Check compatibility*/
     141        int num_procs=IssmComm::GetSize();
     142        int test = num_procs;
     143        marshallhandle->call(test);
     144        if(test!=num_procs) _error_("number of cores is not the same as before");
     145
     146        marshallhandle->call(this->numberofvertices);
     147        marshallhandle->call(this->numberofvertices_local);
     148        marshallhandle->call(this->numberofmasters_local);
     149
     150        marshallhandle->call(this->common_recv,num_procs);
     151        marshallhandle->call(this->common_send,num_procs);
     152        if(marshallhandle->OperationNumber() == MARSHALLING_LOAD){
     153                this->common_recv_ids = xNew<int*>(num_procs);
     154                this->common_send_ids = xNew<int*>(num_procs);
     155        }
     156        for(int i=0;i<num_procs;i++){
     157                marshallhandle->call(this->common_recv_ids[i],this->common_recv[i]);
     158                marshallhandle->call(this->common_send_ids[i],this->common_send[i]);
     159        }
     160        DataSet::Marshall2(marshallhandle);
     161}
     162/*}}}*/
    135163void Vertices::LatLonList(IssmDouble** plat,IssmDouble** plon){/*{{{*/
    136164
  • issm/trunk-jpl/src/c/classes/Vertices.h

    r24335 r25506  
    3232                Vertices* Copy();
    3333                void      Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
     34                void      Marshall2(MarshallHandle* marshallhandle);
    3435
    3536                /*numerics:*/
  • issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h

    r20827 r25506  
    2727                int   Id(){_error_("Not implemented yet");};
    2828                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     29                void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    2930                int   ObjectEnum(){_error_("Not implemented yet");};
    3031
  • issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.h

    r20827 r25506  
    2828                int   Id(){_error_("Not implemented yet");};
    2929                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     30                void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    3031                int   ObjectEnum(){_error_("Not implemented yet");};
    3132
  • issm/trunk-jpl/src/c/classes/kriging/Observation.h

    r20827 r25506  
    3131                int     Id()        {_error_("Not implemented yet"); };
    3232                void    print() const;
    33                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
     33                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
     34                void    Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!");};
    3435                int     ObjectEnum(){_error_("Not implemented yet"); };
    3536
  • issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.h

    r20827 r25506  
    2727                int   Id(){_error_("Not implemented yet");};
    2828                void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     29                void Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    2930                int   ObjectEnum(){_error_("Not implemented yet");};
    3031
  • issm/trunk-jpl/src/c/classes/kriging/Quadtree.h

    r20827 r25506  
    3030                                void    Echo();
    3131                                int     Id()        {_error_("not implemented yet"); };
    32                                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
     32                                void    Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!");};
     33                                void    Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!");};
    3334                                int     ObjectEnum(){_error_("not implemented yet"); };
    3435
  • issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.h

    r20827 r25506  
    2626                void  Echo();
    2727                int   Id(){_error_("Not implemented yet");};
    28                 void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     28                void  Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ _error_("not implemented yet!"); };
     29                void  Marshall2(MarshallHandle* marshallhandle){ _error_("not implemented yet!"); };
    2930                int   ObjectEnum(){_error_("Not implemented yet");};
    3031
  • issm/trunk-jpl/src/c/datastructures/DataSet.cpp

    r25497 r25506  
    242242                                GenericExternalResult<double>* result=new GenericExternalResult<double>();
    243243                                result->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
    244                                 result->Echo();
     244                                this->AddObject(result);
     245                        }
     246                        else _error_("could not recognize enum type: " << obj_enum << ": " << EnumToStringx(obj_enum) );
     247                }
     248        }
     249}
     250/*}}}*/
     251void  DataSet::Marshall2(MarshallHandle* marshallhandle){ /*{{{*/
     252
     253        vector<Object*>::iterator obj;
     254        int obj_size=0;
     255        int obj_enum=0;
     256        int i;
     257
     258        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
     259                obj_size=objects.size();
     260        }
     261        else{
     262                clear();
     263        }
     264
     265        int object_enum = DataSetEnum;
     266        marshallhandle->call(object_enum);
     267
     268        marshallhandle->call(this->enum_type);
     269        marshallhandle->call(this->sorted);
     270        marshallhandle->call(this->presorted);
     271        marshallhandle->call(this->numsorted);
     272
     273        /*Now branch according to direction of marshalling: */
     274        if(marshallhandle->OperationNumber()==MARSHALLING_WRITE || marshallhandle->OperationNumber()==MARSHALLING_SIZE){
     275                if(!(this->sorted && numsorted>0 && this->id_offsets)){
     276                        this->sorted_ids=NULL;
     277                        this->id_offsets=NULL;
     278                }
     279                marshallhandle->call(this->sorted_ids,numsorted);
     280                marshallhandle->call(this->id_offsets,numsorted);
     281                marshallhandle->call(obj_size);
     282
     283                /*Go through our objects, and marshall them into the buffer: */
     284                for( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){
     285                        obj_enum=(*obj)->ObjectEnum();
     286                        marshallhandle->call(obj_enum);
     287                        (*obj)->Marshall2(marshallhandle);
     288                }
     289        }
     290        else{
     291
     292                marshallhandle->call(this->sorted_ids,numsorted);
     293                marshallhandle->call(this->id_offsets,numsorted);
     294                if (!(this->sorted && numsorted>0)){
     295                        sorted_ids=NULL;
     296                        id_offsets=NULL;
     297                }
     298                marshallhandle->call(obj_size);
     299
     300                /*This is the heart of the demashalling method. We have a buffer coming
     301                  in, and we are supposed to create a dataset out of it. No such thing
     302                  as class orientation for buffers, we need to key off the enum of each
     303                  object stored in the buffer. */
     304                for(i=0;i<obj_size;i++){
     305
     306                        /*Recover enum of object first: */
     307                        marshallhandle->call(obj_enum);
     308
     309                        /*Giant case statement to spin-up the right object, and demarshall into it the information
     310                         *stored in the buffer: */
     311                        if(obj_enum==NodeEnum){
     312                                Node* node=NULL;
     313                                node=new Node();
     314                                node->Marshall2(marshallhandle);
     315                                this->AddObject(node);
     316                        }
     317                        else if(obj_enum==VertexEnum){
     318                                Vertex* vertex=NULL;
     319                                vertex=new Vertex();
     320                                vertex->Marshall2(marshallhandle);
     321                                this->AddObject(vertex);
     322                        }
     323                        else if(obj_enum==MaticeEnum){
     324                                Matice* matice=NULL;
     325                                matice=new Matice();
     326                                matice->Marshall2(marshallhandle);
     327                                this->AddObject(matice);
     328                        }
     329                        else if(obj_enum==MatestarEnum){
     330                                Matestar* matestar=NULL;
     331                                matestar=new Matestar();
     332                                matestar->Marshall2(marshallhandle);
     333                                this->AddObject(matestar);
     334                        }
     335                        else if(obj_enum==SpcStaticEnum){
     336                                SpcStatic* spcstatic=NULL;
     337                                spcstatic=new SpcStatic();
     338                                spcstatic->Marshall2(marshallhandle);
     339                                this->AddObject(spcstatic);
     340                        }
     341                        else if(obj_enum==SpcDynamicEnum){
     342                                SpcDynamic* spcdynamic=NULL;
     343                                spcdynamic=new SpcDynamic();
     344                                spcdynamic->Marshall2(marshallhandle);
     345                                this->AddObject(spcdynamic);
     346                        }
     347                        else if(obj_enum==SpcTransientEnum){
     348                                SpcTransient* spctransient=NULL;
     349                                spctransient=new SpcTransient();
     350                                spctransient->Marshall2(marshallhandle);
     351                                this->AddObject(spctransient);
     352                        }
     353                        else if(obj_enum==TriaEnum){
     354                                Tria* tria=NULL;
     355                                tria=new Tria();
     356                                tria->Marshall2(marshallhandle);
     357                                this->AddObject(tria);
     358                        }
     359                        else if(obj_enum==PentaEnum){
     360                                Penta* penta=NULL;
     361                                penta=new Penta();
     362                                penta->Marshall2(marshallhandle);
     363                                this->AddObject(penta);
     364                        }
     365                        else if(obj_enum==TetraEnum){
     366                                Tetra* tetra=NULL;
     367                                tetra=new Tetra();
     368                                tetra->Marshall2(marshallhandle);
     369                                this->AddObject(tetra);
     370                        }
     371                        else if(obj_enum==SegEnum){
     372                                Seg* seg=NULL;
     373                                seg=new Seg();
     374                                seg->Marshall2(marshallhandle);
     375                                this->AddObject(seg);
     376                        }
     377                        else if(obj_enum==RiftfrontEnum){
     378                                Riftfront* rift=NULL;
     379                                rift=new Riftfront();
     380                                rift->Marshall2(marshallhandle);
     381                                this->AddObject(rift);
     382                        }
     383                        else if(obj_enum==NumericalfluxEnum){
     384                                Numericalflux* numflux=NULL;
     385                                numflux=new Numericalflux();
     386                                numflux->Marshall2(marshallhandle);
     387                                this->AddObject(numflux);
     388                        }
     389                        else if(obj_enum==PengridEnum){
     390                                Pengrid* pengrid=NULL;
     391                                pengrid=new Pengrid();
     392                                pengrid->Marshall2(marshallhandle);
     393                                this->AddObject(pengrid);
     394                        }
     395                        else if(obj_enum==PenpairEnum){
     396                                Penpair* penpair=NULL;
     397                                penpair=new Penpair();
     398                                penpair->Marshall2(marshallhandle);
     399                                this->AddObject(penpair);
     400                        }
     401                        else if(obj_enum==DoubleExternalResultEnum){
     402                                GenericExternalResult<double>* result=new GenericExternalResult<double>();
     403                                result->Marshall2(marshallhandle);
    245404                                this->AddObject(result);
    246405                        }
     
    334493Object* DataSet::GetObjectByOffset(int offset){/*{{{*/
    335494
     495        if(this->Size()<=offset) this->Echo();
     496
    336497        /*Check index in debugging mode*/
    337498        _assert_(this!=NULL);
  • issm/trunk-jpl/src/c/datastructures/DataSet.h

    r19198 r25506  
    77/*forward declarations */
    88class Object;
     9class MarshallHandle;
    910
    1011/*! \brief Declaration of DataSet class
     
    3435                ~DataSet();
    3536                void  Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction);
     37                void  Marshall2(MarshallHandle* marshallhandle);
    3638
    3739                /*management*/
  • issm/trunk-jpl/src/c/datastructures/Object.h

    r19198 r25506  
    2222                virtual Object* copy()=0;
    2323                virtual void Marshall(char** pmarshalled_data, int* pmarshalled_data_size, int marshall_direction)=0;
     24                virtual void Marshall2(MarshallHandle* marshallhandle)=0;
    2425
    2526};
  • issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h

    r25497 r25506  
    66#define _MARSHALLING_H_
    77
    8 enum marshall_directions{
     8#include <string.h>
     9#include "../../Exceptions/exceptions.h"
     10#include "../../MemOps/MemOps.h"
     11#include "../../Numerics/recast.h"
     12
     13/*Define Marshall operation Enums first*/
     14enum MarshallOpEnum{
    915        MARSHALLING_WRITE,
    1016        MARSHALLING_LOAD,
    11         MARSHALLING_SIZE
     17        MARSHALLING_SIZE,
    1218};
     19
     20/*Define virtual Marshall Handle*/
     21class MarshallHandle{
     22        public:
     23                MarshallOpEnum operation_enum;
     24                MarshallHandle(MarshallOpEnum op_in) : operation_enum(op_in){}
     25                ~MarshallHandle(){}
     26                virtual void Echo(void)=0;
     27                int OperationNumber(){return operation_enum;}
     28                template<typename T> void call(T  & value);
     29                template<typename T> void call(T* & value,int size);
     30};
     31
     32/*Make sure to pass all fields by reference!*/
     33class WriteCheckpointFunctor: public MarshallHandle{
     34        public:
     35                char** pmarshalled_data;
     36                WriteCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_WRITE),pmarshalled_data(pmarshalled_data_in){}
     37                template<typename T> void call(T & value){
     38                        memcpy(*pmarshalled_data,&value,sizeof(T));
     39                        *pmarshalled_data+=sizeof(T);
     40                }
     41                void Echo(void){
     42                        printf("WriteCheckpointFunctor Echo:\n");
     43                        printf("   pmarshalled_data: %p\n",pmarshalled_data);
     44                }
     45                template<typename T> void call(T* & value,int size){
     46                        bool pointer_null = true;
     47                        if(value) pointer_null = false;
     48                        call(pointer_null);
     49                        if(value){
     50                                memcpy(*pmarshalled_data,value,size*sizeof(T));
     51                                *pmarshalled_data+=size*sizeof(T);
     52                        }
     53                }
     54};
     55
     56class LoadCheckpointFunctor: public MarshallHandle{
     57        public:
     58                char** pmarshalled_data;
     59                LoadCheckpointFunctor(char** pmarshalled_data_in) : MarshallHandle(MARSHALLING_LOAD),pmarshalled_data(pmarshalled_data_in){}
     60                void Echo(void){
     61                        printf("LoadCheckpointFunctor Echo:\n");
     62                        printf("   pmarshalled_data: %p\n",pmarshalled_data);
     63                }
     64                template<typename T> void call(T & value){
     65                        memcpy(&value,*pmarshalled_data,sizeof(T));
     66                        *pmarshalled_data+=sizeof(T);
     67                }
     68                template<typename T> void call(T* & value,int size){
     69                        bool pointer_null;
     70                        call(pointer_null);
     71                        if(!pointer_null){
     72                                value=xNew<T>(size);
     73                                memcpy(value,*pmarshalled_data,size*sizeof(T));
     74                                *pmarshalled_data+=size*sizeof(T);
     75                        }
     76                        else{
     77                                value = NULL;
     78                        }
     79                }
     80};
     81
     82class SizeCheckpointFunctor: public MarshallHandle{
     83        public:
     84                int marshalled_data_size;
     85                SizeCheckpointFunctor(void) : MarshallHandle(MARSHALLING_SIZE),marshalled_data_size(0){}
     86                int MarshalledSize(void){return this->marshalled_data_size;};
     87                void Echo(void){
     88                        printf("SizeCheckpointFunctor Echo:\n");
     89                        printf("   marshalled_data_size: %i\n",marshalled_data_size);
     90                }
     91                template<typename T> void call(T & value){
     92                        marshalled_data_size+=sizeof(T);
     93                }
     94                template<typename T> void call(T* & value,int size){
     95                        bool pointer_null = true;
     96                        if(value) pointer_null = false;
     97                        this->call(pointer_null);
     98                        if(!pointer_null){
     99                                marshalled_data_size+=size*sizeof(T);
     100                        }
     101                }
     102};
     103
     104template<typename T> void MarshallHandle::call(T & value){
     105        switch(OperationNumber()){
     106                case MARSHALLING_WRITE:{WriteCheckpointFunctor* temp = xDynamicCast<WriteCheckpointFunctor*>(this); temp->call(value); break;}
     107                case MARSHALLING_LOAD: {LoadCheckpointFunctor*  temp = xDynamicCast<LoadCheckpointFunctor*>(this);  temp->call(value); break;}
     108                case MARSHALLING_SIZE: {SizeCheckpointFunctor*  temp = xDynamicCast<SizeCheckpointFunctor*>(this);  temp->call(value); break;}
     109                default: _error_("not supported yet");
     110        }
     111}
     112template<typename T> void MarshallHandle::call(T* & value,int size){
     113        switch(OperationNumber()){
     114                case MARSHALLING_WRITE:{WriteCheckpointFunctor* temp = xDynamicCast<WriteCheckpointFunctor*>(this); temp->call(value,size); break;}
     115                case MARSHALLING_LOAD: {LoadCheckpointFunctor*  temp = xDynamicCast<LoadCheckpointFunctor*>(this);  temp->call(value,size); break;}
     116                case MARSHALLING_SIZE: {SizeCheckpointFunctor*  temp = xDynamicCast<SizeCheckpointFunctor*>(this);  temp->call(value,size); break;}
     117                default: _error_("not supported yet");
     118        }
     119}
    13120
    14121#define MARSHALLING_ENUM(EN)\
  • issm/trunk-jpl/src/c/toolkits/issm/Bucket.h

    r19198 r25506  
    133133                }
    134134                /*}}}*/
     135                void Marshall2(MarshallHandle* marshallhandle){/*{{{*/
     136                        _error_("not implemented yet!");
     137                }
     138                /*}}}*/
    135139
    136140                /*specific routines of Bucket: */
Note: See TracChangeset for help on using the changeset viewer.