[Genabel-commits] r1854 - pkg/OmicABELnoMM/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 27 22:02:31 CET 2014


Author: lckarssen
Date: 2014-10-27 22:02:30 +0100 (Mon, 27 Oct 2014)
New Revision: 1854

Modified:
   pkg/OmicABELnoMM/src/AIOwrapper.h
   pkg/OmicABELnoMM/src/Algorithm.h
Log:
Some more code layout clean up in OmicABELnoMM.

No functional changes.


Modified: pkg/OmicABELnoMM/src/AIOwrapper.h
===================================================================
--- pkg/OmicABELnoMM/src/AIOwrapper.h	2014-10-27 20:24:19 UTC (rev 1853)
+++ pkg/OmicABELnoMM/src/AIOwrapper.h	2014-10-27 21:02:30 UTC (rev 1854)
@@ -23,8 +23,6 @@
 
 typedef struct fileh type_fileh;
 
-
-
 struct fileh
 {
     string fnameAL;
@@ -33,17 +31,13 @@
 
     string io_overhead;
 
-
     string fnameOutFiles;
     string fname_dosages;
 
     int mpi_id;
 
+    list< pair<int, int> >* excl_List;
 
-
-    list< pair<int,int> >* excl_List;
-
-
     bool doublefileType;
     bool fakefiles;
     bool storeBin;
@@ -111,7 +105,7 @@
     bool add_dosages;
     int dosage_skip;
 
-    bool use_interactions ;
+    bool use_interactions;
     bool keep_depVar;
     bool use_multiple_interaction_sets;
     string fname_interactions;
@@ -129,25 +123,25 @@
     vector< vector <float> > x_Terms;
     vector< vector <float> > xcov_2_Terms;
 
-    pthread_mutex_t m_more     ;
-    pthread_cond_t  condition_more   ;
-    pthread_mutex_t m_read     ;
+    pthread_mutex_t m_more;
+    pthread_cond_t  condition_more;
+    pthread_mutex_t m_read;
 
-    pthread_cond_t  condition_read  ;
-    pthread_mutex_t m_buff_upd   ;
-    pthread_mutex_t out_buff_upd   ;
+    pthread_cond_t  condition_read;
+    pthread_mutex_t m_buff_upd;
+    pthread_mutex_t out_buff_upd;
 
     pthread_t iothread;
     pthread_attr_t attr;
 
     //barrier
     pthread_barrier_t finalize_barrier;
+};
 
 
-};
-
 #define fgls_malloc(size) fgls_malloc_impl(__FILE__, __LINE__, size)
 
+
 enum datatype{ UNSIGNED_SHORT_INT_TYPE = 1,
                SHORT_INT_TYPE,
                UNSIGNED_INT_TYPE,
@@ -160,100 +154,109 @@
 #define NAMELENGTH 32
 #define RESERVEDSPACE 5
 
+
 typedef struct databel_fvi_header
 {
-	unsigned short int type;
-	unsigned int nelements;
-	unsigned int numObservations;
-	unsigned int numVariables;
-	unsigned int bytesPerRecord;
-	unsigned int bitsPerRecord;
-	unsigned int namelength;
-	unsigned int reserved[RESERVEDSPACE];
+    unsigned short int type;
+    unsigned int nelements;
+    unsigned int numObservations;
+    unsigned int numVariables;
+    unsigned int bytesPerRecord;
+    unsigned int bitsPerRecord;
+    unsigned int namelength;
+    unsigned int reserved[RESERVEDSPACE];
 } databel_fvi_header;
 
+
 typedef struct databel_fvi
 {
-	databel_fvi_header  fvi_header;
-	char               *fvi_data;
+    databel_fvi_header  fvi_header;
+    char               *fvi_data;
 } databel_fvi;
 
+
 class AIOwrapper
 {
-    public:
-        AIOwrapper();
-        ~AIOwrapper();
+ public:
+    AIOwrapper();
+    ~AIOwrapper();
 
-        void initialize(struct Settings &params);
-        void finalize();
+    void initialize(struct Settings &params);
+    void finalize();
 
 
-        void load_AL(type_precision** AL);
-        void load_ARblock(type_precision** Y, int &blockSize);
-        void load_Yblock(type_precision** Y, int &blockSize);
-        void reset_Y();
-        void reset_AR();
+    void load_AL(type_precision** AL);
+    void load_ARblock(type_precision** Y, int &blockSize);
+    void load_Yblock(type_precision** Y, int &blockSize);
+    void reset_Y();
+    void reset_AR();
 
-        void getCurrentWriteBuffers(list < resultH >* &sigResults);
+    void getCurrentWriteBuffers(list < resultH >* &sigResults);
 
-        void write_OutFiles(list < resultH >* &sigResults);
-        void write_OutSignificant(list < resultH >* sigResults, int min_p_disp, bool disp_cov);
+    void write_OutFiles(list < resultH >* &sigResults);
+    void write_OutSignificant(list < resultH >* sigResults,
+                              int min_p_disp, bool disp_cov);
 
-        string io_overhead;
-        int realN;
+    string io_overhead;
+    int realN;
 
 
+ protected:
 
-    protected:
+ private:
+    static void  generate_multinteraction_singleset(float* interaction_data,
+                                                    int cols_data,
+                                                    float* AR,
+                                                    int ar_block_size,
+                                                    int n,
+                                                    float* dest,
+                                                    bool keep_original);
+    static void  generate_singleinteraction_multset(float* interaction_data,
+                                                    int cols_indp_data,
+                                                    float* AR,
+                                                    int ar_block_size,
+                                                    int n,
+                                                    float* dest,
+                                                    bool keep_original);
 
-    private:
+    void read_excludeList(list< pair<int, int> >* excl, int &excl_count,
+                          int max_excl, string fname_excludeList);
+    void read_dosages(string fname_dosages, int expected_count, float* vec);
 
-        static void  generate_multinteraction_singleset(float* interaction_data, int cols_data, float* AR, int ar_block_size, int n, float* dest, bool keep_original  );
-        static void  generate_singleinteraction_multset(float* interaction_data, int cols_indp_data, float* AR, int ar_block_size, int n, float* dest, bool keep_original  );
 
-        void read_excludeList(list< pair<int,int> >* excl, int &excl_count, int max_excl, string fname_excludeList);
-        void read_dosages(string fname_dosages, int expected_count, float* vec);
+    void prepare_AR(int desired_blockSize, int n, int totalR, int columnsR);
+    void finalize_AR();
 
 
-        void prepare_AR( int desired_blockSize, int n, int totalR, int columnsR);
-        void finalize_AR();
+    void prepare_Y(int desired_blockSize, int n, int totalY);
+    void finalize_Y();
 
+    void prepare_AL(int columns, int n);
+    void finalize_AL();
 
-        void prepare_Y(int desired_blockSize, int n, int totalY);
-        void finalize_Y();
+    void prepare_OutFiles();
+    void finalize_OutFiles();
 
-        void prepare_AL( int columns, int n);
-        void finalize_AL();
 
-        void prepare_OutFiles();
-        void finalize_OutFiles();
+    void removeALmissings(list< pair<int, int> >* excl_List,
+                          struct Settings params, int &Almissings);
+    bool splitpair(int value, list< pair<int, int> >* excl_List, int n);
 
+    static void* async_io(void *ptr);
 
-        void removeALmissings(list< pair<int,int> >* excl_List,struct Settings params,int &Almissings);
-        bool splitpair(int value, list< pair<int,int> >* excl_List,int n);
+    struct databel_fvi* load_databel_fvi(const char *path);
+    void free_databel_fvi(struct databel_fvi **fvi);
+    FILE* fgls_fopen(const char *path, const char *mode);
 
+    void* fgls_malloc_impl(const char* file, long line, size_t size);
 
-        static void* async_io(void *ptr );
+    type_fileh FHandler;
+    type_fileh* Fhandler;
 
-        struct databel_fvi * load_databel_fvi( const char *path );
-        void free_databel_fvi( struct databel_fvi **fvi );
-        FILE * fgls_fopen( const char *path, const char *mode );
-
-        void * fgls_malloc_impl( const char* file, long line, size_t size );
-
-        type_fileh FHandler;
-        type_fileh* Fhandler;
-
-
-
-
-        databel_fvi* Yfvi;
-        databel_fvi* ALfvi;
-        databel_fvi* ARfvi;
-        databel_fvi* Ifvi;
-
-
-
+    databel_fvi* Yfvi;
+    databel_fvi* ALfvi;
+    databel_fvi* ARfvi;
+    databel_fvi* Ifvi;
 };
 
 #endif // AIOWRAPPER_H

Modified: pkg/OmicABELnoMM/src/Algorithm.h
===================================================================
--- pkg/OmicABELnoMM/src/Algorithm.h	2014-10-27 20:24:19 UTC (rev 1853)
+++ pkg/OmicABELnoMM/src/Algorithm.h	2014-10-27 21:02:30 UTC (rev 1854)
@@ -33,99 +33,119 @@
 
 class Algorithm
 {
-    public:
+ public:
+    Algorithm();
 
-        Algorithm();
+    virtual ~Algorithm();
 
-        virtual ~Algorithm();
+    void solve(struct Settings params, struct Outputs &out, int type);
 
-        void solve(struct Settings params, struct Outputs &out, int type);
+    void partialNEQ_Blocked_STL_MD(struct Settings params, struct Outputs &out);
 
-        void partialNEQ_Blocked_STL_MD(struct Settings params, struct Outputs &out);
+    void partialNEQ_Blocked_STL(struct Settings params, struct Outputs &out);
 
-        void partialNEQ_Blocked_STL(struct Settings params, struct Outputs &out);
+    void applyDefaultParams(struct Settings &params);
 
-        void applyDefaultParams(struct Settings &params);
 
-    protected:
-    private:
+ protected:
 
 
+ private:
+    list < resultH > sigResults;
 
-        list < resultH > sigResults;
+    int max_threads;
 
-        int max_threads;
+    unsigned int total_results;
 
-        unsigned int total_results;
+    float minPdisp;
 
-        float minPdisp;
 
+    float minTstore;
+    float minR2store;
+    bool storePInd;
+    bool disp_cov;
 
-        float minTstore;
-        float minR2store;
-        bool storePInd;
-        bool disp_cov;
 
+    float* SYY;
 
-        float* SYY;
 
+    void generate_correction_missings_Str(int y_block_size,
+                                          int xr_block_size,
+                                          int n, int l, int r,
+                                          float* __restrict XL_block,
+                                          float* __restrict XR_block,
+                                          float* __restrict Str_block,
+                                          float* __restrict Sbr_block,
+                                          list<long int>* index_nans);
 
-        void generate_correction_missings_Str(int y_block_size, int xr_block_size, int n, int l, int r,
-            float* __restrict XL_block, float* __restrict XR_block, float* __restrict Str_block, float* __restrict Sbr_block,
-                    list<long int>* index_nans);
+    void generate_correction_missings_Stl(int y_block_size,
+                                          int x1_block_size,
+                                          int x2_block_size,
+                                          int n, int cols1, int cols2,
+                                          float* X1_block,
+                                          float* X2_block,
+                                          float* S_block,
+                                          list< long int>* index_nans);
 
-        void generate_correction_missings_Stl(int y_block_size, int x1_block_size, int x2_block_size,
-                            int n, int cols1, int cols2, float* X1_block, float* X2_block, float* S_block, list< long int>* index_nans);
+    void correct_missings_S(int p, int l, int r, float* S, float* Stl,
+                            float* Sbr, float* Str);
 
-        void correct_missings_S(int p,int l,int r, float* S, float* Stl, float* Sbr, float* Str);
 
+    void t_students_cdf(int y_amount, int a_amount, int p, float* T,
+                        float* P, int deg_freedom);
 
-        void t_students_cdf(int y_amount,int a_amount,int p, float* T, float* P, int deg_freedom);
+    void sumSquares(float* Data, int cols, int rows, float* ssData,
+                    list<long int>* indexs_Data);
 
-        void sumSquares(float* Data, int cols, int rows, float* ssData, list<long int>* indexs_Data);
+    void hpc_statistics(int YxALmiss, int n, int realN, float* AL,
+                        float* AR, int a_amount, float* y, int jj,
+                        float varY, float* B, int p, int l, int r,
+                        float* var_x, int y_blck_offset, int A_blck_offset,
+                        list < resultH >* sigResults);
 
-        void hpc_statistics(int YxALmiss, int n, int realN, float* AL, float* AR, int a_amount, float* y, int jj,float varY, float* B,
-                int p, int l,int r,float* var_x, int y_blck_offset, int A_blck_offset, list < resultH >* sigResults);
 
+    void check_result(float* AL, float* AR, int rowsA, int colsA, int rhs,
+                      int colsAR,float* y, float* res, struct Settings params,
+                      int iX, int iiX, int jY, int jjY);
 
-        void check_result(float* AL, float* AR,int rowsA,int colsA, int rhs,int colsAR,
-                            float* y, float* res,struct Settings params,int iX,int iiX, int jY, int jjY);
 
+    void update_R(float* R, float* topRr, float* botRr,
+                  int dim1, int dim2, int r);
 
-        void update_R(float* R, float* topRr, float* botRr,int dim1, int dim2, int r);
+    float* extract_R(float* A, int dim1_A, int dim2_A);
 
-        float* extract_R(float* A,int dim1_A, int dim2_A);
+    float* prepare_R(float* RL, int dim1_A, int dim2_AL, int dim2_AR);
 
-        float* prepare_R(float* RL,int dim1_A, int dim2_AL,int dim2_AR);
+    void prepare_QY(float* qy, float* top, float* bot, int dim1_QY,
+                    int dim2_QY, int dim1_qy_bot, int bot_blocks);
 
-        void prepare_QY(float* qy, float* top,float* bot,int dim1_QY, int dim2_QY,int dim1_qy_bot,int bot_blocks );
+    void prepare_Bfinal(float* bfinal, float* bsource, int a_amount,
+                        int y_amount, int p);
 
-        void prepare_Bfinal(float* bfinal, float* bsource, int a_amount, int y_amount, int p);
+    void extract_subMatrix(float* source, float* dest, int dim1_source,
+                           int dim2_source, int dim1_ini, int dim1_end,
+                           int dim2_ini, int dim2_end);
+    void build_S(float* S, float* Stl, float* Str, float* Sbr, int l, int r);
 
-        void extract_subMatrix(float* source, float* dest,int dim1_source, int dim2_source,
-                                                            int dim1_ini,int dim1_end,int dim2_ini,int dim2_end);
-        void build_S(float* S,float* Stl,float* Str,float* Sbr,int l,int r);
 
+    void hpc_SSY(int n, int p, int l, int r, float* __restrict  AL,
+                 float* __restrict  AR, int a_amount, int y_block_size,
+                 float* __restrict y, float* __restrict B);
 
 
-        void hpc_SSY(int n,int p, int l,int r, float* __restrict  AL, float* __restrict  AR,
-                      int a_amount, int y_block_size, float* __restrict y, float* __restrict  B );
+    void singleSSY( float* __restrict sum, float* __restrict b,
+                    float* __restrict b2, float* __restrict b3,
+                    float* __restrict b4, float* __restrict y1,
+                    float* __restrict y2, float* __restrict y3,
+                    float* __restrict y4, float* __restrict sy,
+                    float* __restrict Xl_n, float* __restrict XR_n,
+                    int l, int r, int p, int n, int thead_id);
 
 
-
-        void singleSSY( float* __restrict sum, float* __restrict b,float* __restrict b2,float* __restrict b3,float* __restrict b4,
-                        float* __restrict y1, float* __restrict y2, float* __restrict y3, float* __restrict y4,
-                        float* __restrict sy,float* __restrict Xl_n,float* __restrict XR_n,
-                     int l,int r, int p, int n, int thead_id  );
-
-
-        inline float singleSSY(float* __restrict b, float* __restrict y, float* __restrict sy,float* __restrict Xl_n,float* __restrict XR_n,
-                     int l,int r, int p, int n, int thead_id  );
-
-
-
-
-
+    inline float singleSSY(float* __restrict b, float* __restrict y,
+                           float* __restrict sy, float* __restrict Xl_n,
+                           float* __restrict XR_n, int l, int r, int p,
+                           int n, int thead_id);
 };
 
 #endif // ALGORITHM_H



More information about the Genabel-commits mailing list