Commit 5621fefd authored by Johannes Blaschke's avatar Johannes Blaschke
Browse files

upgrade cmake. Important: cray libs now include haswell optimization: -hfp3

parent 2b4b39de
......@@ -13,8 +13,10 @@ endif()
#set(MPI_C_COMPILER mpicc.openmpi)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Cray")
message("-- cray compiler detected")
if("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
if("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
message("-- building Debug Version")
add_definitions(-DDEBUG)
set(CMAKE_C_FLAGS "-g")
......@@ -22,7 +24,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Cray")
message("-- building Release Version")
add_definitions(-DNDEBUG)
# aggress, autoprefetch, fusion2, intrinsics, list=a, noomp_trance, display_opt
set(CMAKE_C_FLAGS "-O3 -h c99,pl=./compiler_information,wp")
set(CMAKE_C_FLAGS "-O3 -hfp3 -h c99,pl=./compiler_information,wp")
set(CMAKE_EXE_LINKER_FLAGS "-h pl=./compiler_information,wp")
endif()
......@@ -30,29 +32,50 @@ else()
set(WARNING_OPTIONS "")
set(WARNING_OPTIONS "${WARNING_OPTIONS} -pedantic -Wall -Wextra")
set(WARNING_OPTIONS "${WARNING_OPTIONS} -Wno-long-long -Wno-system-headers -Wno-unused-parameter")
#set(CXX11FLAGS "-std=c++0x")
#add_definitions(-DDICC_USE_STD_SHARED_PTR)
#set(CXX11FLAGS "-std=c++0x")
#add_definitions(-DDICC_USE_STD_SHARED_PTR)
if("${CMAKE_BUILD_TYPE}" STREQUAL Release)
set(CMAKE_C_FLAGS "${WARNING_OPTIONS} ${CXX11FLAGS} -DDICC_NO_LOG -std=c99 -pedantic -Wall -Wextra -Wno-long-long -Wno-system-headers -O3 -DNDEBUG")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL Profile)
set(CMAKE_C_FLAGS "${WARNING_OPTIONS} ${CXX11FLAGS} -DDICC_NO_LOG -std=c99 -pedantic -Wall -Wextra -Wno-long-long -Wno-system-headers -O3 -DNDEBUG -pg")
elseif("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
elseif("${CMAKE_BUILD_TYPE}" STREQUAL Debug)
set(CMAKE_C_FLAGS "${WARNING_OPTIONS} ${CXX11FLAGS} -O0 -g -std=c99 -pedantic -Wall -Wextra -DDEBUG")
else()
else()
set(CMAKE_C_FLAGS "${WARNING_OPTIONS} ${CXX11FLAGS} -O0 -g -std=c99 -pedantic -Wall -Wextra -DDEBUG")
endif()
endif()
endif()
if("${CMAKE_ENABLE_PFIELD}" STREQUAL "True")
message("----> enabling pressure field")
add_definitions(-DENABLE_PFIELD)
endif()
include_directories(${MPI_C_INCLUDE_PATH})
#include_directories(${PYTHON_INCLUDE_DIRS})
if("${CMAKE_ENABLE_INTERACTIVE}" STREQUAL "True")
message("----> enabling interactive (python) mode")
add_definitions(-DENABLEINTERACTIVE)
find_package( PythonLibs 2.7 REQUIRED ) #My code is not compatible with python3 :( TODO
include_directories(${PYTHON_INCLUDE_DIRS})
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/py_console.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/py_backend.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/trypanosome_PyAPI.c")
endif()
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/clearing_functions.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/collision_backend.c")
......@@ -71,7 +94,6 @@ list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/mpi_communication.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/optimize_parallelization.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/particle_functions.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/print_to_file.c")
#list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/py_console.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/random_number_generation.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/squirmer_functions.c")
list(APPEND SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/stream.c")
......
......@@ -486,9 +486,29 @@ int main(int argc, char * argv[])
int rank = 0;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
#ifdef DEBUG
printf("Debug mode, %d processors %d \n", numtasks, rank);
#endif
if(rank == 0){
fprintf(stdout, "INIT: MPI-Comms initialized:\n");
fprintf(stdout, " -> Running on %d processors.\n", numtasks);
fprintf(stdout, "***** COMPILER INFO: ********************************\n");
#ifdef DEBUG
fprintf(stdout," -> Compiled with DEBUG mode ENABLED \n");
#else
fprintf(stdout," -> Compiled with DEBUG mode DISABLED \n");
#endif
#ifdef ENABLEINTERACTIVE
fprintf(stdout, " -> Compiled with INTERACTIVE mode (python) ENABLED.\n");
#else
fprintf(stdout, " -> Compiled with INTERACTIVE mode (python) DISABLED.\n");
#endif
#ifdef ENABLE_PFIELD
fprintf(stdout, " -> Compiled with PFIELD mode ENABLED.\n");
#else
fprintf(stdout, " -> Compiled with PFIELD mode DISABLED.\n");
#endif
fprintf(stdout, "*****************************************************\n");
}
if(argv[1] != NULL)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment