Changeset 12014


Ignore:
Timestamp:
04/16/12 18:48:33 (13 years ago)
Author:
Eric.Larour
Message:

Removing some unused SERIAL code

Location:
issm/trunk-jpl/src/c/objects
Files:
113 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Bamg/QuadTree.h

    r9883 r12014  
    3333                                        int   Id(){_error_("not implemented yet");};
    3434                                        int   MyRank(){_error_("not implemented yet");};
    35                                         #ifdef _SERIAL_
    36                                         void  Marshall(char** pmarshalled_dataset){_error_("not implemented yet");};
    37                                         int   MarshallSize(){_error_("not implemented yet");};
    38                                         void  Demarshall(char** pmarshalled_dataset){_error_("not implemented yet");};
    39                                         #endif
    4035                                        int   ObjectEnum(){_error_("not implemented yet");};
    4136                                        Object* copy(){_error_("not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Constraints/SpcDynamic.cpp

    r9883 r12014  
    7272}
    7373/*}}}1*/
    74 #ifdef _SERIAL_
    75 /*FUNCTION SpcDynamic::Marshall {{{1*/
    76 void  SpcDynamic::Marshall(char** pmarshalled_dataset){
    77 
    78         char* marshalled_dataset=NULL;
    79         int   enum_type=0;
    80 
    81         /*recover marshalled_dataset: */
    82         marshalled_dataset=*pmarshalled_dataset;
    83 
    84         /*get enum type of SpcDynamic: */
    85         enum_type=SpcDynamicEnum;
    86        
    87         /*marshall enum: */
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89        
    90         /*marshall SpcDynamic data: */
    91         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    92         memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    93         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    94         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    95         memcpy(marshalled_dataset,&isset,sizeof(isset));marshalled_dataset+=sizeof(isset);
    96         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    97 
    98         *pmarshalled_dataset=marshalled_dataset;
    99         return;
    100 }
    101 /*}}}1*/
    102 /*FUNCTION SpcDynamic::MarshallSize {{{1*/
    103 int   SpcDynamic::MarshallSize(){
    104 
    105         return sizeof(sid)
    106                 +sizeof(nodeid)
    107                 +sizeof(dof)
    108                 +sizeof(value)
    109                 +sizeof(isset)
    110                 +sizeof(analysis_type)
    111                 +sizeof(int); //sizeof(int) for enum type
    112 }
    113 /*}}}1*/
    114 /*FUNCTION SpcDynamic::Demarshall {{{1*/
    115 void  SpcDynamic::Demarshall(char** pmarshalled_dataset){
    116 
    117         char* marshalled_dataset=NULL;
    118 
    119         /*recover marshalled_dataset: */
    120         marshalled_dataset=*pmarshalled_dataset;
    121 
    122         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    123          *object data (thanks to DataSet::Demarshall):*/
    124 
    125         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    126         memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    127         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    128         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    129         memcpy(&isset,marshalled_dataset,sizeof(isset));marshalled_dataset+=sizeof(isset);
    130         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    131 
    132         /*return: */
    133         *pmarshalled_dataset=marshalled_dataset;
    134         return;
    135 }
    136 /*}}}1*/
    137 #endif
    13874/*FUNCTION SpcDynamic::ObjectEnum{{{1*/
    13975int SpcDynamic::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Constraints/SpcDynamic.h

    r9883 r12014  
    3434                int   Id();
    3535                int   MyRank();
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize();
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum();
    4237                Object* copy();
  • issm/trunk-jpl/src/c/objects/Constraints/SpcStatic.cpp

    r9883 r12014  
    7575}
    7676/*}}}1*/
    77 #ifdef _SERIAL_
    78 /*FUNCTION SpcStatic::Marshall {{{1*/
    79 void  SpcStatic::Marshall(char** pmarshalled_dataset){
    80 
    81         char* marshalled_dataset=NULL;
    82         int   enum_type=0;
    83 
    84         /*recover marshalled_dataset: */
    85         marshalled_dataset=*pmarshalled_dataset;
    86 
    87         /*get enum type of SpcStatic: */
    88         enum_type=SpcStaticEnum;
    89        
    90         /*marshall enum: */
    91         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    92        
    93         /*marshall SpcStatic data: */
    94         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    95         memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    96         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    97         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    98         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    99 
    100         *pmarshalled_dataset=marshalled_dataset;
    101         return;
    102 }
    103 /*}}}1*/
    104 /*FUNCTION SpcStatic::MarshallSize {{{1*/
    105 int   SpcStatic::MarshallSize(){
    106 
    107         return sizeof(sid)
    108                 +sizeof(nodeid)
    109                 +sizeof(dof)
    110                 +sizeof(value)
    111                 +sizeof(analysis_type)
    112                 +sizeof(int); //sizeof(int) for enum type
    113 }
    114 /*}}}1*/
    115 /*FUNCTION SpcStatic::Demarshall {{{1*/
    116 void  SpcStatic::Demarshall(char** pmarshalled_dataset){
    117 
    118         char* marshalled_dataset=NULL;
    119 
    120         /*recover marshalled_dataset: */
    121         marshalled_dataset=*pmarshalled_dataset;
    122 
    123         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    124          *object data (thanks to DataSet::Demarshall):*/
    125 
    126         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    127         memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    128         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    129         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    130         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    131 
    132         /*return: */
    133         *pmarshalled_dataset=marshalled_dataset;
    134         return;
    135 }
    136 /*}}}1*/
    137 #endif
    13877/*FUNCTION SpcStatic::ObjectEnum{{{1*/
    13978int SpcStatic::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Constraints/SpcStatic.h

    r9883 r12014  
    3333                int   Id();
    3434                int   MyRank();
    35                 #ifdef _SERIAL_
    36                 void  Marshall(char** pmarshalled_dataset);
    37                 int   MarshallSize();
    38                 void  Demarshall(char** pmarshalled_dataset);
    39                 #endif
    4035                int   ObjectEnum();
    4136                Object* copy();
  • issm/trunk-jpl/src/c/objects/Constraints/SpcTransient.cpp

    r9883 r12014  
    8787}
    8888/*}}}1*/
    89 #ifdef _SERIAL_
    90 /*FUNCTION SpcTransient::Marshall {{{1*/
    91 void  SpcTransient::Marshall(char** pmarshalled_dataset){
    92 
    93         char* marshalled_dataset=NULL;
    94         int   enum_type=0;
    95 
    96         /*recover marshalled_dataset: */
    97         marshalled_dataset=*pmarshalled_dataset;
    98 
    99         /*get enum type of SpcTransient: */
    100         enum_type=SpcTransientEnum;
    101        
    102         /*marshall enum: */
    103         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104        
    105         /*marshall SpcTransient data: */
    106         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    107         memcpy(marshalled_dataset,&nodeid,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    108         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    109         memcpy(marshalled_dataset,&nsteps,sizeof(nsteps));marshalled_dataset+=sizeof(nsteps);
    110         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    111         if(nsteps){
    112                 memcpy(marshalled_dataset,values,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    113                 memcpy(marshalled_dataset,times,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    114         }
    115 
    116         *pmarshalled_dataset=marshalled_dataset;
    117         return;
    118 }
    119 /*}}}1*/
    120 /*FUNCTION SpcTransient::MarshallSize {{{1*/
    121 int   SpcTransient::MarshallSize(){
    122 
    123         return sizeof(sid)
    124                 +sizeof(nodeid)
    125                 +sizeof(dof)
    126                 +sizeof(nsteps)
    127                 +nsteps*2*sizeof(double)
    128                 +sizeof(analysis_type)
    129                 +sizeof(int); //sizeof(int) for enum type
    130 }
    131 /*}}}1*/
    132 /*FUNCTION SpcTransient::Demarshall {{{1*/
    133 void  SpcTransient::Demarshall(char** pmarshalled_dataset){
    134 
    135         char* marshalled_dataset=NULL;
    136 
    137         /*recover marshalled_dataset: */
    138         marshalled_dataset=*pmarshalled_dataset;
    139 
    140         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    141          *object data (thanks to DataSet::Demarshall):*/
    142 
    143         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    144         memcpy(&nodeid,marshalled_dataset,sizeof(nodeid));marshalled_dataset+=sizeof(nodeid);
    145         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    146         memcpy(&nsteps,marshalled_dataset,sizeof(nsteps));marshalled_dataset+=sizeof(nsteps);
    147         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    148         if(nsteps){
    149                 values=(double*)xmalloc(nsteps*sizeof(double));
    150                 times=(double*)xmalloc(nsteps*sizeof(double));
    151                 memcpy(values,marshalled_dataset,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    152                 memcpy(times,marshalled_dataset,nsteps*sizeof(double));marshalled_dataset+=nsteps*sizeof(double);
    153         }
    154 
    155         /*return: */
    156         *pmarshalled_dataset=marshalled_dataset;
    157         return;
    158 }
    159 /*}}}1*/
    160 #endif
    16189/*FUNCTION SpcTransient::ObjectEnum{{{1*/
    16290int SpcTransient::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Constraints/SpcTransient.h

    r9883 r12014  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • issm/trunk-jpl/src/c/objects/Contour.cpp

    r11887 r12014  
    7979}
    8080/*}}}*/
    81 #ifdef _SERIAL_
    82 /*FUNCTION Contour::Marshall{{{1*/
    83 void  Contour::Marshall(char** pmarshalled_dataset){
    84 
    85         char* marshalled_dataset=NULL;
    86         int   enum_type=0;
    87         char* marshalled_inputs=NULL;
    88         int   marshalled_inputssize;
    89 
    90         /*recover marshalled_dataset: */
    91         marshalled_dataset=*pmarshalled_dataset;
    92 
    93         /*get enum type of Contour: */
    94         enum_type=ContourEnum;
    95        
    96         /*marshall enum: */
    97         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    98        
    99         /*marshall Contour data: */
    100         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    101         memcpy(marshalled_dataset,&nods,sizeof(nods));marshalled_dataset+=sizeof(nods);
    102         memcpy(marshalled_dataset,&closed,sizeof(closed));marshalled_dataset+=sizeof(closed);
    103         memcpy(marshalled_dataset,x,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    104         memcpy(marshalled_dataset,y,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    105 
    106         *pmarshalled_dataset=marshalled_dataset;
    107         return;
    108 }
    109 /*}}}*/
    110 /*FUNCTION Contour::MarshallSize{{{1*/
    111 int   Contour::MarshallSize(){
    112 
    113         return sizeof(id)+
    114                 sizeof(nods)+
    115                 sizeof(closed)+
    116                 2*nods*sizeof(double)+
    117                 sizeof(int); //sizeof(int) for enum type
    118 }
    119 /*}}}*/
    120 /*FUNCTION Contour::Demarshall{{{1*/
    121 void  Contour::Demarshall(char** pmarshalled_dataset){
    122 
    123         char* marshalled_dataset=NULL;
    124 
    125         /*recover marshalled_dataset: */
    126         marshalled_dataset=*pmarshalled_dataset;
    127 
    128         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    129          *object data (thanks to DataSet::Demarshall):*/
    130 
    131         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    132         memcpy(&nods,marshalled_dataset,sizeof(nods));marshalled_dataset+=sizeof(nods);
    133         memcpy(&closed,marshalled_dataset,sizeof(closed));marshalled_dataset+=sizeof(closed);
    134 
    135         if(nods){
    136                 this->x=(double*)xmalloc(nods*sizeof(double));
    137                 this->y=(double*)xmalloc(nods*sizeof(double));
    138                 memcpy(x,marshalled_dataset,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    139                 memcpy(y,marshalled_dataset,nods*sizeof(double));marshalled_dataset+=nods*sizeof(double);
    140         }
    141 
    142         /*return: */
    143         *pmarshalled_dataset=marshalled_dataset;
    144         return;
    145 }
    146 /*}}}*/
    147 #endif
    14881/*FUNCTION Contour::ObjectEnum{{{1*/
    14982int Contour::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Contour.h

    r11956 r12014  
    3434                int   Id(void);
    3535                int   MyRank(void);
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize(void);
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum(void);
    4237                Object* copy(void);
  • issm/trunk-jpl/src/c/objects/DofIndexing.cpp

    r9777 r12014  
    208208}               
    209209/*}}}*/
    210 #ifdef _SERIAL_
    211 /*FUNCTION DofIndexing::Marshall{{{1*/
    212 void  DofIndexing::Marshall(char** pmarshalled_dataset){
    213 
    214         char* marshalled_dataset=NULL;
    215         int   enum_type=0;
    216         bool  flagdoftype; //to indicate if there are some doftype or if NULL
    217 
    218         /*recover marshalled_dataset: */
    219         marshalled_dataset=*pmarshalled_dataset;
    220 
    221         /*preliminary: */
    222         if(this->doftype)flagdoftype=true;
    223         else             flagdoftype=false;
    224 
    225         /*get enum type of DofIndexing: */
    226         enum_type=DofIndexingEnum;
    227        
    228         /*marshall enum: */
    229         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    230        
    231         /*marshall DofIndexing data: */
    232         memcpy(marshalled_dataset,&gsize,sizeof(gsize));marshalled_dataset+=sizeof(gsize);
    233         memcpy(marshalled_dataset,&fsize,sizeof(fsize));marshalled_dataset+=sizeof(fsize);
    234         memcpy(marshalled_dataset,&ssize,sizeof(ssize));marshalled_dataset+=sizeof(ssize);
    235         memcpy(marshalled_dataset,&flagdoftype,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
    236         memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
    237        
    238         if(this->gsize>0){
    239                 memcpy(marshalled_dataset,f_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    240                 memcpy(marshalled_dataset,s_set,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    241                 memcpy(marshalled_dataset,svalues,gsize*sizeof(double)); marshalled_dataset+=gsize*sizeof(double);
    242                 if(flagdoftype){ memcpy(marshalled_dataset,doftype,gsize*sizeof(int)); marshalled_dataset+=gsize*sizeof(int); }
    243                 memcpy(marshalled_dataset,gdoflist,gsize*sizeof(int)); marshalled_dataset+=gsize*sizeof(int);
    244         }
    245         if(this->fsize>0 && this->fsize!=UNDEF){ memcpy(marshalled_dataset,fdoflist,fsize*sizeof(int)); marshalled_dataset+=fsize*sizeof(int);}
    246         if(this->ssize>0 && this->ssize!=UNDEF){ memcpy(marshalled_dataset,sdoflist,ssize*sizeof(int)); marshalled_dataset+=ssize*sizeof(int);}
    247 
    248         *pmarshalled_dataset=marshalled_dataset;
    249         return;
    250 }
    251 /*}}}*/
    252 /*FUNCTION DofIndexing::MarshallSize{{{1*/
    253 int   DofIndexing::MarshallSize(){
    254 
    255         int size=0;
    256 
    257         size+=4*sizeof(int)+sizeof(bool);
    258         if(this->gsize>0){
    259                 size+= 2*this->gsize*sizeof(bool)+
    260                            this->gsize*sizeof(double)+
    261                            this->gsize*sizeof(int);
    262                 if(this->doftype)size+=this->gsize*sizeof(int);
    263         }
    264         if(this->fsize>0 && this->fsize!=UNDEF)size+=this->fsize*sizeof(int);
    265         if(this->ssize>0 && this->ssize!=UNDEF)size+=this->ssize*sizeof(int);
    266 
    267         size+=sizeof(int); //sizeof(int) for enum type
    268 
    269         return size;
    270 }
    271 /*}}}*/
    272 /*FUNCTION DofIndexing::Demarshall{{{1*/
    273 void  DofIndexing::Demarshall(char** pmarshalled_dataset){
    274 
    275         char* marshalled_dataset=NULL;
    276         int   enum_type;
    277         bool  flagdoftype;
    278 
    279         /*recover marshalled_dataset: */
    280         marshalled_dataset=*pmarshalled_dataset;
    281 
    282         /*get enum type of object since DofIndexing is not directly called by DataSet: */
    283         memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    284 
    285         /*easy part: */
    286         memcpy(&gsize,marshalled_dataset,sizeof(gsize));marshalled_dataset+=sizeof(gsize);
    287         memcpy(&fsize,marshalled_dataset,sizeof(fsize));marshalled_dataset+=sizeof(fsize);
    288         memcpy(&ssize,marshalled_dataset,sizeof(ssize));marshalled_dataset+=sizeof(ssize);
    289         memcpy(&flagdoftype,marshalled_dataset,sizeof(flagdoftype));marshalled_dataset+=sizeof(flagdoftype);
    290         memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
    291        
    292         /*Allocate: */
    293         if(this->gsize>0){
    294                 this->f_set=(bool*)xmalloc(this->gsize*sizeof(bool));
    295                 this->s_set=(bool*)xmalloc(this->gsize*sizeof(bool));
    296                 this->svalues=(double*)xmalloc(this->gsize*sizeof(double));
    297                 if(flagdoftype)this->doftype=(int*)xmalloc(this->gsize*sizeof(int));
    298                 else           this->doftype=NULL;
    299                 this->gdoflist=(int*)xmalloc(this->gsize*sizeof(int));
    300         }
    301         else{
    302                 this->f_set=NULL;
    303                 this->s_set=NULL;
    304                 this->svalues=NULL;
    305                 this->doftype=NULL;
    306                 this->gdoflist=NULL;
    307         }
    308         if(this->fsize>0)
    309          this->fdoflist=(int*)xmalloc(this->fsize*sizeof(int));
    310         else
    311          this->fdoflist=NULL;
    312         if(this->ssize>0)
    313          this->sdoflist=(int*)xmalloc(this->ssize*sizeof(int));
    314         else
    315          this->sdoflist=NULL;
    316 
    317         /*Copy arrays: */
    318         if(this->gsize>0){
    319                 memcpy(f_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    320                 memcpy(s_set,marshalled_dataset,gsize*sizeof(bool));marshalled_dataset+=gsize*sizeof(bool);
    321                 memcpy(svalues,marshalled_dataset,gsize*sizeof(double));marshalled_dataset+=gsize*sizeof(double);
    322                 if(flagdoftype){memcpy(doftype,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int); }
    323                 memcpy(gdoflist,marshalled_dataset,gsize*sizeof(int));marshalled_dataset+=gsize*sizeof(int);
    324         }
    325        
    326         if(this->fsize>0 && this->fsize!=UNDEF){ memcpy(this->fdoflist,marshalled_dataset,this->fsize*sizeof(int));marshalled_dataset+=this->fsize*sizeof(int); }
    327         if(this->ssize>0 && this->ssize!=UNDEF){ memcpy(this->sdoflist,marshalled_dataset,this->ssize*sizeof(int));marshalled_dataset+=this->ssize*sizeof(int); }
    328 
    329         /*return: */
    330         *pmarshalled_dataset=marshalled_dataset;
    331         return;
    332 }
    333 /*}}}*/
    334 #endif
    335 
     210
  • issm/trunk-jpl/src/c/objects/DofIndexing.h

    r9777 r12014  
    4343                void  Echo(void);
    4444                void  DeepEcho(void);
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5045                void  copy(DofIndexing* properties);
    5146                /*}}}*/
  • issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.cpp

    r11695 r12014  
    6464}
    6565/*}}}*/
    66 #ifdef _SERIAL_
    67 /*FUNCTION BoolElementResult::Marshall{{{1*/
    68 void  BoolElementResult::Marshall(char** pmarshalled_dataset){
    69 
    70         char* marshalled_dataset=NULL;
    71         int   enum_value=0;
    72 
    73         /*recover marshalled_dataset: */
    74         marshalled_dataset=*pmarshalled_dataset;
    75 
    76         /*get enum value of BoolElementResult: */
    77         enum_value=BoolElementResultEnum;
    78        
    79         /*marshall enum: */
    80         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    81        
    82         /*marshall BoolElementResult data: */
    83         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    84         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    85         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    86         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    87 
    88         *pmarshalled_dataset=marshalled_dataset;
    89 }
    90 /*}}}*/
    91 /*FUNCTION BoolElementResult::Demarshall{{{1*/
    92 void  BoolElementResult::Demarshall(char** pmarshalled_dataset){
    93 
    94         char* marshalled_dataset=NULL;
    95         int   i;
    96 
    97         /*recover marshalled_dataset: */
    98         marshalled_dataset=*pmarshalled_dataset;
    99 
    100         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    101          *object data (thanks to DataSet::Demarshall):*/
    102         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    103         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    104         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    105         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    106 
    107         /*return: */
    108         *pmarshalled_dataset=marshalled_dataset;
    109         return;
    110 }
    111 /*}}}*/
    112 /*FUNCTION BoolElementResult::MarshallSize{{{1*/
    113 int   BoolElementResult::MarshallSize(){
    114        
    115         return sizeof(value)+
    116                 +sizeof(enum_type)
    117                 +sizeof(time)
    118                 +sizeof(step)
    119                 +sizeof(int); //sizeof(int) for enum value
    120 }
    121 /*}}}*/
    122 #endif
    12366/*FUNCTION BoolElementResult::ObjectEnum{{{1*/
    12467int BoolElementResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ElementResults/BoolElementResult.h

    r11695 r12014  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.cpp

    r9883 r12014  
    6464}
    6565/*}}}*/
    66 #ifdef _SERIAL_
    67 /*FUNCTION DoubleElementResult::Marshall{{{1*/
    68 void  DoubleElementResult::Marshall(char** pmarshalled_dataset){
    69 
    70         char* marshalled_dataset=NULL;
    71         int   enum_value=0;
    72 
    73         /*recover marshalled_dataset: */
    74         marshalled_dataset=*pmarshalled_dataset;
    75 
    76         /*get enum value of DoubleElementResult: */
    77         enum_value=DoubleElementResultEnum;
    78        
    79         /*marshall enum: */
    80         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    81        
    82         /*marshall DoubleElementResult data: */
    83         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    84         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    85         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    86         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    87 
    88         *pmarshalled_dataset=marshalled_dataset;
    89 }
    90 /*}}}*/
    91 /*FUNCTION DoubleElementResult::Demarshall{{{1*/
    92 void  DoubleElementResult::Demarshall(char** pmarshalled_dataset){
    93 
    94         char* marshalled_dataset=NULL;
    95         int   i;
    96 
    97         /*recover marshalled_dataset: */
    98         marshalled_dataset=*pmarshalled_dataset;
    99 
    100         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    101          *object data (thanks to DataSet::Demarshall):*/
    102         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    103         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    104         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    105         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    106 
    107         /*return: */
    108         *pmarshalled_dataset=marshalled_dataset;
    109         return;
    110 }
    111 /*}}}*/
    112 /*FUNCTION DoubleElementResult::MarshallSize{{{1*/
    113 int   DoubleElementResult::MarshallSize(){
    114        
    115         return sizeof(value)+
    116                 +sizeof(enum_type)
    117                 +sizeof(time)
    118                 +sizeof(step)
    119                 +sizeof(int); //sizeof(int) for enum value
    120 }
    121 /*}}}*/
    122 #endif
    12366/*FUNCTION DoubleElementResult::ObjectEnum{{{1*/
    12467int DoubleElementResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ElementResults/DoubleElementResult.h

    r11695 r12014  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp

    r11695 r12014  
    6767}
    6868/*}}}*/
    69 #ifdef _SERIAL_
    70 /*FUNCTION PentaP1ElementResult::Marshall{{{1*/
    71 void  PentaP1ElementResult::Marshall(char** pmarshalled_dataset){
    72 
    73         char* marshalled_dataset=NULL;
    74         int   enum_value=0;
    75 
    76         /*recover marshalled_dataset: */
    77         marshalled_dataset=*pmarshalled_dataset;
    78 
    79         /*get enum value of PentaP1ElementResult: */
    80         enum_value=PentaP1ElementResultEnum;
    81        
    82         /*marshall enum: */
    83         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    84        
    85         /*marshall PentaP1ElementResult data: */
    86         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    87         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    88         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    89         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    90 
    91         *pmarshalled_dataset=marshalled_dataset;
    92 }
    93 /*}}}*/
    94 /*FUNCTION PentaP1ElementResult::MarshallSize{{{1*/
    95 int   PentaP1ElementResult::MarshallSize(){
    96        
    97         return sizeof(values)+
    98                 +sizeof(enum_type)
    99                 +sizeof(time)
    100                 +sizeof(step)
    101                 +sizeof(int); //sizeof(int) for enum value
    102 }
    103 /*}}}*/
    104 /*FUNCTION PentaP1ElementResult::Demarshall{{{1*/
    105 void  PentaP1ElementResult::Demarshall(char** pmarshalled_dataset){
    106 
    107         char* marshalled_dataset=NULL;
    108         int   i;
    109 
    110         /*recover marshalled_dataset: */
    111         marshalled_dataset=*pmarshalled_dataset;
    112 
    113         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    114          *object data (thanks to DataSet::Demarshall):*/
    115         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    116         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    117         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    118         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    119 
    120         /*return: */
    121         *pmarshalled_dataset=marshalled_dataset;
    122         return;
    123 }
    124 /*}}}*/
    125 #endif
    12669/*FUNCTION PentaP1ElementResult::ObjectEnum{{{1*/
    12770int PentaP1ElementResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h

    r11695 r12014  
    3434                int   Id();
    3535                int   MyRank();
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize();
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum();
    4237                Object* copy();
  • issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp

    r11695 r12014  
    6666}
    6767/*}}}*/
    68 #ifdef _SERIAL_
    69 /*FUNCTION TriaP1ElementResult::Marshall{{{1*/
    70 void  TriaP1ElementResult::Marshall(char** pmarshalled_dataset){
    71 
    72         char* marshalled_dataset=NULL;
    73         int   enum_value=0;
    74 
    75 
    76         /*recover marshalled_dataset: */
    77         marshalled_dataset=*pmarshalled_dataset;
    78 
    79         /*get enum value of TriaP1ElementResult: */
    80         enum_value=TriaP1ElementResultEnum;
    81        
    82         /*marshall enum: */
    83         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    84        
    85         /*marshall TriaP1ElementResult data: */
    86         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    87         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    88         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    89         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    90 
    91         *pmarshalled_dataset=marshalled_dataset;
    92 }
    93 /*}}}*/
    94 /*FUNCTION TriaP1ElementResult::MarshallSize{{{1*/
    95 int   TriaP1ElementResult::MarshallSize(){
    96        
    97         return sizeof(values)
    98                 +sizeof(enum_type)
    99                 +sizeof(time)
    100                 +sizeof(step)
    101                 +sizeof(int); //sizeof(int) for enum value
    102 }
    103 /*}}}*/
    104 /*FUNCTION TriaP1ElementResult::Demarshall{{{1*/
    105 void  TriaP1ElementResult::Demarshall(char** pmarshalled_dataset){
    106 
    107         char* marshalled_dataset=NULL;
    108         int   i;
    109 
    110         /*recover marshalled_dataset: */
    111         marshalled_dataset=*pmarshalled_dataset;
    112 
    113         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    114          *object data (thanks to DataSet::Demarshall):*/
    115         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    116         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    117         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    118         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    119 
    120         /*return: */
    121         *pmarshalled_dataset=marshalled_dataset;
    122         return;
    123 }
    124 /*}}}*/
    125 #endif
    12668/*FUNCTION TriaP1ElementResult::ObjectEnum{{{1*/
    12769int TriaP1ElementResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h

    r11695 r12014  
    3333                int   Id();
    3434                int   MyRank();
    35                 #ifdef _SERIAL_
    36                 void  Marshall(char** pmarshalled_dataset);
    37                 int   MarshallSize();
    38                 void  Demarshall(char** pmarshalled_dataset);
    39                 #endif
    4035                int   ObjectEnum();
    4136                Object* copy();
  • issm/trunk-jpl/src/c/objects/Elements/Penta.cpp

    r11994 r12014  
    142142}
    143143/*}}}*/
    144 
    145 /*Marshall*/
    146 #ifdef _SERIAL_
    147 /*FUNCTION Penta::Marshall {{{1*/
    148 void  Penta::Marshall(char** pmarshalled_dataset){
    149 
    150         int   i;
    151         char* marshalled_dataset=NULL;
    152         int   enum_type=0;
    153         char* marshalled_inputs=NULL;
    154         int   marshalled_inputs_size;
    155         char* marshalled_results=NULL;
    156         int   marshalled_results_size;
    157         int   flaghook; //to indicate if hook is NULL or exists
    158 
    159         /*recover marshalled_dataset: */
    160         marshalled_dataset=*pmarshalled_dataset;
    161 
    162         /*get enum type of Penta: */
    163         enum_type=PentaEnum;
    164 
    165         /*marshall enum: */
    166         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    167 
    168         /*marshall Penta data: */
    169         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    170         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    171         memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    172 
    173         /*Mershall Ref: */
    174         for(i=0;i<numanalyses;i++){
    175                 memcpy(marshalled_dataset,&element_type_list[i],sizeof(element_type_list[i]));marshalled_dataset+=sizeof(element_type_list[i]);
    176         }
    177 
    178         /*Marshall hooks: */
    179         for(i=0;i<numanalyses;i++){
    180                 if(hnodes[i]){
    181                         /*Set flag to 1 as there is a hook */
    182                         flaghook=1;
    183                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    184                         hnodes[i]->Marshall(&marshalled_dataset);
    185                 }
    186                 else{
    187                         /*Set flag to 0 and do not marshall flag as there is no Hook */
    188                         flaghook=0;
    189                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    190                 }
    191         }
    192         hmatice->Marshall(&marshalled_dataset);
    193         hmatpar->Marshall(&marshalled_dataset);
    194         hneighbors->Marshall(&marshalled_dataset);
    195 
    196         /*Marshall inputs and results: */
    197         marshalled_inputs_size=inputs->MarshallSize();
    198         marshalled_inputs=inputs->Marshall();
    199         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    200         marshalled_dataset+=marshalled_inputs_size;
    201 
    202         marshalled_results_size=results->MarshallSize();
    203         marshalled_results=results->Marshall();
    204         memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char));
    205         marshalled_dataset+=marshalled_results_size;
    206 
    207         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    208 
    209         xfree((void**)&marshalled_inputs);
    210         xfree((void**)&marshalled_results);
    211 
    212         /*marshall horizontal neighbors: */
    213         memcpy(marshalled_dataset,horizontalneighborsids,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    214 
    215         *pmarshalled_dataset=marshalled_dataset;
    216         return;
    217 }
    218 /*}}}*/
    219 /*FUNCTION Penta::MarshallSize {{{1*/
    220 int   Penta::MarshallSize(){
    221 
    222         int i;
    223         int hnodes_size=0;;
    224 
    225         for(i=0;i<numanalyses;i++){
    226                 hnodes_size+=sizeof(int); //Flag 0 or 1
    227                 if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize();
    228         }
    229 
    230         return sizeof(id)
    231                 +sizeof(sid)
    232                 +hnodes_size
    233                 +sizeof(numanalyses)
    234                 +numanalyses*sizeof(int) //element_type_lists
    235                 +hmatice->MarshallSize()
    236                 +hmatpar->MarshallSize()
    237                 +hneighbors->MarshallSize()
    238                 +inputs->MarshallSize()
    239                 +results->MarshallSize()
    240                 +3*sizeof(int)
    241                 +sizeof(int); //sizeof(int) for enum type
    242 }
    243 /*}}}*/
    244 /*FUNCTION Penta::Demarshall {{{1*/
    245 void  Penta::Demarshall(char** pmarshalled_dataset){
    246 
    247         char* marshalled_dataset=NULL;
    248         int   i;
    249         int flaghook;
    250 
    251         /*recover marshalled_dataset: */
    252         marshalled_dataset=*pmarshalled_dataset;
    253 
    254         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    255          *object data (thanks to DataSet::Demarshall):*/
    256         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    257         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    258         memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    259 
    260         /*demarshall Ref: */
    261         this->element_type_list=(int*)xmalloc(this->numanalyses*sizeof(int));
    262         for(i=0;i<numanalyses;i++){ memcpy(&element_type_list[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);}
    263 
    264         /*allocate dynamic memory: */
    265         this->hnodes=new Hook*[this->numanalyses];
    266         /*demarshall hooks: */
    267         for(i=0;i<numanalyses;i++){
    268                 memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    269                 if(flaghook){ // there is a hook so demarshall it
    270                         hnodes[i]=new Hook();
    271                         hnodes[i]->Demarshall(&marshalled_dataset);
    272                 }
    273                 else hnodes[i]=NULL; //There is no hook so it is NULL
    274         }
    275         hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset);
    276         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    277         hneighbors=new Hook(); hneighbors->Demarshall(&marshalled_dataset);
    278 
    279         /*pointers are garbage, until configuration is carried out: */
    280         nodes=NULL;
    281         matice=NULL;
    282         matpar=NULL;
    283         verticalneighbors=NULL;
    284 
    285         /*demarshall inputs and results: */
    286         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    287         results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
    288 
    289         /*parameters: may not exist even yet, so let Configure handle it: */
    290         this->parameters=NULL;
    291 
    292         /*neighbors: */
    293         memcpy(&this->horizontalneighborsids,marshalled_dataset,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    294 
    295         /*return: */
    296         *pmarshalled_dataset=marshalled_dataset;
    297         return;
    298 }
    299 /*}}}*/
    300 #endif
    301144
    302145/*Other*/
  • issm/trunk-jpl/src/c/objects/Elements/Penta.h

    r11994 r12014  
    5555                int               ObjectEnum();
    5656                int               Id();
    57                 #ifdef _SERIAL_
    58                 void      Marshall(char** pmarshalled_dataset);
    59                 int               MarshallSize();
    60                 void      Demarshall(char** pmarshalled_dataset);
    61                 #endif
    6257                int               MyRank();
    6358                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Elements/Tria.cpp

    r11994 r12014  
    122122}
    123123/*}}}*/
    124 
    125 /*Marshall*/
    126 #ifdef _SERIAL_
    127 /*FUNCTION Tria::Marshall {{{1*/
    128 void  Tria::Marshall(char** pmarshalled_dataset){
    129 
    130         int   i;
    131         char* marshalled_dataset=NULL;
    132         int   enum_type=0;
    133         char* marshalled_inputs=NULL;
    134         int   marshalled_inputs_size;
    135         char* marshalled_results=NULL;
    136         int   marshalled_results_size;
    137         int   flaghook; //to indicate if hook is NULL or exists
    138 
    139         /*recover marshalled_dataset: */
    140         marshalled_dataset=*pmarshalled_dataset;
    141 
    142         /*get enum type of Tria: */
    143         enum_type=TriaEnum;
    144 
    145         /*marshall enum: */
    146         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    147 
    148         /*marshall Tria data: */
    149         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    150         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    151         memcpy(marshalled_dataset,&numanalyses,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    152 
    153         /*Mershall Ref: */
    154         for(i=0;i<numanalyses;i++){
    155                 memcpy(marshalled_dataset,&element_type_list[i],sizeof(element_type_list[i]));marshalled_dataset+=sizeof(element_type_list[i]);
    156         }
    157 
    158         /*Marshall hooks: */
    159         for(i=0;i<numanalyses;i++){
    160                 if(hnodes[i]){
    161                         /*Set flag to 1 as there is a hook */
    162                         flaghook=1;
    163                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    164                         hnodes[i]->Marshall(&marshalled_dataset);
    165                 }
    166                 else{
    167                         /*Set flag to 0 and do not marshall flag as there is no Hook */
    168                         flaghook=0;
    169                         memcpy(marshalled_dataset,&flaghook,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    170                 }
    171         }
    172         hmatice->Marshall(&marshalled_dataset);
    173         hmatpar->Marshall(&marshalled_dataset);
    174 
    175         /*Marshall inputs: */
    176         marshalled_inputs_size=inputs->MarshallSize();
    177         marshalled_inputs=inputs->Marshall();
    178         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    179         marshalled_dataset+=marshalled_inputs_size;
    180 
    181         /*Marshall results: */
    182         marshalled_results_size=results->MarshallSize();
    183         marshalled_results=results->Marshall();
    184         memcpy(marshalled_dataset,marshalled_results,marshalled_results_size*sizeof(char));
    185         marshalled_dataset+=marshalled_results_size;
    186 
    187         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    188 
    189         xfree((void**)&marshalled_inputs);
    190         xfree((void**)&marshalled_results);
    191 
    192         /*marshall horizontal neighbors: */
    193         memcpy(marshalled_dataset,horizontalneighborsids,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    194 
    195         *pmarshalled_dataset=marshalled_dataset;
    196         return;
    197 }
    198 /*}}}*/
    199 /*FUNCTION Tria::MarshallSize {{{1*/
    200 int   Tria::MarshallSize(){
    201 
    202         int i;
    203         int hnodes_size=0;;
    204 
    205         for(i=0;i<numanalyses;i++){
    206                 hnodes_size+=sizeof(int); //Flag 0 or 1
    207                 if (hnodes[i]) hnodes_size+=hnodes[i]->MarshallSize();
    208         }
    209 
    210         return sizeof(id)
    211           +sizeof(sid)
    212           +hnodes_size
    213           +sizeof(numanalyses)
    214           +numanalyses*sizeof(int) //element_type_lists
    215           +hmatice->MarshallSize()
    216           +hmatpar->MarshallSize()
    217           +inputs->MarshallSize()
    218           +results->MarshallSize()
    219           +3*sizeof(int)
    220           +sizeof(int); //sizeof(int) for enum type
    221 }
    222 /*}}}*/
    223 /*FUNCTION Tria::Demarshall {{{1*/
    224 void  Tria::Demarshall(char** pmarshalled_dataset){
    225 
    226         char* marshalled_dataset=NULL;
    227         int i;
    228         int flaghook;
    229 
    230         /*recover marshalled_dataset: */
    231         marshalled_dataset=*pmarshalled_dataset;
    232 
    233         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    234          *object data (thanks to DataSet::Demarshall):*/
    235         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    236         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    237         memcpy(&numanalyses,marshalled_dataset,sizeof(numanalyses));marshalled_dataset+=sizeof(numanalyses);
    238 
    239         /*demarshall Ref: */
    240         this->element_type_list=(int*)xmalloc(this->numanalyses*sizeof(int));
    241         for(i=0;i<numanalyses;i++){ memcpy(&element_type_list[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);}
    242 
    243         /*allocate dynamic memory: */
    244         this->hnodes=new Hook*[this->numanalyses];
    245         /*demarshall hooks: */
    246         for(i=0;i<numanalyses;i++){
    247                 memcpy(&flaghook,marshalled_dataset,sizeof(flaghook));marshalled_dataset+=sizeof(flaghook);
    248                 if(flaghook){ // there is a hook so demarshall it
    249                         hnodes[i]=new Hook();
    250                         hnodes[i]->Demarshall(&marshalled_dataset);
    251                 }
    252                 else hnodes[i]=NULL; //There is no hook so it is NULL
    253         }
    254         hmatice=new Hook(); hmatice->Demarshall(&marshalled_dataset);
    255         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    256 
    257         /*pointers are garbabe, until configuration is carried out: */
    258         nodes=NULL;
    259         matice=NULL;
    260         matpar=NULL;
    261        
    262         /*demarshall inputs: */
    263         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    264         results=(Results*)DataSetDemarshallRaw(&marshalled_dataset);
    265 
    266         /*parameters: may not exist even yet, so let Configure handle it: */
    267         this->parameters=NULL;
    268 
    269         /*neighbors: */
    270         memcpy(&this->horizontalneighborsids,marshalled_dataset,3*sizeof(int));marshalled_dataset+=3*sizeof(int);
    271 
    272         /*return: */
    273         *pmarshalled_dataset=marshalled_dataset;
    274         return;
    275 }
    276 /*}}}*/
    277 #endif
    278124
    279125/*Other*/
  • issm/trunk-jpl/src/c/objects/Elements/Tria.h

    r11994 r12014  
    5151                int   Id();
    5252                int   MyRank();
    53                 #ifdef _SERIAL_
    54                 void  Marshall(char** pmarshalled_dataset);
    55                 int   MarshallSize();
    56                 void  Demarshall(char** pmarshalled_dataset);
    57                 #endif
    5853                int   ObjectEnum();
    5954                Object* copy();
  • issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.cpp

    r12011 r12014  
    6868}
    6969/*}}}*/
    70 #ifdef _SERIAL_
    71 /*FUNCTION BoolExternalResult::Marshall{{{1*/
    72 void  BoolExternalResult::Marshall(char** pmarshalled_dataset){
    73 
    74         char* marshalled_dataset=NULL;
    75         int   enum_value=0;
    76 
    77         /*recover marshalled_dataset: */
    78         marshalled_dataset=*pmarshalled_dataset;
    79 
    80         /*get enum value of BoolExternalResult: */
    81         enum_value=BoolExternalResultEnum;
    82        
    83         /*marshall enum: */
    84         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    85        
    86         /*marshall BoolExternalResult data: */
    87         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    90         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    91         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    92 
    93         *pmarshalled_dataset=marshalled_dataset;
    94 }
    95 /*}}}*/
    96 /*FUNCTION BoolExternalResult::MarshallSize{{{1*/
    97 int   BoolExternalResult::MarshallSize(){
    98        
    99         return sizeof(value)+
    100                 +sizeof(id)
    101                 +sizeof(enum_type)
    102                 +sizeof(step)
    103                 +sizeof(time)
    104                 +sizeof(int); //sizeof(int) for enum value
    105 }
    106 /*}}}*/
    107 /*FUNCTION BoolExternalResult::Demarshall{{{1*/
    108 void  BoolExternalResult::Demarshall(char** pmarshalled_dataset){
    109 
    110         char* marshalled_dataset=NULL;
    111         int   i;
    112 
    113         /*recover marshalled_dataset: */
    114         marshalled_dataset=*pmarshalled_dataset;
    115 
    116         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    117          *object data (thanks to DataSet::Demarshall):*/
    118         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    119         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    120         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    121         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    122         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13070/*FUNCTION BoolExternalResult::ObjectEnum{{{1*/
    13171int BoolExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/BoolExternalResult.h

    r12011 r12014  
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1616#endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2217
    2318#include "./ExternalResult.h"
     
    4742                int   Id();
    4843                int   MyRank();
    49                 #ifdef _SERIAL_
    50                 void  Marshall(char** pmarshalled_dataset);
    51                 int   MarshallSize();
    52                 void  Demarshall(char** pmarshalled_dataset);
    53                 #endif
    5444                int   ObjectEnum();
    5545                Object* copy();
     
    6252                /*}}}*/
    6353};
    64 #endif  /* _BOOLEXTERNALRESULT_H */
     54#endif
  • issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.cpp

    r12011 r12014  
    6868}
    6969/*}}}*/
    70 #ifdef _SERIAL_
    71 /*FUNCTION DoubleExternalResult::Marshall{{{1*/
    72 void  DoubleExternalResult::Marshall(char** pmarshalled_dataset){
    73 
    74         char* marshalled_dataset=NULL;
    75         int   enum_value=0;
    76 
    77         /*recover marshalled_dataset: */
    78         marshalled_dataset=*pmarshalled_dataset;
    79 
    80         /*get enum value of DoubleExternalResult: */
    81         enum_value=DoubleExternalResultEnum;
    82        
    83         /*marshall enum: */
    84         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    85        
    86         /*marshall DoubleExternalResult data: */
    87         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    90         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    91         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    92 
    93         *pmarshalled_dataset=marshalled_dataset;
    94 }
    95 /*}}}*/
    96 /*FUNCTION DoubleExternalResult::MarshallSize{{{1*/
    97 int   DoubleExternalResult::MarshallSize(){
    98        
    99         return sizeof(value)+
    100                 +sizeof(id)
    101                 +sizeof(enum_type)
    102                 +sizeof(step)
    103                 +sizeof(time)
    104                 +sizeof(int); //sizeof(int) for enum value
    105 }
    106 /*}}}*/
    107 /*FUNCTION DoubleExternalResult::Demarshall{{{1*/
    108 void  DoubleExternalResult::Demarshall(char** pmarshalled_dataset){
    109 
    110         char* marshalled_dataset=NULL;
    111         int   i;
    112 
    113         /*recover marshalled_dataset: */
    114         marshalled_dataset=*pmarshalled_dataset;
    115 
    116         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    117          *object data (thanks to DataSet::Demarshall):*/
    118         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    119         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    120         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    121         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    122         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13070/*FUNCTION DoubleExternalResult::ObjectEnum{{{1*/
    13171int DoubleExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/DoubleExternalResult.h

    r12011 r12014  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
     
    4844                int   Id();
    4945                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5546                int   ObjectEnum();
    5647                Object* copy();
  • issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.cpp

    r12011 r12014  
    9696}
    9797/*}}}*/
    98 #ifdef _SERIAL_
    99 /*FUNCTION DoubleMatExternalResult::Marshall{{{1*/
    100 void  DoubleMatExternalResult::Marshall(char** pmarshalled_dataset){
    101 
    102         char* marshalled_dataset=NULL;
    103         int   enum_value=0;
    104 
    105         /*recover marshalled_dataset: */
    106         marshalled_dataset=*pmarshalled_dataset;
    107 
    108         /*get enum value of DoubleMatExternalResult: */
    109         enum_value=DoubleMatExternalResultEnum;
    110        
    111         /*marshall enum: */
    112         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    113        
    114         /*marshall DoubleMatExternalResult data: */
    115         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    116         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    117         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    118         memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    119         memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    120         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    121         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    122 
    123         *pmarshalled_dataset=marshalled_dataset;
    124 }
    125 /*}}}*/
    126 /*FUNCTION DoubleMatExternalResult::MarshallSize{{{1*/
    127 int   DoubleMatExternalResult::MarshallSize(){
    128        
    129         return sizeof(M)
    130                 +sizeof(N)
    131                 +M*N*sizeof(double)
    132                 +sizeof(id)
    133                 +sizeof(enum_type)
    134                 +sizeof(step)
    135                 +sizeof(time)
    136                 +sizeof(int); //sizeof(int) for enum value
    137 }
    138 /*}}}*/
    139 /*FUNCTION DoubleMatExternalResult::Demarshall{{{1*/
    140 void  DoubleMatExternalResult::Demarshall(char** pmarshalled_dataset){
    141 
    142         char* marshalled_dataset=NULL;
    143         int   i;
    144 
    145         /*recover marshalled_dataset: */
    146         marshalled_dataset=*pmarshalled_dataset;
    147 
    148         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    149          *object data (thanks to DataSet::Demarshall):*/
    150         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    151         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    152        
    153         /*data: */
    154         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    155         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    156         values=(double*)xmalloc(M*N*sizeof(double));
    157         memcpy(values,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
    158         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    159         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    160 
    161         /*return: */
    162         *pmarshalled_dataset=marshalled_dataset;
    163         return;
    164 }
    165 /*}}}*/
    166 #endif
    16798/*FUNCTION DoubleMatExternalResult::ObjectEnum{{{1*/
    16899int DoubleMatExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/DoubleMatExternalResult.h

    r12011 r12014  
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1515#endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    19 #endif
    20 
    2116
    2217#include "./ExternalResult.h"
     
    4944                int   Id();
    5045                int   MyRank();
    51                 #ifdef _SERIAL_
    52                 void  Marshall(char** pmarshalled_dataset);
    53                 int   MarshallSize();
    54                 void  Demarshall(char** pmarshalled_dataset);
    55                 #endif
    5646                int   ObjectEnum();
    5747                Object* copy();
  • issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.cpp

    r12011 r12014  
    8787}
    8888/*}}}*/
    89 #ifdef _SERIAL_
    90 /*FUNCTION DoubleVecExternalResult::Marshall{{{1*/
    91 void  DoubleVecExternalResult::Marshall(char** pmarshalled_dataset){
    92 
    93         char* marshalled_dataset=NULL;
    94         int   enum_value=0;
    95 
    96         /*recover marshalled_dataset: */
    97         marshalled_dataset=*pmarshalled_dataset;
    98 
    99         /*get enum value of DoubleVecExternalResult: */
    100         enum_value=DoubleVecExternalResultEnum;
    101        
    102         /*marshall enum: */
    103         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    104        
    105         /*marshall DoubleVecExternalResult data: */
    106         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    107         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    108         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    109         memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    110         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    111         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    112 
    113         *pmarshalled_dataset=marshalled_dataset;
    114 }
    115 /*}}}*/
    116 /*FUNCTION DoubleVecExternalResult::MarshallSize{{{1*/
    117 int   DoubleVecExternalResult::MarshallSize(){
    118        
    119         return sizeof(M)
    120                 +M*sizeof(double)
    121                 +sizeof(id)
    122                 +sizeof(enum_type)
    123                 +sizeof(step)
    124                 +sizeof(time)
    125                 +sizeof(int); //sizeof(int) for enum value
    126 }
    127 /*}}}*/
    128 /*FUNCTION DoubleVecExternalResult::Demarshall{{{1*/
    129 void  DoubleVecExternalResult::Demarshall(char** pmarshalled_dataset){
    130 
    131         char* marshalled_dataset=NULL;
    132         int   i;
    133 
    134         /*recover marshalled_dataset: */
    135         marshalled_dataset=*pmarshalled_dataset;
    136 
    137         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    138          *object data (thanks to DataSet::Demarshall):*/
    139         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    140         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    141        
    142         /*data: */
    143         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    144         values=(double*)xmalloc(M*sizeof(double));
    145         memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    146         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    147         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    148 
    149         /*return: */
    150         *pmarshalled_dataset=marshalled_dataset;
    151         return;
    152 }
    153 /*}}}*/
    154 #endif
    15589/*FUNCTION DoubleVecExternalResult::ObjectEnum{{{1*/
    15690int DoubleVecExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/DoubleVecExternalResult.h

    r12011 r12014  
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1515#endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    19 #endif
    20 
    2116
    2217#include "./ExternalResult.h"
     
    4843                int   Id();
    4944                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5545                int   ObjectEnum();
    5646                Object* copy();
  • issm/trunk-jpl/src/c/objects/ExternalResults/ExternalResult.h

    r12011 r12014  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
  • issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.cpp

    r12011 r12014  
    6868}
    6969/*}}}*/
    70 #ifdef _SERIAL_
    71 /*FUNCTION IntExternalResult::Marshall{{{1*/
    72 void  IntExternalResult::Marshall(char** pmarshalled_dataset){
    73 
    74         char* marshalled_dataset=NULL;
    75         int   enum_value=0;
    76 
    77         /*recover marshalled_dataset: */
    78         marshalled_dataset=*pmarshalled_dataset;
    79 
    80         /*get enum value of IntExternalResult: */
    81         enum_value=IntExternalResultEnum;
    82        
    83         /*marshall enum: */
    84         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    85        
    86         /*marshall IntExternalResult data: */
    87         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    88         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    89         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    90         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    91         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    92 
    93         *pmarshalled_dataset=marshalled_dataset;
    94 }
    95 /*}}}*/
    96 /*FUNCTION IntExternalResult::MarshallSize{{{1*/
    97 int   IntExternalResult::MarshallSize(){
    98        
    99         return sizeof(value)+
    100                 +sizeof(id)
    101                 +sizeof(enum_type)
    102                 +sizeof(step)
    103                 +sizeof(time)
    104                 +sizeof(int); //sizeof(int) for enum value
    105 }
    106 /*}}}*/
    107 /*FUNCTION IntExternalResult::Demarshall{{{1*/
    108 void  IntExternalResult::Demarshall(char** pmarshalled_dataset){
    109 
    110         char* marshalled_dataset=NULL;
    111         int   i;
    112 
    113         /*recover marshalled_dataset: */
    114         marshalled_dataset=*pmarshalled_dataset;
    115 
    116         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    117          *object data (thanks to DataSet::Demarshall):*/
    118         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    119         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    120         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    121         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    122         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13070/*FUNCTION IntExternalResult::ObjectEnum{{{1*/
    13171int IntExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/IntExternalResult.h

    r12011 r12014  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
     
    4642                int   Id();
    4743                int   MyRank();
    48                 #ifdef _SERIAL_
    49                 void  Marshall(char** pmarshalled_dataset);
    50                 int   MarshallSize();
    51                 void  Demarshall(char** pmarshalled_dataset);
    52                 #endif
    5344                int   ObjectEnum();
    5445                Object* copy();
  • issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.cpp

    r12011 r12014  
    8080}
    8181/*}}}*/
    82 #ifdef _SERIAL_
    83 /*FUNCTION PetscVecExternalResult::Marshall{{{1*/
    84 void  PetscVecExternalResult::Marshall(char** pmarshalled_dataset){
    85 
    86         char* marshalled_dataset=NULL;
    87         int   enum_value=0;
    88         int   M;
    89         double* serial_value=NULL;
    90 
    91         /*recover marshalled_dataset: */
    92         marshalled_dataset=*pmarshalled_dataset;
    93 
    94         /*get enum value of PetscVecExternalResult: */
    95         enum_value=PetscVecExternalResultEnum;
    96        
    97         /*marshall enum: */
    98         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    99        
    100         /*marshall PetscVecExternalResult data: */
    101         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    102         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    103         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    104         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    105        
    106         if(value){
    107                 VecGetSize(value,&M);
    108                 VecToMPISerial(&serial_value,value);
    109                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    110                 memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    111         }
    112         else{
    113                 M=0;
    114                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    115         }
    116         /*Free ressources:*/
    117         xfree((void**)&serial_value);
    118 
    119         /*return:*/
    120         *pmarshalled_dataset=marshalled_dataset;
    121 }
    122 /*}}}*/
    123 /*FUNCTION PetscVecExternalResult::MarshallSize{{{1*/
    124 int   PetscVecExternalResult::MarshallSize(){
    125 
    126         int M=0;
    127         if(value)VecGetSize(value,&M);
    128 
    129         return sizeof(M)+M*sizeof(double)
    130                 +sizeof(id)
    131                 +sizeof(enum_type)
    132                 +sizeof(step)
    133                 +sizeof(time)
    134                 +sizeof(int); //sizeof(int) for enum value
    135 }
    136 /*}}}*/
    137 /*FUNCTION PetscVecExternalResult::Demarshall{{{1*/
    138 void  PetscVecExternalResult::Demarshall(char** pmarshalled_dataset){
    139 
    140         char* marshalled_dataset=NULL;
    141         int   i;
    142         int   M;
    143         double* serial_vec=NULL;
    144         int*    idxm=NULL;
    145 
    146         /*recover marshalled_dataset: */
    147         marshalled_dataset=*pmarshalled_dataset;
    148 
    149         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    150          *object data (thanks to DataSet::Demarshall):*/
    151         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    152         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    153        
    154         /*data: */
    155         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    156         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    157        
    158         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    159         if(M){
    160                 serial_vec=(double*)xmalloc(M*sizeof(double));
    161                 memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    162 
    163                 value=NewVec(M);
    164                 idxm=(int*)xmalloc(M*sizeof(int));
    165                 for(i=0;i<M;i++)idxm[i]=i;
    166                 VecSetValues(value,M,idxm,serial_vec,INSERT_VALUES);
    167 
    168                 VecAssemblyBegin(value);
    169                 VecAssemblyEnd(value);
    170 
    171                
    172         }
    173         else{
    174                 value=NULL;
    175         }
    176 
    177         /*Free ressources:*/
    178         xfree((void**)&serial_vec);
    179         xfree((void**)&idxm);
    180 
    181         /*return: */
    182         *pmarshalled_dataset=marshalled_dataset;
    183 }
    184 /*}}}*/
    185 #endif
    18682/*FUNCTION PetscVecExternalResult::ObjectEnum{{{1*/
    18783int PetscVecExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/PetscVecExternalResult.h

    r12011 r12014  
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1616#endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2217
    2318#include "./ExternalResult.h"
     
    4843                int   Id();
    4944                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5545                int   ObjectEnum();
    5646                Object* copy();
  • issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.cpp

    r12011 r12014  
    7171}
    7272/*}}}*/
    73 #ifdef _SERIAL_
    74 /*FUNCTION StringExternalResult::Marshall{{{1*/
    75 void  StringExternalResult::Marshall(char** pmarshalled_dataset){
    76 
    77         char* marshalled_dataset=NULL;
    78         int   enum_value=0;
    79         int   stringsize;
    80 
    81         /*recover marshalled_dataset: */
    82         marshalled_dataset=*pmarshalled_dataset;
    83 
    84         /*get enum value of StringExternalResult: */
    85         enum_value=StringExternalResultEnum;
    86        
    87         /*marshall enum: */
    88         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    89 
    90         /*marshall data: */
    91         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    92         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    93         stringsize=strlen(this->value)+1;
    94        
    95         memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
    96         memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    97         memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
    98         memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
    99 
    100         *pmarshalled_dataset=marshalled_dataset;
    101 }
    102 /*}}}*/
    103 /*FUNCTION StringExternalResult::MarshallSize{{{1*/
    104 int   StringExternalResult::MarshallSize(){
    105 
    106         int stringsize;
    107         stringsize=strlen(this->value)+1;
    108        
    109         return sizeof(int)+
    110                 +stringsize*sizeof(char)
    111                 +sizeof(id)
    112                 +sizeof(enum_type)
    113                 +sizeof(step)
    114                 +sizeof(time)
    115                 +sizeof(int); //sizeof(int) for enum value
    116 }
    117 /*}}}*/
    118 /*FUNCTION StringExternalResult::Demarshall{{{1*/
    119 void  StringExternalResult::Demarshall(char** pmarshalled_dataset){
    120 
    121         char* marshalled_dataset=NULL;
    122         int   i;
    123         int   stringsize;
    124 
    125         /*recover marshalled_dataset: */
    126         marshalled_dataset=*pmarshalled_dataset;
    127 
    128         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    129          *object data (thanks to DataSet::Demarshall):*/
    130         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    131         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    132 
    133         memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    134        
    135         this->value=(char*)xmalloc(stringsize*sizeof(char));
    136         memcpy(value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    137         memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
    138         memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
    139 
    140         /*return: */
    141         *pmarshalled_dataset=marshalled_dataset;
    142         return;
    143 }
    144 /*}}}*/
    145 #endif
    14673/*FUNCTION StringExternalResult::ObjectEnum{{{1*/
    14774int StringExternalResult::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/ExternalResults/StringExternalResult.h

    r12011 r12014  
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1616#endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    20 #endif
    21 
    2217
    2318#include "./ExternalResult.h"
     
    4843                int   Id();
    4944                int   MyRank();
    50                 #ifdef _SERIAL_
    51                 void  Marshall(char** pmarshalled_dataset);
    52                 int   MarshallSize();
    53                 void  Demarshall(char** pmarshalled_dataset);
    54                 #endif
    5545                int   ObjectEnum();
    5646                Object* copy();
  • issm/trunk-jpl/src/c/objects/Hook.cpp

    r9777 r12014  
    118118}
    119119/*}}}*/
    120 #ifdef _SERIAL_
    121 /*FUNCTION Hook::Marshall{{{1*/
    122 void Hook::Marshall(char** pmarshalled_dataset){
    123 
    124         char* marshalled_dataset=NULL;
    125         int   enum_type=0;
    126         int   i;
    127 
    128         /*recover marshalled_dataset: */
    129         marshalled_dataset=*pmarshalled_dataset;
    130 
    131         /*get enum type of Hook: */
    132         enum_type=HookEnum;
    133        
    134         /*marshall enum: */
    135         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    136        
    137         /*marshall Hook data: */
    138         memcpy(marshalled_dataset,&num,sizeof(num));marshalled_dataset+=sizeof(num);
    139         for(i=0;i<num;i++){
    140                 memcpy(marshalled_dataset,&this->ids[i],sizeof(int));marshalled_dataset+=sizeof(int);
    141                 memcpy(marshalled_dataset,&this->offsets[i],sizeof(int));marshalled_dataset+=sizeof(int);
    142         }
    143 
    144         *pmarshalled_dataset=marshalled_dataset;
    145         return;
    146 }
    147 /*}}}*/
    148 /*FUNCTION Hook::MarshallSize{{{1*/
    149 int Hook::MarshallSize(){
    150 
    151         return
    152                 sizeof(num)+
    153                 num*sizeof(int)+
    154                 num*sizeof(int)+
    155                 sizeof(int); //sizeof(int) for enum type
    156 }
    157 /*}}}*/
    158 /*FUNCTION Hook::Demarshall{{{1*/
    159 void Hook::Demarshall(char** pmarshalled_dataset){
    160 
    161         char* marshalled_dataset=NULL;
    162         int   i;
    163         int   enum_type;
    164 
    165         /*recover marshalled_dataset: */
    166         marshalled_dataset=*pmarshalled_dataset;
    167 
    168         /*get enum type of object since Hook is not directly called by DataSet: */
    169         memcpy(&enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    170 
    171         memcpy(&num,marshalled_dataset,sizeof(num));marshalled_dataset+=sizeof(num);
    172        
    173         /*allocate: */
    174         if (num<0){
    175                 _error_("cannot demarshall Hook as num<=0");
    176         }
    177         else if (num==0){
    178                 this->ids=NULL;
    179                 this->offsets=NULL;
    180                 this->objects=NULL;
    181         }
    182         else{
    183 
    184                 this->ids=(int*)xmalloc(num*sizeof(int));
    185                 this->offsets=(int*)xmalloc(num*sizeof(int));
    186 
    187                 /*demarshall allocated ids and offsets: */
    188                 _assert_(num<1000);
    189                 for (i=0;i<num;i++){
    190                         memcpy(&this->ids[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    191                         memcpy(&this->offsets[i],marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    192                 }
    193 
    194                 /*nullify object pointers */
    195                 this->objects=(Object**)xmalloc(num*sizeof(Object*));
    196                 for (i=0;i<num;i++){
    197                         this->objects[i]=NULL;
    198                 }
    199         }
    200 
    201         /*return: */
    202         *pmarshalled_dataset=marshalled_dataset;
    203         return;
    204 }
    205 /*}}}*/
    206 #endif
    207120/*FUNCTION Hook::copy {{{1*/
    208121Object* Hook::copy(void){
  • issm/trunk-jpl/src/c/objects/Hook.h

    r9777 r12014  
    3434                void       Echo(void);
    3535                void       DeepEcho(void);
    36                 #ifdef _SERIAL_
    37                 void       Marshall(char** pmarshalled_dataset);
    38                 int        MarshallSize();
    39                 void       Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                Object*    copy(void);
    4237                /*}}}*/
  • issm/trunk-jpl/src/c/objects/Inputs/BoolInput.cpp

    r11695 r12014  
    5959}
    6060/*}}}*/
    61 #ifdef _SERIAL_
    62 /*FUNCTION BoolInput::Marshall{{{1*/
    63 void  BoolInput::Marshall(char** pmarshalled_dataset){
    64 
    65         char* marshalled_dataset=NULL;
    66         int   enum_value=0;
    67 
    68         /*recover marshalled_dataset: */
    69         marshalled_dataset=*pmarshalled_dataset;
    70 
    71         /*get enum value of BoolInput: */
    72         enum_value=BoolInputEnum;
    73        
    74         /*marshall enum: */
    75         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    76        
    77         /*marshall BoolInput data: */
    78         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    79         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    80 
    81         *pmarshalled_dataset=marshalled_dataset;
    82 }
    83 /*}}}*/
    84 /*FUNCTION BoolInput::MarshallSize{{{1*/
    85 int   BoolInput::MarshallSize(){
    86        
    87         return sizeof(value)+
    88                 +sizeof(enum_type)+
    89                 +sizeof(int); //sizeof(int) for enum value
    90 }
    91 /*}}}*/
    92 /*FUNCTION BoolInput::Demarshall{{{1*/
    93 void  BoolInput::Demarshall(char** pmarshalled_dataset){
    94 
    95         char* marshalled_dataset=NULL;
    96         int   i;
    97 
    98         /*recover marshalled_dataset: */
    99         marshalled_dataset=*pmarshalled_dataset;
    100 
    101         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    102          *object data (thanks to DataSet::Demarshall):*/
    103         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    105 
    106         /*return: */
    107         *pmarshalled_dataset=marshalled_dataset;
    108         return;
    109 }
    110 /*}}}*/
    111 #endif
    11261/*FUNCTION BoolInput::ObjectEnum{{{1*/
    11362int BoolInput::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/BoolInput.h

    r11695 r12014  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/ControlInput.cpp

    r11695 r12014  
    9090}
    9191/*}}}*/
    92 #ifdef _SERIAL_
    93 /*FUNCTION ControlInput::Marshall{{{1*/
    94 void  ControlInput::Marshall(char** pmarshalled_dataset){
    95 
    96         char* marshalled_dataset=NULL;
    97         int   enum_value=0;
    98         int   flag;
    99 
    100         /*recover marshalled_dataset: */
    101         marshalled_dataset=*pmarshalled_dataset;
    102 
    103         /*get enum value of ControlInput: */
    104         enum_value=ControlInputEnum;
    105        
    106         /*marshall enum: */
    107         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    108        
    109         /*marshall enum_type: */
    110         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    111         memcpy(marshalled_dataset,&control_id,sizeof(control_id));marshalled_dataset+=sizeof(control_id);
    112 
    113         /*marshal values*/
    114         if(!values){
    115                 flag=0;
    116                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    117         }
    118         else{
    119                 flag=1;
    120                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    121                 this->values->Marshall(&marshalled_dataset);
    122         }
    123 
    124         /*marshal savedvalues*/
    125         if(!savedvalues){
    126                 flag=0;
    127                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    128         }
    129         else{
    130                 flag=1;
    131                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    132                 this->savedvalues->Marshall(&marshalled_dataset);
    133         }
    134 
    135         /*marshal minvalues*/
    136         if(!minvalues){
    137                 flag=0;
    138                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    139         }
    140         else{
    141                 flag=1;
    142                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    143                 this->minvalues->Marshall(&marshalled_dataset);
    144         }
    145 
    146         /*marshal maxvalues*/
    147         if(!maxvalues){
    148                 flag=0;
    149                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    150         }
    151         else{
    152                 flag=1;
    153                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    154                 this->maxvalues->Marshall(&marshalled_dataset);
    155         }
    156 
    157         /*marshal gradient*/
    158         if(!gradient){
    159                 flag=0;
    160                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    161         }
    162         else{
    163                 flag=1;
    164                 memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
    165                 this->gradient->Marshall(&marshalled_dataset);
    166         }
    167 
    168         /*clean up and assign output pointer*/
    169         *pmarshalled_dataset=marshalled_dataset;
    170 }
    171 /*}}}*/
    172 /*FUNCTION ControlInput::MarshallSize{{{1*/
    173 int   ControlInput::MarshallSize(){
    174        
    175         int size=0;
    176 
    177         size=sizeof(enum_type)+
    178           +sizeof(control_id)
    179           +5*sizeof(int) //5 flags
    180           +sizeof(int); //sizeof(int) for enum value
    181 
    182         if(values)     size+=values->MarshallSize();
    183         if(savedvalues)size+=savedvalues->MarshallSize();
    184         if(minvalues)size+=minvalues->MarshallSize();
    185         if(maxvalues)size+=maxvalues->MarshallSize();
    186         if(gradient)   size+=gradient->MarshallSize();
    187         return size;
    188 }
    189 /*}}}*/
    190 /*FUNCTION ControlInput::Demarshall{{{1*/
    191 void  ControlInput::Demarshall(char** pmarshalled_dataset){
    192 
    193         char* marshalled_dataset=NULL;
    194         int   flag,input_enum_type;
    195 
    196         /*recover marshalled_dataset: */
    197         marshalled_dataset=*pmarshalled_dataset;
    198 
    199         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    200          *object data (thanks to DataSet::Demarshall):*/
    201         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    202         memcpy(&control_id,marshalled_dataset,sizeof(control_id));marshalled_dataset+=sizeof(control_id);
    203 
    204         /*Demarshal values*/
    205         memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    206         if(flag){
    207                 memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    208                 if(input_enum_type==PentaP1InputEnum){
    209                         values=new PentaP1Input();
    210                         values->Demarshall(&marshalled_dataset);
    211                 }
    212                 else if(input_enum_type==TriaP1InputEnum){
    213                         values=new TriaP1Input();
    214                         values->Demarshall(&marshalled_dataset);
    215                 }
    216                 else _error_("Not supported yet");
    217         }
    218         else{
    219                 values=NULL;
    220         }
    221 
    222         /*Demarshal savedvalues*/
    223         memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    224         if(flag){
    225                 memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    226                 if(input_enum_type==PentaP1InputEnum){
    227                         savedvalues=new PentaP1Input();
    228                         savedvalues->Demarshall(&marshalled_dataset);
    229                 }
    230                 else if(input_enum_type==TriaP1InputEnum){
    231                         savedvalues=new TriaP1Input();
    232                         savedvalues->Demarshall(&marshalled_dataset);
    233                 }
    234                 else _error_("Not supported yet");
    235         }
    236         else{
    237                 savedvalues=NULL;
    238         }
    239 
    240         /*Demarshal minvalues*/
    241         memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    242         if(flag){
    243                 memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    244                 if(input_enum_type==PentaP1InputEnum){
    245                         minvalues=new PentaP1Input();
    246                         minvalues->Demarshall(&marshalled_dataset);
    247                 }
    248                 else if(input_enum_type==TriaP1InputEnum){
    249                         minvalues=new TriaP1Input();
    250                         minvalues->Demarshall(&marshalled_dataset);
    251                 }
    252                 else _error_("Not supported yet");
    253         }
    254         else{
    255                 minvalues=NULL;
    256         }
    257 
    258         /*Demarshal maxvalues*/
    259         memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    260         if(flag){
    261                 memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    262                 if(input_enum_type==PentaP1InputEnum){
    263                         maxvalues=new PentaP1Input();
    264                         maxvalues->Demarshall(&marshalled_dataset);
    265                 }
    266                 else if(input_enum_type==TriaP1InputEnum){
    267                         maxvalues=new TriaP1Input();
    268                         maxvalues->Demarshall(&marshalled_dataset);
    269                 }
    270                 else _error_("Not supported yet");
    271         }
    272         else{
    273                 maxvalues=NULL;
    274         }
    275 
    276         /*Demarshal gradient*/
    277         memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    278         if(flag){
    279                 memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
    280                 if(input_enum_type==PentaP1InputEnum){
    281                         gradient=new PentaP1Input();
    282                         gradient->Demarshall(&marshalled_dataset);
    283                 }
    284                 else if(input_enum_type==TriaP1InputEnum){
    285                         gradient=new TriaP1Input();
    286                         gradient->Demarshall(&marshalled_dataset);
    287                 }
    288                 else _error_("Not supported yet");
    289         }
    290         else{
    291                 gradient=NULL;
    292         }
    293 
    294         /*return: */
    295         *pmarshalled_dataset=marshalled_dataset;
    296         return;
    297 }
    298 /*}}}*/
    299 #endif
    30092/*FUNCTION ControlInput::ObjectEnum{{{1*/
    30193int ControlInput::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/ControlInput.h

    r11695 r12014  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.cpp

    r10135 r12014  
    6161}
    6262/*}}}*/
    63 #ifdef _SERIAL_
    64 /*FUNCTION DatasetInput::Marshall{{{1*/
    65 void  DatasetInput::Marshall(char** pmarshalled_dataset){
    66 
    67         char* marshalled_dataset=NULL;
    68         char* marshalled_inputs=NULL;
    69         int   marshalled_inputs_size;
    70         int   enum_value=0;
    71 
    72         /*recover marshalled_dataset: */
    73         marshalled_dataset=*pmarshalled_dataset;
    74 
    75         /*get enum value of DatasetInput: */
    76         enum_value=DatasetInputEnum;
    77        
    78         /*marshall enum: */
    79         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    80        
    81         /*marshall enum_type: */
    82         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    83 
    84         /*marshal inputs*/
    85         marshalled_inputs_size=inputs->MarshallSize();
    86         marshalled_inputs=inputs->Marshall();
    87         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    88         marshalled_dataset+=marshalled_inputs_size;
    89 
    90         /*clean up and assign output pointer*/
    91         xfree((void**)&marshalled_inputs);
    92         *pmarshalled_dataset=marshalled_dataset;
    93 }
    94 /*}}}*/
    95 /*FUNCTION DatasetInput::MarshallSize{{{1*/
    96 int   DatasetInput::MarshallSize(){
    97        
    98         int size=0;
    99 
    100         size=sizeof(enum_type)+
    101           +inputs->MarshallSize()
    102           +sizeof(int); //sizeof(int) for enum value
    103 
    104         return size;
    105 }
    106 /*}}}*/
    107 /*FUNCTION DatasetInput::Demarshall{{{1*/
    108 void  DatasetInput::Demarshall(char** pmarshalled_dataset){
    109         char* marshalled_dataset=NULL;
    110 
    111         /*recover marshalled_dataset: */
    112         marshalled_dataset=*pmarshalled_dataset;
    113 
    114         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    115          *object data (thanks to DataSet::Demarshall):*/
    116         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    117 
    118         /*Demarshal values*/
    119         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    120 
    121         /*return: */
    122         *pmarshalled_dataset=marshalled_dataset;
    123         return;
    124 }
    125 /*}}}*/
    126 #endif
    12763/*FUNCTION DatasetInput::ObjectEnum{{{1*/
    12864int DatasetInput::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/DatasetInput.h

    r11695 r12014  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.cpp

    r11695 r12014  
    5959}
    6060/*}}}*/
    61 #ifdef _SERIAL_
    62 /*FUNCTION DoubleInput::Marshall{{{1*/
    63 void  DoubleInput::Marshall(char** pmarshalled_dataset){
    64 
    65         char* marshalled_dataset=NULL;
    66         int   enum_value=0;
    67 
    68         /*recover marshalled_dataset: */
    69         marshalled_dataset=*pmarshalled_dataset;
    70 
    71         /*get enum value of DoubleInput: */
    72         enum_value=DoubleInputEnum;
    73        
    74         /*marshall enum: */
    75         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    76        
    77         /*marshall DoubleInput data: */
    78         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    79         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    80 
    81         *pmarshalled_dataset=marshalled_dataset;
    82 }
    83 /*}}}*/
    84 /*FUNCTION DoubleInput::MarshallSize{{{1*/
    85 int   DoubleInput::MarshallSize(){
    86        
    87         return sizeof(value)+
    88                 +sizeof(enum_type)+
    89                 +sizeof(int); //sizeof(int) for enum value
    90 }
    91 /*}}}*/
    92 /*FUNCTION DoubleInput::Demarshall{{{1*/
    93 void  DoubleInput::Demarshall(char** pmarshalled_dataset){
    94 
    95         char* marshalled_dataset=NULL;
    96         int   i;
    97 
    98         /*recover marshalled_dataset: */
    99         marshalled_dataset=*pmarshalled_dataset;
    100 
    101         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    102          *object data (thanks to DataSet::Demarshall):*/
    103         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    105 
    106         /*return: */
    107         *pmarshalled_dataset=marshalled_dataset;
    108         return;
    109 }
    110 /*}}}*/
    111 #endif
    11261/*FUNCTION DoubleInput::ObjectEnum{{{1*/
    11362int DoubleInput::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/DoubleInput.h

    r11695 r12014  
    3030                int   Id();
    3131                int   MyRank();
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset);
    34                 int   MarshallSize();
    35                 void  Demarshall(char** pmarshalled_dataset);
    36                 #endif
    3732                int   ObjectEnum();
    3833                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/IntInput.cpp

    r11695 r12014  
    5454}
    5555/*}}}*/
    56 #ifdef _SERIAL_
    57 /*FUNCTION IntInput::Marshall{{{1*/
    58 void  IntInput::Marshall(char** pmarshalled_dataset){
    59 
    60         char* marshalled_dataset=NULL;
    61         int   enum_value=0;
    62 
    63         /*recover marshalled_dataset: */
    64         marshalled_dataset=*pmarshalled_dataset;
    65 
    66         /*get enum value of IntInput: */
    67         enum_value=IntInputEnum;
    68        
    69         /*marshall enum: */
    70         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    71        
    72         /*marshall IntInput data: */
    73         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    74         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    75 
    76         *pmarshalled_dataset=marshalled_dataset;
    77 }
    78 /*}}}*/
    79 /*FUNCTION IntInput::MarshallSize{{{1*/
    80 int   IntInput::MarshallSize(){
    81        
    82         return sizeof(value)+
    83                 +sizeof(enum_type)+
    84                 +sizeof(int); //sizeof(int) for enum value
    85 }
    86 /*}}}*/
    87 /*FUNCTION IntInput::Demarshall{{{1*/
    88 void  IntInput::Demarshall(char** pmarshalled_dataset){
    89 
    90         char* marshalled_dataset=NULL;
    91         int   i;
    92 
    93         /*recover marshalled_dataset: */
    94         marshalled_dataset=*pmarshalled_dataset;
    95 
    96         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    97          *object data (thanks to DataSet::Demarshall):*/
    98         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    99         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    100 
    101         /*return: */
    102         *pmarshalled_dataset=marshalled_dataset;
    103         return;
    104 }
    105 /*}}}*/
    106 #endif
    10756/*FUNCTION IntInput::ObjectEnum{{{1*/
    10857int IntInput::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/IntInput.h

    r11695 r12014  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp

    r11695 r12014  
    7070}
    7171/*}}}*/
    72 #ifdef _SERIAL_
    73 /*FUNCTION PentaP1Input::Marshall{{{1*/
    74 void  PentaP1Input::Marshall(char** pmarshalled_dataset){
    75 
    76         char* marshalled_dataset=NULL;
    77         int   enum_value=0;
    78 
    79         /*recover marshalled_dataset: */
    80         marshalled_dataset=*pmarshalled_dataset;
    81 
    82         /*get enum value of PentaP1Input: */
    83         enum_value=PentaP1InputEnum;
    84        
    85         /*marshall enum: */
    86         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    87        
    88         /*marshall PentaP1Input data: */
    89         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    90         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    91 
    92         *pmarshalled_dataset=marshalled_dataset;
    93 }
    94 /*}}}*/
    95 /*FUNCTION PentaP1Input::MarshallSize{{{1*/
    96 int   PentaP1Input::MarshallSize(){
    97        
    98         return sizeof(values)+
    99                 +sizeof(enum_type)+
    100                 +sizeof(int); //sizeof(int) for enum value
    101 }
    102 /*}}}*/
    103 /*FUNCTION PentaP1Input::Demarshall{{{1*/
    104 void  PentaP1Input::Demarshall(char** pmarshalled_dataset){
    105 
    106         char* marshalled_dataset=NULL;
    107         int   i;
    108 
    109         /*recover marshalled_dataset: */
    110         marshalled_dataset=*pmarshalled_dataset;
    111 
    112         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    113          *object data (thanks to DataSet::Demarshall):*/
    114         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    115         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    116 
    117         /*return: */
    118         *pmarshalled_dataset=marshalled_dataset;
    119         return;
    120 }
    121 /*}}}*/
    122 #endif
    12372/*FUNCTION PentaP1Input::ObjectEnum{{{1*/
    12473int PentaP1Input::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.h

    r11695 r12014  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/TransientInput.cpp

    r11695 r12014  
    114114}
    115115/*}}}*/
    116 #ifdef _SERIAL_
    117 /*FUNCTION TransientInput::Marshall{{{1*/
    118 void  TransientInput::Marshall(char** pmarshalled_dataset){
    119 
    120         char* marshalled_dataset=NULL;
    121         char* marshalled_inputs=NULL;
    122         int   marshalled_inputs_size;
    123         int   enum_value=0;
    124 
    125         /*recover marshalled_dataset: */
    126         marshalled_dataset=*pmarshalled_dataset;
    127 
    128         /*get enum value of TransientInput: */
    129         enum_value=TransientInputEnum;
    130        
    131         /*marshall enum: */
    132         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    133 
    134         /*marshall TransientInput data: */
    135         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    136         memcpy(marshalled_dataset,&numtimesteps,sizeof(numtimesteps));marshalled_dataset+=sizeof(numtimesteps);
    137         memcpy(marshalled_dataset,timesteps,numtimesteps*sizeof(double));marshalled_dataset+=numtimesteps*sizeof(double);
    138 
    139         /*marshal inputs*/
    140         marshalled_inputs_size=inputs->MarshallSize();
    141         marshalled_inputs=inputs->Marshall();
    142         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    143         marshalled_dataset+=marshalled_inputs_size;
    144 
    145         /*clean up and assign output pointer*/
    146         xfree((void**)&marshalled_inputs);
    147         *pmarshalled_dataset=marshalled_dataset;
    148 
    149 }
    150 /*}}}*
    151 /*FUNCTION TransientInput::MarshallSize{{{1*/
    152 int   TransientInput::MarshallSize(){
    153 
    154         return
    155                 +sizeof(enum_type)+
    156                 +sizeof(numtimesteps)+
    157                 +inputs->MarshallSize()
    158                 +numtimesteps*sizeof(double)+
    159                 +sizeof(int); //sizeof(int) for enum value
    160 }
    161 /*}}}*/
    162 /*FUNCTION TransientInput::Demarshall{{{1*/
    163 void  TransientInput::Demarshall(char** pmarshalled_dataset){
    164 
    165         char* marshalled_dataset=NULL;
    166 
    167         /*recover marshalled_dataset: */
    168         marshalled_dataset=*pmarshalled_dataset;
    169 
    170         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    171          *object data (thanks to DataSet::Demarshall):*/
    172         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    173         memcpy(&numtimesteps,marshalled_dataset,sizeof(numtimesteps));marshalled_dataset+=sizeof(numtimesteps);
    174 
    175         /*allocate: */
    176         timesteps=(double*)xmalloc(numtimesteps*sizeof(double));
    177         memcpy(timesteps,marshalled_dataset,numtimesteps*sizeof(double));marshalled_dataset+=numtimesteps*sizeof(double);
    178 
    179         /*Demarshal values*/
    180         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    181 
    182         /*return: */
    183         *pmarshalled_dataset=marshalled_dataset;
    184         return;
    185 
    186 }
    187 /*}}}*/
    188 #endif
    189116/*FUNCTION TransientInput::ObjectEnum{{{1*/
    190117int TransientInput::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/TransientInput.h

    r11695 r12014  
    3434                int   Id();
    3535                int   MyRank();
    36                 #ifdef _SERIAL_
    37                 void  Marshall(char** pmarshalled_dataset);
    38                 int   MarshallSize();
    39                 void  Demarshall(char** pmarshalled_dataset);
    40                 #endif
    4136                int   ObjectEnum();
    4237                Object* copy();
  • issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp

    r11695 r12014  
    7070}
    7171/*}}}*/
    72 #ifdef _SERIAL_
    73 /*FUNCTION TriaP1Input::Marshall{{{1*/
    74 void  TriaP1Input::Marshall(char** pmarshalled_dataset){
    75 
    76         char* marshalled_dataset=NULL;
    77         int   enum_value=0;
    78 
    79         /*recover marshalled_dataset: */
    80         marshalled_dataset=*pmarshalled_dataset;
    81 
    82         /*get enum value of TriaP1Input: */
    83         enum_value=TriaP1InputEnum;
    84        
    85         /*marshall enum: */
    86         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    87        
    88         /*marshall TriaP1Input data: */
    89         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    90         memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
    91 
    92         *pmarshalled_dataset=marshalled_dataset;
    93 }
    94 /*}}}*/
    95 /*FUNCTION TriaP1Input::MarshallSize{{{1*/
    96 int   TriaP1Input::MarshallSize(){
    97        
    98         return sizeof(values)+
    99                 +sizeof(enum_type)+
    100                 +sizeof(int); //sizeof(int) for enum value
    101 }
    102 /*}}}*/
    103 /*FUNCTION TriaP1Input::Demarshall{{{1*/
    104 void  TriaP1Input::Demarshall(char** pmarshalled_dataset){
    105 
    106         char* marshalled_dataset=NULL;
    107         int   i;
    108 
    109         /*recover marshalled_dataset: */
    110         marshalled_dataset=*pmarshalled_dataset;
    111 
    112         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    113          *object data (thanks to DataSet::Demarshall):*/
    114         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    115         memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
    116 
    117         /*return: */
    118         *pmarshalled_dataset=marshalled_dataset;
    119         return;
    120 }
    121 /*}}}*/
    122 #endif
    12372/*FUNCTION TriaP1Input::ObjectEnum{{{1*/
    12473int TriaP1Input::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.h

    r11695 r12014  
    3131                int   Id();
    3232                int   MyRank();
    33                 #ifdef _SERIAL_
    34                 void  Marshall(char** pmarshalled_dataset);
    35                 int   MarshallSize();
    36                 void  Demarshall(char** pmarshalled_dataset);
    37                 #endif
    3833                int   ObjectEnum();
    3934                Object* copy();
  • issm/trunk-jpl/src/c/objects/Loads/Icefront.cpp

    r11874 r12014  
    163163}
    164164/*}}}*/
    165 #ifdef _SERIAL_
    166 /*FUNCTION Icefront::Marshall {{{1*/
    167 void  Icefront::Marshall(char** pmarshalled_dataset){
    168 
    169         char* marshalled_dataset=NULL;
    170         int   enum_type=0;
    171         char* marshalled_inputs=NULL;
    172         int   marshalled_inputs_size;
    173 
    174         /*recover marshalled_dataset: */
    175         marshalled_dataset=*pmarshalled_dataset;
    176 
    177         /*get enum type of Icefront: */
    178         enum_type=IcefrontEnum;
    179 
    180         /*marshall enum: */
    181         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    182 
    183         /*marshall Icefront data: */
    184         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    185         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    186 
    187         /*Marshall hooks: */
    188         hnodes->Marshall(&marshalled_dataset);
    189         helement->Marshall(&marshalled_dataset);
    190         hmatpar->Marshall(&marshalled_dataset);
    191 
    192         /*Marshall inputs: */
    193         marshalled_inputs_size=inputs->MarshallSize();
    194         marshalled_inputs=inputs->Marshall();
    195         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    196         marshalled_dataset+=marshalled_inputs_size;
    197 
    198         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    199 
    200         xfree((void**)&marshalled_inputs);
    201 
    202         *pmarshalled_dataset=marshalled_dataset;
    203 }
    204 /*}}}*/
    205 /*FUNCTION Icefront::MarshallSize {{{1*/
    206 int   Icefront::MarshallSize(){
    207        
    208         return sizeof(id)
    209                 +sizeof(analysis_type)
    210                 +hnodes->MarshallSize()
    211                 +helement->MarshallSize()
    212                 +hmatpar->MarshallSize()
    213                 +inputs->MarshallSize()
    214                 +sizeof(int); //sizeof(int) for enum type
    215 }
    216 /*}}}*/
    217 /*FUNCTION Icefront::Demarshall {{{1*/
    218 void  Icefront::Demarshall(char** pmarshalled_dataset){
    219 
    220         char* marshalled_dataset=NULL;
    221         int   i;
    222 
    223         /*recover marshalled_dataset: */
    224         marshalled_dataset=*pmarshalled_dataset;
    225 
    226         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    227          *object data (thanks to DataSet::Demarshall):*/
    228         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    229         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    230 
    231         /*demarshall hooks: */
    232         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    233         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    234         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    235        
    236         /*pointers are garbabe, until configuration is carried out: */
    237         nodes=NULL;
    238         element=NULL;
    239         matpar=NULL;
    240 
    241         /*demarshall inputs: */
    242         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    243 
    244         /*parameters: may not exist even yet, so let Configure handle it: */
    245         this->parameters=NULL;
    246 
    247         /*return: */
    248         *pmarshalled_dataset=marshalled_dataset;
    249         return;
    250 }
    251 /*}}}*/
    252 #endif
    253165/*FUNCTION Icefront::ObjectEnum{{{1*/
    254166int Icefront::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Loads/Icefront.h

    r11874 r12014  
    4949                int   Id();
    5050                int   MyRank();
    51                 #ifdef _SERIAL_
    52                 void  Marshall(char** pmarshalled_dataset);
    53                 int   MarshallSize();
    54                 void  Demarshall(char** pmarshalled_dataset);
    55                 #endif
    5651                int   ObjectEnum();
    5752                Object* copy();
  • issm/trunk-jpl/src/c/objects/Loads/Numericalflux.cpp

    r11679 r12014  
    189189}
    190190/*}}}*/
    191 #ifdef _SERIAL_
    192 /*FUNCTION Numericalflux::Marshall {{{1*/
    193 void  Numericalflux::Marshall(char** pmarshalled_dataset){
    194 
    195         char* marshalled_dataset=NULL;
    196         int   enum_type=0;
    197         char* marshalled_inputs=NULL;
    198         int   marshalled_inputs_size;
    199 
    200         /*recover marshalled_dataset: */
    201         marshalled_dataset=*pmarshalled_dataset;
    202 
    203         /*get enum type of Numericalflux: */
    204         enum_type=NumericalfluxEnum;
    205 
    206         /*marshall enum: */
    207         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    208 
    209         /*marshall Numericalflux data: */
    210         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    211         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    212 
    213         /*Marshall hooks: */
    214         hnodes->Marshall(&marshalled_dataset);
    215         helement->Marshall(&marshalled_dataset);
    216 
    217         /*Marshall inputs: */
    218         marshalled_inputs_size=inputs->MarshallSize();
    219         marshalled_inputs=inputs->Marshall();
    220         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    221         marshalled_dataset+=marshalled_inputs_size;
    222 
    223         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    224 
    225         xfree((void**)&marshalled_inputs);
    226 
    227         *pmarshalled_dataset=marshalled_dataset;
    228         return;
    229 }
    230 /*}}}*/
    231 /*FUNCTION Numericalflux::MarshallSize{{{1*/
    232 int   Numericalflux::MarshallSize(){
    233 
    234         return sizeof(id)
    235                 +sizeof(analysis_type)
    236                 +hnodes->MarshallSize()
    237                 +helement->MarshallSize()
    238                 +inputs->MarshallSize()
    239                 +sizeof(int); //sizeof(int) for enum type
    240 }
    241 /*}}}*/
    242 /*FUNCTION Numericalflux::Demarshall {{{1*/
    243 void  Numericalflux::Demarshall(char** pmarshalled_dataset){
    244 
    245         char* marshalled_dataset=NULL;
    246         int   i;
    247 
    248         /*recover marshalled_dataset: */
    249         marshalled_dataset=*pmarshalled_dataset;
    250 
    251         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    252          *object data (thanks to DataSet::Demarshall):*/
    253         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    254         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    255 
    256         /*demarshall hooks: */
    257         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    258         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    259        
    260         /*demarshall inputs: */
    261         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    262 
    263         /*parameters: may not exist even yet, so let Configure handle it: */
    264         this->parameters=NULL;
    265         this->element=NULL;
    266         this->nodes=NULL;
    267 
    268         /*return: */
    269         *pmarshalled_dataset=marshalled_dataset;
    270         return;
    271 }
    272 /*}}}*/
    273 #endif
    274191/*FUNCTION Numericalflux::ObjectEnum{{{1*/
    275192int Numericalflux::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Loads/Numericalflux.h

    r11679 r12014  
    4545                int   Id();
    4646                int   MyRank();
    47                 #ifdef _SERIAL_
    48                 void  Marshall(char** pmarshalled_dataset);
    49                 int   MarshallSize();
    50                 void  Demarshall(char** pmarshalled_dataset);
    51                 #endif
    5247                int   ObjectEnum();
    5348                Object* copy();
  • issm/trunk-jpl/src/c/objects/Loads/Pengrid.cpp

    r11679 r12014  
    132132}
    133133/*}}}1*/
    134 #ifdef _SERIAL_
    135 /*FUNCTION Pengrid::Marshall {{{1*/
    136 void  Pengrid::Marshall(char** pmarshalled_dataset){
    137 
    138         char* marshalled_dataset=NULL;
    139         int   enum_type=0;
    140         char* marshalled_inputs=NULL;
    141         int   marshalled_inputs_size;
    142 
    143         /*recover marshalled_dataset: */
    144         marshalled_dataset=*pmarshalled_dataset;
    145 
    146         /*get enum type of Tria: */
    147         enum_type=PengridEnum;
    148 
    149         /*marshall enum: */
    150         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    151 
    152         /*marshall Tria data: */
    153         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    154         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    155         memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active);
    156         memcpy(marshalled_dataset,&zigzag_counter,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
    157 
    158         /*Marshall hooks: */
    159         hnode->Marshall(&marshalled_dataset);
    160         helement->Marshall(&marshalled_dataset);
    161         hmatpar->Marshall(&marshalled_dataset);
    162 
    163         /*Marshall inputs: */
    164         marshalled_inputs_size=inputs->MarshallSize();
    165         marshalled_inputs=inputs->Marshall();
    166         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    167         marshalled_dataset+=marshalled_inputs_size;
    168 
    169         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    170 
    171         xfree((void**)&marshalled_inputs);
    172 
    173         *pmarshalled_dataset=marshalled_dataset;
    174         return;
    175 }
    176 /*}}}*/
    177 /*FUNCTION Pengrid::MarshallSize {{{1*/
    178 int   Pengrid::MarshallSize(){
    179        
    180         return sizeof(id)
    181                 +sizeof(analysis_type)
    182                 +sizeof(active)
    183                 +sizeof(zigzag_counter)
    184                 +hnode->MarshallSize()
    185                 +helement->MarshallSize()
    186                 +hmatpar->MarshallSize()
    187                 +inputs->MarshallSize()
    188                 +sizeof(int); //sizeof(int) for enum type
    189 }
    190 /*}}}*/
    191 /*FUNCTION Pengrid::Demarshall {{{1*/
    192 void  Pengrid::Demarshall(char** pmarshalled_dataset){
    193 
    194         char* marshalled_dataset=NULL;
    195         int   i;
    196 
    197         /*recover marshalled_dataset: */
    198         marshalled_dataset=*pmarshalled_dataset;
    199 
    200         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    201          *object data (thanks to DataSet::Demarshall):*/
    202 
    203         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    204         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    205         memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
    206         memcpy(&zigzag_counter,marshalled_dataset,sizeof(zigzag_counter));marshalled_dataset+=sizeof(zigzag_counter);
    207 
    208         /*demarshall hooks: */
    209         hnode=new Hook(); hnode->Demarshall(&marshalled_dataset);
    210         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    211         hmatpar=new Hook(); hmatpar->Demarshall(&marshalled_dataset);
    212        
    213         /*demarshall inputs: */
    214         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    215 
    216         /*parameters: may not exist even yet, so let Configure handle it: */
    217         this->parameters=NULL;
    218         this->node=NULL;
    219         this->element=NULL;
    220         this->matpar=NULL;
    221 
    222         /*return: */
    223         *pmarshalled_dataset=marshalled_dataset;
    224         return;
    225 }
    226 /*}}}*/
    227 #endif
    228134/*FUNCTION Pengrid::ObjectEnum{{{1*/
    229135int Pengrid::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Loads/Pengrid.h

    r11679 r12014  
    5050                int   Id();
    5151                int   MyRank();
    52                 #ifdef _SERIAL_
    53                 void  Marshall(char** pmarshalled_dataset);
    54                 int   MarshallSize();
    55                 void  Demarshall(char** pmarshalled_dataset);
    56                 #endif
    5752                int   ObjectEnum();
    5853                Object* copy();
  • issm/trunk-jpl/src/c/objects/Loads/Penpair.cpp

    r11679 r12014  
    8585}
    8686/*}}}1*/
    87 #ifdef _SERIAL_
    88 /*FUNCTION Penpair::Marshall {{{1*/
    89 void  Penpair::Marshall(char** pmarshalled_dataset){
    90 
    91         char* marshalled_dataset=NULL;
    92         int   enum_type=0;
    93 
    94         /*recover marshalled_dataset: */
    95         marshalled_dataset=*pmarshalled_dataset;
    96 
    97         /*get enum type of Penpair: */
    98         enum_type=PenpairEnum;
    99        
    100         /*marshall enum: */
    101         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    102        
    103         /*marshall Penpair data: */
    104         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    105         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    106 
    107         /*Marshall hooks*/
    108         hnodes->Marshall(&marshalled_dataset);
    109 
    110         *pmarshalled_dataset=marshalled_dataset;
    111         return;
    112 }
    113 /*}}}1*/
    114 /*FUNCTION Penpair::MarshallSize {{{1*/
    115 int   Penpair::MarshallSize(){
    116 
    117         return sizeof(id)+
    118                 +sizeof(analysis_type)
    119                 +hnodes->MarshallSize()
    120                 +sizeof(int); //sizeof(int) for enum type
    121 }
    122 /*}}}1*/
    123 /*FUNCTION Penpair::Demarshall {{{1*/
    124 void  Penpair::Demarshall(char** pmarshalled_dataset){
    125 
    126         int i;
    127         char* marshalled_dataset=NULL;
    128 
    129         /*recover marshalled_dataset: */
    130         marshalled_dataset=*pmarshalled_dataset;
    131 
    132         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    133          *object data (thanks to DataSet::Demarshall):*/
    134         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    135         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    136 
    137         /*demarshall hooks: */
    138         hnodes=new Hook(); hnodes->Demarshall(&marshalled_dataset);
    139 
    140         /*pointers are garbabe, until configuration is carried out: */
    141         nodes=NULL;
    142         parameters=NULL;
    143 
    144         /*return: */
    145         *pmarshalled_dataset=marshalled_dataset;
    146         return;
    147 }
    148 /*}}}1*/
    149 #endif
    15087/*FUNCTION Penpair::ObjectEnum{{{1*/
    15188int Penpair::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Loads/Penpair.h

    r11679 r12014  
    3737                int   Id();
    3838                int   MyRank();
    39                 #ifdef _SERIAL_
    40                 void  Marshall(char** pmarshalled_dataset);
    41                 int   MarshallSize();
    42                 void  Demarshall(char** pmarshalled_dataset);
    43                 #endif
    4439                int   ObjectEnum();
    4540                Object* copy();
  • issm/trunk-jpl/src/c/objects/Loads/Riftfront.cpp

    r11679 r12014  
    192192}
    193193/*}}}1*/
    194 #ifdef _SERIAL_
    195 /*FUNCTION Riftfront::Marshall {{{1*/
    196 void  Riftfront::Marshall(char** pmarshalled_dataset){
    197 
    198         char* marshalled_dataset=NULL;
    199         int   enum_type=0;
    200         char* marshalled_inputs=NULL;
    201         int   marshalled_inputs_size;
    202 
    203         /*recover marshalled_dataset: */
    204         marshalled_dataset=*pmarshalled_dataset;
    205 
    206         /*get enum type of Riftfront: */
    207         enum_type=RiftfrontEnum;
    208 
    209         /*marshall enum: */
    210         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    211 
    212         /*marshall Riftfront data: */
    213         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    214         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    215         memcpy(marshalled_dataset,&active,sizeof(active));marshalled_dataset+=sizeof(active);
    216         memcpy(marshalled_dataset,&normal,sizeof(normal));marshalled_dataset+=sizeof(normal);
    217         memcpy(marshalled_dataset,&length,sizeof(length));marshalled_dataset+=sizeof(length);
    218         memcpy(marshalled_dataset,&fraction,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
    219         memcpy(marshalled_dataset,&frozen,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
    220         memcpy(marshalled_dataset,&state,sizeof(state));marshalled_dataset+=sizeof(state);
    221         memcpy(marshalled_dataset,&counter,sizeof(counter));marshalled_dataset+=sizeof(counter);
    222         memcpy(marshalled_dataset,&prestable,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
    223         memcpy(marshalled_dataset,&penalty_lock,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
    224         memcpy(marshalled_dataset,&material_converged,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
    225 
    226         /*Marshall hooks: */
    227         hnodes->Marshall(&marshalled_dataset);
    228         helements->Marshall(&marshalled_dataset);
    229         hmatpar->Marshall(&marshalled_dataset);
    230 
    231         /*Marshall inputs: */
    232         marshalled_inputs_size=inputs->MarshallSize();
    233         marshalled_inputs=inputs->Marshall();
    234         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    235         marshalled_dataset+=marshalled_inputs_size;
    236 
    237         /*parameters: don't do anything about it. parameters are marshalled somewhere else!*/
    238 
    239         xfree((void**)&marshalled_inputs);
    240 
    241         *pmarshalled_dataset=marshalled_dataset;
    242         return;
    243 }
    244 /*}}}*/
    245 /*FUNCTION Riftfront::MarshallSize {{{1*/
    246 int   Riftfront::MarshallSize(){
    247        
    248         return sizeof(id)
    249                 +sizeof(analysis_type)
    250                 +sizeof(active)
    251                 +sizeof(normal)
    252                 +sizeof(length)
    253                 +sizeof(fraction)
    254                 +sizeof(frozen)
    255                 +sizeof(state)
    256                 +sizeof(counter)
    257                 +sizeof(prestable)
    258                 +sizeof(penalty_lock)
    259                 +sizeof(material_converged)
    260                 +hnodes->MarshallSize()
    261                 +helements->MarshallSize()
    262                 +hmatpar->MarshallSize()
    263                 +inputs->MarshallSize()
    264                 +sizeof(int); //sizeof(int) for enum type
    265 }
    266 /*}}}*/
    267 /*FUNCTION Riftfront::Demarshall {{{1*/
    268 void  Riftfront::Demarshall(char** pmarshalled_dataset){
    269 
    270         char* marshalled_dataset=NULL;
    271         int   i;
    272 
    273         /*recover marshalled_dataset: */
    274         marshalled_dataset=*pmarshalled_dataset;
    275 
    276         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    277          *object data (thanks to DataSet::Demarshall):*/
    278 
    279         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    280         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    281         memcpy(&active,marshalled_dataset,sizeof(active));marshalled_dataset+=sizeof(active);
    282         memcpy(&normal,marshalled_dataset,sizeof(normal));marshalled_dataset+=sizeof(normal);
    283         memcpy(&length,marshalled_dataset,sizeof(length));marshalled_dataset+=sizeof(length);
    284         memcpy(&fraction,marshalled_dataset,sizeof(fraction));marshalled_dataset+=sizeof(fraction);
    285         memcpy(&frozen,marshalled_dataset,sizeof(frozen));marshalled_dataset+=sizeof(frozen);
    286         memcpy(&state,marshalled_dataset,sizeof(state));marshalled_dataset+=sizeof(state);
    287         memcpy(&counter,marshalled_dataset,sizeof(counter));marshalled_dataset+=sizeof(counter);
    288         memcpy(&prestable,marshalled_dataset,sizeof(prestable));marshalled_dataset+=sizeof(prestable);
    289         memcpy(&penalty_lock,marshalled_dataset,sizeof(penalty_lock));marshalled_dataset+=sizeof(penalty_lock);
    290         memcpy(&material_converged,marshalled_dataset,sizeof(material_converged));marshalled_dataset+=sizeof(material_converged);
    291 
    292         /*demarshall hooks: */
    293         hnodes=new Hook();    hnodes->Demarshall(&marshalled_dataset);
    294         helements=new Hook(); helements->Demarshall(&marshalled_dataset);
    295         hmatpar=new Hook();   hmatpar->Demarshall(&marshalled_dataset);
    296 
    297         /*pointers are garbabe, until configuration is carried out: */
    298         nodes=NULL;
    299         elements=NULL;
    300         matpar=NULL;
    301        
    302         /*demarshall inputs: */
    303         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    304 
    305         /*parameters: may not exist even yet, so let Configure handle it: */
    306         this->parameters=NULL;
    307 
    308         /*return: */
    309         *pmarshalled_dataset=marshalled_dataset;
    310 }
    311 /*}}}*/
    312 #endif
    313194/*FUNCTION Riftfront::ObjectEnum{{{1*/
    314195int Riftfront::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Loads/Riftfront.h

    r11679 r12014  
    5757                int   Id();
    5858                int   MyRank();
    59                 #ifdef _SERIAL_
    60                 void  Marshall(char** pmarshalled_dataset);
    61                 int   MarshallSize();
    62                 void  Demarshall(char** pmarshalled_dataset);
    63                 #endif
    6459                int   ObjectEnum();
    6560                Object* copy();
  • issm/trunk-jpl/src/c/objects/Materials/Matice.cpp

    r11874 r12014  
    8888}
    8989/*}}}*/
    90 #ifdef _SERIAL_
    91 /*FUNCTION Matice::Marshall {{{1*/
    92 void  Matice::Marshall(char** pmarshalled_dataset){
    93 
    94         /*Intermediaries*/
    95         char* marshalled_dataset=NULL;
    96         int   enum_type=0;
    97         char* marshalled_inputs=NULL;
    98         int   marshalled_inputs_size;
    99 
    100         /*recover marshalled_dataset: */
    101         marshalled_dataset=*pmarshalled_dataset;
    102 
    103         /*get enum type of Matice: */
    104         enum_type=MaticeEnum;
    105        
    106         /*marshall enum: */
    107         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    108        
    109         /*marshall Matice data: */
    110         memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
    111 
    112         /*Marshall hooks: */
    113         helement->Marshall(&marshalled_dataset);
    114 
    115         /*Marshall inputs: */
    116         marshalled_inputs_size=inputs->MarshallSize();
    117         marshalled_inputs=inputs->Marshall();
    118         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputs_size*sizeof(char));
    119         marshalled_dataset+=marshalled_inputs_size;
    120 
    121         *pmarshalled_dataset=marshalled_dataset;
    122 
    123         /*clean up and return*/
    124         xfree((void**)&marshalled_inputs);
    125 }
    126 /*}}}*/
    127 /*FUNCTION Matice::MarshallSize{{{1*/
    128 int   Matice::MarshallSize(){
    129 
    130         return sizeof(mid)
    131           +helement->MarshallSize()
    132           +inputs->MarshallSize()
    133           +sizeof(int); //sizeof(int) for enum type
    134 }
    135 /*}}}*/
    136 /*FUNCTION Matice::Demarshall {{{1*/
    137 void  Matice::Demarshall(char** pmarshalled_dataset){
    138 
    139         char* marshalled_dataset=NULL;
    140 
    141         /*recover marshalled_dataset: */
    142         marshalled_dataset=*pmarshalled_dataset;
    143 
    144         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    145          *object data (thanks to DataSet::Demarshall):*/
    146         memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
    147 
    148         /*demarshall hooks: */
    149         helement=new Hook(); helement->Demarshall(&marshalled_dataset);
    150 
    151         /*demarshall inputs: */
    152         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    153 
    154         /*return: */
    155         *pmarshalled_dataset=marshalled_dataset;
    156         return;
    157 }
    158 /*}}}*/
    159 #endif
    16090/*FUNCTION Matice::ObjectEnum{{{1*/
    16191int Matice::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Materials/Matice.h

    r11695 r12014  
    3535                int   Id();
    3636                int   MyRank();
    37                 #ifdef _SERIAL_
    38                 void  Marshall(char** pmarshalled_dataset);
    39                 int   MarshallSize();
    40                 void  Demarshall(char** pmarshalled_dataset);
    41                 #endif
    4237                int   ObjectEnum();
    4338                Object* copy();
  • issm/trunk-jpl/src/c/objects/Materials/Matpar.cpp

    r11351 r12014  
    102102}
    103103/*}}}1*/
    104 #ifdef _SERIAL_
    105 /*FUNCTION Matpar::Marshall {{{1*/
    106 void  Matpar::Marshall(char** pmarshalled_dataset){
    107 
    108         char* marshalled_dataset=NULL;
    109         int   enum_type=0;
    110 
    111         /*recover marshalled_dataset: */
    112         marshalled_dataset=*pmarshalled_dataset;
    113 
    114         /*get enum type of Matpar: */
    115         enum_type=MatparEnum;
    116        
    117         /*marshall enum: */
    118         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    119        
    120         /*marshall Matpar data: */
    121         memcpy(marshalled_dataset,&mid,sizeof(mid));marshalled_dataset+=sizeof(mid);
    122         memcpy(marshalled_dataset,&rho_ice,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
    123         memcpy(marshalled_dataset,&rho_water,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
    124         memcpy(marshalled_dataset,&mu_water,sizeof(mu_water));marshalled_dataset+=sizeof(mu_water);
    125         memcpy(marshalled_dataset,&heatcapacity,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
    126         memcpy(marshalled_dataset,&thermalconductivity,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
    127         memcpy(marshalled_dataset,&latentheat,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
    128         memcpy(marshalled_dataset,&beta,sizeof(beta));marshalled_dataset+=sizeof(beta);
    129         memcpy(marshalled_dataset,&meltingpoint,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
    130         memcpy(marshalled_dataset,&referencetemperature,sizeof(referencetemperature));marshalled_dataset+=sizeof(referencetemperature);
    131         memcpy(marshalled_dataset,&mixed_layer_capacity,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
    132         memcpy(marshalled_dataset,&thermal_exchange_velocity,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
    133         memcpy(marshalled_dataset,&g,sizeof(g));marshalled_dataset+=sizeof(g);
    134 
    135         *pmarshalled_dataset=marshalled_dataset;
    136         return;
    137 }
    138 /*}}}1*/
    139 /*FUNCTION Matpar::MarshallSize {{{1*/
    140 int   Matpar::MarshallSize(){
    141 
    142         return sizeof(mid)+
    143                 sizeof(rho_ice)+
    144                 sizeof(rho_water)+
    145                 sizeof(mu_water)+
    146                 sizeof(heatcapacity)+
    147                 sizeof(thermalconductivity)+
    148                 sizeof(latentheat)+
    149                 sizeof(beta)+
    150                 sizeof(meltingpoint)+
    151                 sizeof(referencetemperature)+
    152                 sizeof(mixed_layer_capacity)+
    153                 sizeof(thermal_exchange_velocity)+
    154                 sizeof(g)+
    155                 sizeof(int); //sizeof(int) for enum type
    156 }
    157 /*}}}1*/
    158 /*FUNCTION Matpar::Demarshall {{{1*/
    159 void  Matpar::Demarshall(char** pmarshalled_dataset){
    160 
    161         char* marshalled_dataset=NULL;
    162 
    163         /*recover marshalled_dataset: */
    164         marshalled_dataset=*pmarshalled_dataset;
    165 
    166         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    167          *object data (thanks to DataSet::Demarshall):*/
    168 
    169         memcpy(&mid,marshalled_dataset,sizeof(mid));marshalled_dataset+=sizeof(mid);
    170         memcpy(&rho_ice,marshalled_dataset,sizeof(rho_ice));marshalled_dataset+=sizeof(rho_ice);
    171         memcpy(&rho_water,marshalled_dataset,sizeof(rho_water));marshalled_dataset+=sizeof(rho_water);
    172         memcpy(&mu_water,marshalled_dataset,sizeof(mu_water));marshalled_dataset+=sizeof(mu_water);
    173         memcpy(&heatcapacity,marshalled_dataset,sizeof(heatcapacity));marshalled_dataset+=sizeof(heatcapacity);
    174         memcpy(&thermalconductivity,marshalled_dataset,sizeof(thermalconductivity));marshalled_dataset+=sizeof(thermalconductivity);
    175         memcpy(&latentheat,marshalled_dataset,sizeof(latentheat));marshalled_dataset+=sizeof(latentheat);
    176         memcpy(&beta,marshalled_dataset,sizeof(beta));marshalled_dataset+=sizeof(beta);
    177         memcpy(&meltingpoint,marshalled_dataset,sizeof(meltingpoint));marshalled_dataset+=sizeof(meltingpoint);
    178         memcpy(&referencetemperature,marshalled_dataset,sizeof(referencetemperature));marshalled_dataset+=sizeof(referencetemperature);
    179         memcpy(&mixed_layer_capacity,marshalled_dataset,sizeof(mixed_layer_capacity));marshalled_dataset+=sizeof(mixed_layer_capacity);
    180         memcpy(&thermal_exchange_velocity,marshalled_dataset,sizeof(thermal_exchange_velocity));marshalled_dataset+=sizeof(thermal_exchange_velocity);
    181         memcpy(&g,marshalled_dataset,sizeof(g));marshalled_dataset+=sizeof(g);
    182 
    183         /*return: */
    184         *pmarshalled_dataset=marshalled_dataset;
    185         return;
    186 }
    187 /*}}}1*/
    188 #endif
    189104/*FUNCTION Matpar::ObjectEnum{{{1*/
    190105int Matpar::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Materials/Matpar.h

    r11695 r12014  
    4646                int   Id();
    4747                int   MyRank();
    48                 #ifdef _SERIAL_
    49                 void  Marshall(char** pmarshalled_dataset);
    50                 int   MarshallSize();
    51                 void  Demarshall(char** pmarshalled_dataset);
    52                 #endif
    5348                int   ObjectEnum();
    5449                Object* copy();
  • issm/trunk-jpl/src/c/objects/Node.cpp

    r11695 r12014  
    193193}
    194194/*}}}*/
    195 #ifdef _SERIAL_
    196 /*FUNCTION Node::Marshall{{{1*/
    197 void  Node::Marshall(char** pmarshalled_dataset){
    198 
    199         char* marshalled_dataset=NULL;
    200         int   enum_type=0;
    201         char* marshalled_inputs=NULL;
    202         int   marshalled_inputssize;
    203 
    204         /*recover marshalled_dataset: */
    205         marshalled_dataset=*pmarshalled_dataset;
    206 
    207         /*get enum type of Node: */
    208         enum_type=NodeEnum;
    209        
    210         /*marshall enum: */
    211         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    212        
    213         /*marshall Node data: */
    214         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    215         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    216         memcpy(marshalled_dataset,&analysis_type,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    217         memcpy(marshalled_dataset,&coord_system,9*sizeof(double));marshalled_dataset+=9*sizeof(double); 
    218 
    219         /*marshall objects: */
    220         indexing.Marshall(&marshalled_dataset);
    221         hvertex->Marshall(&marshalled_dataset);
    222 
    223         /*Marshall inputs: */
    224         marshalled_inputssize=inputs->MarshallSize();
    225         marshalled_inputs=inputs->Marshall();
    226         memcpy(marshalled_dataset,marshalled_inputs,marshalled_inputssize*sizeof(char));
    227         marshalled_dataset+=marshalled_inputssize;
    228 
    229         /*Free ressources:*/
    230         xfree((void**)&marshalled_inputs);
    231 
    232         *pmarshalled_dataset=marshalled_dataset;
    233         return;
    234 }
    235 /*}}}*/
    236 /*FUNCTION Node::MarshallSize{{{1*/
    237 int   Node::MarshallSize(){
    238 
    239         return sizeof(id)+
    240                 sizeof(sid)+
    241                 indexing.MarshallSize()+
    242                 hvertex->MarshallSize()+
    243                 inputs->MarshallSize()+
    244                 sizeof(analysis_type)+
    245                 9*sizeof(double)+
    246                 sizeof(int); //sizeof(int) for enum type
    247 }
    248 /*}}}*/
    249 /*FUNCTION Node::Demarshall{{{1*/
    250 void  Node::Demarshall(char** pmarshalled_dataset){
    251 
    252         char* marshalled_dataset=NULL;
    253 
    254         /*recover marshalled_dataset: */
    255         marshalled_dataset=*pmarshalled_dataset;
    256 
    257         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    258          *object data (thanks to DataSet::Demarshall):*/
    259 
    260         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    261         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    262         memcpy(&analysis_type,marshalled_dataset,sizeof(analysis_type));marshalled_dataset+=sizeof(analysis_type);
    263         memcpy(&coord_system,marshalled_dataset,9*sizeof(double));marshalled_dataset+=9*sizeof(double);
    264        
    265         /*demarshall objects: */
    266         indexing.Demarshall(&marshalled_dataset);
    267         hvertex=new Hook(); hvertex->Demarshall(&marshalled_dataset);
    268 
    269         /*demarshall inputs: */
    270         inputs=(Inputs*)DataSetDemarshallRaw(&marshalled_dataset);
    271 
    272         /*return: */
    273         *pmarshalled_dataset=marshalled_dataset;
    274         return;
    275 }
    276 /*}}}*/
    277 #endif
    278195/*FUNCTION Node::ObjectEnum{{{1*/
    279196int Node::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Node.h

    r11695 r12014  
    4444                int   Id();
    4545                int   MyRank();
    46                 #ifdef _SERIAL_
    47                 void  Marshall(char** pmarshalled_dataset);
    48                 int   MarshallSize();
    49                 void  Demarshall(char** pmarshalled_dataset);
    50                 #endif
    5146                int   ObjectEnum();
    5247                Object* copy(){_error_("Not implemented yet (similar to Elements)");};
  • issm/trunk-jpl/src/c/objects/Numerics/Vector.h

    r12011 r12014  
    2121#endif
    2222               
    23 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    24 #include "mex.h"
    25 #endif
    26 
    2723/*}}}*/
    2824
  • issm/trunk-jpl/src/c/objects/Object.h

    r9883 r12014  
    2121                virtual int   Id()=0;
    2222                virtual int   MyRank()=0;
    23                 #ifdef _SERIAL_
    24                 virtual void  Marshall(char** pmarshalled_dataset)=0;
    25                 virtual int   MarshallSize()=0;
    26                 virtual void  Demarshall(char** pmarshalled_dataset)=0;
    27                 #endif
    2823                virtual int   ObjectEnum()=0;
    2924                virtual Object* copy()=0;
  • issm/trunk-jpl/src/c/objects/Options/Option.h

    r9883 r12014  
    3333                int   Id(){_error_("Not implemented yet");};
    3434                int   MyRank(){_error_("Not implemented yet");};
    35                 #ifdef _SERIAL_
    36                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    37                 int   MarshallSize(){_error_("Not implemented yet");};
    38                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    39                 #endif
    4035                int   ObjectEnum(){return OptionEnum;};
    4136                Object* copy(){_error_("Not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Options/OptionCell.h

    r9883 r12014  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionCellEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Options/OptionChar.h

    r9883 r12014  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionCharEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Options/OptionDouble.h

    r9883 r12014  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionDoubleEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Options/OptionLogical.h

    r9883 r12014  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionLogicalEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Options/OptionStruct.h

    r9883 r12014  
    3030                int   Id(){_error_("Not implemented yet");};
    3131                int   MyRank(){_error_("Not implemented yet");};
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    34                 int   MarshallSize(){_error_("Not implemented yet");};
    35                 void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet");};
    36                 #endif
    3732                int   ObjectEnum(){return OptionStructEnum;};
    3833                Object* copy(){_error_("Not implemented yet");};
  • issm/trunk-jpl/src/c/objects/Params/BoolParam.cpp

    r12011 r12014  
    6262}
    6363/*}}}*/
    64 #ifdef _SERIAL_
    65 /*FUNCTION BoolParam::Marshall{{{1*/
    66 void  BoolParam::Marshall(char** pmarshalled_dataset){
    67 
    68         char* marshalled_dataset=NULL;
    69         int   enum_value=0;
    70 
    71         /*recover marshalled_dataset: */
    72         marshalled_dataset=*pmarshalled_dataset;
    73 
    74         /*get enum value of BoolParam: */
    75         enum_value=BoolParamEnum;
    76        
    77         /*marshall enum: */
    78         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    79        
    80         /*marshall BoolParam data: */
    81         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    82         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    83 
    84         *pmarshalled_dataset=marshalled_dataset;
    85 }
    86 /*}}}*/
    87 /*FUNCTION BoolParam::MarshallSize{{{1*/
    88 int   BoolParam::MarshallSize(){
    89        
    90         return sizeof(value)+
    91                 +sizeof(enum_type)+
    92                 +sizeof(int); //sizeof(int) for enum value
    93 }
    94 /*}}}*/
    95 /*FUNCTION BoolParam::Demarshall{{{1*/
    96 void  BoolParam::Demarshall(char** pmarshalled_dataset){
    97 
    98         char* marshalled_dataset=NULL;
    99         int   i;
    100 
    101         /*recover marshalled_dataset: */
    102         marshalled_dataset=*pmarshalled_dataset;
    103 
    104         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    105          *object data (thanks to DataSet::Demarshall):*/
    106         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    107         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    108 
    109         /*return: */
    110         *pmarshalled_dataset=marshalled_dataset;
    111         return;
    112 }
    113 /*}}}*/
    114 #endif
    11564/*FUNCTION BoolParam::ObjectEnum{{{1*/
    11665int BoolParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/BoolParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4137                int   Id();
    4238                int   MyRank();
    43                 #ifdef _SERIAL_
    44                 void  Marshall(char** pmarshalled_dataset);
    45                 int   MarshallSize();
    46                 void  Demarshall(char** pmarshalled_dataset);
    47                 #endif
    4839                int   ObjectEnum();
    4940                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.cpp

    r12011 r12014  
    127127}
    128128/*}}}*/
    129 #ifdef _SERIAL_
    130 /*FUNCTION DoubleMatArrayParam::Marshall{{{1*/
    131 void  DoubleMatArrayParam::Marshall(char** pmarshalled_dataset){
    132 
    133         char* marshalled_dataset=NULL;
    134         int   enum_value=0;
    135         int   i;
    136 
    137         /*recover marshalled_dataset: */
    138         marshalled_dataset=*pmarshalled_dataset;
    139 
    140         /*get enum value of DoubleMatArrayParam: */
    141         enum_value=DoubleMatArrayParamEnum;
    142        
    143         /*marshall enum: */
    144         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    145        
    146         /*marshall DoubleMatArrayParam data: */
    147         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    148         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    149         if(M){
    150                 memcpy(marshalled_dataset,mdim_array,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    151                 memcpy(marshalled_dataset,ndim_array,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    152                 for(i=0;i<M;i++){
    153                         double* matrix=this->array[i];
    154                         int     m=this->mdim_array[i];
    155                         int     n=this->ndim_array[i];
    156                         memcpy(marshalled_dataset,&m,sizeof(m));marshalled_dataset+=sizeof(m);
    157                         memcpy(marshalled_dataset,&n,sizeof(n));marshalled_dataset+=sizeof(n);
    158                         if(m*n)memcpy(marshalled_dataset,matrix,m*n*sizeof(double));marshalled_dataset+=m*n*sizeof(double);
    159                 }
    160         }
    161        
    162         *pmarshalled_dataset=marshalled_dataset;
    163 }
    164 /*}}}*/
    165 /*FUNCTION DoubleMatArrayParam::MarshallSize{{{1*/
    166 int   DoubleMatArrayParam::MarshallSize(){
    167 
    168         int size=0;
    169         int i;
    170 
    171         size+=sizeof(enum_type)+
    172                 sizeof(M)+
    173                 M*sizeof(int)+
    174                 M*sizeof(int);
    175 
    176         for(i=0;i<M;i++){
    177                 int     m=this->mdim_array[i];
    178                 int     n=this->ndim_array[i];
    179                 size+=sizeof(m)+sizeof(n)+m*n*sizeof(double);
    180         }
    181         size+=sizeof(int); //sizeof(int) for enum value
    182 
    183         return  size;
    184 }
    185 /*}}}*/
    186 /*FUNCTION DoubleMatArrayParam::Demarshall{{{1*/
    187 void  DoubleMatArrayParam::Demarshall(char** pmarshalled_dataset){
    188 
    189         char* marshalled_dataset=NULL;
    190         int   i;
    191         double* matrix=NULL;
    192         int     m,n;
    193 
    194         /*recover marshalled_dataset: */
    195         marshalled_dataset=*pmarshalled_dataset;
    196 
    197         /*this time, no need to get enum value, the pointer directly points to the beginning of the
    198          *object data (thanks to DataSet::Demarshall):*/
    199        
    200         /*data: */
    201         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    202        
    203         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    204         if(M){
    205                 this->mdim_array=(int*)xmalloc(M*sizeof(int));
    206                 this->ndim_array=(int*)xmalloc(M*sizeof(int));
    207                 memcpy(this->mdim_array,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    208                 memcpy(this->ndim_array,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    209 
    210                 this->array=(double**)xmalloc(M*sizeof(double*));
    211                 for(i=0;i<M;i++){
    212                         memcpy(&m,marshalled_dataset,sizeof(m));marshalled_dataset+=sizeof(m);
    213                         memcpy(&n,marshalled_dataset,sizeof(n));marshalled_dataset+=sizeof(n);
    214                         if(m*n){
    215                                 matrix=(double*)xmalloc(m*n*sizeof(double));
    216                                 memcpy(matrix,marshalled_dataset,m*n*sizeof(double));marshalled_dataset+=m*n*sizeof(double);
    217                         }
    218                         else{
    219                                 matrix=NULL;
    220                         }
    221                         this->array[i]=matrix;
    222                 }
    223         }
    224         else{
    225                 this->array=NULL;
    226                 this->mdim_array=NULL;
    227                 this->ndim_array=NULL;
    228         }
    229 
    230         /*return: */
    231         *pmarshalled_dataset=marshalled_dataset;
    232         return;
    233 }
    234 /*}}}*/
    235 #endif
    236129/*FUNCTION DoubleMatArrayParam::ObjectEnum{{{1*/
    237130int DoubleMatArrayParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/DoubleMatArrayParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4440                int   Id();
    4541                int   MyRank();
    46                 #ifdef _SERIAL_
    47                 void  Marshall(char** pmarshalled_dataset);
    48                 int   MarshallSize();
    49                 void  Demarshall(char** pmarshalled_dataset);
    50                 #endif
    5142                int   ObjectEnum();
    5243                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.cpp

    r12011 r12014  
    7878}
    7979/*}}}*/
    80 #ifdef _SERIAL_
    81 /*FUNCTION DoubleMatParam::Marshall{{{1*/
    82 void  DoubleMatParam::Marshall(char** pmarshalled_dataset){
    83 
    84         char* marshalled_dataset=NULL;
    85         int   enum_value=0;
    86 
    87         /*recover marshalled_dataset: */
    88         marshalled_dataset=*pmarshalled_dataset;
    89 
    90         /*get enum value of DoubleMatParam: */
    91         enum_value=DoubleMatParamEnum;
    92        
    93         /*marshall enum: */
    94         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    95        
    96         /*marshall DoubleMatParam data: */
    97         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    98         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    99         memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    100         memcpy(marshalled_dataset,value,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
    101 
    102         *pmarshalled_dataset=marshalled_dataset;
    103 }
    104 /*}}}*/
    105 /*FUNCTION DoubleMatParam::MarshallSize{{{1*/
    106 int   DoubleMatParam::MarshallSize(){
    107        
    108         return sizeof(M)
    109                 +sizeof(N)
    110                 +M*N*sizeof(double)
    111                 +sizeof(enum_type)+
    112                 +sizeof(int); //sizeof(int) for enum value
    113 }
    114 /*}}}*/
    115 /*FUNCTION DoubleMatParam::Demarshall{{{1*/
    116 void  DoubleMatParam::Demarshall(char** pmarshalled_dataset){
    117 
    118         char* marshalled_dataset=NULL;
    119         int   i;
    120 
    121         /*recover marshalled_dataset: */
    122         marshalled_dataset=*pmarshalled_dataset;
    123 
    124         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    125          *object data (thanks to DataSet::Demarshall):*/
    126         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    127        
    128         /*data: */
    129         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    130         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    131         value=(double*)xmalloc(M*N*sizeof(double));
    132         memcpy(value,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=M*N*sizeof(double);
    133 
    134         /*return: */
    135         *pmarshalled_dataset=marshalled_dataset;
    136         return;
    137 }
    138 /*}}}*/
    139 #endif
    14080/*FUNCTION DoubleMatParam::ObjectEnum{{{1*/
    14181int DoubleMatParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/DoubleMatParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4339                int   Id();
    4440                int   MyRank();
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5041                int   ObjectEnum();
    5142                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/DoubleParam.cpp

    r12011 r12014  
    5959}
    6060/*}}}*/
    61 #ifdef _SERIAL_
    62 /*FUNCTION DoubleParam::Marshall{{{1*/
    63 void  DoubleParam::Marshall(char** pmarshalled_dataset){
    64 
    65         char* marshalled_dataset=NULL;
    66         int   enum_value=0;
    67 
    68         /*recover marshalled_dataset: */
    69         marshalled_dataset=*pmarshalled_dataset;
    70 
    71         /*get enum value of DoubleParam: */
    72         enum_value=DoubleParamEnum;
    73        
    74         /*marshall enum: */
    75         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    76        
    77         /*marshall DoubleParam data: */
    78         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    79         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    80 
    81         *pmarshalled_dataset=marshalled_dataset;
    82 }
    83 /*}}}*/
    84 /*FUNCTION DoubleParam::MarshallSize{{{1*/
    85 int   DoubleParam::MarshallSize(){
    86        
    87         return sizeof(value)+
    88                 +sizeof(enum_type)+
    89                 +sizeof(int); //sizeof(int) for enum value
    90 }
    91 /*}}}*/
    92 /*FUNCTION DoubleParam::Demarshall{{{1*/
    93 void  DoubleParam::Demarshall(char** pmarshalled_dataset){
    94 
    95         char* marshalled_dataset=NULL;
    96         int   i;
    97 
    98         /*recover marshalled_dataset: */
    99         marshalled_dataset=*pmarshalled_dataset;
    100 
    101         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    102          *object data (thanks to DataSet::Demarshall):*/
    103         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    104         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    105 
    106         /*return: */
    107         *pmarshalled_dataset=marshalled_dataset;
    108         return;
    109 }
    110 /*}}}*/
    111 #endif
    11261/*FUNCTION DoubleParam::ObjectEnum{{{1*/
    11362int DoubleParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/DoubleParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/DoubleTransientMatParam.h

    r11861 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
  • issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.cpp

    r12011 r12014  
    7575}
    7676/*}}}*/
    77 #ifdef _SERIAL_
    78 /*FUNCTION DoubleVecParam::Marshall{{{1*/
    79 void  DoubleVecParam::Marshall(char** pmarshalled_dataset){
    80 
    81         char* marshalled_dataset=NULL;
    82         int   enum_value=0;
    83 
    84         /*recover marshalled_dataset: */
    85         marshalled_dataset=*pmarshalled_dataset;
    86 
    87         /*get enum value of DoubleVecParam: */
    88         enum_value=DoubleVecParamEnum;
    89        
    90         /*marshall enum: */
    91         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    92        
    93         /*marshall DoubleVecParam data: */
    94         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    95         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    96         memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    97 
    98         *pmarshalled_dataset=marshalled_dataset;
    99 }
    100 /*}}}*/
    101 /*FUNCTION DoubleVecParam::MarshallSize{{{1*/
    102 int   DoubleVecParam::MarshallSize(){
    103        
    104         return sizeof(M)
    105                 +M*sizeof(double)
    106                 +sizeof(enum_type)+
    107                 +sizeof(int); //sizeof(int) for enum value
    108 }
    109 /*}}}*/
    110 /*FUNCTION DoubleVecParam::Demarshall{{{1*/
    111 void  DoubleVecParam::Demarshall(char** pmarshalled_dataset){
    112 
    113         char* marshalled_dataset=NULL;
    114         int   i;
    115 
    116         /*recover marshalled_dataset: */
    117         marshalled_dataset=*pmarshalled_dataset;
    118 
    119         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    120          *object data (thanks to DataSet::Demarshall):*/
    121         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    122        
    123         /*data: */
    124         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    125         values=(double*)xmalloc(M*sizeof(double));
    126         memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);
    127 
    128         /*return: */
    129         *pmarshalled_dataset=marshalled_dataset;
    130         return;
    131 }
    132 /*}}}*/
    133 #endif
    13477/*FUNCTION DoubleVecParam::ObjectEnum{{{1*/
    13578int DoubleVecParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/DoubleVecParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/FileParam.cpp

    r12011 r12014  
    6262}
    6363/*}}}*/
    64 #ifdef _SERIAL_
    65 /*FUNCTION FileParam::Marshall{{{1*/
    66 void  FileParam::Marshall(char** pmarshalled_dataset){
    67 
    68         _error_("FileParam is a pointer and cannot be marshalled");
    69 }
    70 /*}}}*/
    71 /*FUNCTION FileParam::MarshallSize{{{1*/
    72 int   FileParam::MarshallSize(){
    73         _error_("FileParam is a pointer and cannot be marshalled");
    74 }
    75 /*}}}*/
    76 /*FUNCTION FileParam::Demarshall{{{1*/
    77 void  FileParam::Demarshall(char** pmarshalled_dataset){
    78         _error_("FileParam is a pointer and cannot be marshalled");
    79 }
    80 /*}}}*/
    81 #endif
    8264/*FUNCTION FileParam::ObjectEnum{{{1*/
    8365int FileParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/FileParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4137                int   Id();
    4238                int   MyRank();
    43                 #ifdef _SERIAL_
    44                 void  Marshall(char** pmarshalled_dataset);
    45                 int   MarshallSize();
    46                 void  Demarshall(char** pmarshalled_dataset);
    47                 #endif
    4839                int   ObjectEnum();
    4940                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/IntMatParam.cpp

    r12011 r12014  
    7878}
    7979/*}}}*/
    80 #ifdef _SERIAL_
    81 /*FUNCTION IntMatParam::Marshall{{{1*/
    82 void  IntMatParam::Marshall(char** pmarshalled_dataset){
    83 
    84         char* marshalled_dataset=NULL;
    85         int   enum_value=0;
    86 
    87         /*recover marshalled_dataset: */
    88         marshalled_dataset=*pmarshalled_dataset;
    89 
    90         /*get enum value of IntMatParam: */
    91         enum_value=IntMatParamEnum;
    92        
    93         /*marshall enum: */
    94         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    95        
    96         /*marshall IntMatParam data: */
    97         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    98         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    99         memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    100         memcpy(marshalled_dataset,value,M*N*sizeof(int));marshalled_dataset+=M*N*sizeof(int);
    101 
    102         *pmarshalled_dataset=marshalled_dataset;
    103 }
    104 /*}}}*/
    105 /*FUNCTION IntMatParam::MarshallSize{{{1*/
    106 int   IntMatParam::MarshallSize(){
    107        
    108         return sizeof(M)
    109                 +sizeof(N)
    110                 +M*N*sizeof(int)
    111                 +sizeof(enum_type)+
    112                 +sizeof(int); //sizeof(int) for enum value
    113 }
    114 /*}}}*/
    115 /*FUNCTION IntMatParam::Demarshall{{{1*/
    116 void  IntMatParam::Demarshall(char** pmarshalled_dataset){
    117 
    118         char* marshalled_dataset=NULL;
    119         int   i;
    120 
    121         /*recover marshalled_dataset: */
    122         marshalled_dataset=*pmarshalled_dataset;
    123 
    124         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    125          *object data (thanks to DataSet::Demarshall):*/
    126         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    127        
    128         /*data: */
    129         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    130         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    131         value=(int*)xmalloc(M*N*sizeof(int));
    132         memcpy(value,marshalled_dataset,M*N*sizeof(int));marshalled_dataset+=M*N*sizeof(int);
    133 
    134         /*return: */
    135         *pmarshalled_dataset=marshalled_dataset;
    136         return;
    137 }
    138 /*}}}*/
    139 #endif
    14080/*FUNCTION IntMatParam::ObjectEnum{{{1*/
    14181int IntMatParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/IntMatParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4339                int   Id();
    4440                int   MyRank();
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5041                int   ObjectEnum();
    5142                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/IntParam.cpp

    r12011 r12014  
    6262}
    6363/*}}}*/
    64 #ifdef _SERIAL_
    65 /*FUNCTION IntParam::Marshall{{{1*/
    66 void  IntParam::Marshall(char** pmarshalled_dataset){
    67 
    68         char* marshalled_dataset=NULL;
    69         int   enum_value=0;
    70 
    71         /*recover marshalled_dataset: */
    72         marshalled_dataset=*pmarshalled_dataset;
    73 
    74         /*get enum value of IntParam: */
    75         enum_value=IntParamEnum;
    76        
    77         /*marshall enum: */
    78         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    79        
    80         /*marshall IntParam data: */
    81         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    82         memcpy(marshalled_dataset,&value,sizeof(value));marshalled_dataset+=sizeof(value);
    83 
    84         *pmarshalled_dataset=marshalled_dataset;
    85 }
    86 /*}}}*/
    87 /*FUNCTION IntParam::MarshallSize{{{1*/
    88 int   IntParam::MarshallSize(){
    89        
    90         return sizeof(value)+
    91                 +sizeof(enum_type)+
    92                 +sizeof(int); //sizeof(int) for enum value
    93 }
    94 /*}}}*/
    95 /*FUNCTION IntParam::Demarshall{{{1*/
    96 void  IntParam::Demarshall(char** pmarshalled_dataset){
    97 
    98         char* marshalled_dataset=NULL;
    99         int   i;
    100 
    101         /*recover marshalled_dataset: */
    102         marshalled_dataset=*pmarshalled_dataset;
    103 
    104         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    105          *object data (thanks to DataSet::Demarshall):*/
    106         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    107         memcpy(&value,marshalled_dataset,sizeof(value));marshalled_dataset+=sizeof(value);
    108 
    109         /*return: */
    110         *pmarshalled_dataset=marshalled_dataset;
    111         return;
    112 }
    113 /*}}}*/
    114 #endif
    11564/*FUNCTION IntParam::ObjectEnum{{{1*/
    11665int IntParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/IntParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/IntVecParam.cpp

    r12011 r12014  
    9191}
    9292/*}}}*/
    93 #ifdef _SERIAL_
    94 /*FUNCTION IntVecParam::Marshall{{{1*/
    95 void  IntVecParam::Marshall(char** pmarshalled_dataset){
    96 
    97         char* marshalled_dataset=NULL;
    98         int   enum_value=0;
    99 
    100         /*recover marshalled_dataset: */
    101         marshalled_dataset=*pmarshalled_dataset;
    102 
    103         /*get enum value of IntVecParam: */
    104         enum_value=IntVecParamEnum;
    105        
    106         /*marshall enum: */
    107         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    108        
    109         /*marshall IntVecParam data: */
    110         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    111         memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    112         if(M)memcpy(marshalled_dataset,values,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    113 
    114         *pmarshalled_dataset=marshalled_dataset;
    115 }
    116 /*}}}*/
    117 /*FUNCTION IntVecParam::MarshallSize{{{1*/
    118 int   IntVecParam::MarshallSize(){
    119        
    120         return sizeof(M)+
    121                 +M*sizeof(int)
    122                 +sizeof(enum_type)+
    123                 +sizeof(int); //sizeof(int) for enum value
    124 }
    125 /*}}}*/
    126 /*FUNCTION IntVecParam::Demarshall{{{1*/
    127 void  IntVecParam::Demarshall(char** pmarshalled_dataset){
    128 
    129         char* marshalled_dataset=NULL;
    130         int   i;
    131 
    132         /*recover marshalled_dataset: */
    133         marshalled_dataset=*pmarshalled_dataset;
    134 
    135         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    136          *object data (thanks to DataSet::Demarshall):*/
    137         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    138        
    139         /*data: */
    140         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    141         if(M) {
    142                 values=(int*)xmalloc(M*sizeof(int));
    143                 memcpy(values,marshalled_dataset,M*sizeof(int));marshalled_dataset+=M*sizeof(int);
    144         }
    145 
    146         /*return: */
    147         *pmarshalled_dataset=marshalled_dataset;
    148         return;
    149 }
    150 /*}}}*/
    151 #endif
    15293/*FUNCTION IntVecParam::ObjectEnum{{{1*/
    15394int IntVecParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/IntVecParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4339                int   Id();
    4440                int   MyRank();
    45                 #ifdef _SERIAL_
    46                 void  Marshall(char** pmarshalled_dataset);
    47                 int   MarshallSize();
    48                 void  Demarshall(char** pmarshalled_dataset);
    49                 #endif
    5041                int   ObjectEnum();
    5142                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/MatrixParam.cpp

    r12011 r12014  
    7070}
    7171/*}}}*/
    72 #ifdef _SERIAL_
    73 /*FUNCTION MatrixParam::Marshall{{{1*/
    74 void  MatrixParam::Marshall(char** pmarshalled_dataset){
    75 
    76         char* marshalled_dataset=NULL;
    77         int   enum_value=0;
    78         int   M,N;
    79         double* serial_mat=NULL;
    80 
    81         /*recover marshalled_dataset: */
    82         marshalled_dataset=*pmarshalled_dataset;
    83 
    84         /*get enum value of MatrixParam: */
    85         enum_value=MatrixParamEnum;
    86        
    87         /*marshall enum: */
    88         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    89        
    90         /*marshall MatrixParam data: */
    91         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    92         if(value){
    93                 value->GetSize(&M,&N);
    94                 serial_mat=value->ToSerial();
    95                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    96                 memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    97                 memcpy(marshalled_dataset,serial_mat,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
    98         }
    99         else{
    100                 M=0;
    101                 N=0;
    102                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    103                 memcpy(marshalled_dataset,&N,sizeof(N));marshalled_dataset+=sizeof(N);
    104         }
    105        
    106         /*Free ressources:*/
    107         xfree((void**)&serial_mat);
    108 
    109         /*return:*/
    110         *pmarshalled_dataset=marshalled_dataset;
    111 }
    112 /*}}}*/
    113 /*FUNCTION MatrixParam::MarshallSize{{{1*/
    114 int   MatrixParam::MarshallSize(){
    115 
    116         int M=0;
    117         int N=0;
    118         if(value)value->GetSize(&M,&N);
    119                        
    120         return sizeof(M)+
    121                 sizeof(N)+
    122                 M*N*sizeof(double)+
    123                 +sizeof(enum_type)+
    124                 +sizeof(int); //sizeof(int) for enum value
    125 }
    126 /*}}}*/
    127 /*FUNCTION MatrixParam::Demarshall{{{1*/
    128 void  MatrixParam::Demarshall(char** pmarshalled_dataset){
    129 
    130         char* marshalled_dataset=NULL;
    131         int   M,N;
    132         double* serial_mat=NULL;
    133 
    134         /*recover marshalled_dataset: */
    135         marshalled_dataset=*pmarshalled_dataset;
    136 
    137         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    138          *object data (thanks to DataSet::Demarshall):*/
    139         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    140        
    141         /*data: */
    142         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    143         memcpy(&N,marshalled_dataset,sizeof(N));marshalled_dataset+=sizeof(N);
    144         if(M!=0 && N!=0){
    145                 serial_mat=(double*)xmalloc(M*N*sizeof(double));
    146                 memcpy(serial_mat,marshalled_dataset,M*N*sizeof(double));marshalled_dataset+=(M*N*sizeof(double));
    147                 value=new Matrix(serial_mat,M,N,.001);
    148         }
    149         else{
    150                 value=NULL;
    151         }
    152 
    153         /*Free ressources:*/
    154         xfree((void**)&serial_mat);
    155 
    156         /*return: */
    157         *pmarshalled_dataset=marshalled_dataset;
    158 }
    159 /*}}}*/
    160 #endif
    16172/*FUNCTION MatrixParam::ObjectEnum{{{1*/
    16273int MatrixParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/MatrixParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/Param.h

    r12011 r12014  
    1414#else
    1515#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    16 #endif
    17 
    18 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    19 #include <mex.h>
    2016#endif
    2117
  • issm/trunk-jpl/src/c/objects/Params/StringArrayParam.cpp

    r12011 r12014  
    9292}
    9393/*}}}*/
    94 #ifdef _SERIAL_
    95 /*FUNCTION StringArrayParam::Marshall{{{1*/
    96 void  StringArrayParam::Marshall(char** pmarshalled_dataset){
    97 
    98         int   i;
    99         char* marshalled_dataset=NULL;
    100         int   enum_value=0;
    101         int   stringsize;
    102         char* string=NULL;
    103 
    104         /*recover marshalled_dataset: */
    105         marshalled_dataset=*pmarshalled_dataset;
    106 
    107         /*get enum value of StringArrayParam: */
    108         enum_value=StringArrayParamEnum;
    109        
    110         /*marshall enum: */
    111         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    112        
    113         /*marshall data: */
    114         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    115         memcpy(marshalled_dataset,&numstrings,sizeof(numstrings));marshalled_dataset+=sizeof(numstrings);
    116         for(i=0;i<numstrings;i++){
    117                 string=this->value[i];
    118                 stringsize=strlen(string)+1;
    119                
    120                 memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
    121                 memcpy(marshalled_dataset,string,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    122         }
    123 
    124         *pmarshalled_dataset=marshalled_dataset;
    125 }
    126 /*}}}*/
    127 /*FUNCTION StringArrayParam::MarshallSize{{{1*/
    128 int   StringArrayParam::MarshallSize(){
    129 
    130         int i;
    131         int marshallsize=0;
    132         int stringsize;
    133         char* string=NULL;
    134 
    135         marshallsize+=sizeof(numstrings);
    136 
    137         for(i=0;i<numstrings;i++){
    138                 string=this->value[i];
    139                 stringsize=strlen(string)+1;
    140                 marshallsize+=sizeof(stringsize);
    141                 marshallsize+=stringsize*sizeof(char);
    142         }
    143        
    144         marshallsize+=sizeof(enum_type);
    145         marshallsize+=sizeof(int); //sizeof(int) for enum value
    146 
    147         return marshallsize;
    148 }
    149 /*}}}*/
    150 /*FUNCTION StringArrayParam::Demarshall{{{1*/
    151 void  StringArrayParam::Demarshall(char** pmarshalled_dataset){
    152 
    153         char* marshalled_dataset=NULL;
    154         int   i;
    155         int   stringsize;
    156         char* string=NULL;
    157 
    158         /*recover marshalled_dataset: */
    159         marshalled_dataset=*pmarshalled_dataset;
    160 
    161         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    162          *object data (thanks to DataSet::Demarshall):*/
    163         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    164 
    165         memcpy(&numstrings,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    166         if(numstrings){
    167                 this->value=(char**)xmalloc(numstrings*sizeof(char*));
    168 
    169                 for(i=0;i<numstrings;i++){
    170                         memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    171 
    172                         string=(char*)xmalloc(stringsize*sizeof(char));
    173                         memcpy(string,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    174 
    175                         this->value[i]=string;
    176                 }
    177         }
    178         else this->value=NULL;
    179 
    180         /*return: */
    181         *pmarshalled_dataset=marshalled_dataset;
    182         return;
    183 }
    184 /*}}}*/
    185 #endif
    18694/*FUNCTION StringArrayParam::ObjectEnum{{{1*/
    18795int StringArrayParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/StringArrayParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4440                int   Id();
    4541                int   MyRank();
    46                 #ifdef _SERIAL_
    47                 void  Marshall(char** pmarshalled_dataset);
    48                 int   MarshallSize();
    49                 void  Demarshall(char** pmarshalled_dataset);
    50                 #endif
    5142                int   ObjectEnum();
    5243                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/StringParam.cpp

    r12011 r12014  
    6464}
    6565/*}}}*/
    66 #ifdef _SERIAL_
    67 /*FUNCTION StringParam::Marshall{{{1*/
    68 void  StringParam::Marshall(char** pmarshalled_dataset){
    69 
    70         char* marshalled_dataset=NULL;
    71         int   enum_value=0;
    72         int   stringsize;
    73 
    74         /*recover marshalled_dataset: */
    75         marshalled_dataset=*pmarshalled_dataset;
    76 
    77         /*get enum value of StringParam: */
    78         enum_value=StringParamEnum;
    79        
    80         /*marshall enum: */
    81         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    82 
    83         /*marshall data: */
    84         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    85         stringsize=strlen(this->value)+1;
    86        
    87         memcpy(marshalled_dataset,&stringsize,sizeof(stringsize));marshalled_dataset+=sizeof(stringsize);
    88         memcpy(marshalled_dataset,this->value,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    89 
    90         *pmarshalled_dataset=marshalled_dataset;
    91 }
    92 /*}}}*/
    93 /*FUNCTION StringParam::MarshallSize{{{1*/
    94 int   StringParam::MarshallSize(){
    95 
    96         int stringsize;
    97         stringsize=strlen(this->value)+1;
    98        
    99         return sizeof(int)+
    100                 stringsize*sizeof(char)+
    101                 sizeof(enum_type)+
    102                 sizeof(int); //sizeof(int) for enum value
    103 }
    104 /*}}}*/
    105 /*FUNCTION StringParam::Demarshall{{{1*/
    106 void  StringParam::Demarshall(char** pmarshalled_dataset){
    107 
    108         char* marshalled_dataset=NULL;
    109         int   i;
    110         int   stringsize;
    111 
    112         /*recover marshalled_dataset: */
    113         marshalled_dataset=*pmarshalled_dataset;
    114 
    115         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    116          *object data (thanks to DataSet::Demarshall):*/
    117         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    118 
    119         memcpy(&stringsize,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
    120        
    121         this->value=(char*)xmalloc(stringsize*sizeof(char));
    122         memcpy(this->value,marshalled_dataset,stringsize*sizeof(char));marshalled_dataset+=stringsize*sizeof(char);
    123 
    124         /*return: */
    125         *pmarshalled_dataset=marshalled_dataset;
    126         return;
    127 }
    128 /*}}}*/
    129 #endif
    13066/*FUNCTION StringParam::ObjectEnum{{{1*/
    13167int StringParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/StringParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
  • issm/trunk-jpl/src/c/objects/Params/VectorParam.cpp

    r12011 r12014  
    7272}
    7373/*}}}*/
    74 #ifdef _SERIAL_
    75 /*FUNCTION VectorParam::Marshall{{{1*/
    76 void  VectorParam::Marshall(char** pmarshalled_dataset){
    77 
    78         char* marshalled_dataset=NULL;
    79         int   enum_value=0;
    80         int   M;
    81         double* serial_value=NULL;
    82 
    83         /*recover marshalled_dataset: */
    84         marshalled_dataset=*pmarshalled_dataset;
    85 
    86         /*get enum value of VectorParam: */
    87         enum_value=VectorParamEnum;
    88        
    89         /*marshall enum: */
    90         memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
    91        
    92         /*marshall VectorParam data: */
    93         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    94         if(value){
    95                 value->GetSize(&M);
    96                 serial_value=value->ToMPISerial();
    97                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    98                 memcpy(marshalled_dataset,serial_value,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    99         }
    100         else{
    101                 M=0;
    102                 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M);
    103         }
    104         /*Free ressources:*/
    105         xfree((void**)&serial_value);
    106 
    107         /*return:*/
    108         *pmarshalled_dataset=marshalled_dataset;
    109 }
    110 /*}}}*/
    111 /*FUNCTION VectorParam::MarshallSize{{{1*/
    112 int   VectorParam::MarshallSize(){
    113 
    114         int M=0;
    115         if(value)value->GetSize(&M);
    116 
    117         return sizeof(M)+M*sizeof(double)
    118                 +sizeof(enum_type)+
    119                 +sizeof(int); //sizeof(int) for enum value
    120 }
    121 /*}}}*/
    122 /*FUNCTION VectorParam::Demarshall{{{1*/
    123 void  VectorParam::Demarshall(char** pmarshalled_dataset){
    124 
    125         char* marshalled_dataset=NULL;
    126         int   i;
    127         double* serial_vec=NULL;
    128         int   M;
    129 
    130         /*recover marshalled_dataset: */
    131         marshalled_dataset=*pmarshalled_dataset;
    132 
    133         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    134          *object data (thanks to DataSet::Demarshall):*/
    135         memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    136        
    137         /*data: */
    138        
    139         memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M);
    140         if(M){
    141                 serial_vec=(double*)xmalloc(M*sizeof(double));
    142                 memcpy(serial_vec,marshalled_dataset,M*sizeof(double));marshalled_dataset+=(M*sizeof(double));
    143 
    144                 value=new Vector(serial_vec,M);
    145         }
    146         else{
    147                 value=NULL;
    148         }
    149 
    150         /*Free ressources:*/
    151         xfree((void**)&serial_vec);
    152 
    153         /*return: */
    154         *pmarshalled_dataset=marshalled_dataset;
    155 }
    156 /*}}}*/
    157 #endif
    15874/*FUNCTION VectorParam::ObjectEnum{{{1*/
    15975int VectorParam::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Params/VectorParam.h

    r12011 r12014  
    1313#else
    1414#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    15 #endif
    16 
    17 #if defined(_HAVE_MATLAB_) && defined(_SERIAL_)
    18 #include <mex.h>
    1915#endif
    2016
     
    4238                int   Id();
    4339                int   MyRank();
    44                 #ifdef _SERIAL_
    45                 void  Marshall(char** pmarshalled_dataset);
    46                 int   MarshallSize();
    47                 void  Demarshall(char** pmarshalled_dataset);
    48                 #endif
    4940                int   ObjectEnum();
    5041                Object* copy();
  • issm/trunk-jpl/src/c/objects/Patch.cpp

    r11399 r12014  
    122122        MPI_Status  status;
    123123
    124         #ifdef _SERIAL_
    125         return; //nothing to be done
    126         #endif
    127        
    128124        /*First, figure out total number of rows combining all the cpus: */
    129125        MPI_Reduce(&this->numrows,&total_numrows,1,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD );
  • issm/trunk-jpl/src/c/objects/Segment.cpp

    r9883 r12014  
    7171}
    7272/*}}}*/
    73 #ifdef _SERIAL_
    74 /*FUNCTION Segment::Marshall{{{1*/
    75 void  Segment::Marshall(char** pmarshalled_dataset){
    76 
    77         _error_(" not supported yet!");
    78 }
    79 /*}}}*/
    80 /*FUNCTION Segment::MarshallSize{{{1*/
    81 int   Segment::MarshallSize(){
    82         _error_(" not supported yet!");
    83 }
    84 /*}}}*/
    85 /*FUNCTION Segment::Demarshall{{{1*/
    86 void  Segment::Demarshall(char** pmarshalled_dataset){
    87         _error_(" not supported yet!");
    88 }
    89 /*}}}*/
    90 #endif
    9173/*FUNCTION Segment::ObjectEnum{{{1*/
    9274int Segment::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Segment.h

    r9883 r12014  
    3030                int   Id();
    3131                int   MyRank();
    32                 #ifdef _SERIAL_
    33                 void  Marshall(char** pmarshalled_dataset);
    34                 int   MarshallSize();
    35                 void  Demarshall(char** pmarshalled_dataset);
    36                 #endif
    3732                int   ObjectEnum();
    3833                Object* copy();
  • issm/trunk-jpl/src/c/objects/Vertex.cpp

    r11695 r12014  
    9292}
    9393/*}}}*/
    94 #ifdef _SERIAL_
    95 /*FUNCTION Vertex::Marshall {{{1*/
    96 void  Vertex::Marshall(char** pmarshalled_dataset){
    97 
    98         char* marshalled_dataset=NULL;
    99         int   enum_type=0;
    100 
    101         /*recover marshalled_dataset: */
    102         marshalled_dataset=*pmarshalled_dataset;
    103 
    104         /*get enum type of Vertex: */
    105         enum_type=VertexEnum;
    106 
    107         /*marshall enum: */
    108         memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
    109 
    110         /*marshall Vertex data: */
    111         memcpy(marshalled_dataset,&id,sizeof(id));marshalled_dataset+=sizeof(id);
    112         memcpy(marshalled_dataset,&sid,sizeof(sid));marshalled_dataset+=sizeof(sid);
    113         memcpy(marshalled_dataset,&x,sizeof(x));marshalled_dataset+=sizeof(x);
    114         memcpy(marshalled_dataset,&y,sizeof(y));marshalled_dataset+=sizeof(y);
    115         memcpy(marshalled_dataset,&z,sizeof(z));marshalled_dataset+=sizeof(z);
    116         memcpy(marshalled_dataset,&sigma,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
    117         memcpy(marshalled_dataset,&connectivity,sizeof(connectivity));marshalled_dataset+=sizeof(connectivity);
    118         memcpy(marshalled_dataset,&dof,sizeof(dof));marshalled_dataset+=sizeof(dof);
    119         memcpy(marshalled_dataset,&clone,sizeof(clone));marshalled_dataset+=sizeof(clone);
    120 
    121         *pmarshalled_dataset=marshalled_dataset;
    122         return;
    123 }
    124 /*}}}*/
    125 /*FUNCTION Vertex::MarshallSize {{{1*/
    126 int   Vertex::MarshallSize(){
    127        
    128         return sizeof(id)+
    129                 sizeof(sid)+
    130                 sizeof(x)+
    131                 sizeof(y)+
    132                 sizeof(z)+
    133                 sizeof(sigma)+
    134                 sizeof(connectivity)+
    135                 sizeof(dof)+
    136                 sizeof(clone)+
    137                 +sizeof(int); //sizeof(int) for enum type
    138 }
    139 /*}}}*/
    140 /*FUNCTION Vertex::Demarshall {{{1*/
    141 void  Vertex::Demarshall(char** pmarshalled_dataset){
    142 
    143         char* marshalled_dataset=NULL;
    144         int   i;
    145 
    146         /*recover marshalled_dataset: */
    147         marshalled_dataset=*pmarshalled_dataset;
    148 
    149         /*this time, no need to get enum type, the pointer directly points to the beginning of the
    150          *object data (thanks to DataSet::Demarshall):*/
    151 
    152         memcpy(&id,marshalled_dataset,sizeof(id));marshalled_dataset+=sizeof(id);
    153         memcpy(&sid,marshalled_dataset,sizeof(sid));marshalled_dataset+=sizeof(sid);
    154         memcpy(&x,marshalled_dataset,sizeof(x));marshalled_dataset+=sizeof(x);
    155         memcpy(&y,marshalled_dataset,sizeof(y));marshalled_dataset+=sizeof(y);
    156         memcpy(&z,marshalled_dataset,sizeof(z));marshalled_dataset+=sizeof(z);
    157         memcpy(&sigma,marshalled_dataset,sizeof(sigma));marshalled_dataset+=sizeof(sigma);
    158         memcpy(&connectivity,marshalled_dataset,sizeof(connectivity));marshalled_dataset+=sizeof(connectivity);
    159         memcpy(&dof,marshalled_dataset,sizeof(dof));marshalled_dataset+=sizeof(dof);
    160         memcpy(&clone,marshalled_dataset,sizeof(clone));marshalled_dataset+=sizeof(clone);
    161 
    162         /*return: */
    163         *pmarshalled_dataset=marshalled_dataset;
    164         return;
    165 }
    166 /*}}}*/
    167 #endif
    16894/*FUNCTION Vertex::ObjectEnum{{{1*/
    16995int Vertex::ObjectEnum(void){
  • issm/trunk-jpl/src/c/objects/Vertex.h

    r11695 r12014  
    4747                int   Id();
    4848                int   MyRank();
    49                 #ifdef _SERIAL_
    50                 void  Marshall(char** pmarshalled_dataset);
    51                 int   MarshallSize();
    52                 void  Demarshall(char** pmarshalled_dataset);
    53                 #endif
    5449                int   ObjectEnum();
    5550                Object* copy();
Note: See TracChangeset for help on using the changeset viewer.