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,
CBLAS_SADDR(alpha), A, LDA,
X, INCX,
CBLAS_SADDR(beta), W, 1);
/* y - w */
cblas_zaxpy(k, CBLAS_SADDR(mzone), Y, INCY, W, 1);
/* Max Norm */
*Rnorm = LAPACKE_zlange_work(LAPACK_COL_MAJOR, 'm', 1, k, W, 1, work);
if ( (*Rnorm / (M*N)) > eps) {
return 1;
} else {
return 0;
}
(void)L; (void)storev;
}
/*--------------------------------------------------------------
......@@ -136,8 +138,8 @@ int testing_zpemv(int argc, char **argv)
printf("Out of Memory \n ");
exit(0);
}
/* Initialize Data */
/* Initialize Data */
MORSE_zplrnt(n, n, A, lda, 479 );
MORSE_zplrnt(n, n, X, lda, 320 );
MORSE_zplrnt(n, 1, Y0, n, 573 );
......@@ -152,7 +154,7 @@ int testing_zpemv(int argc, char **argv)
nfails = 0;
for (i=0; i<6; i++) {
/* m and n cannot be greater than lda (arg_n) */
switch (i) {
case 0: l = 0; m = arg_n; n = m; break;
......@@ -165,17 +167,17 @@ int testing_zpemv(int argc, char **argv)
/* Colwise ConjTrans & Rowwise NoTrans */
#ifdef COMPLEX
for (t=0; t<3; t++) {
for (t=0; t<3; t++)
#else
for (t=0; t<2; t++) {
for (t=0; t<2; t++)
#endif
{
/* Swap m and n for transpose cases */
if ( t == 1 ) {
k = m; m = n; n = k;
}
LAPACKE_zlacpy_work( LAPACK_COL_MAJOR, 'A', m, n,
LAPACKE_zlacpy_work( LAPACK_COL_MAJOR, 'A', m, n,
A, lda, A0, lda);
if ( trans[t] == MorseNoTrans ) {
......@@ -217,29 +219,29 @@ int testing_zpemv(int argc, char **argv)
case 2: incx = lda; incy = 1; break;
case 3: incx = lda; incy = lda; break;
}
/* initialize Y with incy */
cblas_zcopy(n, Y0, 1, Y, incy);
/* ZPEMV */
CORE_zpemv( trans[t], storev, m, n, l,
alpha, A, lda,
X, incx,
beta, Y, incy,
CORE_zpemv( trans[t], storev, m, n, l,
alpha, A, lda,
X, incx,
beta, Y, incy,
work);
/* Check the solution */
info_solution = check_solution(trans[t], storev,
m, n, l,
info_solution = check_solution(trans[t], storev,
m, n, l,
alpha, A0, lda,
X, incx,
beta, Y0, 1,
Y, incy,
X, incx,
beta, Y0, 1,
Y, incy,
work, &rnorm);
if ( info_solution != 0 ) {
nfails++;
printf("Failed: t=%s, s=%s, M=%3d, N=%3d, L=%3d, alpha=%e, incx=%3d, beta=%e, incy=%3d, rnorm=%e\n",
printf("Failed: t=%s, s=%s, M=%3d, N=%3d, L=%3d, alpha=%e, incx=%3d, beta=%e, incy=%3d, rnorm=%e\n",
transstr[t], cstorev, m, n, l, creal(alpha), incx, creal(beta), incy, rnorm );
}
nbtests++;
......@@ -268,4 +270,3 @@ int testing_zpemv(int argc, char **argv)
return hres;
}
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