Skip to content

Commit

Permalink
Merge branch 'hotfix/1.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
emfomy committed Sep 14, 2017
2 parents cb2b9eb + de22bdd commit e4127b3
Show file tree
Hide file tree
Showing 129 changed files with 1,706 additions and 1,311 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ include(cmake/vars.cmake)

# Add subdirectories
add_subdirectory(ext)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(demo)
add_subdirectory(share)
Expand Down
31 changes: 20 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Integrated Singular Value Decomposition (iSVD)
* https://github.com/emfomy/isvd

### Documentation
* http://emfomy.github.io/isvd
* Please download from https://github.com/emfomy/isvd/releases or build using **make doc** (see below) on your own computer.

### Author
* Mu Yang <<emfomy@gmail.com>>
Expand All @@ -33,17 +33,18 @@ Integrated Singular Value Decomposition (iSVD)
Please use the following commands to create Makefiles

```
cd <isvd-source-folder>
mkdir build
cd build
cmake <path-to-source>
cmake ..
```

### Options

Use the following command to set options

```
ccmake <path-to-source>
ccmake ..
```

The following table are the main options
Expand All @@ -67,20 +68,28 @@ The following table are the main options

### Makefile

The following table are the main make rules
The following table are the main Makefile rules

| Command | Detail |
|----------------|--------------------------------|
| `make all` | build all libraries |
| `make install` | install package |
| `make check` | build and run unit tests |
| `make doc` | build documentation |
| `make help` | display make-rules |
| Command | Detail | Options |
|----------------|--------------------------------|--------------------------------|
| `make all` | build all libraries | |
| `make install` | install package | |
| `make check` | build and run unit tests | Require `ISVD_BUILD_TEST` |
| `make doc` | build documentation | Require `ISVD_BUILD_DOC` |
| `make help` | display make-rules | |

### Test installation

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

## Usage

* Define `ISVD_USE_ILP64` before include `isvd.h` to use 64-bit integer.
* All 64bit libraries and executables are named with suffix "`_64`".
* The header files are located in `build/include`
* The libraries are located in `build/lib`

### Libraries

Expand Down
14 changes: 7 additions & 7 deletions check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function(ISVD_SET_TARGET_CHECK_CPU target)
isvd_set_target_mpi(${target} CXX)
isvd_set_target_blas(${target})
isvd_set_target_gtest(${target})
target_link_libraries(${target} checkisvd extmmio)
target_link_libraries(${target} checkisvd_gpu_none checkisvd_core_la extmmio)
target_compile_definitions(${target} PUBLIC "-DISVD_DATA_PATH=\"${PROJECT_SOURCE_DIR}/data\"")
endfunction()

Expand All @@ -45,18 +45,18 @@ function(ISVD_SET_TARGET_CHECK_GPU target)
isvd_set_target_blas(${target})
isvd_set_target_gtest(${target})
isvd_set_target_gpu(${target})
target_link_libraries(${target} checkisvd_gpu extmmio)
target_link_libraries(${target} checkisvd_gpu_magma checkisvd_core_la extmmio)
target_compile_definitions(${target} PUBLIC "-DISVD_DATA_PATH=\"${PROJECT_SOURCE_DIR}/data\"")
endfunction()

# Set include paths
include_directories("${PROJECT_CONFIG_DIR}/include/c"
"${CMAKE_CURRENT_CONFIG_DIR}/src"
"${PROJECT_CONFIG_DIR}/src"
SYSTEM "${PROJECT_SOURCE_DIR}/ext")
include_directories("${CMAKE_CURRENT_CONFIG_DIR}/lib"
"${PROJECT_BINARY_DIR}/include/c"
"${PROJECT_BINARY_DIR}/lib"
SYSTEM "${PROJECT_SOURCE_DIR}/ext/mmio")

# Add subdirectories
add_subdirectory(src)
add_subdirectory(lib)

# Configure files
isvd_configure_x_fn("${CMAKE_CURRENT_SOURCE_DIR}/check" "${CMAKE_CURRENT_CONFIG_DIR}/check" "${ISVD_S_TYPES}")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <mpi.h>
#include <mmio/mmio.h>
#include <mmio.h>
#include <isvd.h>
#include <libisvd.h>

Expand All @@ -10,7 +10,7 @@
#define serr 1e-3
#define derr 1e-8

typedef @xtype@ isvd_val_t;
typedef @xtype_____@ isvd_val_t;

TEST(@XStr@_HierarchicalReductionIntegration, Test) {

Expand All @@ -26,7 +26,7 @@ TEST(@XStr@_HierarchicalReductionIntegration, Test) {

// Read Qs
file = fopen(QS_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand All @@ -47,7 +47,7 @@ TEST(@XStr@_HierarchicalReductionIntegration, Test) {

// Read Qbar
file = fopen(Q_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand Down Expand Up @@ -92,12 +92,12 @@ TEST(@XStr@_HierarchicalReductionIntegration, Test) {
isvd_int_t ldqt = l;

// Run stage
isvd_@x@IntegrateHierarchicalReduction(param, nullptr, 0, nullptr, 0, qst, ldqst, qt, ldqt);
isvd_@x@IntegrateHierarchicalReduction(param, NULL, 0, NULL, 0, qst, ldqst, qt, ldqt);

// Gather results
isvd_val_t *qt_ = isvd_@x@malloc(l * Pmb);
isvd_int_t ldqt_ = l;
MPI_Gather(qt, mb*ldqt, MPI_@X_TYPE@, qt_, mb*ldqt, MPI_@X_TYPE@, mpi_root, MPI_COMM_WORLD);
MPI_Gather(qt, mb*ldqt, MPI_@XTYPE@, qt_, mb*ldqt, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);

if ( mpi_rank == mpi_root ) {
// Compute space
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <mpi.h>
#include <mmio/mmio.h>
#include <mmio.h>
#include <isvd.h>
#include <libisvd.h>

Expand All @@ -15,7 +15,7 @@
#define serr 1e-3
#define derr 1e-8

typedef @xtype@ isvd_val_t;
typedef @xtype_____@ isvd_val_t;

TEST(@XStr@_KolmogorovNagumoIntegration, Test) {

Expand All @@ -31,7 +31,7 @@ TEST(@XStr@_KolmogorovNagumoIntegration, Test) {

// Read Qs
file = fopen(QS_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand All @@ -52,7 +52,7 @@ TEST(@XStr@_KolmogorovNagumoIntegration, Test) {

// Read Qbar
file = fopen(Q_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand Down Expand Up @@ -107,7 +107,7 @@ TEST(@XStr@_KolmogorovNagumoIntegration, Test) {
// Gather results
isvd_val_t *qt_ = isvd_@x@malloc(l * Pmb);
isvd_int_t ldqt_ = l;
MPI_Gather(qt, mb*ldqt, MPI_@X_TYPE@, qt_, mb*ldqt, MPI_@X_TYPE@, mpi_root, MPI_COMM_WORLD);
MPI_Gather(qt, mb*ldqt, MPI_@XTYPE@, qt_, mb*ldqt, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);

// Check results
if ( mpi_rank == mpi_root ) {
Expand Down
10 changes: 5 additions & 5 deletions check/check/libisvd/core/stage/@x@_integrate_wen_yin.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <mpi.h>
#include <mmio/mmio.h>
#include <mmio.h>
#include <isvd.h>
#include <libisvd.h>

Expand All @@ -15,7 +15,7 @@
#define serr 1e-3
#define derr 1e-8

typedef @xtype@ isvd_val_t;
typedef @xtype_____@ isvd_val_t;

TEST(@XStr@_WenYinIntegration, Test) {

Expand All @@ -31,7 +31,7 @@ TEST(@XStr@_WenYinIntegration, Test) {

// Read Qs
file = fopen(QS_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand All @@ -52,7 +52,7 @@ TEST(@XStr@_WenYinIntegration, Test) {

// Read Qbar
file = fopen(Q_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand Down Expand Up @@ -107,7 +107,7 @@ TEST(@XStr@_WenYinIntegration, Test) {
// Gather results
isvd_val_t *qt_ = isvd_@x@malloc(l * Pmb);
isvd_int_t ldqt_ = l;
MPI_Gather(qt, mb*ldqt, MPI_@X_TYPE@, qt_, mb*ldqt, MPI_@X_TYPE@, mpi_root, MPI_COMM_WORLD);
MPI_Gather(qt, mb*ldqt, MPI_@XTYPE@, qt_, mb*ldqt, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);

// Check results
if ( mpi_rank == mpi_root ) {
Expand Down
12 changes: 6 additions & 6 deletions check/check/libisvd/core/stage/@x@_orthogonalize_gramian.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <mpi.h>
#include <mmio/mmio.h>
#include <mmio.h>
#include <isvd.h>
#include <libisvd.h>

Expand All @@ -10,7 +10,7 @@
#define serr 1e-3
#define derr 1e-8

typedef @xtype@ isvd_val_t;
typedef @xtype_____@ isvd_val_t;

TEST(@XStr@_GramianOrthogonalization, Test) {

Expand All @@ -25,7 +25,7 @@ TEST(@XStr@_GramianOrthogonalization, Test) {

// Read Ys
file = fopen(YS_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand All @@ -46,7 +46,7 @@ TEST(@XStr@_GramianOrthogonalization, Test) {

// Read Qs
file = fopen(QS_PATH, "r");
ASSERT_NE(file, (void*)(nullptr));
ASSERT_NE(file, nullptr);
ASSERT_EQ(mm_read_banner(file, &matcode), 0);
EXPECT_TRUE(mm_is_array(matcode)) << mm_typecode_to_str(matcode);
EXPECT_TRUE(mm_is_real(matcode)) << mm_typecode_to_str(matcode);
Expand Down Expand Up @@ -90,12 +90,12 @@ TEST(@XStr@_GramianOrthogonalization, Test) {
isvd_@x@Omatcopy('N', Nl, mj, 1.0, yst0 + param.rowidxbegin * ldyst0, ldyst0, yst, ldyst);

// Run
isvd_@x@OrthogonalizeGramian(param, nullptr, 0, nullptr, 0, yst, ldyst);
isvd_@x@OrthogonalizeGramian(param, NULL, 0, NULL, 0, yst, ldyst);

// Gather results
isvd_val_t *qst_ = isvd_@x@malloc(Pmb * ldyst);
isvd_int_t ldqst_ = ldyst;
MPI_Gather(yst, mb*ldyst, MPI_@X_TYPE@, qst_, mb*ldyst, MPI_@X_TYPE@, mpi_root, MPI_COMM_WORLD);
MPI_Gather(yst, mb*ldyst, MPI_@XTYPE@, qst_, mb*ldyst, MPI_@XTYPE@, mpi_root, MPI_COMM_WORLD);

if ( mpi_rank == mpi_root ) {
// Compute space
Expand Down
Loading

0 comments on commit e4127b3

Please sign in to comment.