Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 75c85b49 authored by Mathieu Faverge's avatar Mathieu Faverge

Fix includes with the move to subdir chameleon, and fix some warnings

parent 3755e526
......@@ -32,7 +32,7 @@
*/
#include <stdlib.h>
#include "control/common.h"
#include "runtime.h"
#include "chameleon/morse_runtime.h"
/*******************************************************************************
* Register an exception.
......
......@@ -9,7 +9,7 @@
**/
/***
*
*
*
* @file async.h
*
......@@ -26,7 +26,7 @@
#ifndef _MORSE_ASYNC_H_
#define _MORSE_ASYNC_H_
#include "morse_struct.h"
#include "chameleon/morse_struct.h"
#ifdef __cplusplus
extern "C" {
......
......@@ -27,7 +27,7 @@
#ifndef _MORSE_AUXILIARY_H_
#define _MORSE_AUXILIARY_H_
#include "morse_struct.h"
#include "chameleon/morse_struct.h"
#ifdef __cplusplus
extern "C" {
......
......@@ -41,7 +41,7 @@
#include "control/common.h"
#include "control/auxiliary.h"
#include "control/context.h"
#include "runtime.h"
#include "chameleon/morse_runtime.h"
/*******************************************************************************
* Global data
......
......@@ -27,7 +27,7 @@
#ifndef _MORSE_CONTEXT_H_
#define _MORSE_CONTEXT_H_
#include "morse_struct.h"
#include "chameleon/morse_struct.h"
/*******************************************************************************
* Routines to handle threads context
......
......@@ -35,7 +35,7 @@
#include <stdlib.h>
#include "control/auxiliary.h"
#include "control/common.h"
#include "runtime.h"
#include "chameleon/morse_runtime.h"
/** ***************************************************************************
*
......
......@@ -34,7 +34,7 @@
#include <assert.h>
#include "control/common.h"
#include "control/descriptor.h"
#include "runtime.h"
#include "chameleon/morse_runtime.h"
static int nbdesc = 0;
......
......@@ -27,8 +27,8 @@
#define _MORSE_DESCRIPTOR_H_
#include <assert.h>
#include "include/chameleon_config.h"
#include "morse_struct.h"
#include "chameleon/chameleon_config.h"
#include "chameleon/morse_struct.h"
#include "control/auxiliary.h"
#ifdef __cplusplus
......
......@@ -42,12 +42,9 @@
/** ****************************************************************************
* MORSE types and constants
**/
#include "morse_types.h"
#include "morse_struct.h"
#include "morse_constants.h"
//#include "control/auxiliary.h"
//#include "control/descriptor.h"
//#include "control/tile.h"
#include "chameleon/morse_types.h"
#include "chameleon/morse_struct.h"
#include "chameleon/morse_constants.h"
/** ****************************************************************************
* CORE BLAS headers
......
......@@ -53,6 +53,7 @@ inline static void* user_getaddr_arrayofpointers(const MORSE_desc_t *A, int m, i
**/
inline static int user_getblkldd_arrayofpointers(const MORSE_desc_t *A, int m)
{
(void)m;
return A->mb;
}
......
......@@ -190,6 +190,7 @@ inline static void* user_getaddr_arrayofpointers(const MORSE_desc_t *A, int m, i
*/
inline static int user_getblkldd_arrayofpointers(const MORSE_desc_t *A, int m)
{
(void)m;
return A->mb;
}
......@@ -198,6 +199,7 @@ inline static int user_getblkldd_arrayofpointers(const MORSE_desc_t *A, int m)
*/
inline static int user_getrankof_zero(const MORSE_desc_t *A, int m, int n)
{
(void)A; (void)m; (void)n;
return 0;
}
......
......@@ -34,8 +34,8 @@ set(CHAMELEON_HDRS_GENERATED "")
set(ZHDR
chameleon/morse_z.h
chameleon/morse_zc.h
chameleon/runtime_z.h
chameleon/runtime_zc.h
chameleon/morse_tasks_z.h
chameleon/morse_tasks_zc.h
)
precisions_rules_py(CHAMELEON_HDRS_GENERATED "${ZHDR}"
......@@ -52,11 +52,12 @@ set(CHAMELEON_HDRS
chameleon/chameleon_config.h
chameleon/morse_constants.h
chameleon/morse_kernels.h
chameleon/morse_mangling.h
chameleon/morse_runtime.h
chameleon/morse_simulate.h
chameleon/morse_struct.h
chameleon/morse_tasks.h
chameleon/morse_types.h
chameleon/morse_mangling.h
chameleon/runtime.h
${CHAMELEON_HDRS_GENERATED}
)
......
......@@ -56,4 +56,20 @@
#cmakedefine CHAMELEON_HAVE_GETOPT_H
#cmakedefine CHAMELEON_HAVE_GETOPT_LONG
#ifdef BEGIN_C_DECLS
#undef BEGIN_C_DECLS
#endif
#ifdef END_C_DECLS
#undef END_C_DECLS
#endif
#if defined(c_plusplus) || defined(__cplusplus)
# define BEGIN_C_DECLS extern "C" {
# define END_C_DECLS }
#else
# define BEGIN_C_DECLS /* empty */
# define END_C_DECLS /* empty */
#endif
#endif /* CHAMELEON_CONFIG_H_HAS_BEEN_INCLUDED */
......@@ -85,4 +85,4 @@ typedef enum morse_kernel_e {
MORSE_NBKERNELS
} MORSE_kernel_t;
#endif /* _MORSE_KERNELS_H_ */
#endif
......@@ -24,10 +24,10 @@
* @date 2011-06-01
*
**/
#ifndef _RUNTIME_H_
#define _RUNTIME_H_
#ifndef _MORSE_RUNTIME_H_
#define _MORSE_RUNTIME_H_
#include "morse_struct.h"
#include "chameleon/morse_struct.h"
/*******************************************************************************
* RUNTIME Async
......@@ -133,34 +133,4 @@ void RUNTIME_ddisplay_oneprofile (MORSE_kernel_t);
void RUNTIME_sdisplay_allprofile ();
void RUNTIME_sdisplay_oneprofile (MORSE_kernel_t);
/*******************************************************************************
* RUNTIME Kernels
**/
#include "runtime_z.h"
#include "runtime_d.h"
#include "runtime_c.h"
#include "runtime_s.h"
#include "runtime_zc.h"
#include "runtime_ds.h"
void MORSE_TASK_ztile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
void MORSE_TASK_dtile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
void MORSE_TASK_ctile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
void MORSE_TASK_stile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
/*
* Mark a data as unused after this call
*/
void MORSE_TASK_dataflush(const MORSE_option_t *options,
const MORSE_desc_t *A, int Am, int An);
void MORSE_TASK_dataflush_all();
#endif
#endif /* _MORSE_RUNTIME_H_ */
......@@ -25,7 +25,7 @@
#ifndef _MORSE_SIMULATE_H_
#define _MORSE_SIMULATE_H_
#include "chameleon_config.h"
#include "chameleon/chameleon_config.h"
/* we need this when starpu is compiled with simgrid enabled */
#if defined(CHAMELEON_SCHED_STARPU) && defined(CHAMELEON_SIMULATION)
......
......@@ -28,8 +28,8 @@
#ifndef _MORSE_STRUCT_H_
#define _MORSE_STRUCT_H_
#include "chameleon_config.h"
#include "morse_types.h"
#include "chameleon/chameleon_config.h"
#include "chameleon/morse_types.h"
/** ****************************************************************************
* RUNTIME headers to include types of :
......@@ -188,7 +188,6 @@ typedef struct morse_option_s {
/** ****************************************************************************
* MORSE kernels
**/
#include "morse_kernels.h"
#include "chameleon/morse_kernels.h"
#endif /* __CHAMELEON_H__ */
/**
*
* @copyright (c) 2009-2014 The University of Tennessee and The University
* of Tennessee Research Foundation.
* All rights reserved.
* @copyright (c) 2012-2014 Inria. All rights reserved.
* @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
/**
*
* @file morse_tasks.h
*
* MORSE codelets kernel
* MORSE is a software package provided by Univ. of Tennessee,
* Univ. of California Berkeley and Univ. of Colorado Denver,
* and INRIA Bordeaux Sud-Ouest
*
* @version 2.3.1
* @author Mathieu Faverge
* @author Cedric Augonnet
* @date 2011-06-01
*
**/
#ifndef _MORSE_TASKS_H_
#define _MORSE_TASKS_H_
/*******************************************************************************
* MORSE Task submission routines
**/
void MORSE_TASK_ztile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
void MORSE_TASK_dtile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
void MORSE_TASK_ctile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
void MORSE_TASK_stile_zero(const MORSE_option_t *options,
int X1, int X2, int Y1, int Y2,
const MORSE_desc_t *A, int Am, int An, int lda);
/*
* Mark a data as unused after this call
*/
void MORSE_TASK_dataflush(const MORSE_option_t *options,
const MORSE_desc_t *A, int Am, int An);
void MORSE_TASK_dataflush_all();
#include "chameleon/morse_tasks_z.h"
#include "chameleon/morse_tasks_d.h"
#include "chameleon/morse_tasks_c.h"
#include "chameleon/morse_tasks_s.h"
#include "chameleon/morse_tasks_zc.h"
#include "chameleon/morse_tasks_ds.h"
#endif /* _MORSE_TASKS_H_ */
......@@ -10,7 +10,7 @@
/**
*
* @file runtime_z.h
* @file morse_tasks_z.h
*
* MORSE auxiliary routines
* MORSE is a software package provided by Univ. of Tennessee,
......@@ -29,8 +29,8 @@
* @precisions normal z -> c d s
*
**/
#ifndef _RUNTIME_ZBLAS_H_
#define _RUNTIME_ZBLAS_H_
#ifndef _MORSE_TASKS_Z_H_
#define _MORSE_TASKS_Z_H_
#define COMPLEX
......
......@@ -10,7 +10,7 @@
/**
*
* @file runtime_zc.h
* @file morse_tasks_zc.h
*
* MORSE auxiliary routines
* MORSE is a software package provided by Univ. of Tennessee,
......@@ -28,8 +28,8 @@
* @precisions mixed zc -> ds
*
**/
#ifndef _RUNTIME_ZCBLAS_H_
#define _RUNTIME_ZCBLAS_H_
#ifndef _MORSE_TASKS_Z_H_
#define _MORSE_TASKS_Z_H_
#ifdef __cplusplus
extern "C" {
......
......@@ -31,29 +31,48 @@
/* ****************************************************************************
* MORSE types and constants
*/
#include "chameleon_config.h"
#include "morse_types.h"
#include "morse_struct.h"
#include "morse_constants.h"
#include "chameleon/chameleon_config.h"
#include "chameleon/morse_types.h"
#include "chameleon/morse_struct.h"
#include "chameleon/morse_constants.h"
#include "chameleon/morse_kernels.h"
/* ****************************************************************************
* RUNTIME Functions
* MORSE runtime common API
*/
#include "runtime.h"
#include "chameleon/morse_runtime.h"
/* ****************************************************************************
* For Simulation mode
* MORSE Simulation mode
*/
#include "morse_simulate.h"
#include "chameleon/morse_simulate.h"
/* ****************************************************************************
* Include LibHQR for hierarchical trees QR/LQ factorizations
*/
#include "libhqr.h"
/* ****************************************************************************
* MORSE Tasks
*/
#include "chameleon/morse_tasks.h"
/* ****************************************************************************
* MORSE functionnalities
*/
#include "chameleon/morse_z.h"
#include "chameleon/morse_c.h"
#include "chameleon/morse_d.h"
#include "chameleon/morse_s.h"
#include "chameleon/morse_zc.h"
#include "chameleon/morse_ds.h"
/* ****************************************************************************
* MORSE Functions
*/
#ifdef __cplusplus
extern "C" {
#endif
BEGIN_C_DECLS
/* Auxiliary */
int MORSE_Version (int *ver_major, int *ver_minor, int *ver_micro);
......@@ -113,16 +132,6 @@ int MORSE_Sequence_Create (MORSE_sequence_t **sequence);
int MORSE_Sequence_Destroy (MORSE_sequence_t *sequence);
int MORSE_Sequence_Wait (MORSE_sequence_t *sequence);
#ifdef __cplusplus
}
#endif
#include "libhqr.h"
#include "morse_z.h"
#include "morse_c.h"
#include "morse_d.h"
#include "morse_s.h"
#include "morse_zc.h"
#include "morse_ds.h"
END_C_DECLS
#endif
......@@ -54,28 +54,33 @@ extern void (*update_progress_callback)(int, int) ;
/*******************************************************************************
* Display a progress information when executing the tasks
**/
int RUNTIME_progress( MORSE_context_t *morse)
int RUNTIME_progress( MORSE_context_t *morse )
{
int tasksLeft, current, timer = 0;
int max;
#if defined(CHAMELEON_USE_MPI)
if (morse->my_mpi_rank!=0)
return MORSE_SUCCESS;
if ( morse->my_mpi_rank != 0 )
return MORSE_SUCCESS;
#endif
int tasksLeft, current, timer=0;
int max = starpu_task_nsubmitted();
if (max==0)
return MORSE_SUCCESS;
// update_progress_callback(0, max);
while ((tasksLeft = starpu_task_nsubmitted()) > 0) {
current = max - tasksLeft;
max = starpu_task_nsubmitted();
if ( max == 0 )
return MORSE_SUCCESS;
// update_progress_callback(0, max);
while ((tasksLeft = starpu_task_nsubmitted()) > 0) {
current = max - tasksLeft;
if (timer > PROGRESS_MINIMUM_DURATION)
update_progress_callback(current, max);
sleep(1);
timer++;
}
if (timer > PROGRESS_MINIMUM_DURATION)
update_progress_callback(current, max);
sleep(1);
timer++;
}
if (timer > PROGRESS_MINIMUM_DURATION)
update_progress_callback(max, max);
update_progress_callback(max, max);
return MORSE_SUCCESS;
(void)morse;
return MORSE_SUCCESS;
}
/*******************************************************************************
......@@ -86,7 +91,7 @@ int RUNTIME_sequence_wait( MORSE_context_t *morse, MORSE_sequence_t *sequence )
(void)morse;
(void)sequence;
if (morse->progress_enabled)
RUNTIME_progress(morse);
RUNTIME_progress(morse);
starpu_task_wait_for_all();
#if defined(CHAMELEON_USE_MPI)
starpu_mpi_barrier(MPI_COMM_WORLD);
......
......@@ -50,14 +50,17 @@ static int _tag_mpi_initialized_ = 0;
#define FOLDED 0
#endif
void RUNTIME_user_tag_size(int user_tag_width, int user_tag_sep) {
void RUNTIME_user_tag_size( int user_tag_width, int user_tag_sep ) {
#if defined(CHAMELEON_USE_MPI)
if (_tag_mpi_initialized_ == 0) {
tag_width=user_tag_width;
tag_sep=user_tag_sep;
} else
morse_error("RUNTIME_user_tag_size", "must be called before creating any Morse descriptor with MORSE_Desc_create(). The tag sizes will not be modified.");
tag_width = user_tag_width;
tag_sep = user_tag_sep;
} else {
morse_error("RUNTIME_user_tag_size",
"must be called before creating any Morse descriptor with MORSE_Desc_create(). The tag sizes will not be modified.");
}
#endif
(void)user_tag_width; (void)user_tag_sep;
}
......@@ -126,9 +129,9 @@ void RUNTIME_desc_create( MORSE_desc_t *desc )
int pagesize = getpagesize();
if ((desc->mb * desc->nb * eltsze) % pagesize != 0
|| (lastmm * desc->nb * eltsze) % pagesize != 0
|| (desc->mb * lastnn * eltsze) % pagesize != 0
|| (lastmm * lastnn * eltsze) % pagesize != 0)
|| (lastmm * desc->nb * eltsze) % pagesize != 0
|| (desc->mb * lastnn * eltsze) % pagesize != 0
|| (lastmm * lastnn * eltsze) % pagesize != 0)
{
morse_error("RUNTIME_desc_create", "Matrix and tile size not suitable for out-of-core: all tiles have to be multiples of 4096. Tip : choose 'n' and 'nb' as both multiples of 32.");
return;
......
......@@ -250,8 +250,23 @@ void RUNTIME_zlocality_onerestore( MORSE_kernel_t kernel )
}
}
#else
void RUNTIME_zlocality_allrestrict( uint32_t where ) {}
void RUNTIME_zlocality_onerestrict( MORSE_kernel_t kernel, uint32_t where ) {}
void RUNTIME_zlocality_allrestrict( uint32_t where )
{
(void)where;
}
void RUNTIME_zlocality_onerestrict( MORSE_kernel_t kernel, uint32_t where )
{
(void)kernel;
(void)where;
}
void RUNTIME_zlocality_allrestore( ) {}
void RUNTIME_zlocality_onerestore( MORSE_kernel_t kernel ) {}
void RUNTIME_zlocality_onerestore( MORSE_kernel_t kernel )
{
(void)kernel;
}
#endif
......@@ -157,7 +157,7 @@ int map_RRRB(int m, int n, int mb, int nb, int i, int j) {
return ( m*n0 + (n-n0)*m0 + map_rm( m%mb, n%nb, i%mb, j%nb) );
}
void *formatmap[6] = { map_CM, map_RM, map_CCRB, map_CRRB, map_RCRB, map_RRRB };
int (*formatmap[6])(int, int, int, int, int, int) = { map_CM, map_RM, map_CCRB, map_CRRB, map_RCRB, map_RRRB };
int main (int argc, char **argv)
{
......
......@@ -68,7 +68,7 @@ extern char *itypestr[3];
extern char *storevstr[2];
extern char *normstr[4];
extern void *formatmap[6];
extern int (*formatmap[6])(int, int, int, int, int, int);
int map_CM (int m, int n, int mb, int nb, int i, int j);
int map_CCRB(int m, int n, int mb, int nb, int i, int j);
......
......@@ -42,12 +42,12 @@
/*--------------------------------------------------------------
* Check the pemv
*/
static int check_solution(MORSE_enum trans, MORSE_enum storev,
static int check_solution(MORSE_enum trans, MORSE_enum storev,
int M, int N, int L,
MORSE_Complex64_t alpha, MORSE_Complex64_t *A, int LDA,
MORSE_Complex64_t *X, int INCX,
MORSE_Complex64_t *X, int INCX,
MORSE_Complex64_t beta, MORSE_Complex64_t *Y0, int INCY0,
MORSE_Complex64_t *Y, int INCY,
MORSE_Complex64_t *Y, int INCY,
MORSE_Complex64_t *W, double *Rnorm)
{
int k;
......@@ -61,28 +61,30 @@ static int check_solution(MORSE_enum trans, MORSE_enum storev,
} else {
k = M;
}
work = (double *)malloc(k * sizeof(double));
cblas_zcopy(k, Y0, INCY0, W, 1);
/* w = a A x + b w */
cblas_zgemv(CblasColMajor, (CBLAS_TRANSPOSE)trans,
cblas_zgemv(CblasColMajor, (CBLAS_TRANSPOSE)trans,
M, N,
CBLAS_SADDR(alpha), A, LDA,
X, INCX,