Commit 0bb75545 authored by PRUVOST Florent's avatar PRUVOST Florent

factorize HAVE_STARPU_... and STARPU_..._FOUND variables, just one is enough

parent 5e2da7ea
...@@ -660,47 +660,40 @@ if( CHAMELEON_SCHED_STARPU ) ...@@ -660,47 +660,40 @@ if( CHAMELEON_SCHED_STARPU )
list(APPEND CMAKE_REQUIRED_FLAGS "-include" "starpu_simgrid_wrap.h") list(APPEND CMAKE_REQUIRED_FLAGS "-include" "starpu_simgrid_wrap.h")
endif() endif()
string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
check_function_exists(starpu_data_idle_prefetch_on_node STARPU_IDLE_PREFETCH_FOUND) check_function_exists(starpu_data_idle_prefetch_on_node HAVE_STARPU_IDLE_PREFETCH)
if ( STARPU_IDLE_PREFETCH_FOUND ) if ( HAVE_STARPU_IDLE_PREFETCH )
set(HAVE_STARPU_IDLE_PREFETCH 1)
message("-- ${Blue}Add definition HAVE_STARPU_IDLE_PREFETCH${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_IDLE_PREFETCH${ColourReset}")
endif() endif()
check_function_exists(starpu_iteration_push STARPU_ITERATION_PUSH_FOUND) check_function_exists(starpu_iteration_push HAVE_STARPU_ITERATION_PUSH)
if ( STARPU_ITERATION_PUSH_FOUND ) if ( HAVE_STARPU_ITERATION_PUSH )
set(HAVE_STARPU_ITERATION_PUSH 1)
message("-- ${Blue}Add definition HAVE_STARPU_ITERATION_PUSH${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_ITERATION_PUSH${ColourReset}")
endif() endif()
check_function_exists(starpu_data_wont_use STARPU_DATA_WONT_USE_FOUND) check_function_exists(starpu_data_wont_use HAVE_STARPU_DATA_WONT_USE)
if ( STARPU_DATA_WONT_USE_FOUND ) if ( HAVE_STARPU_DATA_WONT_USE )
set(HAVE_STARPU_DATA_WONT_USE 1)
message("-- ${Blue}Add definition HAVE_STARPU_DATA_WONT_USE${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_DATA_WONT_USE${ColourReset}")
endif() endif()
check_function_exists(starpu_data_set_coordinates STARPU_DATA_SET_COORDINATES_FOUND) check_function_exists(starpu_data_set_coordinates HAVE_STARPU_DATA_SET_COORDINATES)
if ( STARPU_DATA_SET_COORDINATES_FOUND ) if ( HAVE_STARPU_DATA_SET_COORDINATES )
set(HAVE_STARPU_DATA_SET_COORDINATES 1)
message("-- ${Blue}Add definition HAVE_STARPU_DATA_SET_COORDINATES${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_DATA_SET_COORDINATES${ColourReset}")
endif() endif()
check_function_exists(starpu_malloc_on_node_set_default_flags STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS) check_function_exists(starpu_malloc_on_node_set_default_flags HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS)
if ( STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS ) if ( HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS )
set(HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS 1) set(HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS 1)
message("-- ${Blue}Add definition HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS${ColourReset}")
endif() endif()
check_function_exists(starpu_mpi_data_migrate STARPU_MPI_DATA_MIGRATE_FOUND) check_function_exists(starpu_mpi_data_migrate HAVE_STARPU_MPI_DATA_MIGRATE)
if ( STARPU_MPI_DATA_MIGRATE_FOUND ) if ( HAVE_STARPU_MPI_DATA_MIGRATE )
set(HAVE_STARPU_MPI_DATA_MIGRATE 1)
message("-- ${Blue}Add definition HAVE_STARPU_MPI_DATA_MIGRATE${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_MPI_DATA_MIGRATE${ColourReset}")
elseif(CHAMELEON_USE_MIGRATE) elseif(CHAMELEON_USE_MIGRATE)
set(CHAMELEON_USE_MIGRATE "OFF") set(CHAMELEON_USE_MIGRATE "OFF")
message("-- CHAMELEON_USE_MIGRATE is turned OFF because starpu_mpi_data_migrate not found") message("-- ${Blue}CHAMELEON_USE_MIGRATE is turned OFF because starpu_mpi_data_migrate not found${ColourReset}")
endif() endif()
if(CHAMELEON_ENABLE_TRACING) if(CHAMELEON_ENABLE_TRACING)
# check if fxt profiling is accessible in starpu and activate it in chameleon # check if fxt profiling is accessible in starpu and activate it in chameleon
unset(STARPU_FXT_START_PROFILING_FOUND CACHE) check_function_exists(starpu_fxt_start_profiling HAVE_STARPU_FXT_PROFILING)
check_function_exists(starpu_fxt_start_profiling STARPU_FXT_START_PROFILING_FOUND) if ( HAVE_STARPU_FXT_PROFILING )
if ( STARPU_FXT_START_PROFILING_FOUND )
message("-- ${Blue}Add definition HAVE_STARPU_FXT_PROFILING" message("-- ${Blue}Add definition HAVE_STARPU_FXT_PROFILING"
" - Activate FxT profiling through StarPU${ColourReset}") " - Activate FxT profiling through StarPU${ColourReset}")
set(HAVE_STARPU_FXT_PROFILING 1)
else() else()
message("-- ${Red}Looking for starpu with fxt" message("-- ${Red}Looking for starpu with fxt"
" - starpu_fxt_start_profiling() test fails in StarPU${ColourReset}") " - starpu_fxt_start_profiling() test fails in StarPU${ColourReset}")
...@@ -709,36 +702,22 @@ if( CHAMELEON_SCHED_STARPU ) ...@@ -709,36 +702,22 @@ if( CHAMELEON_SCHED_STARPU )
endif() endif()
if (CHAMELEON_USE_MPI) if (CHAMELEON_USE_MPI)
# Check if a specific function exist # Check if a specific function exist
unset(STARPU_MPI_DATA_REGISTER_FOUND CACHE) check_function_exists(starpu_mpi_data_register_comm HAVE_STARPU_MPI_DATA_REGISTER)
check_function_exists(starpu_mpi_data_register_comm STARPU_MPI_DATA_REGISTER_FOUND) if ( HAVE_STARPU_MPI_DATA_REGISTER )
if ( STARPU_MPI_DATA_REGISTER_FOUND )
message("-- ${Blue}Add definition HAVE_STARPU_MPI_DATA_REGISTER - Activate" message("-- ${Blue}Add definition HAVE_STARPU_MPI_DATA_REGISTER - Activate"
" use of starpu_mpi_data_register() in Chameleon with StarPU${ColourReset}") " use of starpu_mpi_data_register() in Chameleon with StarPU${ColourReset}")
set(HAVE_STARPU_MPI_DATA_REGISTER 1)
else()
message("-- ${Red}Looking for starpu with starpu_mpi_data_register"
" - starpu_mpi_data_register() test fails in StarPU${ColourReset}")
message("-- ${Red}Check in CMakeFiles/CMakeError.log to figure out why it fails${ColourReset}")
endif() endif()
unset(STARPU_MPI_COMM_RANK_FOUND CACHE) check_function_exists(starpu_mpi_comm_rank HAVE_STARPU_MPI_COMM_RANK)
check_function_exists(starpu_mpi_comm_rank STARPU_MPI_COMM_RANK_FOUND) if ( HAVE_STARPU_MPI_COMM_RANK )
if ( STARPU_MPI_COMM_RANK_FOUND )
message("-- ${Blue}Add definition HAVE_STARPU_MPI_COMM_RANK - Activate" message("-- ${Blue}Add definition HAVE_STARPU_MPI_COMM_RANK - Activate"
" use of starpu_mpi_comm_rank() in Chameleon with StarPU${ColourReset}") " use of starpu_mpi_comm_rank() in Chameleon with StarPU${ColourReset}")
set(HAVE_STARPU_MPI_COMM_RANK 1)
else()
message("-- ${Red}Looking for starpu with starpu_mpi_comm_rank"
" - starpu_mpi_comm_rank() test fails in StarPU${ColourReset}")
message("-- ${Red}Check in CMakeFiles/CMakeError.log to figure out why it fails${ColourReset}")
endif() endif()
check_function_exists(starpu_mpi_cached_receive STARPU_MPI_CACHED_RECEIVE) check_function_exists(starpu_mpi_cached_receive HAVE_STARPU_MPI_CACHED_RECEIVE)
if ( STARPU_MPI_CACHED_RECEIVE ) if ( HAVE_STARPU_MPI_CACHED_RECEIVE )
set(HAVE_STARPU_MPI_CACHED_RECEIVE 1)
message("-- ${Blue}Add definition HAVE_STARPU_MPI_CACHED_RECEIVE${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_MPI_CACHED_RECEIVE${ColourReset}")
endif() endif()
check_function_exists(starpu_mpi_comm_get_attr STARPU_MPI_COMM_GET_ATTR) check_function_exists(starpu_mpi_comm_get_attr HAVE_STARPU_MPI_COMM_GET_ATTR)
if ( STARPU_MPI_COMM_GET_ATTR ) if ( HAVE_STARPU_MPI_COMM_GET_ATTR )
set(HAVE_STARPU_MPI_COMM_GET_ATTR 1)
message("-- ${Blue}Add definition HAVE_STARPU_MPI_COMM_GET_ATTR${ColourReset}") message("-- ${Blue}Add definition HAVE_STARPU_MPI_COMM_GET_ATTR${ColourReset}")
endif() endif()
endif() endif()
......
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