Commit 518b651a authored by Mathieu Faverge's avatar Mathieu Faverge

Add comments

parent 07e8b3cc
......@@ -2,15 +2,14 @@
*
* @file libhqr_list.h
*
* List module for the treewalk algorithm.
* List module for the adapted reduction tree algorithm.
*
* @copyright 2017-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Mathieu Faverge
* @date 2017-03-21
* @date 2018-09-30
*
*/
#ifndef _libhqr_list_h_
......@@ -20,12 +19,22 @@ struct libhqr_list_elt_s;
typedef struct libhqr_list_elt_s libhqr_list_elt_t;
typedef struct libhqr_list_elt_s *libhqr_list_t;
/**
* @brief A list element data structure
*/
struct libhqr_list_elt_s {
libhqr_list_elt_t *next;
int id;
int date;
libhqr_list_elt_t *next; /**< The pointer to the next element in the list */
int id; /**< The id of the element */
int date; /**< The date of last modification of the element */
};
/**
* @brief Push an element into a sorted list
* @param[in,out] list_head
* The head of the list.
* @param[in,out] elt
* The element to add to the list at the right place.
*/
static inline void
libhqr_list_push( libhqr_list_t *list_head, libhqr_list_elt_t *elt )
{
......@@ -52,6 +61,12 @@ libhqr_list_push( libhqr_list_t *list_head, libhqr_list_elt_t *elt )
elt->next = next;
}
/**
* @brief Pop the first element of a sorted list
* @param[in,out] list_head
* The head of the list. On exit, the head is removed.
* @return The first element of the list.
*/
static inline libhqr_list_elt_t *
libhqr_list_pop( libhqr_list_t *list_head )
{
......
......@@ -100,6 +100,13 @@ hqr_high_binary_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start)
}
}
/**
* @brief Initialize the function pointers for a high-level binary tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a binary high level tree for QR/LQ factorization.
*/
void
hqr_high_binary_init(hqr_subpiv_t *arg) {
arg->currpiv = hqr_high_binary_currpiv;
......
......@@ -59,6 +59,13 @@ hqr_high_fibonacci_nextpiv( const hqr_subpiv_t *qrpiv, int k, int p, int start )
return qrpiv->ldd;
}
/**
* @brief Initialize the function pointers for a high-level fibonacci tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a fibonacci high level tree for QR/LQ factorization.
*/
void
hqr_high_fibonacci_init(hqr_subpiv_t *arg) {
int *ipiv;
......@@ -91,9 +98,15 @@ hqr_high_fibonacci_init(hqr_subpiv_t *arg) {
}
}
/****************************************************
* HQR_HIGH_GREEDY_TREE (1 panel duplicated)
***************************************************/
/**
* @brief Initialize the function pointers for a replicated high-level greedy tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a replicated greedy high level tree for QR/LQ factorization.
* The greedy distribution is perfoned once, and then replicated on
* all other columns.
*/
void hqr_high_greedy1p_init(hqr_subpiv_t *arg){
int *ipiv;
int mt, p;
......
......@@ -55,6 +55,13 @@ hqr_high_flat_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start)
return arg->ldd;
}
/**
* @brief Initialize the function pointers for a high-level flat tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a flat high level tree for QR/LQ factorization.
*/
void
hqr_high_flat_init(hqr_subpiv_t *arg) {
arg->currpiv = hqr_high_flat_currpiv;
......
......@@ -52,6 +52,15 @@ hqr_high_greedy_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start)
return arg->ldd;
}
/**
* @brief Initialize the function pointers for a high-level greedy tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a greedy high level tree for QR/LQ factorization.
* The greedy algorithm is applied on all columns taking into
* account the history of previous steps.
*/
void
hqr_high_greedy_init(hqr_subpiv_t *arg, int minMN) {
int *ipiv;
......
......@@ -74,6 +74,23 @@ svd_low_adaptiv_nextpiv( const hqr_subpiv_t *arg,
return ldd;
}
/**
* @brief Initialize the function pointers for a low-level adaptiv tree for SVD computations
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define an adaptive low level tree in the general to band
* reduction process of the SVD computation.
* @param[in] gmt
* The global number of rows of tiles in the matrix to consider.
* @param[in] gnt
* The global number of columns of tiles in the matrix to consider.
* @param[in] nbcores
* The number of cores available on each node to perfrom the computation.
* @param[in] ratio
* The number of tiles per thread that should be available at each
* step of the factorization.
*/
void
svd_low_adaptiv_init( hqr_subpiv_t *arg,
int gmt, int gnt, int nbcores, int ratio )
......
......@@ -109,6 +109,13 @@ hqr_low_binary_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start_pa)
}
}
/**
* @brief Initialize the function pointers for a low-level binary tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a low level binary tree.
*/
void
hqr_low_binary_init(hqr_subpiv_t *arg) {
arg->currpiv = hqr_low_binary_currpiv;
......
......@@ -56,6 +56,15 @@ hqr_low_fibonacci_nextpiv( const hqr_subpiv_t *qrpiv, int k, int p, int start_pa
return qrpiv->ldd;
}
/**
* @brief Initialize the function pointers for a low-level fibonacci tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a fibonacci low level tree for QR/LQ factorization
* @param[in] minMN
* The number of step to perform.
*/
void
hqr_low_fibonacci_init(hqr_subpiv_t *arg, int minMN) {
int *ipiv;
......
......@@ -81,6 +81,13 @@ hqr_low_flat_prevpiv(const hqr_subpiv_t *arg, int k, int p, int start_pa)
return arg->ldd;
}
/**
* @brief Initialize the function pointers for a low-level flat tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a flat low level tree for QR/LQ factorization
*/
void hqr_low_flat_init(hqr_subpiv_t *arg){
arg->currpiv = hqr_low_flat_currpiv;
arg->nextpiv = hqr_low_flat_nextpiv;
......
......@@ -65,6 +65,15 @@ hqr_low_greedy_nextpiv( const hqr_subpiv_t *qrpiv, int k, int p, int start_pa )
return qrpiv->ldd;
}
/**
* @brief Initialize the function pointers for a low-level greedy tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a greedy low level tree for QR/LQ factorization
* @param[in] minMN
* The number of step to perform.
*/
void
hqr_low_greedy_init(hqr_subpiv_t *arg, int minMN) {
int *ipiv;
......
......@@ -64,8 +64,20 @@ hqr_low_greedy1p_nextpiv( const hqr_subpiv_t *qrpiv, int k, int p, int start_pa
return qrpiv->ldd;
}
/**
* @brief Initialize the function pointers for a replicated low-level greedy tree
*
* @param[in,out] arg
* The data structure to initialize. On exit, it can be used to
* define a replicated greedy low level tree for QR/LQ factorization.
* The greedy distribution is computed once, and replicated on all
* other columns.
* @param[in] minMN
* The number of step to perform.
*/
void
hqr_low_greedy1p_init(hqr_subpiv_t *arg, int minMN) {
hqr_low_greedy1p_init(hqr_subpiv_t *arg, int minMN)
{
int *ipiv;
int mt, a, p, pa, domino;
int j, k, height, start, end, nT, nZ;
......
......@@ -169,6 +169,12 @@ rdmtx_prevpiv(const libhqr_tree_t *qrtree, int k, int p, int m){
}
}
/**
* @brief Initialize the function pointers for a matrix reduction tree
* @param[in,out] qrtree
* On entry an allocated reduction tree.
* On exit, the function pointers are updated to use the internal data.
*/
void
libhqr_rdmtx_initfct( libhqr_tree_t *qrtree )
{
......@@ -182,6 +188,18 @@ libhqr_rdmtx_initfct( libhqr_tree_t *qrtree )
return;
}
/**
* @brief Convert a function based reduction tree to a matrix based tree
* @param[in] in
* The reduction tree to convert
* @param[in,out] out
* On entry an allocated reduction tree.
* On exit, the reduction tree is initialized with the matrix functions
*
* This transforms a reduction tree based on functions that computes the
* information at each call, to a reduction tree storing all the information in
* an internal matrix structure to avoid computation at factorization time.
*/
void
libhqr_fct_to_mtx( const libhqr_tree_t *in, libhqr_tree_t *out )
{
......
......@@ -34,6 +34,9 @@ typedef enum iparam_e {
IPARAM_SIZEOF /**< Size of the parameter array */
} iparam_e;
/**
* @brief Macro to copy/paste all testings parameters
*/
#define PASTE_CODE_IPARAM_LOCALS(iparam) \
int nodes = iparam[IPARAM_NNODES]; \
int cores = iparam[IPARAM_NCORES]; \
......@@ -64,6 +67,9 @@ typedef enum iparam_e {
(void)loud; \
(void)check;
/**
* @brief Function to parse ptions argument of the testings
*/
void parse_arguments(int *_argc, char ***_argv, int *iparam);
#endif /* _hqr_testings_common_h_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment