Changeset 12377


Ignore:
Timestamp:
06/07/12 08:01:49 (13 years ago)
Author:
Mathieu Morlighem
Message:

Added parallel kriging module

Location:
issm/trunk-jpl/src/c
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Observations.cpp

    r12368 r12377  
    2121#include "../include/include.h"
    2222#include "../EnumDefinitions/EnumDefinitions.h"
     23#include "../io/io.h"
    2324
    2425using namespace std;
     
    7172
    7273        /*Initialize Quadtree*/
    73         printf("Generating quadtree with a maximum box size %g (depth=%i)... ",minlength,maxdepth);
     74        _printf_(true,"Generating quadtree with a maximum box size %g (depth=%i)... ",minlength,maxdepth);
    7475        this->quadtree = new Quadtree(xmin,xmax,ymin,ymax,maxdepth);
    7576
     
    101102                }
    102103        }
    103         printf("done\n");
    104         printf("Initial number of observations: %i\n",n);
    105         printf("  Final number of observations: %i\n",this->quadtree->NbObs);
     104        _printf_(true,"done\n");
     105        _printf_(true,"Initial number of observations: %i\n",n);
     106        _printf_(true,"  Final number of observations: %i\n",this->quadtree->NbObs);
    106107}
    107108/*}}}*/
  • issm/trunk-jpl/src/c/Makefile.am

    r12355 r12377  
    633633                                                ./modules/Krigingx/Krigingx.h
    634634
     635#For parallel kriging, only difference is ./modules/Krigingx/pKrigingx.cpp with no multithreading
     636pkriging_sources = ./Container/Observations.h\
     637                                                ./Container/Observations.cpp\
     638                                                ./objects/Kriging/Variogram.h \
     639                                                ./objects/Kriging/GaussianVariogram.h\
     640                                                ./objects/Kriging/GaussianVariogram.cpp\
     641                                                ./objects/Kriging/ExponentialVariogram.h\
     642                                                ./objects/Kriging/ExponentialVariogram.cpp\
     643                                                ./objects/Kriging/SphericalVariogram.h\
     644                                                ./objects/Kriging/SphericalVariogram.cpp\
     645                                                ./objects/Kriging/PowerVariogram.h\
     646                                                ./objects/Kriging/PowerVariogram.cpp\
     647                                                ./objects/Kriging/Quadtree.h\
     648                                                ./objects/Kriging/Quadtree.cpp\
     649                                                ./objects/Kriging/Observation.h\
     650                                                ./objects/Kriging/Observation.cpp\
     651                                                ./modules/Krigingx/pKrigingx.cpp\
     652                                                ./modules/Krigingx/Krigingx.h
     653
    635654#}}}
    636655#Kml sources  {{{1
     
    964983
    965984libISSMCore_a_SOURCES  = $(issm_sources)
     985libISSMCore_a_SOURCES += $(pkriging_sources)
    966986libISSMCore_a_CXXFLAGS = $(ALLCXXFLAGS)
    967987
     
    10051025issm_SOURCES = solutions/issm.cpp
    10061026issm_CXXFLAGS= -fPIC $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
     1027
     1028bin_PROGRAMS += kriging
     1029kriging_SOURCES = solutions/kriging.cpp
     1030kriging_CXXFLAGS= -fPIC $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS)
    10071031#}}}
    10081032#Automatic differentiation: append this fold to the end of the src/c/Makefile.am to get this Makefile.am {{{
  • issm/trunk-jpl/src/c/io/Disk/diskio.h

    r11202 r12377  
    1010#include "../../include/include.h"
    1111
    12 class DataSet;
    13 class Parameters;
    14 
    1512FILE* pfopen(char* filename,const char* format);
    1613void  pfclose(FILE* fid,char* filename);
  • issm/trunk-jpl/src/c/io/io.h

    r12365 r12377  
    66#define _ISSM_IO_H_
    77
    8 #ifdef HAVE_CONFIG_H //config.h {{{
     8#ifdef HAVE_CONFIG_H
    99#include <config.h>
    1010#else
    1111#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    1212#endif
    13 //}}}
    14 
    1513#include "./Disk/diskio.h"
    1614
  • issm/trunk-jpl/src/c/issm.h

    r9761 r12377  
    2222#include "./modules/modules.h"
    2323
    24 
    2524#endif //ifndef _ISSM_H_
  • issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp

    r12292 r12377  
    1010#include "../../Container/Observations.h"
    1111#include "../modules.h"
    12 
    1312#ifdef _HAVE_GSL_
    1413#include <gsl/gsl_linalg.h>
    1514#endif
    16 
    17 #include "../../objects/Kriging/GaussianVariogram.h"
    1815/*FUNCTION Krigingx{{{*/
    1916int Krigingx(double** ppredictions,double **perror,double* obs_x, double* obs_y, double* obs_list, int obs_length,double* x_interp,double* y_interp,int n_interp,Options* options){
  • issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h

    r12292 r12377  
    1313
    1414int  Krigingx(double** ppredictions,double **perror,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp,Options* options);
     15int  pKrigingx(double** ppredictions,double **perror,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp,Options* options);
    1516void ProcessVariogram(Variogram **pvariogram,Options* options);
    1617void GslSolve(double** pX,double* A,double* B,int n);
  • issm/trunk-jpl/src/c/modules/OutputResultsx/OutputResultsx.cpp

    r12011 r12377  
    1616#include "../../objects/objects.h"
    1717               
    18 void OutputResultsx(                    Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
     18void OutputResultsx(Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Results* results){
    1919
    2020        extern int  my_rank;
  • issm/trunk-jpl/src/c/objects/IoModel.cpp

    r12365 r12377  
    7171IoModel::~IoModel(){
    7272
    73         delete this->constants;
     73        if(this->constants) delete this->constants;
    7474
    7575        /*Some checks in debugging mode*/
    7676        #ifdef _ISSM_DEBUG_
    77         for(int i=0;i<MaximumNumberOfEnums;i++){
    78                 if(this->data[i]){
    79                         _printf_("Info: previous pointer of %s has not been freed (DeleteData has not been called)",EnumToStringx(i));
     77        if(this->data){
     78                for(int i=0;i<MaximumNumberOfEnums;i++){
     79                        if(this->data[i]){
     80                                _printf_("Info: previous pointer of %s has not been freed (DeleteData has not been called)",EnumToStringx(i));
     81                        }
    8082                }
    8183        }
     
    8385
    8486        xfree((void**)&this->data);
    85 
    8687        xfree((void**)&this->my_elements);
    8788        xfree((void**)&this->my_nodes);
     
    9899        int record_enum = 0;
    99100
    100 
    101101        /*Check that some fields have been allocated*/
    102102        _assert_(this->fid || my_rank);
    103 
    104103
    105104        /*Go find in the binary file, the position of the data we want to fetch: */
  • issm/trunk-jpl/src/c/objects/IoModel.h

    r12322 r12377  
    1818
    1919        private:
    20                 FILE        *fid;         //pointer to input file
    2120                IssmDouble     **data;        //this dataset holds temporary data, memory intensive.
    2221                Parameters  *constants;   //this dataset holds all IssmDouble, int, bool and char *parameters read in from the input file.*
     
    2423        public:
    2524                /*This data needs to stay memory resident at all time, even if it's memory intensive: */
     25                FILE        *fid;         //pointer to input file
    2626                bool *my_elements;
    2727                bool *my_nodes;
Note: See TracChangeset for help on using the changeset viewer.