Changeset 8330 for issm/trunk/src/c/io


Ignore:
Timestamp:
05/17/11 16:05:50 (14 years ago)
Author:
Eric.Larour
Message:

Serial and parallel runs now running with marshalling routines, more homogeneous

Location:
issm/trunk/src/c/io
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/io/FetchData.cpp

    r7860 r8330  
    571571#endif
    572572
    573 #if defined(_PARALLEL_) && defined(_HAVE_PETSC_)
     573#if defined(_HAVE_PETSC_)
    574574/*FUNCTION FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){{{1*/
    575575void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid){
  • issm/trunk/src/c/io/IoModelFetchData.cpp

    r6412 r8330  
    1111#include "./io.h"
    1212
    13 #ifdef _SERIAL_
    14 /***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
    15                                                                                                           Serial IoModelFetch Data Routines, all overloaded.
    16 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
    17 /*FUNCTION IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){{{1*/
    18 void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){
    19 
    20         FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name));
     13/*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name){{{1*/
     14void  IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name){
     15       
     16        FILE* fid=NULL;
     17       
     18        /*Set file pointer to beginning of the data: */
     19        fid=SetFilePointerToData(model_handle,data_name);
     20       
     21        /*Now fetch: */
     22        FetchData(pmatrix,pM,pN,fid);
    2123
    2224}
    2325/*}}}*/
    24 /*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){{{1*/
    25 void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){
     26/*FUNCTION IoModelFetchData(char** pstring,FILE* model_handle,char* data_name){{{1*/
     27void  IoModelFetchData(char** pstring,FILE* model_handle,char* data_name){
     28
     29        FILE* fid=NULL;
    2630       
    27         FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name));
    28 
     31        /*Set file pointer to beginning of the data: */
     32        fid=SetFilePointerToData(model_handle,data_name);
     33       
     34        /*Now fetch: */
     35        FetchData(pstring,fid);
    2936}
    3037/*}}}*/
    31 /*FUNCTION IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){{{1*/
    32 void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){
     38/*FUNCTION IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name){{{1*/
     39void  IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name){
     40
     41        FILE* fid=NULL;
    3342       
    34         FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name));
    35 
     43        /*Set file pointer to beginning of the data: */
     44        fid=SetFilePointerToData(model_handle,data_name);
     45       
     46        /*Now fetch: */
     47        FetchData(pscalar,fid);
    3648}
    3749/*}}}*/
    38 /*FUNCTION IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){{{1*/
    39 void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){
     50/*FUNCTION IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name){{{1*/
     51void  IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name){
     52
     53        FILE* fid=NULL;
    4054       
    41         FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name));
    42 
     55        /*Set file pointer to beginning of the data: */
     56        fid=SetFilePointerToData(model_handle,data_name);
     57       
     58        /*Now fetch: */
     59        FetchData(pinteger,fid);
    4360}
    4461/*}}}*/
    45 /*FUNCTION IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){{{1*/
    46 void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){
    47        
    48         FetchData(pvector,mxGetAssignedField(model_handle,0,data_name));
    49 
    50 }
    51 /*}}}*/
    52 /*FUNCTION IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){{{1*/
    53 void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
    54        
    55         FetchData(pstring,mxGetAssignedField(model_handle,0,data_name));
    56 
    57 }
    58 /*}}}*/
    59 /*FUNCTION IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){{{1*/
    60 void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
    61        
    62         FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name));
    63 
    64 }
    65 /*}}}*/
    66 /*FUNCTION IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){{{1*/
    67 void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
    68 
    69         FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name));
    70 }
    71 /*}}}*/
    72 #endif
    73 
    74 #ifdef _PARALLEL_
    75 /***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
    76                                                                                                           Parallel IoModelFetch Data Routines, all overloaded.
    77 **************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
    78 /*FUNCTION SetFilePointerToData(ConstDataHandle model_handle,char* data_name){{{1*/
    79 FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name){
     62/*FUNCTION SetFilePointerToData(FILE* model_handle,char* data_name){{{1*/
     63FILE* SetFilePointerToData(FILE* model_handle,char* data_name){
    8064
    8165        extern int my_rank;
     
    140124}
    141125/*}}}*/
    142 /*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){{{1*/
    143 void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name){
     126
     127#ifdef _SERIAL_
     128/***************** **************** **************** **************** **************** **************** **************** **************** **************** ****************
     129                                                                                                          Serial IoModelFetch Data Routines, all overloaded.
     130**************** **************** **************** **************** **************** **************** **************** **************** **************** *****************/
     131/*FUNCTION IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){{{1*/
     132void IoModelFetchData(DataSet** pdataset,ConstDataHandle model_handle,char* data_name){
     133
     134        FetchData(pdataset,mxGetAssignedField(model_handle,0,data_name));
     135
     136}
     137/*}}}*/
     138/*FUNCTION IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){{{1*/
     139void IoModelFetchData(double** pmatrix,int* pM,int *pN,ConstDataHandle model_handle,char* data_name){
    144140       
    145         FILE* fid=NULL;
     141        FetchData(pmatrix,pM,pN,mxGetAssignedField(model_handle,0,data_name));
     142
     143}
     144/*}}}*/
     145/*FUNCTION IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){{{1*/
     146void IoModelFetchData(Mat* pmatrix,ConstDataHandle model_handle,char* data_name){
    146147       
    147         /*Set file pointer to beginning of the data: */
    148         fid=SetFilePointerToData(model_handle,data_name);
     148        FetchData(pmatrix,mxGetAssignedField(model_handle,0,data_name));
     149
     150}
     151/*}}}*/
     152/*FUNCTION IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){{{1*/
     153void IoModelFetchData(double** pvector,int* pM,ConstDataHandle model_handle,char* data_name){
    149154       
    150         /*Now fetch: */
    151         FetchData(pmatrix,pM,pN,fid);
     155        FetchData(pvector,pM,mxGetAssignedField(model_handle,0,data_name));
     156
     157}
     158/*}}}*/
     159/*FUNCTION IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){{{1*/
     160void IoModelFetchData(Vec* pvector,ConstDataHandle model_handle,char* data_name){
     161       
     162        FetchData(pvector,mxGetAssignedField(model_handle,0,data_name));
    152163
    153164}
    154165/*}}}*/
    155166/*FUNCTION IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){{{1*/
    156 void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
     167void IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name){
     168       
     169        FetchData(pstring,mxGetAssignedField(model_handle,0,data_name));
    157170
    158         FILE* fid=NULL;
    159        
    160         /*Set file pointer to beginning of the data: */
    161         fid=SetFilePointerToData(model_handle,data_name);
    162        
    163         /*Now fetch: */
    164         FetchData(pstring,fid);
    165171}
    166172/*}}}*/
    167173/*FUNCTION IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){{{1*/
    168 void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
     174void IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name){
     175       
     176        FetchData(pscalar,mxGetAssignedField(model_handle,0,data_name));
    169177
    170         FILE* fid=NULL;
    171        
    172         /*Set file pointer to beginning of the data: */
    173         fid=SetFilePointerToData(model_handle,data_name);
    174        
    175         /*Now fetch: */
    176         FetchData(pscalar,fid);
    177178}
    178179/*}}}*/
    179180/*FUNCTION IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){{{1*/
    180 void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
     181void IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name){
    181182
    182         FILE* fid=NULL;
    183        
    184         /*Set file pointer to beginning of the data: */
    185         fid=SetFilePointerToData(model_handle,data_name);
    186        
    187         /*Now fetch: */
    188         FetchData(pinteger,fid);
     183        FetchData(pinteger,mxGetAssignedField(model_handle,0,data_name));
    189184}
    190185/*}}}*/
  • issm/trunk/src/c/io/io.h

    r7860 r8330  
    1515FILE* pfopen(char* filename,char* format);
    1616void  pfclose(FILE* fid,char* filename);
     17
     18
     19void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
     20void FetchData(char** pstring,FILE* fid);
     21void FetchData(double* pscalar,FILE* fid);
     22void FetchData(int* pinteger,FILE* fid);
     23void  IoModelFetchData(double** pmatrix,int* pM,int* pN,FILE* model_handle,char* data_name);
     24void  IoModelFetchData(char** pstring,FILE* model_handle,char* data_name);
     25void  IoModelFetchData(double* pscalar,FILE* model_handle,char* data_name);
     26void  IoModelFetchData(int* pinteger,FILE* model_handle,char* data_name);
     27FILE* SetFilePointerToData(FILE* model_handle,char* data_name);
     28
    1729
    1830#ifdef _SERIAL_
     
    7587
    7688#ifdef _PARALLEL_
    77 void FetchData(double** pmatrix, int* pM,int* pN,FILE* fid);
    78 void FetchData(char** pstring,FILE* fid);
    79 void FetchData(double* pscalar,FILE* fid);
    80 void FetchData(int* pinteger,FILE* fid);
    8189
    82 
    83 FILE* SetFilePointerToData(ConstDataHandle model_handle,char* data_name);
    84 void  IoModelFetchData(double** pmatrix,int* pM,int* pN,ConstDataHandle model_handle,char* data_name);
    85 void  IoModelFetchData(char** pstring,ConstDataHandle model_handle,char* data_name);
    86 void  IoModelFetchData(double* pscalar,ConstDataHandle model_handle,char* data_name);
    87 void  IoModelFetchData(int* pinteger,ConstDataHandle model_handle,char* data_name);
    8890
    8991void WriteData(int* pdummy,void* data,char* data_type);
    9092void WriteDataToDisk(void* data,int* pM,int* pN,char* datatype,FILE* fid);
    9193
    92 /*petsc options: */
    93 void ParsePetscOptions(Parameters* parameters, char* filename);
    9494
    9595#endif
Note: See TracChangeset for help on using the changeset viewer.