Skip to content

Commit

Permalink
Merge branch 'hotfix/1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
emfomy committed Oct 12, 2017
2 parents b2b732e + aec102e commit 45da290
Show file tree
Hide file tree
Showing 52 changed files with 629 additions and 587 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include(cmake/old.cmake)
set(ISVD_NAME "Integrated Singular Value Decomposition")
set(ISVD_MAJOR_VERSION 1)
set(ISVD_MINOR_VERSION 2)
set(ISVD_PATCH_VERSION 0)
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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The following table are the main options
| `ISVD_INDEX_TYPE` | the selection index type. | Options: `32/64` |
| `ISVD_OMP` | the selection OpenMP library. | Options: `OFF/GOMP/IOMP` |
| `ISVD_USE_GPU` | enable GPU support. | |
| `ISVD_VERBOSE_TEST` | enable verbose unit tests. | |
| `ISVD_TEST_VERBOSE` | enable verbose unit tests. | |
| `GTEST_ROOT` | the root path of Google Test. | Require `ISVD_BUILD_TEST` |
| `INTEL_ROOT` | the root path of Intel libraries. | Require `ISVD_BLAS = MKL` |
| `MKL_ROOT` | the root path of Intel MKL. | Require `ISVD_BLAS = MKL` |
Expand All @@ -81,7 +81,7 @@ The following table are the main Makefile rules

### Test installation

* Set `ISVD_BUILD_TEST` using **ccmake**. (Also recommended to unset `ISVD_VERBOSE_TEST` if GPU is enabled).
* Set `ISVD_BUILD_TEST` using **ccmake**. (Also recommended to unset `ISVD_TEST_VERBOSE` if GPU is enabled).
* Run **make check**
* Known issue: **RealSingle_WenYinIntegration.Test.#** / **s_integrate_wen_yin_#** fail the test.

Expand Down
2 changes: 1 addition & 1 deletion check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ endmacro()
# Set double unit tests
isvd_check_fn("${ISVD_S_TYPES}")
isvd_check_fn("${ISVD_D_TYPES}")
unset(isvd_check_fn)
unset(isvd_check_fn)
4 changes: 2 additions & 2 deletions check/check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ macro(_ADD_CHECK checktype)
_add_check_predo("${checktype}" "")

# Add test
if(ISVD_VERBOSE_TEST)
if(ISVD_TEST_VERBOSE)
gtest_add_tests($<TARGET_FILE:${checktarget}> "" ${checkmain} ${files})
else()
add_test(NAME ${checkname} COMMAND $<TARGET_FILE:${checktarget}>)
Expand All @@ -49,7 +49,7 @@ macro(_ADD_MPI_CHECK checktype listprocs)
_add_check_predo("${checktype}")

# Add test
if(ISVD_VERBOSE_TEST)
if(ISVD_TEST_VERBOSE)
gtest_add_mpi_tests($<TARGET_FILE:${checktarget}> "${listprocs}" "" ${checkmain} ${files})
else()
foreach(procs ${listprocs})
Expand Down
26 changes: 24 additions & 2 deletions check/check/libisvd/core/stage/@x@_postprocess_symmetric.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
const isvd_int_t mj = param.nrow_proc;
const isvd_int_t mb = param.nrow_each;
const isvd_int_t Pmb = param.nrow_total;
const isvd_int_t nb = param.ncol_each;
const isvd_int_t Pnb = param.ncol_total;

// Create matrices
isvd_val_t *a;
Expand Down Expand Up @@ -182,12 +184,15 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_val_t *ut_ = isvd_@x@malloc(l * Pmb);
isvd_int_t ldut_ = l;

isvd_val_t *vt_ = isvd_@x@malloc(l * Pnb);
isvd_int_t ldvt_ = l;

switch ( jobuv ) {
case GatherUV: {

// Run stage
isvd_@x@PostprocessSymmetric(param, NULL, 0, NULL, 0, dista_, ordera_,
a, lda, qt, ldqt, s, ut_, ldut_, NULL, 0, mpi_root, -2);
a, lda, qt, ldqt, s, ut_, ldut_, vt_, ldvt_, mpi_root, mpi_root);

break;
}
Expand All @@ -198,15 +203,20 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_val_t *ut = isvd_@x@malloc(l * mb);
isvd_int_t ldut = l;

isvd_val_t *vt = isvd_@x@malloc(l * nb);
isvd_int_t ldvt = l;

// Run stage
isvd_@x@PostprocessSymmetric(param, NULL, 0, NULL, 0, dista_, ordera_,
a, lda, qt, ldqt, s, ut, ldut, NULL, 0, -1, -2);
a, lda, qt, ldqt, s, ut, ldut, vt, ldvt, -1, -1);

// Gather results
MPI_Gather(ut, mb*ldut, MPI_@XTYPE@, ut_, mb*ldut, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);
MPI_Gather(vt, nb*ldvt, MPI_@XTYPE@, vt_, nb*ldvt, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);

// Deallocate memory
isvd_free(ut);
isvd_free(vt);

break;
}
Expand Down Expand Up @@ -236,19 +246,30 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_int_t lduut_ = m;
isvd_val_t *uut0 = isvd_@x@malloc(m * m);
isvd_int_t lduut0 = m;
isvd_val_t *vvt_ = isvd_@x@malloc(n * n);
isvd_int_t ldvvt_ = n;
isvd_val_t *vvt0 = uut0;
isvd_int_t ldvvt0 = lduut0;
isvd_@x@Syrk('U', 'T', m, k, 1.0, ut_, ldut_, 0.0, uut_, lduut_);
isvd_@x@Syrk('U', 'T', m, k, 1.0, ut0, ldut0, 0.0, uut0, lduut0);
isvd_@x@Syrk('U', 'T', n, k, 1.0, vt_, ldvt_, 0.0, vvt_, ldvvt_);

// Check results
for ( isvd_int_t ir = 0; ir < m; ++ir ) {
for ( isvd_int_t ic = ir; ic < m; ++ic ) {
ASSERT_NEAR(uut_[ir+ic*lduut_], uut0[ir+ic*lduut0], @x@err) << "(ir, ic) = (" << ir << ", " << ic << ")";
}
}
for ( isvd_int_t ir = 0; ir < n; ++ir ) {
for ( isvd_int_t ic = ir; ic < n; ++ic ) {
ASSERT_NEAR(vvt_[ir+ic*ldvvt_], vvt0[ir+ic*ldvvt0], @x@err) << "(ir, ic) = (" << ir << ", " << ic << ")";
}
}

// Deallocate memory
isvd_free(uut_);
isvd_free(uut0);
isvd_free(vvt_);
}
}

Expand All @@ -260,6 +281,7 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_free(qt);
isvd_free(s);
isvd_free(ut_);
isvd_free(vt_);
}

TEST(@XStr@_SymmetricPostprocessing, BlockCol_ColMajor_GatherUV) {
Expand Down
28 changes: 25 additions & 3 deletions check/check/libisvd/gpu/stage/@x@_postprocess_symmetric_gpu.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
const isvd_int_t mj = param.nrow_proc;
const isvd_int_t mb = param.nrow_each;
const isvd_int_t Pmb = param.nrow_total;
const isvd_int_t nb = param.ncol_each;
const isvd_int_t Pnb = param.ncol_total;

// Create matrices
isvd_val_t *a;
Expand Down Expand Up @@ -182,12 +184,15 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_val_t *ut_ = isvd_@x@malloc(l * Pmb);
isvd_int_t ldut_ = l;

isvd_val_t *vt_ = isvd_@x@malloc(l * Pnb);
isvd_int_t ldvt_ = l;

switch ( jobuv ) {
case GatherUV: {

// Run stage
isvd_@x@PostprocessSymmetric_gpu(param, NULL, 0, NULL, 0, dista_, ordera_,
a, lda, qt, ldqt, s, ut_, ldut_, NULL, 0, mpi_root, -2);
a, lda, qt, ldqt, s, ut_, ldut_, vt_, ldvt_, mpi_root, mpi_root);

break;
}
Expand All @@ -198,15 +203,20 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_val_t *ut = isvd_@x@malloc(l * mb);
isvd_int_t ldut = l;

isvd_val_t *vt = isvd_@x@malloc(l * nb);
isvd_int_t ldvt = l;

// Run stage
isvd_@x@PostprocessSymmetric_gpu(param, NULL, 0, NULL, 0, dista_, ordera_,
a, lda, qt, ldqt, s, ut, ldut, NULL, 0, -1, -2);
a, lda, qt, ldqt, s, ut, ldut, vt, ldvt, -1, -1);

// Gather results
MPI_Gather(ut, mb*ldut, MPI_@XTYPE@, ut_, mb*ldut, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);
MPI_Gather(vt, nb*ldvt, MPI_@XTYPE@, vt_, nb*ldvt, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);

// Deallocate memory
isvd_free(ut);
isvd_free(vt);

break;
}
Expand All @@ -215,7 +225,7 @@ static void test( char dista, char ordera, const JobUV jobuv ) {

// Run stage
isvd_@x@PostprocessSymmetric_gpu(param, NULL, 0, NULL, 0, dista_, ordera_,
a, lda, qt, ldqt, s, NULL, 0, NULL, 0, -2, -2);
a, lda, qt, ldqt, s, NULL, 0, NULL, 0, -2, -2);

break;
}
Expand All @@ -236,19 +246,30 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_int_t lduut_ = m;
isvd_val_t *uut0 = isvd_@x@malloc(m * m);
isvd_int_t lduut0 = m;
isvd_val_t *vvt_ = isvd_@x@malloc(n * n);
isvd_int_t ldvvt_ = n;
isvd_val_t *vvt0 = uut0;
isvd_int_t ldvvt0 = lduut0;
isvd_@x@Syrk('U', 'T', m, k, 1.0, ut_, ldut_, 0.0, uut_, lduut_);
isvd_@x@Syrk('U', 'T', m, k, 1.0, ut0, ldut0, 0.0, uut0, lduut0);
isvd_@x@Syrk('U', 'T', n, k, 1.0, vt_, ldvt_, 0.0, vvt_, ldvvt_);

// Check results
for ( isvd_int_t ir = 0; ir < m; ++ir ) {
for ( isvd_int_t ic = ir; ic < m; ++ic ) {
ASSERT_NEAR(uut_[ir+ic*lduut_], uut0[ir+ic*lduut0], @x@err) << "(ir, ic) = (" << ir << ", " << ic << ")";
}
}
for ( isvd_int_t ir = 0; ir < n; ++ir ) {
for ( isvd_int_t ic = ir; ic < n; ++ic ) {
ASSERT_NEAR(vvt_[ir+ic*ldvvt_], vvt0[ir+ic*ldvvt0], @x@err) << "(ir, ic) = (" << ir << ", " << ic << ")";
}
}

// Deallocate memory
isvd_free(uut_);
isvd_free(uut0);
isvd_free(vvt_);
}
}

Expand All @@ -260,6 +281,7 @@ static void test( char dista, char ordera, const JobUV jobuv ) {
isvd_free(qt);
isvd_free(s);
isvd_free(ut_);
isvd_free(vt_);
}

TEST(@XStr@_SymmetricPostprocessing_Gpu, BlockCol_ColMajor_GatherUV) {
Expand Down
18 changes: 15 additions & 3 deletions check/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ isvd_set_target(checkisvd_core_la)
isvd_set_target_omp(checkisvd_core_la CXX)
isvd_set_target_mpi(checkisvd_core_la CXX)
isvd_set_target_blas(checkisvd_core_la)
isvd_set_target_gtest(checkisvd_core_la)
if(ISVD_TEST_DEEP)
isvd_set_target_gtest(checkisvd_core_la)
else()
target_compile_definitions(checkisvd_core_la PRIVATE "NDEBUG")
endif()

# checkisvd_gpu_none
file(GLOB_RECURSE files "${CMAKE_CURRENT_CONFIG_DIR}/libisvd/nogpu/*")
add_library(checkisvd_gpu_none EXCLUDE_FROM_ALL ${files})
isvd_set_target(checkisvd_gpu_none)
isvd_set_target_mpi(checkisvd_gpu_none CXX)
isvd_set_target_gtest(checkisvd_gpu_none)
if(ISVD_TEST_DEEP)
isvd_set_target_gtest(checkisvd_gpu_none)
else()
target_compile_definitions(checkisvd_gpu_none PRIVATE "NDEBUG")
endif()

# checkisvd_gpu_magma
if(ISVD_USE_GPU)
Expand All @@ -38,5 +46,9 @@ if(ISVD_USE_GPU)
isvd_set_target(checkisvd_gpu_magma)
isvd_set_target_mpi(checkisvd_gpu_magma CXX)
isvd_set_target_gpu(checkisvd_gpu_magma)
isvd_set_target_gtest(checkisvd_gpu_magma)
if(ISVD_TEST_DEEP)
isvd_set_target_gtest(checkisvd_gpu_magma)
else()
target_compile_definitions(checkisvd_gpu_magma PRIVATE "NDEBUG")
endif()
endif()
9 changes: 7 additions & 2 deletions cmake/display.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ message(STATUS "Set 'ISVD_BUILD_LIB' to build libraries.")
message(STATUS "Set 'ISVD_BUILD_TEST' to build unit tests.")
message(STATUS "Set 'ISVD_INDEX_TYPE' to select index type. [32/64]")
message(STATUS "Set 'ISVD_OMP' to select OpenMP library. [OFF/GOMP/IOMP]")
message(STATUS "Set 'ISVD_TEST_DEEP' to enable deep unit tests.")
message(STATUS "Set 'ISVD_TEST_VERBOSE' to enable verbose unit tests.")
message(STATUS "Set 'ISVD_USE_GPU' to enable GPU support.")
message(STATUS "Set 'ISVD_VERBOSE_TEST' to enable verbose unit tests.")
message(STATUS "")
message(STATUS "Set 'GTEST_ROOT' for the root path of Google Test. (Require 'ISVD_BUILD_TEST')")
message(STATUS "Set 'INTEL_ROOT' for the root path of Intel libraries. (Require 'ISVD_BLAS = MKL')")
Expand All @@ -52,7 +53,11 @@ if(NOT ISVD_USE_ILP64)
else()
disp("Integer type: " "64bit integer (ILP64)")
endif()
disp("Verbose unit tests: " "${ISVD_VERBOSE_TEST}")

message(STATUS "")

disp("Deep unit tests: " "${ISVD_TEST_DEEP}")
disp("Verbose unit tests: " "${ISVD_TEST_VERBOSE}")

message(STATUS "")
message(STATUS "================================================================================")
Expand Down
13 changes: 7 additions & 6 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ else()
endif()

# Set options
option(ISVD_BUILD_LIB "Build libraries." "ON")
option(ISVD_BUILD_DEMO "Build demo codes." "ON")
option(ISVD_BUILD_TEST "Build unit tests." "OFF")
option(ISVD_BUILD_DOC "Build documentation." "ON")
option(ISVD_USE_GPU "Enable GPU support." "OFF")
option(ISVD_VERBOSE_TEST "Verbose unit tests." "ON")
option(ISVD_BUILD_LIB "Build libraries." "ON")
option(ISVD_BUILD_DEMO "Build demo codes." "ON")
option(ISVD_BUILD_TEST "Build unit tests." "OFF")
option(ISVD_BUILD_DOC "Build documentation." "ON")
option(ISVD_USE_GPU "Enable GPU support." "OFF")
option(ISVD_TEST_DEEP "Enable deep unit tests." "ON")
option(ISVD_TEST_VERBOSE "Enable verbose unit tests." "ON")

set(ISVD_INDEX_TYPE "32" CACHE STRING "Index type. [32/64]")
set_property(CACHE ISVD_INDEX_TYPE PROPERTY STRINGS "32;64")
Expand Down
23 changes: 0 additions & 23 deletions cmake/vars.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,3 @@ list(APPEND ISVD_S_TYPES "s" "isvd_s_val_t" "Real Single" "RealSingle")
list(APPEND ISVD_D_TYPES "d" "isvd_d_val_t" "Real Double" "RealDouble")
list(APPEND ISVD_C_TYPES "c" "isvd_c_val_t" "Complex Single" "ComplexSingle")
list(APPEND ISVD_Z_TYPES "z" "isvd_z_val_t" "Complex Double" "ComplexDouble")

# BLAS definitions
set(
ISVD_TYPE_MACRO_DEFINE
"#define CHAR1 char"
"#define INT isvd_int_t"
"#define REAL4 isvd_s_val_t"
"#define REAL8 isvd_d_val_t"
"#define COMP4 isvd_c_val_t"
"#define COMP8 isvd_z_val_t"
)
string(REPLACE ";" "\n" ISVD_TYPE_MACRO_DEFINE "${ISVD_TYPE_MACRO_DEFINE}")

set(
ISVD_TYPE_MACRO_UNDEF
"#undef CHAR1"
"#undef INT"
"#undef REAL4"
"#undef REAL8"
"#undef COMP4"
"#undef COMP8"
)
string(REPLACE ";" "\n" ISVD_TYPE_MACRO_UNDEF "${ISVD_TYPE_MACRO_UNDEF}")
2 changes: 1 addition & 1 deletion doxygen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set(ISVD_DOCS_DIR "${ISVD_DOCS_DIR}" PARENT_SCOPE)
isvd_configure_fn("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_CONFIG_DIR}")

# Set install rule
install(DIRECTORY "${ISVD_DOCS_DIR}" DESTINATION docs)
install(DIRECTORY "${ISVD_DOCS_DIR}" DESTINATION docs OPTIONAL)

# Add rule
add_custom_target(
Expand Down
2 changes: 2 additions & 0 deletions src/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# The CMake setting of 'src/include/'

isvd_set_config_var()

# Set install rule
install(DIRECTORY "${CMAKE_CURRENT_CONFIG_DIR}/c/" DESTINATION include/c)
Loading

0 comments on commit 45da290

Please sign in to comment.