Changeset 25497
- Timestamp:
- 08/28/20 11:24:57 (5 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r25486 r25497 2243 2243 2244 2244 _assert_(this); 2245 if(marshall_direction==MARSHALLING_ BACKWARD){2245 if(marshall_direction==MARSHALLING_LOAD){ 2246 2246 nodes = NULL; 2247 2247 } -
issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
r23644 r25497 75 75 76 76 /*preliminary, before marshall starts: */ 77 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction==MARSHALLING_SIZE){77 if(marshall_direction==MARSHALLING_WRITE || marshall_direction==MARSHALLING_SIZE){ 78 78 if(this->hneighbors)hneighbors_null=false; 79 79 if(this->hnodes){ … … 94 94 MARSHALLING_DYNAMIC(hnodesi_null,bool,numanalyses); 95 95 96 if(marshall_direction==MARSHALLING_ BACKWARD){96 if(marshall_direction==MARSHALLING_LOAD){ 97 97 98 98 if (!hnodes_null)this->hnodes = new Hook*[numanalyses]; -
issm/trunk-jpl/src/c/classes/ExternalResults/GenericExternalResult.h
r24053 r25497 62 62 /*Marshal result name*/ 63 63 int size = 0; 64 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction == MARSHALLING_SIZE) size=strlen(result_name)+1;64 if(marshall_direction==MARSHALLING_WRITE || marshall_direction == MARSHALLING_SIZE) size=strlen(result_name)+1; 65 65 MARSHALLING(size); 66 66 MARSHALLING_DYNAMIC(result_name,char,size); … … 69 69 this->value=0; 70 70 bool isnull=true; 71 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction == MARSHALLING_SIZE){71 if(marshall_direction==MARSHALLING_WRITE || marshall_direction == MARSHALLING_SIZE){ 72 72 if(value) isnull=false; 73 73 } … … 347 347 int size = 0; 348 348 349 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1;349 if(marshall_direction==MARSHALLING_WRITE || marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1; 350 350 351 351 MARSHALLING(id); -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r25490 r25497 259 259 260 260 /*Marshall:*/ 261 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_ FORWARD);261 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_WRITE); 262 262 263 263 /*Reset position of buffer: */ … … 487 487 int analysis_type; 488 488 489 if(marshall_direction==MARSHALLING_ BACKWARD){489 if(marshall_direction==MARSHALLING_LOAD){ 490 490 delete this->materials; 491 491 delete this->parameters; … … 531 531 this->elements->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 532 532 533 if(marshall_direction==MARSHALLING_ BACKWARD){533 if(marshall_direction==MARSHALLING_LOAD){ 534 534 this->constraints_list = xNew<Constraints*>(this->nummodels); 535 535 for(i=0;i<nummodels;i++) this->constraints_list[i] = new Constraints(); … … 546 546 } 547 547 548 if(marshall_direction==MARSHALLING_ BACKWARD){548 if(marshall_direction==MARSHALLING_LOAD){ 549 549 /*reset hooks for elements, loads and nodes:*/ 550 550 this->elements->ResetHooks(); … … 609 609 610 610 /*Create new FemModel by demarshalling the buffer: */ 611 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_ BACKWARD);611 this->Marshall(&femmodel_buffer,NULL,MARSHALLING_LOAD); 612 612 613 613 /*Reset position of buffer: */ -
issm/trunk-jpl/src/c/classes/Hook.cpp
r25363 r25497 122 122 void Hook::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 123 123 124 if(marshall_direction==MARSHALLING_ BACKWARD) reset();124 if(marshall_direction==MARSHALLING_LOAD) reset(); 125 125 126 126 MARSHALLING_ENUM(HookEnum); -
issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
r25379 r25497 89 89 MARSHALLING(this->numberofvertices_local); 90 90 MARSHALLING_DYNAMIC(ids,int,numids); 91 //if (marshall_direction == MARSHALLING_ BACKWARD) inputs = new Inputs();91 //if (marshall_direction == MARSHALLING_LOAD) inputs = new Inputs(); 92 92 //inputs->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 93 93 _error_("not implemented"); -
issm/trunk-jpl/src/c/classes/Inputs/Inputs.cpp
r25406 r25497 87 87 MARSHALLING_ENUM(InputsEnum); 88 88 89 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction==MARSHALLING_SIZE){89 if(marshall_direction==MARSHALLING_WRITE || marshall_direction==MARSHALLING_SIZE){ 90 90 91 91 /*Marshall num_inputs first*/ -
issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
r25379 r25497 141 141 else this->values = NULL; 142 142 143 if(marshall_direction == MARSHALLING_ BACKWARD){143 if(marshall_direction == MARSHALLING_LOAD){ 144 144 this->element_values = xNewZeroInit<IssmDouble>(PentaRef::NumberofNodes(this->interpolation)); 145 145 } -
issm/trunk-jpl/src/c/classes/Inputs/SegInput.cpp
r25379 r25497 122 122 else this->values = NULL; 123 123 124 if(marshall_direction == MARSHALLING_ BACKWARD){124 if(marshall_direction == MARSHALLING_LOAD){ 125 125 this->element_values = xNewZeroInit<IssmDouble>(SegRef::NumberofNodes(this->interpolation)); 126 126 } -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
r25406 r25497 119 119 void TransientInput::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 120 120 121 if (marshall_direction == MARSHALLING_ BACKWARD){121 if (marshall_direction == MARSHALLING_LOAD){ 122 122 _error_("not implmented"); 123 123 //inputs = new Inputs(); -
issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
r25379 r25497 127 127 else this->values = NULL; 128 128 129 if(marshall_direction == MARSHALLING_ BACKWARD){129 if(marshall_direction == MARSHALLING_LOAD){ 130 130 this->element_values = xNewZeroInit<IssmDouble>(TriaRef::NumberofNodes(this->interpolation)); 131 131 } -
issm/trunk-jpl/src/c/classes/Loads/Channel.cpp
r25446 r25497 155 155 MARSHALLING(S); 156 156 157 if(marshall_direction==MARSHALLING_ BACKWARD){157 if(marshall_direction==MARSHALLING_LOAD){ 158 158 this->hnodes = new Hook(); 159 159 this->hvertices = new Hook(); -
issm/trunk-jpl/src/c/classes/Loads/Moulin.cpp
r25386 r25497 117 117 MARSHALLING(id); 118 118 119 if(marshall_direction==MARSHALLING_ BACKWARD){119 if(marshall_direction==MARSHALLING_LOAD){ 120 120 this->hnode = new Hook(); 121 121 this->hvertex = new Hook(); -
issm/trunk-jpl/src/c/classes/Loads/Neumannflux.cpp
r25446 r25497 133 133 MARSHALLING(id); 134 134 135 if(marshall_direction==MARSHALLING_ BACKWARD){135 if(marshall_direction==MARSHALLING_LOAD){ 136 136 this->hnodes = new Hook(); 137 137 this->hvertices = new Hook(); -
issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
r25446 r25497 211 211 MARSHALLING(flux_degree); 212 212 213 if(marshall_direction==MARSHALLING_ BACKWARD){213 if(marshall_direction==MARSHALLING_LOAD){ 214 214 this->hnodes = new Hook(); 215 215 this->hvertices = new Hook(); -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
r25386 r25497 127 127 MARSHALLING(id); 128 128 129 if(marshall_direction==MARSHALLING_ BACKWARD){129 if(marshall_direction==MARSHALLING_LOAD){ 130 130 this->hnode = new Hook(); 131 131 this->helement = new Hook(); -
issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp
r25386 r25497 92 92 MARSHALLING(id); 93 93 94 if(marshall_direction==MARSHALLING_ BACKWARD){94 if(marshall_direction==MARSHALLING_LOAD){ 95 95 this->hnodes = new Hook(); 96 96 } -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
r25386 r25497 200 200 MARSHALLING(shelf); 201 201 202 if(marshall_direction==MARSHALLING_ BACKWARD){202 if(marshall_direction==MARSHALLING_LOAD){ 203 203 this->hnodes = new Hook(); 204 204 this->hvertices = new Hook(); -
issm/trunk-jpl/src/c/classes/Materials/Matestar.cpp
r25379 r25497 103 103 void Matestar::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 104 104 105 if(marshall_direction==MARSHALLING_ BACKWARD)helement=new Hook();105 if(marshall_direction==MARSHALLING_LOAD)helement=new Hook(); 106 106 107 107 MARSHALLING_ENUM(MatestarEnum); -
issm/trunk-jpl/src/c/classes/Materials/Matice.cpp
r25379 r25497 161 161 void Matice::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 162 162 163 if(marshall_direction==MARSHALLING_ BACKWARD)helement=new Hook();163 if(marshall_direction==MARSHALLING_LOAD)helement=new Hook(); 164 164 165 165 MARSHALLING_ENUM(MaticeEnum); -
issm/trunk-jpl/src/c/classes/Nodes.cpp
r24681 r25497 117 117 DataSet::Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction); 118 118 119 if(marshall_direction == MARSHALLING_ BACKWARD){119 if(marshall_direction == MARSHALLING_LOAD){ 120 120 this->common_recv_ids = xNew<int*>(num_procs); 121 121 this->common_send_ids = xNew<int*>(num_procs); -
issm/trunk-jpl/src/c/classes/Params/DataSetParam.cpp
r23066 r25497 54 54 void DataSetParam::Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction){ /*{{{*/ 55 55 56 if(marshall_direction==MARSHALLING_ BACKWARD)value=new DataSet();56 if(marshall_direction==MARSHALLING_LOAD)value=new DataSet(); 57 57 58 58 MARSHALLING_ENUM(DataSetParamEnum); -
issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.cpp
r23066 r25497 125 125 MARSHALLING_DYNAMIC(mdim_array,int,M); 126 126 MARSHALLING_DYNAMIC(ndim_array,int,M); 127 if(marshall_direction==MARSHALLING_ BACKWARD && M) array=xNew<IssmDouble*>(M);127 if(marshall_direction==MARSHALLING_LOAD && M) array=xNew<IssmDouble*>(M); 128 128 for(int i=0;i<M;i++){ 129 129 MARSHALLING_DYNAMIC(array[i],IssmDouble,mdim_array[i]*ndim_array[i]); -
issm/trunk-jpl/src/c/classes/Params/FileParam.cpp
r20827 r25497 55 55 MARSHALLING(value); 56 56 57 if(marshall_direction==MARSHALLING_ BACKWARD) value=NULL; //meaningless file pointer!57 if(marshall_direction==MARSHALLING_LOAD) value=NULL; //meaningless file pointer! 58 58 59 59 } -
issm/trunk-jpl/src/c/classes/Params/Parameters.cpp
r25317 r25497 118 118 MARSHALLING_ENUM(ParametersEnum); 119 119 120 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction==MARSHALLING_SIZE){120 if(marshall_direction==MARSHALLING_WRITE || marshall_direction==MARSHALLING_SIZE){ 121 121 122 122 /*Marshall num_params first*/ -
issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp
r23066 r25497 77 77 int* sizes=NULL; 78 78 79 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction==MARSHALLING_SIZE){79 if(marshall_direction==MARSHALLING_WRITE || marshall_direction==MARSHALLING_SIZE){ 80 80 if(numstrings)sizes=xNew<int>(numstrings); 81 81 for(int i=0;i<numstrings;i++)sizes[i]=strlen(value[i])+1; … … 89 89 if(numstrings){ 90 90 MARSHALLING_DYNAMIC(sizes,int,numstrings); 91 if(marshall_direction==MARSHALLING_ BACKWARD) value=xNew<char*>(numstrings);91 if(marshall_direction==MARSHALLING_LOAD) value=xNew<char*>(numstrings); 92 92 for(int i=0;i<numstrings;i++)MARSHALLING_DYNAMIC(value[i],char,sizes[i]); 93 93 } -
issm/trunk-jpl/src/c/classes/Params/StringParam.cpp
r23066 r25497 54 54 int size = 0; 55 55 56 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1;56 if(marshall_direction==MARSHALLING_WRITE || marshall_direction == MARSHALLING_SIZE)size=strlen(value)+1; 57 57 58 58 MARSHALLING_ENUM(StringParamEnum); -
issm/trunk-jpl/src/c/classes/Params/TransientArrayParam.cpp
r25481 r25497 81 81 MARSHALLING(M); 82 82 MARSHALLING(N); 83 if(marshall_direction==MARSHALLING_ BACKWARD){83 if(marshall_direction==MARSHALLING_LOAD){ 84 84 values = xNew<IssmDouble>(M*N); 85 85 timesteps = xNew<IssmDouble>(N); -
issm/trunk-jpl/src/c/classes/Params/TransientParam.cpp
r25481 r25497 75 75 MARSHALLING(interpolation); 76 76 MARSHALLING(N); 77 if(marshall_direction==MARSHALLING_ BACKWARD){77 if(marshall_direction==MARSHALLING_LOAD){ 78 78 values=xNew<IssmDouble>(N); 79 79 timesteps=xNew<IssmDouble>(N); -
issm/trunk-jpl/src/c/classes/Vertices.cpp
r24335 r25497 122 122 MARSHALLING_DYNAMIC(this->common_recv,int,num_procs); 123 123 MARSHALLING_DYNAMIC(this->common_send,int,num_procs); 124 if(marshall_direction == MARSHALLING_ BACKWARD){124 if(marshall_direction == MARSHALLING_LOAD){ 125 125 this->common_recv_ids = xNew<int*>(num_procs); 126 126 this->common_send_ids = xNew<int*>(num_procs); -
issm/trunk-jpl/src/c/cores/transient_core.cpp
r25476 r25497 53 53 #if defined(_HAVE_BAMG_) && !defined(_HAVE_AD_) 54 54 if(amr_frequency){ 55 56 57 55 femmodel->parameters->FindParam(&amr_restart,AmrRestartEnum); 56 if(amr_restart) femmodel->ReMesh(); 57 } 58 58 #endif 59 59 … … 325 325 double *Xb = xNewZeroInit<double>(Xsize); 326 326 double *Yb = xNewZeroInit<double>(Ysize); 327 double *Yin = xNewZeroInit<double>(Ysize);327 int *Yin = xNewZeroInit<int>(Ysize); 328 328 329 329 /*Start tracing*/ … … 400 400 xDelete<IssmDouble>(Y); 401 401 xDelete<double>(Yb); 402 xDelete< double>(Yin);402 xDelete<int>(Yin); 403 403 }/*}}}*/ 404 404 #endif -
issm/trunk-jpl/src/c/datastructures/DataSet.cpp
r24379 r25497 98 98 int i; 99 99 100 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction==MARSHALLING_SIZE){100 if(marshall_direction==MARSHALLING_WRITE || marshall_direction==MARSHALLING_SIZE){ 101 101 obj_size=objects.size(); 102 102 } … … 112 112 113 113 /*Now branch according to direction of marshalling: */ 114 if(marshall_direction==MARSHALLING_ FORWARD|| marshall_direction==MARSHALLING_SIZE){114 if(marshall_direction==MARSHALLING_WRITE || marshall_direction==MARSHALLING_SIZE){ 115 115 if(!(this->sorted && numsorted>0 && this->id_offsets)){ 116 116 sorted_ids=NULL; -
issm/trunk-jpl/src/c/shared/io/Marshalling/Marshalling.h
r25481 r25497 7 7 8 8 enum marshall_directions{ 9 MARSHALLING_ FORWARD,10 MARSHALLING_ BACKWARD,9 MARSHALLING_WRITE, 10 MARSHALLING_LOAD, 11 11 MARSHALLING_SIZE 12 12 }; … … 14 14 #define MARSHALLING_ENUM(EN)\ 15 15 int type_enum=EN;\ 16 if(marshall_direction==MARSHALLING_ FORWARD){\16 if(marshall_direction==MARSHALLING_WRITE){\ 17 17 memcpy(*pmarshalled_data,&type_enum,sizeof(int));\ 18 18 *pmarshalled_data+=sizeof(int);\ … … 21 21 *pmarshalled_data_size+=sizeof(int);\ 22 22 }\ 23 else if(marshall_direction==MARSHALLING_ BACKWARD){\23 else if(marshall_direction==MARSHALLING_LOAD){\ 24 24 *pmarshalled_data+=sizeof(int);\ 25 25 }\ … … 29 29 #define MARSHALLING(FIELD)\ 30 30 \ 31 if(marshall_direction==MARSHALLING_ FORWARD){\31 if(marshall_direction==MARSHALLING_WRITE){\ 32 32 memcpy(*pmarshalled_data,&FIELD,sizeof(FIELD));\ 33 33 *pmarshalled_data+=sizeof(FIELD);\ … … 36 36 *pmarshalled_data_size+=sizeof(FIELD);\ 37 37 }\ 38 else if(marshall_direction==MARSHALLING_ BACKWARD){\38 else if(marshall_direction==MARSHALLING_LOAD){\ 39 39 memcpy(&FIELD,*pmarshalled_data,sizeof(FIELD));\ 40 40 *pmarshalled_data+=sizeof(FIELD);\ … … 51 51 \ 52 52 if(!field_null){\ 53 if(marshall_direction==MARSHALLING_ FORWARD){\53 if(marshall_direction==MARSHALLING_WRITE){\ 54 54 memcpy(*pmarshalled_data,FIELD,SIZE*sizeof(TYPE));\ 55 55 *pmarshalled_data+=SIZE*sizeof(TYPE);\ … … 58 58 *pmarshalled_data_size+=SIZE*sizeof(TYPE);\ 59 59 }\ 60 else if(marshall_direction==MARSHALLING_ BACKWARD){\60 else if(marshall_direction==MARSHALLING_LOAD){\ 61 61 FIELD=xNew<TYPE>(SIZE);\ 62 62 memcpy(FIELD,*pmarshalled_data,SIZE*sizeof(TYPE));\
Note:
See TracChangeset
for help on using the changeset viewer.