Skip to content

Commit

Permalink
resolved merge conflicts, added version check and edited output timin…
Browse files Browse the repository at this point in the history
…g convention

Change-Id: I98fa548599b99ff6924e882bddeb6434402125cf
  • Loading branch information
vchunchu-amd committed Jul 19, 2022
2 parents 9492a4a + 8fda2e3 commit 3083dca
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ CMake:
a. Latest Ninja Binary at https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip
1. Intel OneAPI toolkit, should include C, C++, Fortran Compilers, MPI, MKL libraries (refer https://software.intel.com/content/www/us/en/develop/articles/oneapi-standalone-components.html#vtune)
2. Prebuilt AOCL libraries for Blis, Libflame and Scalapack
a. Blis and Libflame libraries can be built from source or extracted from AOCL_Windows-setup-xxxx-AMD.exe based on integer size needed, LP64 or ILP64. Refer https://developer.amd.com/amd-aocl/ for more details.
1. Choose MT Shared libraries for Blis: AOCL-LibBlis-Win-MT-dll.lib and AOCL-LibBlis-Win-MT-dll.dll
2. Shared libraries for Libflame: AOCL-LibFlame-Win-MT-dll.lib and AOCL-LibFlame-Win-MT-dll.dll
b. Scalapack library needs to be built manually after the below changes to sources for Mumps
a. Comment the line that sets 'lowercase' to 'CMAKE_Fortran_FLAGS' variable in aocl-scalapack\BLACS\INSTALL\CMakeLists.txt and aocl-scalapack/CMakeLists.txt
#set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /names:lowercase")
b. Remove DTL Logging source files "aocl_dtl_trace_entry.c" and "aocl_dtl_trace_exit.c" from aocl-scalapack\SRC\CMakeLists.txt
c. Link the Blis/Libflame libraries that are extracted from AMD installer exe and build the Scalapack library
d. Refer AOCL User Guide for build instructions of Scalapack at https://developer.amd.com/amd-aocl/
c. LP64/ILP64 libraries of the dependent libraries (Blis, Libflame and Scalapack) need to be linked with the corresponding Mumps LP64/ILP64 builds

3. If reordering library is chosen to be Metis, Prebuilt Metis Library from SuiteSparse public repo (https://github.com/group-gu/SuiteSparse.git). Build Metis library separately from metis folder.
a. cd SuiteSparse\metis-5.1.0
b. Define IDXTYPEWIDTH and REALTYPEWIDTH to 32/64 based on integer size required in metis/include/metis.h
Expand Down
23 changes: 5 additions & 18 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.77 REQUIRED) # header only libraries must not be added here

if(MUMPS_UPSTREAM_VERSION VERSION_LESS 5.1)
message(STATUS "Mumps version set is less than 5.1. Not supported.")
return()
endif()

if("d" IN_LIST arith)
add_executable(amd_aocl amd_mumps.cpp)
target_compile_options(amd_aocl PRIVATE /Qopenmp /Qopenmp-threadprivate:compat -DAdd_)
Expand All @@ -51,21 +56,3 @@ if("d" IN_LIST arith)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
target_link_libraries(Csimple PRIVATE ${IMPI_LIB_ILP64} ${MPI_C_LIBRARIES} MUMPS::MUMPS ${NUMERIC_LIBS})
endif()

if(MUMPS_UPSTREAM_VERSION VERSION_LESS 5.1)
return()
endif()

# Windows DLL
get_property(test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)

set_tests_properties(${test_names} PROPERTIES
RESOURCE_LOCK cpu_mpi
TIMEOUT 30
)

if(WIN32 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
set_tests_properties(${test_names} PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_append:${CMAKE_INSTALL_PREFIX}/bin;PATH=path_list_append:${CMAKE_PREFIX_PATH}/bin;PATH=path_list_append:${PROJECT_BINARY_DIR}"
)
endif()
21 changes: 12 additions & 9 deletions tests/amd_mumps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,15 @@ int main(int argc, char* argv[]) {
{
int ompNumThrds = omp_get_max_threads();
double sparsity_percent = 0.0;
double symbolic_t = 0.0, numeric_t = 0.0, solve_t = 0.0, sns_t = 0.0;
double symbolic_t = 0.0, numeric_t = 0.0, solve_t = 0.0, afs_t = 0.0, fs_t = 0.0;
sparsity_percent = (nrows * nrows) - nnz;
sparsity_percent = sparsity_percent / (nrows * nrows);
sparsity_percent = sparsity_percent * 100;
symbolic_t = std::chrono::duration_cast<ns>(SymbolicFactorizationTime).count() / 1.0e9;
numeric_t = std::chrono::duration_cast<ns>(NumericFactorizationTime).count() / 1.0e9;
solve_t = std::chrono::duration_cast<ns>(FBSolveTime).count() / 1.0e9;
sns_t = std::chrono::duration_cast<ns>(SymbolicFactorizationTime + NumericFactorizationTime + FBSolveTime).count() / 1.0e9;
afs_t = std::chrono::duration_cast<ns>(SymbolicFactorizationTime + NumericFactorizationTime + FBSolveTime).count() / 1.0e9;
fs_t = std::chrono::duration_cast<ns>(NumericFactorizationTime + FBSolveTime).count() / 1.0e9;
#ifdef PARAM_LOG
std::cout.precision(2);
std::cout.setf(std::ios::fixed);
Expand All @@ -372,10 +373,11 @@ int main(int argc, char* argv[]) {
<< std::setw(12) << "nnz"
<< std::setw(12) << "mpi_ranks"
<< std::setw(12) << "sparsity_%"
<< std::setw(16) << "symbolic_time"
<< std::setw(16) << "numeric_time"
<< std::setw(16) << "analysis_time"
<< std::setw(16) << "fact_time"
<< std::setw(16) << "solve_time"
<< std::setw(16) << "sns_time"
<< std::setw(16) << "afs_time"
<< std::setw(16) << "fs_time"
<< std::setw(12) << "relativeError"
<< std::endl;

Expand All @@ -387,12 +389,13 @@ int main(int argc, char* argv[]) {
<< std::setw(16) << std::scientific << symbolic_t
<< std::setw(16) << std::scientific << numeric_t
<< std::setw(16) << std::scientific << solve_t
<< std::setw(16) << std::scientific << sns_t
<< std::setw(16) << std::scientific << afs_t
<< std::setw(16) << std::scientific << fs_t
<< std::setw(12) << std::fixed << relativeError << std::endl;
#else
//input, mpiProcs, ompThrds, symmetry, nrows, nnz, sparsity_%, symbolic_t, numeric_t, solve_t, sns_t, relError
printf("%s, %d, %d, %d, %d, %d, %5.2f, %5.2f, %5.2f, %5.2f, %5.2f, %5.2f\n", matrix_name.c_str(), comm_size, ompNumThrds, id.sym, nrows, nnz, sparsity_percent,
symbolic_t, numeric_t, solve_t, sns_t, relativeError);
//input, mpiProcs, ompThrds, symmetry, nrows, nnz, sparsity_%, analysis_time, fact_time, solve_t, afs_time, fs_time, relError
printf("%s, %d, %d, %d, %d, %d, %5.2f, %5.2f, %5.2f, %5.2f, %5.2f, %5.2f, %5.2f\n", matrix_name.c_str(), comm_size, ompNumThrds, id.sym, nrows, nnz, sparsity_percent,
symbolic_t, numeric_t, solve_t, afs_t, fs_t, relativeError);
#endif
}

Expand Down

0 comments on commit 3083dca

Please sign in to comment.