diff --git a/CMakeLists.txt b/CMakeLists.txt index d8c67c3..83b7841 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ include(cmake/old.cmake) set(ISVD_NAME "Integrated Singular Value Decomposition") set(ISVD_MAJOR_VERSION 1) set(ISVD_MINOR_VERSION 3) -set(ISVD_PATCH_VERSION 1) +set(ISVD_PATCH_VERSION 2) set(ISVD_VERSION "${ISVD_MAJOR_VERSION}.${ISVD_MINOR_VERSION}.${ISVD_PATCH_VERSION}") if(NOT CMAKE_VERSION VERSION_LESS 3.0.0) cmake_policy(SET CMP0048 OLD) diff --git a/README.md b/README.md index c5d8891..21a03d7 100644 --- a/README.md +++ b/README.md @@ -156,4 +156,5 @@ Please link exactly one library for all categories. * [Mu Yang, “Highly Scalable Parallelism of Integrated Randomized Singular Value Decomposition with Big Data Applications”](http://doi.org/10.6342/NTU201702960) # License {#Readme_License} +* [MIT License](LICENSE.md) \include LICENSE.md diff --git a/check/check/libisvd/core/stage/@x@_sketch_gaussian_projection.hxx b/check/check/libisvd/core/stage/@x@_sketch_gaussian_projection.hxx index d335f1c..140812c 100644 --- a/check/check/libisvd/core/stage/@x@_sketch_gaussian_projection.hxx +++ b/check/check/libisvd/core/stage/@x@_sketch_gaussian_projection.hxx @@ -137,10 +137,10 @@ static void test( char dista, char ordera ) { // Deallocate memory isvd_Free(yst_); -#else +#else // ISVD_USE_MKL ISVD_UNUSED(mpi_rank); ISVD_UNUSED(Pmb); -#endif /// ISVD_USE_MKL +#endif // ISVD_USE_MKL // Deallocate memory isvd_Free(a0); diff --git a/cmake/packages.cmake b/cmake/packages.cmake index cb4dd4a..9dea958 100644 --- a/cmake/packages.cmake +++ b/cmake/packages.cmake @@ -39,8 +39,6 @@ if(ISVD_USE_PACKAGE) endforeach() endif() -# Set target - # Set target find_library( M_LIBRARY @@ -69,9 +67,6 @@ endif() mark_as_advanced(M_LIBRARY PTHREAD_LIBRARY) set(DEFAULT_LIBRARY ${M_LIBRARY} ${PTHREAD_LIBRARY}) -mark_as_advanced(M_LIBRARY PTHREAD_LIBRARY) -set(DEFAULT_LIBRARY ${M_LIBRARY} ${PTHREAD_LIBRARY}) - function(ISVD_SET_TARGET target) set_property(TARGET ${target} PROPERTY OUTPUT_NAME "${target}${BIN_SUFFIX}") target_link_libraries(${target} ${DEFAULT_LIBRARY}) diff --git a/cpplint/CMakeLists.txt b/cpplint/CMakeLists.txt index feaed51..d566fe4 100644 --- a/cpplint/CMakeLists.txt +++ b/cpplint/CMakeLists.txt @@ -7,7 +7,7 @@ mark_as_advanced(CMAKE_CPPLINT) # Break if(NOT CMAKE_CPPLINT) - # Add rule 'doc' + # Add rule 'cpplint' add_custom_target( cpplint COMMAND eval "exit 1" @@ -36,5 +36,5 @@ add_custom_target( COMMENT "Run cpplint" ) -set_cpplint_target(include/c 128 "-build/include,-build/include_order,-readability/casting,-whitespace/blank_line,-whitespace/braces,-whitespace/parens") -set_cpplint_target(lib 128 "-build/include,-build/include_order,-build/include_what_you_use,-readability/casting,-whitespace/blank_line,-whitespace/braces,-whitespace/parens") +set_cpplint_target(tmp/src/include/c 128 "-build/include,-build/include_order,-readability/casting,-whitespace/blank_line,-whitespace/braces,-whitespace/parens") +set_cpplint_target(tmp/src/lib 128 "-build/include,-build/include_order,-build/include_what_you_use,-readability/casting,-whitespace/blank_line,-whitespace/braces,-whitespace/parens") diff --git a/doxygen/tutorial/core/notation.dox b/doxygen/tutorial/core/notation.dox index f786b2a..47a4bb9 100644 --- a/doxygen/tutorial/core/notation.dox +++ b/doxygen/tutorial/core/notation.dox @@ -32,5 +32,5 @@ - For \f$j = P-1\f$, \f$n^{(j)} = n - n_b(P-1)\f$. - \f$n^{(0)} + n^{(1)} + \dotsb + n^{(P-1)} = n\f$. - \see isvd_Param + \see \ref isvd_Param */ diff --git a/src/include/c/isvd/core/param.h b/src/include/c/isvd/core/param.h index 223875d..7b91165 100644 --- a/src/include/c/isvd/core/param.h +++ b/src/include/c/isvd/core/param.h @@ -20,7 +20,9 @@ extern "C" { /// \ingroup c_core_module /// \brief The parameters. /// -/// \see \ref tutorial_core_notation +/// \note Use \ref isvd_createParam to initialize the parameters rather than directly declaring it. +/// +/// \see \ref isvd_createParam, \ref tutorial_core_notation /// typedef struct { @@ -93,6 +95,8 @@ typedef struct { /// \ingroup c_core_module /// \brief Initializes the parameters. /// +/// \see \ref isvd_Param, \ref tutorial_core_notation +/// isvd_Param isvd_createParam( const isvd_int_t nrow, const isvd_int_t ncol, const isvd_int_t rank, const isvd_int_t over_rank, const isvd_int_t num_sketch, const mpi_int_t mpi_root, const isvd_MpiComm mpi_comm diff --git a/src/include/c/isvd/def.h b/src/include/c/isvd/def.h index dbf2180..98a1cb3 100644 --- a/src/include/c/isvd/def.h +++ b/src/include/c/isvd/def.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #undef I @@ -91,16 +92,7 @@ typedef int omp_int_t; /// \ingroup c_core_module /// \brief The MPI communicator type. -#if !defined(DOXYGEN_SHOULD_SKIP_THIS) -#if !defined(__cplusplus) -typedef int isvd_MpiComm; -#else // __cplusplus -#include typedef MPI_Comm isvd_MpiComm; -#endif // __cplusplus -#else // DOXYGEN_SHOULD_SKIP_THIS) -typedef MPI_Comm isvd_MpiComm; -#endif // DOXYGEN_SHOULD_SKIP_THIS #if defined(__cplusplus) } diff --git a/src/lib/libisvd/core/env.c b/src/lib/libisvd/core/env.c index e7a5602..88b5d1a 100644 --- a/src/lib/libisvd/core/env.c +++ b/src/lib/libisvd/core/env.c @@ -43,6 +43,6 @@ void isvd_PrintEnvironment_cpu( const isvd_MpiComm mpi_comm ) { mpi_int_t mpi_size = isvd_getMpiSize(mpi_comm); omp_int_t omp_size = isvd_getOmpMaxSize(); - printf("iSVD %s, %lu-bit isvd_int_t, %lu-bit pointer\n", ISVD_VERSION, sizeof(isvd_int_t) * 8, sizeof(void*) * 8); - printf("%d MPI processors, %d OpenMP threads per process\n\n", mpi_size, omp_size); + printf("iSVD %s, %lu-bit isvd_int_t, %lu-bit pointer.\n", ISVD_VERSION, sizeof(isvd_int_t) * 8, sizeof(void*) * 8); + printf("%d MPI processors, %d OpenMP threads per process.\n\n", mpi_size, omp_size); } diff --git a/src/lib/libisvd/core/param.c b/src/lib/libisvd/core/param.c index bf2ab42..a75d679 100644 --- a/src/lib/libisvd/core/param.c +++ b/src/lib/libisvd/core/param.c @@ -21,8 +21,8 @@ isvd_Param isvd_createParam( const isvd_MpiComm mpi_comm ) { - mpi_int_t mpi_size = isvd_getMpiSize(MPI_COMM_WORLD); - mpi_int_t mpi_rank = isvd_getMpiRank(MPI_COMM_WORLD); + mpi_int_t mpi_size = isvd_getMpiSize(mpi_comm); + mpi_int_t mpi_rank = isvd_getMpiRank(mpi_comm); struct { isvd_int_t nrow_; diff --git a/src/lib/libisvd/def.h b/src/lib/libisvd/def.h index 983eb98..6202b48 100644 --- a/src/lib/libisvd/def.h +++ b/src/lib/libisvd/def.h @@ -65,8 +65,8 @@ extern "C" { #endif // ISVD_USE_GTEST && __cplusplus -#define isvd_assert_pass( condition ) { isvd_int_t code = condition; ISVD_UNUSED(code); isvd_assert_eq(code, 0); } -#define isvd_assert_code( condition ) { isvd_int_t code = condition; ISVD_UNUSED(code); isvd_assert_ne(code, 0); } +#define isvd_assert_pass( condition ) { isvd_assert_eq(condition, 0); } +#define isvd_assert_code( condition ) { isvd_assert_ne(condition, 0); } #define isvd_assert_fail() { isvd_assert_true(false); } //\} diff --git a/src/lib/libisvd/gpu/def.h b/src/lib/libisvd/gpu/def.h index ca85b33..fc61bde 100644 --- a/src/lib/libisvd/gpu/def.h +++ b/src/lib/libisvd/gpu/def.h @@ -26,4 +26,9 @@ static const size_t isvd_kBlockSizeGpu = 64; +#define isvd_assert_pass_cuda( condition ) \ + cudaError_t code = condition; \ + if ( code ) fprintf(stderr, "[%s] %s!\n", cudaGetErrorName(code), cudaGetErrorString(code)); \ + isvd_assert_pass(code); + #endif // LIBISVD_GPU_DEF_H_ diff --git a/src/lib/libisvd/gpu/env.c b/src/lib/libisvd/gpu/env.c index 6bed49a..9471b2e 100644 --- a/src/lib/libisvd/gpu/env.c +++ b/src/lib/libisvd/gpu/env.c @@ -29,7 +29,7 @@ void isvd_Init_gpu( int *argcp, char ***argvp, const isvd_MpiComm mpi_comm ) { ISVD_UNUSED(argvp); const isvd_int_t mpi_rank = isvd_getMpiRank(mpi_comm); int count = 0; - isvd_assert_pass(cudaGetDeviceCount(&count)); + isvd_assert_pass_cuda(cudaGetDeviceCount(&count)); isvd_assert_ne(count, 0); magma_init(); magma_setdevice(mpi_rank % count);