Changeset 6372


Ignore:
Timestamp:
10/21/10 12:35:35 (14 years ago)
Author:
Eric.Larour
Message:

Simplified OutputResults module. Now also handles I/O in parallel. Not tested yet in parallel.

Location:
issm/trunk
Files:
3 added
3 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Container/DataSet.h

    r4575 r6372  
    1313/*forward declarations */
    1414
    15 
    1615class Elements;
    1716class Loads;
     
    2019class Materials;
    2120class Parameters;
     21class Patch;
     22class Results;
     23class Patch;
    2224
    2325class DataSet{
     
    6264                DataSet* Copy(void);
    6365                int   DeleteObject(Object* object);
     66                Results* SpawnTriaResults(int* indices);
    6467                /*}}}*/
    6568
     
    6972DataSet* DataSetDemarshall(char* marshalled_dataset);
    7073DataSet* DataSetDemarshallRaw(char** pmarshalled_dataset);
     74       
     75
    7176
    7277#endif
  • issm/trunk/src/c/Container/Elements.cpp

    r4216 r6372  
    4242/*}}}*/
    4343
     44
     45
    4446/*Object management*/
     47/*FUNCTION Elements::ProcessResultsUnits{{{1*/
     48void Elements::ProcessResultsUnits(void){
     49
     50        int i;
     51
     52        //Process results to be output in the correct units
     53        for(i=0;i<this->Size();i++){
     54                Element* element=(Element*)this->GetObjectByOffset(i);
     55                element->ProcessResultsUnits();
     56        }
     57}
     58/*}}}*/
     59/*FUNCTION Elements::DeleteResults{{{1*/
     60void Elements::DeleteResults(void){
     61       
     62        int i;
     63
     64        for (i=0;i<this->Size();i++){
     65                Element* element=(Element*)this->GetObjectByOffset(i);
     66                element->DeleteResults();
     67        }
     68}
     69/*}}}*/
     70/*FUNCTION Elements::ToResults{{{1*/
     71void Elements::ToResults(Results* results,Parameters* parameters,int step, double time){
     72
     73        /*output: */
     74        Patch* patch=NULL;
     75
     76        /*I/O strategy: */
     77        bool   io_gather=true; //the default
     78
     79        /*Recover parameters: */
     80        parameters->FindParam(&io_gather,IoGatherEnum);
     81
     82
     83        /*create patch object out of all results in this dataset: */
     84        patch=this->ResultsToPatch();
     85
     86        /*Gather onto master cpu 0, if needed: */
     87        #ifdef _PARALLEL_
     88        if(io_gather)patch->MPI_Gather();
     89        #endif
     90       
     91        /*create result object and add to results dataset:*/
     92        if (patch->maxvertices && patch->maxnodes){
     93                results->AddObject(new IntExternalResult(results->Size()+1,PatchVerticesEnum,patch->maxvertices,step,time));
     94                results->AddObject(new IntExternalResult(results->Size()+1,PatchNodesEnum,   patch->maxnodes,step,time));
     95                results->AddObject(new DoubleMatExternalResult(results->Size()+1,PatchEnum,patch->values,patch->numrows,patch->numcols,step,time));
     96        }
     97
     98        /*Free ressources:*/
     99        delete patch;
     100
     101}
     102/*}}}*/
     103/*FUNCTION Elements::ResultsToPatch{{{1*/
     104Patch* Elements::ResultsToPatch(void){
     105
     106        /*output: */
     107        Patch* patch=NULL;
     108
     109        /*intermediary: */
     110        int i;
     111        int count;
     112        int numrows;
     113        int numvertices;
     114        int numnodes;
     115        int max_numvertices;
     116        int max_numnodes;
     117        int element_numvertices;
     118        int element_numrows;
     119        int element_numnodes;
     120
     121        /*We are going to extract from the results within the elements, the desired results , and create a table
     122         * of patch information, that will hold, for each element that computed the result that
     123         * we desire, the enum_type of the result, the step and time, the id of the element, the interpolation type, the vertices ids, and the values
     124         * at the nodes (could be different from the vertices). This will be used for visualization purposes.
     125         * For example, we could build the following patch table, for velocities:
     126         *
     127         1. on a Beam element, Vx, at step 1, time .5, element id 1, interpolation type P0 (constant), vertices ids 1 and 2, one constant value 4.5
     128         VxEnum 1  .5  1 P0  1 2       4.5 NaN  NaN
     129         2. on a Tria element, Vz, at step 2, time .8, element id 2, interpolation type P1 (linear), vertices ids 1 3 and 4, with values at 3 nodes 4.5, 3.2, 2.5
     130         VzEnum 2  .8  2 P1  1 3 4     4.5 3.2  2.5
     131         * ... etc ...
     132         *
     133         * So what do we need to build the table: the maximum number of vertices included in the table,
     134         * and the maximum number of nodal values, as well as the number of rows. Once we have that,
     135         * we ask the elements to fill their own row in the table, by looping on the elememnts.
     136         *
     137         * We will use the Patch object, which will store all of the information needed, and will be able
     138         * to output itself to disk on its own. See object/Patch.h for format of this object.*/
     139       
     140        /*First, determine maximum number of vertices, nodes, and number of results: */
     141        numrows=0;
     142        numvertices=0;
     143        numnodes=0;
     144
     145        for(i=0;i<this->Size();i++){
     146
     147                Element* element=(Element*)this->GetObjectByOffset(i);
     148                element->PatchSize(&element_numrows,&element_numvertices,&element_numnodes);
     149
     150                numrows+=element_numrows;
     151                if(element_numvertices>numvertices)numvertices=element_numvertices;
     152                if(element_numnodes>numnodes)numnodes=element_numnodes;
     153        }
     154
     155        #ifdef _PARALLEL_
     156        /*Synchronize across cluster, so as to not end up with different sizes for each patch on each cpu: */
     157        MPI_Reduce (&numvertices,&max_numvertices,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
     158        MPI_Bcast(&max_numvertices,1,MPI_INT,0,MPI_COMM_WORLD);
     159        numvertices=max_numvertices;
     160
     161        MPI_Reduce (&numnodes,&max_numnodes,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
     162        MPI_Bcast(&max_numnodes,1,MPI_INT,0,MPI_COMM_WORLD);
     163        numnodes=max_numnodes;
     164        #endif
     165
     166        /*Ok, initialize Patch object: */
     167        patch=new Patch(numrows,numvertices,numnodes);
     168
     169        /*Now, go through elements, and fill the Patch object: */
     170        count=0;
     171        for(i=0;i<this->Size();i++){
     172                Element* element=(Element*)this->GetObjectByOffset(i);
     173                element->PatchFill(&count,patch);
     174        }
     175
     176        return patch;
     177
     178}
     179/*}}}*/
  • issm/trunk/src/c/Container/Elements.h

    r4236 r6372  
    2727                /*}}}*/
    2828                /*numerics: {{{1*/
     29                void ProcessResultsUnits(void);
     30                void DeleteResults(void);
     31                void ToResults(Results* results,Parameters* parameters,int step, double time);
     32                Patch* ResultsToPatch(void);
    2933                /*}}}*/
    3034
  • issm/trunk/src/c/Container/Materials.h

    r4236 r6372  
    77
    88/*forward declarations */
    9 class Materials;
    109class Parameters;
    1110class Elements;
  • issm/trunk/src/c/Container/Results.cpp

    r4927 r6372  
    6969}
    7070/*}}}*/
     71/*FUNCTION Results::Write{{{1*/
     72#ifdef _SERIAL_
     73void Results::Write(mxArray** pdataref){
     74
     75        int i,j;
     76        int count;
     77
     78        /*output: */
     79        mxArray* dataref=NULL;
     80        mxArray* processeddataref=NULL;
     81        mwSize nfields;
     82        mwSize maxfields;
     83        mwSize nsteps;
     84        mwSize step;
     85        const char **fnames      = NULL;
     86        int         *enums       = NULL;
     87        int          baseenum;
     88        mwSize       onebyone[2] = {1,1};
     89        mwSize       ndim        = 2;
     90
     91        /*How many time steps do we have? : */
     92        nsteps=0;
     93        for(i=0;i<this->Size();i++){
     94                ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
     95                step=result->GetStep();
     96                if(step>nsteps)nsteps=step;
     97        }
     98        onebyone[0]=nsteps;
     99
     100        /*How many field names do we have. First, figure out how many result types we have: */
     101        maxfields=(mwSize)this->Size();
     102        enums=(int*)xmalloc(maxfields*sizeof(int));
     103        for(i=0;i<maxfields;i++){
     104                ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
     105                enums[i]=result->EnumType();
     106        }
     107        /*Now, make result types unique: */
     108        for(i=0;i<maxfields;i++){
     109                if(enums[i]>=0){//if <0, it means this enum was found to replicate another one previously
     110                        baseenum=enums[i];             
     111                        /*is the baseenum repeated later on?:*/
     112                        for(j=i+1;j<maxfields;j++){
     113                                if (enums[j]==baseenum)enums[j]=-1;
     114                        }
     115                }
     116                else continue;
     117        }
     118
     119        /*Now, go through enums, and whatever is not null is a non repeated field name: */
     120        nfields=0;
     121        for(i=0;i<maxfields;i++)if(enums[i]>0)nfields++;
     122
     123        /*Add 2 fields for time and step: */
     124        nfields=nfields+2;
     125       
     126        /*Fill the names of the structure field: */
     127        fnames=(const char**)xmalloc(nfields*sizeof(char*));
     128        count=0;
     129        for(i=0;i<maxfields;i++){
     130                if (enums[i]>0){
     131                        fnames[count]=EnumToString(enums[i]);
     132                        count++;
     133                }
     134        }
     135        /*don't forget the extra fields "time" and "step":*/
     136        fnames[nfields-2]="time";
     137        fnames[nfields-1]="step";
     138
     139        /*Initialize structure: */
     140        dataref=mxCreateStructArray( ndim,onebyone,nfields,fnames);
     141
     142        /*Fill each field: */
     143        for(i=0;i<nfields-2;i++){ //do not include the last one used for time
     144                ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
     145                result->SetMatlabField(dataref);
     146        }
     147
     148        /*Now, process the patch in the dataref structure, by calling MatlabProcessPatch.m
     149         *on the current dataref structure: */
     150        mexCallMATLAB(1,&processeddataref,1,&dataref, "MatlabProcessPatch");
     151
     152        /*Assign output pointers:*/
     153        *pdataref=processeddataref;
     154}
     155#else
     156void Results::Write(Parameters* parameters){
     157       
     158        int         i;
     159        FILE       *fid          = NULL;
     160
     161        /*Recover file descriptor: */
     162        parameters->FindParam(&fid,OutputFilePointerEnum);
     163
     164        for(i=0;i<this->Size();i++){
     165
     166                ExternalResult* result=(ExternalResult*)this->GetObjectByOffset(i);
     167
     168                /*write result to disk: */
     169                result->WriteData(fid);
     170
     171        }
     172
     173}
     174#endif
     175/*}}}*/
  • issm/trunk/src/c/Container/Results.h

    r4927 r6372  
    2727                /*numerics: {{{1*/
    2828                Results* SpawnTriaResults(int* indices);
     29                #ifdef _SERIAL_
     30                void Write(mxArray** pdataref);
     31                #else
     32                void Write(Parameters* parameters);
     33                #endif
    2934                /*}}}*/
    30 
    3135};
    32 
    33 
    34 
    3536#endif //ifndef _RESULTS_H_
    3637
  • issm/trunk/src/c/Container/Vertices.h

    r6231 r6372  
    88/*forward declarations */
    99class Materials;
    10 class Parameters;
    1110class Elements;
    1211class Vertices;
  • issm/trunk/src/c/Makefile.am

    r6273 r6372  
    415415                                        ./modules/OutputResultsx/OutputResultsx.h\
    416416                                        ./modules/OutputResultsx/OutputResultsx.cpp\
    417                                         ./modules/OutputResultsx/ElementResultsToPatch.cpp\
    418                                         ./modules/OutputResultsx/MatlabWriteResults.cpp\
    419417                                        ./modules/MinVelx/MinVelx.h\
    420418                                        ./modules/MinVelx/MinVelx.cpp\
     
    989987                                        ./modules/OutputResultsx/OutputResultsx.h\
    990988                                        ./modules/OutputResultsx/OutputResultsx.cpp\
    991                                         ./modules/OutputResultsx/ElementResultsToPatch.cpp\
    992                                         ./modules/OutputResultsx/FileWriteResults.cpp\
    993989                                        ./modules/MinVelx/MinVelx.h\
    994990                                        ./modules/MinVelx/MinVelx.cpp\
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r6350 r6372  
    7272        parameters->AddObject(new IntParam(NumberOfElementsEnum,iomodel->numberofelements));
    7373        parameters->AddObject(new BoolParam(KffEnum,iomodel->kff));
     74        parameters->AddObject(new BoolParam(IoGatherEnum,iomodel->io_gather));
     75        parameters->AddObject(new BoolParam(IoSplitEnum,iomodel->io_split));
    7476
    7577        /*Deal with more complex parameters*/
  • issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r5103 r6372  
    1717               
    1818#ifdef _SERIAL_
    19 void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,DataSet** presults, int step, double time){
     19void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results** presults, int step, double time){
    2020#else                                                                                                                                                                                             
    21 void OutputResultsx(                    Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,DataSet** presults, int step, double time){
     21void OutputResultsx(                    Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results** presults, int step, double time){
    2222#endif
    2323
    24         /*Intermediaries*/
    25         int      i;
    26         int      solutiontype;
    27         DataSet *results;
    28         Element *element;
     24        extern int  my_rank;
     25        FILE       *fid                     = NULL;
     26        char       *outputfilename          = NULL;
     27        char        cpu_outputfilename[100];        //easier to convert an integer with sprintf
     28        bool        io_gather;
     29        bool        io_split;
     30        int         solutiontype;
     31        Results    *results                 = NULL;
    2932
    30         /*Recover results*/
     33        /*recover results dataset: */
    3134        results=*presults;
    32        
    33         /*Transfer element results into the femmodel->results dataset: */
    34         ElementResultsToPatch( elements,  nodes,  vertices,  loads, materials, parameters,results,step,time);
    3535
    36         #ifdef _PARALLEL_
     36
     37        /*We have results inside our elements, loads, etc ... Get them out of there, into the results dataset: */
     38        elements->ProcessResultsUnits();
     39        elements->ToResults(results,parameters,step,time);
     40        elements->DeleteResults();
     41
     42
    3743        /*Results do not include the type of solution being run . In parallel, we output results to a filename,
    3844         *therefore, we need to include the solutiontype into the filename: */
    39         parameters->FindParam(&solutiontype,SolutionTypeEnum);
    40         results->AddObject(new StringExternalResult(results->Size()+1,SolutionTypeEnum,EnumToString(solutiontype),1,0));
     45        #ifdef _PARALLEL_
     46        if(my_rank==0){
     47                parameters->FindParam(&solutiontype,SolutionTypeEnum);
     48                results->AddObject(new StringExternalResult(results->Size()+1,SolutionTypeEnum,EnumToString(solutiontype),1,0));
     49        }
     50
     51
     52        /*Now, open file for writing, if not already done: */
     53        if(!parameters->FindParam(&fid,OutputFilePointerEnum)){
     54               
     55                /*We don't have a file pointer. Retrieve the output file name and open it for writing:*/
     56                parameters->FindParam(&outputfilename,OutputFileNameEnum);
     57
     58
     59                /*What strategy? : */
     60                parameters->FindParam(&io_gather,IoGatherEnum);
     61                parameters->FindParam(&io_split,IoSplitEnum);
     62               
     63
     64                if(io_gather){
     65                        /*Just open the file for output on cpu 0. We are gathering the data on cpu 0 from all other cpus: */
     66                        if(my_rank==0) fid=pfopen(outputfilename ,"wb");
     67                }
     68                if(io_split){
     69                        /*We are opening different  files for output on all cpus. Append the  rank to the filename, and open: */
     70                        sprintf(cpu_outputfilename,"%s.%i",outputfilename,my_rank);
     71                        fid=pfopen(cpu_outputfilename ,"wb");
     72                }
     73               
     74                /*Add file pointer in parameters for further calls to OutputResultsx: */
     75                parameters->SetParam(fid,OutputFilePointerEnum);
     76        }
     77
    4178        #endif
    4279
    43         /*Write data to matlab structure or filename: */
     80        /*Write results to disk (in parallel), or to memory (in serial mode): */
    4481        #ifdef _SERIAL_
    45                 /*Write Matlab structure*/
    46                 MatlabWriteResults(pdataref,parameters,results);
    47 
    48                 /*DO NOT delete results serially*/
     82                results->Write(pdataref);
    4983        #else
    50                 /*Write File*/
    51                 FileWriteResults(parameters,results);
    52 
    53                 /*Now delete results (ElementResults and ExternalResults)*/
    54                 delete results;
    55                 for (i=0;i<elements->Size();i++){
    56                         element=(Element*)elements->GetObjectByOffset(i);
    57                         element->DeleteResults();
    58                 }
     84                results->Write(parameters);
    5985        #endif
    6086
    6187
     88        /*Delete and reinitialize results, in parallel: */
     89        #ifdef _PARALLEL_
     90                delete results; results=new Results();
     91        #endif
    6292
    63         /*We have to reinitialize results for next step*/
    64         results=new DataSet();
     93        /*Assign output pointers:*/
    6594        *presults=results;
    66 
    6795}
  • issm/trunk/src/c/modules/OutputResultsx/OutputResultsx.h

    r4879 r6372  
    1616#ifdef _SERIAL_
    1717#include <mex.h>
    18 void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads,  Materials* materials, Parameters* parameters,DataSet** results,int step=1,double time=0);
    19 void MatlabWriteResults(mxArray** pdataref, Parameters* parameters, DataSet* results);
     18void OutputResultsx(mxArray** pdataref, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads,  Materials* materials, Parameters* parameters, Results** presults,int step=1,double time=0);
    2019#else
    21 void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads,  Materials* materials, Parameters* parameters,DataSet** results,int step=1,double time=0);
    22 void FileWriteResults(Parameters* parameters, DataSet* results);
     20void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads,  Materials* materials, Parameters* parameters, Results** presults,int step=1,double time=0);
    2321#endif
    24 
    25 /* local prototypes: */
    26 void ElementResultsToPatch(Elements* elements,  Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,DataSet* results,int step, double time);
    2722
    2823#endif  /* _OUTPUTRESULTS_H */
  • issm/trunk/src/c/objects/FemModel.cpp

    r6325 r6372  
    2020/*Object constructors and destructor*/
    2121/*FUNCTION FemModel::constructor {{{1*/
    22 FemModel::FemModel(ConstDataHandle IOMODEL,const int in_solution_type,const int* analyses,const int nummodels){
     22FemModel::FemModel(char* inputfilename, char* outputfilename, const int in_solution_type,const int* analyses,const int nummodels){
     23#ifdef _PARALLEL_
    2324
    2425        /*intermediary*/
    2526        int i;
    2627        int analysis_type;
     28        FILE* IOMODEL;
     29
     30        /*Open input file on cpu 0: */
     31        if(my_rank==0) IOMODEL= pfopen(inputfilename ,"rb");
    2732
    2833        /*Initialize internal data: */
     
    3035        this->solution_type=in_solution_type;
    3136        this->analysis_counter=nummodels-1; //point to last analysis_type carried out.
    32         this->results=new DataSet(); //not initialized by CreateDataSets
     37        this->results=new Results(); //not initialized by CreateDataSets
    3338       
    3439        /*Dynamically allocate whatever is a list of length nummodels: */
     
    7277                ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
    7378        }
     79       
     80        /*Close input file descriptors: */
     81        if(my_rank==0) pfclose(IOMODEL,inputfilename);
     82
     83        /*Add output file name to parameters: */
     84        this->parameters->AddObject(new StringParam(OutputFileNameEnum,outputfilename));
     85
     86#endif
     87
    7488}
     89
    7590/*}}}1*/
    7691/*FUNCTION FemModel::destructor {{{1*/
  • issm/trunk/src/c/objects/FemModel.h

    r6231 r6372  
    3434                Materials*          materials;  //one set of materials, for each element
    3535                Parameters*         parameters; //one set of parameters, independent of the analysis_type
    36                 DataSet*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
     36                Results*            results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...)
    3737
    3838                //multiple  sets of matrices/vectors for each analysis_type. m stands for multiple
     
    4646
    4747                /*constructors, destructors: */
    48                 FemModel(ConstDataHandle IOMODEL,const int solution_type,const int* analyses,const int nummodels);
     48                FemModel(char* inputfilename, char* outputfilename, const int solution_type,const int* analyses,const int nummodels);
    4949                ~FemModel();
    5050
  • issm/trunk/src/c/objects/IoModel.cpp

    r6305 r6372  
    211211                IoModelFetchData(&this->qmu_mass_flux_num_profiles,iomodel_handle,"qmu_mass_flux_num_profiles");
    212212        }
     213        /*i/o: */
     214        IoModelFetchData(&this->io_gather,iomodel_handle,"io_gather");
     215        IoModelFetchData(&this->io_split,iomodel_handle,"io_split");
    213216       
    214217        /*parameter output : */
     
    247250        this->gridonmacayeal=NULL;
    248251        this->gridonpattyn=NULL;
     252        this->io_gather=1;
     253        this->io_split=0;
    249254       
    250255        this->vx_obs=NULL;
  • issm/trunk/src/c/objects/IoModel.h

    r6236 r6372  
    5555                double* pressure;
    5656                double* temperature;
     57
     58                /*i/o: */
     59                int    io_gather;
     60                int    io_split;
    5761
    5862                /*observations: */
  • issm/trunk/src/c/solutions/issm.cpp

    r6323 r6372  
    1212
    1313        /*I/O: */
    14         FILE     *input_fid        = NULL;
    1514        FILE     *output_fid       = NULL;
    16         char     *inputfilename    = NULL;
    1715        char     *petscoptionsfilename = NULL;
    18         char     *outputfilename   = NULL;
    1916        char     *lockname         = NULL;
    2017        bool      qmu_analysis     = false;
     
    5350        _printf_("Launching solution sequence\n");
    5451        solution_type=StringToEnum(argv[1]);
    55         inputfilename=argv[3];
    5652        petscoptionsfilename=argv[4];
    57         outputfilename=argv[5];
    5853        lockname=argv[6];
    5954
     
    6459        SolutionConfiguration(&analyses,&numanalyses,&solutioncore,solution_type);
    6560
    66         /*Open input file to process model
    67          * and ouput file to start unload results*/
    68         input_fid =pfopen(inputfilename ,"rb");
    69         output_fid=pfopen(outputfilename,"wb");
    70 
    71         femmodel=new FemModel(input_fid,solution_type,analyses,numanalyses);
    72 
    73         /*add output_fid to parameters: */
    74         femmodel->parameters->SetParam(output_fid,OutputFilePointerEnum);
     61        /*Create femmodel, using input file: */
     62        femmodel=new FemModel(argv[3] /*input*/,argv[5] /*output*/,solution_type,analyses,numanalyses);
    7563
    7664        /*add petsc options to parameters: */
     
    112100
    113101        /*Close output file and write lock file if requested*/
    114         pfclose(output_fid,outputfilename);
     102        femmodel->parameters->FindParam(&output_fid,OutputFilePointerEnum); pfclose(output_fid,argv[5]);
    115103        if (waitonlock>0){
    116104                _printf_("write lock file:\n");
  • issm/trunk/src/c/solutions/transient2d_core.cpp

    r6323 r6372  
    4343       
    4444                /*Increment*/
    45                 if(time_adapt) TimeAdaptx(&dt,femmodel->elements, femmodel->nodes,femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     45                if(time_adapt){
     46                        TimeAdaptx(&dt,femmodel->elements, femmodel->nodes,femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     47                        InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,dt,DtEnum);
     48                }
    4649                time+=dt;
    4750                step+=1;
  • issm/trunk/src/c/solutions/transient3d_core.cpp

    r6323 r6372  
    4343
    4444                /*Increment*/
    45                 if(time_adapt) TimeAdaptx(&dt,femmodel->elements, femmodel->nodes,femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     45                if(time_adapt){
     46                        TimeAdaptx(&dt,femmodel->elements, femmodel->nodes,femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
     47                        InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,dt,DtEnum);
     48                }
    4649                step+=1;
    4750                time+=dt;
  • issm/trunk/src/m/classes/@model/model.m

    r6304 r6372  
    4141        md.elementconnectivity=NaN;
    4242        md.edges=NaN;
     43
     44        %I/O
     45        md.io_gather=NaN;
     46        md.io_split=NaN;
    4347
    4448        %Initial 2d mesh
  • issm/trunk/src/m/classes/@model/setdefaultparameters.m

    r6323 r6372  
    245245%solution speed-up
    246246md.kff=0;
     247
     248%i/o:
     249md.io_gather=1;
     250md.io_split=0;
  • issm/trunk/src/m/model/marshall.m

    r6304 r6372  
    182182WriteData(fid,md.outputfilename,'String','outputfilename');
    183183
     184%i/o:
     185WriteData(fid,md.io_gather,'Integer','io_gather');
     186WriteData(fid,md.io_split,'Integer','io_split');
     187
     188
    184189%close file
    185190st=fclose(fid);
  • issm/trunk/src/m/solutions/transient2d_core.m

    r6323 r6372  
    2222
    2323                %increment
    24                 if(time_adapt) dt=TimeAdapt(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters); end
     24                if(time_adapt),
     25                        dt=TimeAdapt(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters); end
     26                        [femmodel.elements]=InputUpdateFromConstant(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,dt,DtEnum);
     27                end
    2528                step=step+1;
    2629                time=time+dt;
  • issm/trunk/src/m/solutions/transient3d_core.m

    r6323 r6372  
    2222
    2323                %Increment
    24                 if(time_adapt) dt=TimeAdapt(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters); end
     24                if(time_adapt),
     25                        dt=TimeAdapt(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters); end
     26                        [femmodel.elements]=InputUpdateFromConstant(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,dt,DtEnum);
     27                end
    2528                step=step+1;
    2629                time=time+dt;
  • issm/trunk/src/mex/OutputResults/OutputResults.cpp

    r4873 r6372  
    1414        Materials* materials=NULL;
    1515        Parameters* parameters=NULL;
    16         DataSet* results=NULL;
     16        Results* results=NULL;
    1717       
    1818        /* output datasets: */
     
    3232        FetchData((DataSet**)&materials,MATERIALS);
    3333        FetchParams(&parameters,PARAMETERS);
    34         FetchData(&results,RESULTS);
     34        FetchData((DataSet**)&results,RESULTS);
    3535
    3636        /*results might be NILL, allocate: */
  • issm/trunk/test/NightlyRun/test101.m

    r6015 r6372  
    55md.cluster=none;
    66md=solve(md,'analysis_type',DiagnosticSolutionEnum);
     7md.verbose=verbose('mprocessor',true,'module',true,'solution',true,'solver',true,'convergence',true,'qmu',true,'control',true);
     8
    79
    810%Fields and tolerances to track changes
  • issm/trunk/test/NightlyRun/test102.m

    r6015 r6372  
    44md=setelementstype(md,'macayeal','all');
    55md=SetParallel(md,3);
     6md.cluster.np=1;
    67md=solve(md,'analysis_type',DiagnosticSolutionEnum);
    78
Note: See TracChangeset for help on using the changeset viewer.