Made some changes to get additional configuration options working. Not sure yet

how to handle setting MPI flags in general.
This commit is contained in:
falgout 2012-03-14 00:30:30 +00:00
parent dd50449de1
commit de1c289538
9 changed files with 57 additions and 29 deletions

View File

@ -11,26 +11,23 @@ set (HYPRE_SRCDIR "${PROJECT_SOURCE_DIR}")
# Set default installation directory, but provide a means for users to change
set (HYPRE_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/hypre" CACHE PATH
"Installation directory for HYPRE")
set (CMAKE_INSTALL_PREFIX "${HYPRE_INSTALL_PREFIX}" CACHE INTERNAL
"Prefix prepended to install directories" FORCE)
set (CMAKE_INSTALL_PREFIX "${HYPRE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE)
# Set default compile optimization flag
set (HYPRE_BUILD_TYPE "RELEASE" CACHE STRING
"Optimization flags: set to DEBUG, RELEASE, RELWITHDEBINFO, or MINSIZEREL")
set (CMAKE_BUILD_TYPE "${HYPRE_BUILD_TYPE}" CACHE INTERNAL "" FORCE)
# Configuration options
option(HYPRE_BIGINT
"Use long long int for HYPRE_Int" OFF)
option(HYPRE_SEQUENTIAL
"Compile without MPI" OFF)
option(HYPRE_TIMING
"Use HYPRE timing routines" OFF)
option(HYPRE_USING_HYPRE_BLAS
"Use internal BLAS library" ON)
option(HYPRE_USING_HYPRE_LAPACK
"Use internal LAPACK library" ON)
option(HYPRE_NO_GLOBAL_PARTITION
"Use assumed partition" OFF)
option(HYPRE_PRINT_ERRORS
"Print HYPRE errors" OFF)
option(HYPRE_USING_OPENMP
"Use OpenMP" OFF)
option(HYPRE_SHARED "Build a shared library" OFF)
option(HYPRE_BIGINT "Use long long int for HYPRE_Int" OFF)
option(HYPRE_SEQUENTIAL "Compile without MPI" OFF)
option(HYPRE_TIMING "Use HYPRE timing routines" OFF)
option(HYPRE_USING_HYPRE_BLAS "Use internal BLAS library" ON)
option(HYPRE_USING_HYPRE_LAPACK "Use internal LAPACK library" ON)
option(HYPRE_NO_GLOBAL_PARTITION "Use assumed partition" OFF)
option(HYPRE_PRINT_ERRORS "Print HYPRE errors" OFF)
option(HYPRE_USING_OPENMP "Use OpenMP" OFF)
# --with-examples Build example codes.
# --with-fei Use internal FEI routines.
@ -728,6 +725,37 @@ include_directories (${PROJECT_BINARY_DIR}
"${PROJECT_SOURCE_DIR}/sstruct_ls"
)
# Set library build type
if (HYPRE_SHARED)
set (BUILD_SHARED_LIBS ON CACHE INTERNAL "" FORCE)
else ()
set (BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
endif ()
# Set MPI compile flags
if (NOT HYPRE_SEQUENTIAL)
find_package (MPI)
if ((MPI_C_FOUND) AND (NOT MPI_C_COMPILER))
include_directories (${MPI_C_INCLUDE_PATH})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS}")
endif ((MPI_C_FOUND) AND (NOT MPI_C_COMPILER))
if ((MPI_CXX_FOUND) AND (NOT MPI_CXX_COMPILER))
include_directories (${MPI_CXX_INCLUDE_PATH})
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
endif ((MPI_CXX_FOUND) AND (NOT MPI_CXX_COMPILER))
endif (NOT HYPRE_SEQUENTIAL)
# set (HYPRE_MPI_C_INCLUDE_PATH "${MPI_C_INCLUDE_PATH}" CACHE PATH
# "MPI include path")
# Set OpenMP compile flags
if (HYPRE_USING_OPENMP)
find_package (OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif (OPENMP_FOUND)
endif (HYPRE_USING_OPENMP)
# Turn optimization off for this file
set_source_files_properties (lapack/dlamch.c PROPERTIES COMPILE_FLAGS -O0)

View File

@ -24,7 +24,7 @@
/* MPI is not needed here, so don't include mpi.h */
#ifndef HYPRE_SEQUENTIAL
#define HYPRE_SEQUENTIAL 1
#define HYPRE_SEQUENTIAL
#endif
#include "_hypre_utilities.h"

View File

@ -24,7 +24,7 @@
/* MPI is not needed here, so don't include mpi.h */
#ifndef HYPRE_SEQUENTIAL
#define HYPRE_SEQUENTIAL 1
#define HYPRE_SEQUENTIAL
#endif
#include "_hypre_utilities.h"

View File

@ -723,7 +723,7 @@ HYPRE_Int
hypre_BlockMatvecCommPkgCreate(hypre_ParCSRBlockMatrix *A)
{
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
HYPRE_Int row_start=0, row_end=0, col_start = 0, col_end = 0;
HYPRE_Int num_recvs, *recv_procs, *recv_vec_starts;

View File

@ -221,7 +221,7 @@ hypre_ParCSRFindExtendCommPkg(hypre_ParCSRMatrix *A, HYPRE_Int newoff, HYPRE_Int
/* use found instead of col_map_offd in A, and newoff instead
of num_cols_offd*/
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
HYPRE_Int row_start=0, row_end=0, col_start = 0, col_end = 0;
HYPRE_Int global_num_cols;

View File

@ -672,7 +672,7 @@ HYPRE_Int hypre_BoomerAMGCoarsenCGC (hypre_ParCSRMatrix *S,HYPRE_Int numberof
hypre_printf ("Starting CGC matrix communication\n");
}
#endif
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
{
/* classical CGC does not really make sense in combination with HYPRE_NO_GLOBAL_PARTITION,
but anyway, here it is:
@ -750,7 +750,7 @@ HYPRE_Int hypre_BoomerAMGCoarsenCGC (hypre_ParCSRMatrix *S,HYPRE_Int numberof
#endif
HYPRE_IJMatrixDestroy (ijG);
if (vertexrange) hypre_TFree (vertexrange);
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
if (vertexrange_all) hypre_TFree (vertexrange_all);
#endif
if (CF_marker_offd) hypre_TFree (CF_marker_offd);
@ -915,7 +915,7 @@ HYPRE_Int AmgCGCGraphAssemble (hypre_ParCSRMatrix *S,HYPRE_Int *vertexrange,HYPR
pointrange = hypre_ParCSRMatrixRowStarts (S);
pointrange_nonlocal = hypre_CTAlloc (HYPRE_Int, 2*num_recvs);
vertexrange_nonlocal = hypre_CTAlloc (HYPRE_Int, 2*num_recvs);
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
{
HYPRE_Int num_sends = hypre_ParCSRCommPkgNumSends (comm_pkg);
HYPRE_Int *send_procs = hypre_ParCSRCommPkgSendProcs (comm_pkg);

View File

@ -468,7 +468,7 @@ hypre_MatvecCommPkgCreate ( hypre_ParCSRMatrix *A)
HYPRE_Int num_cols_offd = hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A));
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
HYPRE_Int row_start=0, row_end=0, col_start = 0, col_end = 0;
HYPRE_Int global_num_cols;

View File

@ -350,7 +350,7 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph )
hypre_IndexRef index;
HYPRE_Int i, j;
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
/* may need to re-do box managers for the AP*/
hypre_BoxManager ***managers = hypre_SStructGridBoxManagers(grid);

View File

@ -622,7 +622,7 @@ hypre_SStructGridAssembleBoxManagers( hypre_SStructGrid *grid )
} /* end of variable loop */
} /* end of part loop */
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
{
/* need to do a gather entries on neighbor information so that we have
what we need for the NborBoxManagers function */
@ -805,7 +805,7 @@ hypre_SStructGridAssembleNborBoxManagers( hypre_SStructGrid *grid )
* but we don't gather anything currently for the neighbor boxman, so
* the next bit of code is not needed right now. */
#if 0
#if HYPRE_NO_GLOBAL_PARTITION
#ifdef HYPRE_NO_GLOBAL_PARTITION
{
MPI_Comm comm = hypre_SStructGridComm(grid);
hypre_Box *vbox;