Commit 43a99307 authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

update LABBOOK

parent 22ff0f69
...@@ -94,6 +94,8 @@ echo ${HOME}/src/chameleon/ ...@@ -94,6 +94,8 @@ echo ${HOME}/src/chameleon/
:PROPERTIES: :PROPERTIES:
:header-args:shell: :var WORKDIR=fabulous_root :session *build* :results silent :header-args:shell: :var WORKDIR=fabulous_root :session *build* :results silent
:END: :END:
The code blocks in this org file work best when you work with the fabulous directory
installed in your home directory file:~/fabulous
** Install Dependencies ** Install Dependencies
*** FXT (tracing) *** FXT (tracing)
**** manually **** manually
......
...@@ -407,3 +407,24 @@ ctest ...@@ -407,3 +407,24 @@ ctest
CLOCK: [2017-05-24 Wed 19:06]--[2017-05-24 Wed 19:08] => 0:02 CLOCK: [2017-05-24 Wed 19:06]--[2017-05-24 Wed 19:08] => 0:02
:END: :END:
[2017-05-24 Wed 19:06] [2017-05-24 Wed 19:06]
*** 2017-05-29 Monday
**** Update tests to rely more on Cmake ctest framework
Some tests/example runs were split to fit best as part fo cmake test framework.
Most of the test are simple run of the algorithms but doesnt check for correctness.
They are primarily meant to quickly detect regression and problems that would
cause the library to crash
#+NAME: fabulous_root
#+BEGIN_SRC shell
echo ${HOME}/fabulous
#+END_SRC
#+BEGIN_SRC shell :session *fabulous-test* :var WORKDIR=fabulous_root
cd ${WORKDIR}/build
ctest
#+END_SRC
:LOGBOOK:
CLOCK: [2017-05-29 Mon 09:25]--[2017-05-29 Mon 09:29] => 0:04
:END:
[2017-05-29 Mon 09:25]
...@@ -388,17 +388,17 @@ ggplot(df, aes(x=nb_mvp)) + ...@@ -388,17 +388,17 @@ ggplot(df, aes(x=nb_mvp)) +
*** GCR first results nrhs=10 m=300 *** GCR first results nrhs=10 m=300
**** test case **** test case
#+BEGIN_SRC shell #+BEGIN_SRC shell
cd ${WORKDIR}/build/src/test/run/ cd ${WORKDIR}/build/src/test/cmd/
./gcr_breakdown 10 300 ./fabulous_test -A GCR -n 10 -m 300 -s IMGS -t BLOCK
#+END_SRC #+END_SRC
file:~/fabulous/build/src/test/run/young1c_gcr_breakdown_IMGS_BLOCK_BGCR.res file:~/fabulous/build/src/test/cmd/young1c.mtx_IMGS_BLOCK_BGCR.res
**** graphic **** graphic
The max and min displayed here are the max and min of the not discared direction The max and min displayed here are the max and min of the not discared direction
This is why the min may be increasing on this graphic: This means a direction was discarded This is why the min may be increasing on this graphic: This means a direction was discarded
and its norm is not taken into account anymore. and its norm is not taken into account anymore.
#+BEGIN_SRC R #+BEGIN_SRC R
library(ggplot2) library(ggplot2)
df <- read.csv("./build/src/test/run/young1c_gcr_breakdown_IMGS_BLOCK_BGCR.res") df <- read.csv("./build/src/test/cmd/young1c.mtx_IMGS_BLOCK_BGCR.res")
ggplot(df, aes(x=nb_mvp)) + ggplot(df, aes(x=nb_mvp)) +
geom_line(aes(y=maxRes, color="max")) + geom_line(aes(y=maxRes, color="max")) +
geom_line(aes(y=minRes, color="min")) + geom_line(aes(y=minRes, color="min")) +
...@@ -409,17 +409,17 @@ ggplot(df, aes(x=nb_mvp)) + ...@@ -409,17 +409,17 @@ ggplot(df, aes(x=nb_mvp)) +
*** GCR first results nrhs=6 m=90 *** GCR first results nrhs=6 m=90
**** test case **** test case
#+BEGIN_SRC shell #+BEGIN_SRC shell
cd ${WORKDIR}/build/src/test/run/ cd ${WORKDIR}/build/src/test/cmd/
./gcr_breakdown 6 90 ./fabulous_test -A GCR -n 6 -m 90 -s IMGS -t BLOCK
#+END_SRC #+END_SRC
file:~/fabulous/build/src/test/run/young1c_gcr_breakdown_IMGS_BLOCK_BGCR.res file:~/fabulous/build/src/test/cmd/young1c.mtx_IMGS_BLOCK_BGCR.res
**** graphic **** graphic
The max and min displayed here are the max and min of the not discared direction The max and min displayed here are the max and min of the not discared direction
This is why the min may be increasing on this graphic: This means a direction was discarded This is why the min may be increasing on this graphic: This means a direction was discarded
and its norm is not taken into account anymore. and its norm is not taken into account anymore.
#+BEGIN_SRC R #+BEGIN_SRC R
library(ggplot2) library(ggplot2)
df <- read.csv("./build/src/test/run/young1c_gcr_breakdown_IMGS_BLOCK_BGCR.res") df <- read.csv("./build/src/test/cmd/young1c.mtx_IMGS_BLOCK_BGCR.res")
ggplot(df, aes(x=nb_mvp)) + ggplot(df, aes(x=nb_mvp)) +
geom_line(aes(y=maxRes, color="max")) + geom_line(aes(y=maxRes, color="max")) +
geom_line(aes(y=minRes, color="min")) + geom_line(aes(y=minRes, color="min")) +
......
...@@ -39,7 +39,7 @@ private: ...@@ -39,7 +39,7 @@ private:
{ {
o << "#######################################################\n"; o << "#######################################################\n";
o << "#################### Arnoldi(BGCR) ###################\n"; o << "#################### Arnoldi(BGCR) ###################\n";
o << "######## Mat Vect product scheduled "<< nb_mvp <<"###########\n"; o << "######## Mat Vect product scheduled "<< nb_mvp <<" ###########\n";
} }
void print_footer(std::ostream &o = std::cerr) void print_footer(std::ostream &o = std::cerr)
......
...@@ -43,7 +43,7 @@ private: ...@@ -43,7 +43,7 @@ private:
{ {
o << "#######################################################\n"; o << "#######################################################\n";
o << "#################### Arnoldi ##########################\n"; o << "#################### Arnoldi ##########################\n";
o << "######## Mat Vect product scheduled "<< nb_mvp <<"###########\n"; o << "######## Mat Vect product scheduled "<< nb_mvp <<" ###########\n";
} }
void print_footer(std::ostream &o = std::cerr) void print_footer(std::ostream &o = std::cerr)
......
...@@ -20,7 +20,7 @@ namespace fabulous { ...@@ -20,7 +20,7 @@ namespace fabulous {
/* **************************************************** */ /* **************************************************** */
template< class U > template<class U>
static void *fabulous_desc_get_blk_addr(const MORSE_desc_t *A, int m, int n) static void *fabulous_desc_get_blk_addr(const MORSE_desc_t *A, int m, int n)
{ {
size_t mm = m + A->i / A->mb; size_t mm = m + A->i / A->mb;
...@@ -30,14 +30,14 @@ static void *fabulous_desc_get_blk_addr(const MORSE_desc_t *A, int m, int n) ...@@ -30,14 +30,14 @@ static void *fabulous_desc_get_blk_addr(const MORSE_desc_t *A, int m, int n)
return desc->get_blk_addr(mm, nn); return desc->get_blk_addr(mm, nn);
} }
template< class U > template<class U>
static int fabulous_desc_get_blk_ld(const MORSE_desc_t *D, int i) static int fabulous_desc_get_blk_ld(const MORSE_desc_t *D, int i)
{ {
morse_desc_impl<U> *desc = reinterpret_cast<morse_desc_impl<U>*>(D->mat); morse_desc_impl<U> *desc = reinterpret_cast<morse_desc_impl<U>*>(D->mat);
return desc->get_blk_ld(i); return desc->get_blk_ld(i);
} }
template< class U > template<class U>
static int fabulous_desc_get_rankof(const MORSE_desc_t *D, int i, int j) static int fabulous_desc_get_rankof(const MORSE_desc_t *D, int i, int j)
{ {
morse_desc_impl<U> *desc = reinterpret_cast<morse_desc_impl<U>*>(D->mat); morse_desc_impl<U> *desc = reinterpret_cast<morse_desc_impl<U>*>(D->mat);
...@@ -49,7 +49,7 @@ static int fabulous_desc_get_rankof(const MORSE_desc_t *D, int i, int j) ...@@ -49,7 +49,7 @@ static int fabulous_desc_get_rankof(const MORSE_desc_t *D, int i, int j)
/** /**
* \brief Helper class to implement Pointer semantic of the MorseDesc class * \brief Helper class to implement Pointer semantic of the MorseDesc class
*/ */
template <class U> template<class U>
class morse_desc_impl class morse_desc_impl
{ {
private: private:
......
...@@ -13,8 +13,8 @@ template<class> class MorseDesc; ...@@ -13,8 +13,8 @@ template<class> class MorseDesc;
}; };
}; };
#include "TileTable.hpp" #include "fabulous/data/TileTable.hpp"
#include "Chameleon.hpp" #include "fabulous/utils/Chameleon.hpp"
namespace fabulous { namespace fabulous {
namespace experimental { namespace experimental {
......
...@@ -18,7 +18,8 @@ namespace fabulous { ...@@ -18,7 +18,8 @@ namespace fabulous {
/** /**
* \brief Deleter class for shared_ptr on MORSE_desc_t object * \brief Deleter class for shared_ptr on MORSE_desc_t object
*/ */
struct DescDeleter{ struct DescDeleter
{
inline void operator()(MORSE_desc_t *desc) inline void operator()(MORSE_desc_t *desc)
{ {
//FABULOUS_DEBUG("call descriptor destroy"); //FABULOUS_DEBUG("call descriptor destroy");
...@@ -29,7 +30,8 @@ struct DescDeleter{ ...@@ -29,7 +30,8 @@ struct DescDeleter{
/** /**
* \brief Deleter class for shared_ptr on MORSE_sequence_t object * \brief Deleter class for shared_ptr on MORSE_sequence_t object
*/ */
struct SeqDeleter{ struct SeqDeleter
{
inline void operator()(MORSE_sequence_t *seq) inline void operator()(MORSE_sequence_t *seq)
{ {
FABULOUS_DEBUG("call sequence destroy"); FABULOUS_DEBUG("call sequence destroy");
...@@ -40,7 +42,7 @@ struct SeqDeleter{ ...@@ -40,7 +42,7 @@ struct SeqDeleter{
/** /**
* \brief Dump a MORSE_desc_t object to standard output for debugging purposes. * \brief Dump a MORSE_desc_t object to standard output for debugging purposes.
*/ */
inline void dump_descriptor(const MORSE_desc_t *desc) inline void dump_descriptor(const MORSE_desc_t &desc)
{ {
printf("mb: %d\n" printf("mb: %d\n"
"nb: %d\n" "nb: %d\n"
...@@ -60,18 +62,27 @@ inline void dump_descriptor(const MORSE_desc_t *desc) ...@@ -60,18 +62,27 @@ inline void dump_descriptor(const MORSE_desc_t *desc)
"use_mat: %d\n" "use_mat: %d\n"
"alloc_mat: %d\n" "alloc_mat: %d\n"
"register_mat: %d\n", "register_mat: %d\n",
desc->mb, desc->nb, desc.mb, desc.nb,
desc->bsiz, desc.bsiz,
desc->lm, desc->ln, desc.lm, desc.ln,
desc->lmt, desc->lnt, desc.lmt, desc.lnt,
desc->i, desc->j, desc.i, desc.j,
desc->m, desc->n, desc.m, desc.n,
desc->mt, desc->nt, desc.mt, desc.nt,
desc->id, desc.id,
desc->occurences, desc.occurences,
desc->use_mat, desc.use_mat,
desc->alloc_mat, desc.alloc_mat,
desc->register_mat ); desc.register_mat );
}
/**
* \brief Dump a MORSE_desc_t object to standard output for debugging purposes.
*/
inline void dump_descriptor(const MORSE_desc_t *desc)
{
FABULOUS_ASSERT( desc != nullptr );
dump_descriptor(*desc);
} }
} // end namespace fabulous } // end namespace fabulous
......
...@@ -198,7 +198,7 @@ inline const char *basename(const char *str) ...@@ -198,7 +198,7 @@ inline const char *basename(const char *str)
#ifdef FABULOUS_DEBUG_MODE #ifdef FABULOUS_DEBUG_MODE
#define FABULOUS_THROW(ErrorName_, errstr_) \ #define FABULOUS_THROW(ErrorName_, errstr_) \
FABULOUS_FATAL_ERROR( #ErrorName_ " == " << errstr_ ) FABULOUS_FATAL_ERROR( #ErrorName_ "Error: " << errstr_ )
#else // FABULOUS_DEBUG_MODE #else // FABULOUS_DEBUG_MODE
......
...@@ -40,7 +40,9 @@ public: ...@@ -40,7 +40,9 @@ public:
template<class Matrix> template<class Matrix>
void LoadMatrix(Matrix &A, std::string name="") void LoadMatrix(Matrix &A, std::string name="")
{ {
if (name == "") { name = "A"; } if (name == "") {
name = "matrix";
}
std::cerr << "Loading randomly '" << name << "'\n"; std::cerr << "Loading randomly '" << name << "'\n";
using S = typename Matrix::value_type; using S = typename Matrix::value_type;
......
...@@ -250,7 +250,7 @@ int main(int argc, char *argv[]) ...@@ -250,7 +250,7 @@ int main(int argc, char *argv[])
MORSE_Init(NCPU, 0); MORSE_Init(NCPU, 0);
MORSE_Enable(MORSE_WARNINGS); MORSE_Enable(MORSE_WARNINGS);
MORSE_Disable(MORSE_AUTOTUNING); MORSE_Disable(MORSE_AUTOTUNING);
MORSE_user_tag_size(31, 10); MORSE_user_tag_size(31, 18);
#endif #endif
switch(info.arithmetic_arg) { switch(info.arithmetic_arg) {
......
...@@ -8,8 +8,13 @@ using namespace fabulous; ...@@ -8,8 +8,13 @@ using namespace fabulous;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
std::vector<std::string> args{argv, argv+argc}; std::vector<std::string> args{argv, argv+argc};
for (auto arg : args) for (auto arg : args) {
std::cout << arg << "\n"; if (arg == "-h" || arg == "--help") {
std::cerr<<"Usage: "<<args[0]
<<" [ nbRHS(=100) [ Max_Krylov_Space_Size(=Dim(A)+1) ] ]\n";
exit(EXIT_SUCCESS);
}
}
using P = double; using P = double;
using S = std::complex<P>; using S = std::complex<P>;
...@@ -37,6 +42,7 @@ int main(int argc, char *argv[]) ...@@ -37,6 +42,7 @@ int main(int argc, char *argv[])
Block<S> XExact{dim, nbRHS}; Block<S> XExact{dim, nbRHS};
Block<S> RHS{dim, nbRHS}; Block<S> RHS{dim, nbRHS};
std::vector<P> epsilon{1e-4}; std::vector<P> epsilon{1e-4};
FABULOUS_ASSERT( nbRHS % 2 == 0 );
// for (int i = 0; i < nbRHS; ++i) // for (int i = 0; i < nbRHS; ++i)
// XExact.at(i, i) = S{1.0/*,1.0*/}; // XExact.at(i, i) = S{1.0/*,1.0*/};
...@@ -44,7 +50,7 @@ int main(int argc, char *argv[]) ...@@ -44,7 +50,7 @@ int main(int argc, char *argv[])
Block<S> right = XExact.sub_block(0, nbRHS/2, dim, nbRHS/2); Block<S> right = XExact.sub_block(0, nbRHS/2, dim, nbRHS/2);
RandomMatrixLoader rndld; RandomMatrixLoader rndld;
rndld.LoadMatrix(left); rndld.LoadMatrix(left, "XExact.left_part");
right.copy(left); right.copy(left);
mat.MatBlockVect(XExact, RHS); mat.MatBlockVect(XExact, RHS);
......
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