Commit 8755a160 authored by Philippe Virouleau's avatar Philippe Virouleau

Cleanup

parent 658637a0
......@@ -906,120 +906,14 @@ if( CHAMELEON_SCHED_OPENMP )
find_package(OpenMP COMPONENTS ${OPENMP_COMPONENT_LIST})
# Add definition and include_dir if found
# TODO
if ( OPENMP_FOUND )
message("-- ${Blue}Add definition CHAMELEON_SCHED_OPENMP"
" - Activate OpenMP in Chameleon${ColourReset}")
#if (STARPU_INCLUDE_DIRS_DEP)
#include_directories(${STARPU_INCLUDE_DIRS_DEP})
#set(CMAKE_REQUIRED_INCLUDES "${STARPU_INCLUDE_DIRS_DEP}")
#endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}")
#if(STARPU_LDFLAGS_OTHER_DEP)
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STARPU_LDFLAGS_OTHER_DEP}")
#set(CMAKE_REQUIRED_LDFLAGS "${STARPU_LDFLAGS_OTHER_DEP}")
#endif()
#if(STARPU_LIBRARY_DIRS_DEP)
#list(APPEND CMAKE_INSTALL_RPATH "${STARPU_LIBRARY_DIRS_DEP}")
#endif()
#if (STARPU_LIBRARIES_DEP)
#list(INSERT CHAMELEON_DEP 0 ${STARPU_LIBRARIES_DEP})
#set(CMAKE_REQUIRED_LIBRARIES "${STARPU_LIBRARIES_DEP}")
#endif()
#if (CHAMELEON_SIMULATION)
#list(APPEND CMAKE_REQUIRED_FLAGS "-include" "starpu_simgrid_wrap.h")
#endif()
#string(REPLACE ";" " " CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
#check_function_exists(starpu_data_idle_prefetch_on_node HAVE_STARPU_IDLE_PREFETCH)
#if ( HAVE_STARPU_IDLE_PREFETCH )
#message("-- ${Blue}Add definition HAVE_STARPU_IDLE_PREFETCH${ColourReset}")
#endif()
#check_function_exists(starpu_iteration_push HAVE_STARPU_ITERATION_PUSH)
#if ( HAVE_STARPU_ITERATION_PUSH )
#message("-- ${Blue}Add definition HAVE_STARPU_ITERATION_PUSH${ColourReset}")
#endif()
#check_function_exists(starpu_data_wont_use HAVE_STARPU_DATA_WONT_USE)
#if ( HAVE_STARPU_DATA_WONT_USE )
#message("-- ${Blue}Add definition HAVE_STARPU_DATA_WONT_USE${ColourReset}")
#endif()
#check_function_exists(starpu_data_set_coordinates HAVE_STARPU_DATA_SET_COORDINATES)
#if ( HAVE_STARPU_DATA_SET_COORDINATES )
#message("-- ${Blue}Add definition HAVE_STARPU_DATA_SET_COORDINATES${ColourReset}")
#endif()
#check_function_exists(starpu_malloc_on_node_set_default_flags HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS)
#if ( HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS )
#message("-- ${Blue}Add definition HAVE_STARPU_MALLOC_ON_NODE_SET_DEFAULT_FLAGS${ColourReset}")
#endif()
#check_function_exists(starpu_mpi_data_migrate HAVE_STARPU_MPI_DATA_MIGRATE)
#if ( HAVE_STARPU_MPI_DATA_MIGRATE )
#message("-- ${Blue}Add definition HAVE_STARPU_MPI_DATA_MIGRATE${ColourReset}")
#elseif(CHAMELEON_USE_MIGRATE)
#set(CHAMELEON_USE_MIGRATE "OFF")
#message("-- ${Blue}CHAMELEON_USE_MIGRATE is turned OFF because starpu_mpi_data_migrate not found${ColourReset}")
#endif()
# TODO: check for compiler support for "_Pragma"
else ( OPENMP_FOUND )
message(FATAL_ERROR "Something went wrong when finding OpenMP")
#if(MORSE_VERBOSE_FIND_PACKAGE)
#if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
#if (NOT HWLOC_hwloc.h_DIRS)
#Print_Find_Header_Status(hwloc hwloc.h)
#endif ()
#if (NOT HWLOC_hwloc_LIBRARY)
#Print_Find_Library_Status(hwloc libhwloc)
#endif ()
#endif()
#if(CHAMELEON_ENABLE_TRACING AND (NOT FXT_FOUND OR NOT FXT_LIBRARIES))
#if (NOT FXT_fxt.h_DIRS)
#Print_Find_Header_Status(fxt fxt.h)
#endif ()
#if (NOT FXT_fxt_LIBRARY)
#Print_Find_Library_Status(fxt libfxt)
#endif ()
#endif()
#if(CHAMELEON_SIMULATION AND (NOT SIMGRID_FOUND OR NOT SIMGRID_LIBRARIES))
#if (NOT SIMGRID_simgrid.h_DIRS)
#Print_Find_Header_Status(simgrid simgrid.h)
#endif ()
#if (NOT SIMGRID_simgrid_LIBRARY)
#Print_Find_Library_Status(simgrid libsimgrid)
#endif ()
#endif()
#if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
#( STARPU_LOOK_FOR_MPI AND (NOT STARPU_MPI_FOUND OR NOT STARPU_MPI_LIBRARIES) )
#)
#foreach(starpu_hdr ${STARPU_hdrs_to_find})
#if (NOT STARPU_${starpu_hdr}_INCLUDE_DIRS)
#Print_Find_Header_Status(starpu ${starpu_hdr})
#endif ()
#endforeach()
#if(STARPU_VERSION_STRING)
#foreach(starpu_lib ${STARPU_libs_to_find})
#if (NOT STARPU_${starpu_lib}_LIBRARY)
#Print_Find_Library_Status(starpu ${starpu_lib})
#endif ()
#endforeach()
#endif ()
#endif ()
#else(MORSE_VERBOSE_FIND_PACKAGE)
#message(WARNING "StarPU library has not been found and MORSE_VERBOSE_FIND_PACKAGE is set to OFF."
#" Try to activate MORSE_VERBOSE_FIND_PACKAGE option (-DMORSE_VERBOSE_FIND_PACKAGE=ON) to get some hints for the detection")
#endif(MORSE_VERBOSE_FIND_PACKAGE)
#if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
#message(FATAL_ERROR "hwloc library is required but has not been found")
#endif()
#if(CHAMELEON_SIMULATION AND (NOT SIMGRID_FOUND OR NOT SIMGRID_LIBRARIES))
#message(FATAL_ERROR "SimGrid library is required but has not been found")
#endif()
#if(CHAMELEON_ENABLE_TRACING AND (NOT FXT_FOUND OR NOT FXT_LIBRARIES))
#message(FATAL_ERROR "FxT library is required but has not been found")
#endif()
#if( (NOT STARPU_SHM_FOUND) OR (NOT STARPU_SHM_LIBRARIES) OR
#( STARPU_LOOK_FOR_MPI AND (NOT STARPU_MPI_FOUND OR NOT STARPU_MPI_LIBRARIES) )
#)
#message(FATAL_ERROR "StarPU library is required but has not been found")
#endif()
endif ( OPENMP_FOUND )
endif( CHAMELEON_SCHED_OPENMP )
......
......@@ -23,7 +23,6 @@
*
*/
#include "control/common.h"
#include <stdio.h>
/**
********************************************************************************
......
......@@ -135,6 +135,16 @@ int CHAMELEON_Sequence_Create (RUNTIME_sequence_t **sequence);
int CHAMELEON_Sequence_Destroy (RUNTIME_sequence_t *sequence);
int CHAMELEON_Sequence_Wait (RUNTIME_sequence_t *sequence);
#if defined(CHAMELEON_SCHED_OPENMP)
#define CHAMELEON_INIT(nworkers, ncudas)\
CHAMELEON_Init(nworkers, ncudas);\
_Pragma("omp parallel")\
_Pragma("omp master")
#else
#define CHAMELEON_INIT(nworkers, ncudas)\
CHAMELEON_Init(nworkers, ncudas);
#endif
END_C_DECLS
#endif /* _chameleon_h_ */
......@@ -4,7 +4,7 @@
#
# @copyright 2009-2015 The University of Tennessee and The University of
# Tennessee Research Foundation. All rights reserved.
# @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# @copyright 2012-2018 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
# Univ. Bordeaux. All rights reserved.
#
###
......@@ -30,17 +30,6 @@ cmake_minimum_required(VERSION 2.8)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/include )
# Generate headers for all possible precisions
# --------------------------------------------
#set(RUNTIME_HDRS_GENERATED "")
#set(ZHDR
#include/runtime_codelet_z.h
#)
#precisions_rules_py(RUNTIME_HDRS_GENERATED "${ZHDR}"
#PRECISIONS "s;d;c;z;ds;zc"
#TARGETDIR "include")
# Define the list of headers
# --------------------------
set(RUNTIME_HDRS
......@@ -71,17 +60,6 @@ install(
# Generate the Chameleon common for all possible precisions
# ---------------------------------------------------------
# FIXME: restore this generation once file is done
#set(RUNTIME_COMMON_GENERATED "")
#set(ZSRC
#control/runtime_zprofiling.c
#control/runtime_zlocality.c
#)
#precisions_rules_py(
#RUNTIME_COMMON_GENERATED "${ZSRC}"
#PRECISIONS "${CHAMELEON_PRECISION}"
#TARGETDIR "control")
set(RUNTIME_COMMON
control/runtime_async.c
......@@ -90,21 +68,13 @@ set(RUNTIME_COMMON
control/runtime_descriptor.c
control/runtime_options.c
control/runtime_profiling.c
#control/runtime_workspace.c
${RUNTIME_COMMON_GENERATED}
)
#set(flags_to_add "")
#foreach(_prec ${CHAMELEON_PRECISION})
#set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
#endforeach()
#set_source_files_properties(control/runtime_profiling.c PROPERTIES COMPILE_FLAGS "${flags_to_add}")
# Generate the Chameleon sources for all possible precisions
# ----------------------------------------------------------
set(RUNTIME_SRCS_GENERATED "")
set(ZSRC
#codelets/codelet_zcallback.c
${CODELETS_ZSRC}
)
......
......@@ -50,8 +50,11 @@ int RUNTIME_options_ws_alloc( RUNTIME_option_t *options, size_t worker_size, siz
options->ws_worker = malloc(worker_size* sizeof(char));
options->ws_wsize = worker_size;
}
// TODO maybe we'll need it at some point
options->ws_hsize = host_size;
if (host_size > 0) {
// TODO used for scratch, maybe we can do better than malloc
options->ws_host = malloc(host_size * sizeof(char));
options->ws_hsize = host_size;
}
return CHAMELEON_SUCCESS;
}
......@@ -61,6 +64,9 @@ int RUNTIME_options_ws_free( RUNTIME_option_t *options )
free(options->ws_worker);
options->ws_wsize = 0;
}
options->ws_hsize = 0;
if (options->ws_hsize) {
free(options->ws_host);
options->ws_hsize = 0;
}
return CHAMELEON_SUCCESS;
}
......@@ -48,14 +48,8 @@ RunTest(int *iparam, double *dparam, chameleon_time_t *t_)
memset(descT->mat, 0, (descT->llm*descT->lln)*sizeof(ChamComplexDouble));
/* CHAMELEON ZGEQRF */
#if defined (CHAMELEON_SCHED_OPENMP)
#pragma omp parallel
#pragma omp master
#endif
{
START_TIMING();
CHAMELEON_zgeqrf_Tile( descA, descT );
}
STOP_TIMING();
/* Check the solution */
......
......@@ -619,46 +619,25 @@ parse_arguments(int *_argc, char ***_argv, int *iparam, int *start, int *stop, i
} while(-1 != c);
}
// NOTE: this function is here to cope with the fact that OpenMP parallel
// regions must not have instructions jumping outside the region (eg: returns)
int
main(int argc, char *argv[]) {
int i, m, n, mx, nx;
CHAMELEON_Main(int *iparam, char *prog_name, int start, int stop, int step) {
int status;
int i, m, n, mx, nx;
int nbnode = 1;
int start = 500;
int stop = 5000;
int step = 500;
int iparam[IPARAM_SIZEOF];
int success = 0;
set_iparam_default(iparam);
parse_arguments(&argc, &argv, iparam, &start, &stop, &step);
#if !defined(CHAMELEON_USE_CUDA)
if (iparam[IPARAM_NCUDAS] != 0){
fprintf(stderr, "ERROR: CHAMELEON_USE_CUDA is not defined. "
"The number of CUDA devices must be set to 0 (--gpus=0).\n");
return EXIT_FAILURE;
}
#endif
n = iparam[IPARAM_N];
m = iparam[IPARAM_M];
mx = iparam[IPARAM_MX];
nx = iparam[IPARAM_NX];
/* Initialize CHAMELEON */
CHAMELEON_Init( iparam[IPARAM_THRDNBR],
iparam[IPARAM_NCUDAS] );
#if defined (CHAMELEON_SCHED_OPENMP)
#pragma omp parallel
#pragma omp master
#endif
{
/* Get the number of threads set by the runtime */
iparam[IPARAM_THRDNBR] = CHAMELEON_GetThreadNbr();
}
/* Stops profiling here to avoid profiling uninteresting routines.
It will be reactivated in the time_*.c routines with the macro START_TIMING() */
......@@ -709,7 +688,7 @@ main(int argc, char *argv[]) {
CHAMELEON_Set(CHAMELEON_TRANSLATION_MODE, iparam[IPARAM_INPLACE]);
if ( CHAMELEON_My_Mpi_Rank() == 0 ) {
print_header( argv[0], iparam);
print_header( prog_name, iparam);
}
if (step < 1) step = 1;
......@@ -749,7 +728,37 @@ main(int argc, char *argv[]) {
if (status != CHAMELEON_SUCCESS) return status;
success += status;
}
}
int
main(int argc, char *argv[]) {
int start = 500;
int stop = 5000;
int step = 500;
int iparam[IPARAM_SIZEOF];
set_iparam_default(iparam);
parse_arguments(&argc, &argv, iparam, &start, &stop, &step);
#if !defined(CHAMELEON_USE_CUDA)
if (iparam[IPARAM_NCUDAS] != 0){
fprintf(stderr, "ERROR: CHAMELEON_USE_CUDA is not defined. "
"The number of CUDA devices must be set to 0 (--gpus=0).\n");
return EXIT_FAILURE;
}
#endif
int return_code;
/* Initialize CHAMELEON */
CHAMELEON_INIT( iparam[IPARAM_THRDNBR],
iparam[IPARAM_NCUDAS] );
{
return_code = CHAMELEON_Main(iparam, argv[0], start, stop, step);
}
CHAMELEON_Finalize();
return success;
return return_code;
}
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