Commit 4bedc20a authored by Mathieu Faverge's avatar Mathieu Faverge

Update quark with cleanup of the runtime API

parent bacf4ad5
......@@ -46,8 +46,9 @@ void CORE_zgetrf_quark(Quark *quark)
quark_unpack_args_9(quark, m, n, A, lda, IPIV, sequence, request, check_info, iinfo);
CORE_zgetrf( m, n, A, lda, IPIV, &info );
if (info != MORSE_SUCCESS && check_info)
RUNTIME_sequence_flush(quark, sequence, request, iinfo+info);
if ( (info != MORSE_SUCCESS) && check_info ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
void MORSE_TASK_zgetrf(const MORSE_option_t *options,
......
......@@ -49,8 +49,9 @@ void CORE_zgetrf_incpiv_quark(Quark *quark)
quark_unpack_args_10(quark, m, n, ib, A, lda, IPIV, sequence, request, check_info, iinfo);
CORE_zgetrf_incpiv(m, n, ib, A, lda, IPIV, &info);
if (info != MORSE_SUCCESS && check_info)
RUNTIME_sequence_flush(quark, sequence, request, iinfo+info);
if ( (info != MORSE_SUCCESS) && check_info ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
/***************************************************************************//**
......
......@@ -43,8 +43,9 @@ void CORE_zgetrf_nopiv_quark(Quark *quark)
quark_unpack_args_8(quark, m, n, ib, A, lda, sequence, request, iinfo);
CORE_zgetrf_nopiv(m, n, ib, A, lda, &info);
if (info != MORSE_SUCCESS)
RUNTIME_sequence_flush(quark, sequence, request, iinfo+info);
if ( info != MORSE_SUCCESS ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
/***************************************************************************//**
......
......@@ -46,8 +46,9 @@ void CORE_zpotrf_quark(Quark *quark)
quark_unpack_args_7(quark, uplo, n, A, lda, sequence, request, iinfo);
CORE_zpotrf(uplo, n, A, lda, &info);
if (sequence->status == MORSE_SUCCESS && info != 0)
RUNTIME_sequence_flush(quark, sequence, request, iinfo+info);
if ( (sequence->status == MORSE_SUCCESS) && (info != 0) ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
void MORSE_TASK_zpotrf(const MORSE_option_t *options,
......
......@@ -45,8 +45,9 @@ void CORE_zsytrf_nopiv_quark(Quark *quark)
quark_unpack_args_7(quark, uplo, n, A, lda, sequence, request, iinfo);
info = CORE_zsytf2_nopiv(uplo, n, A, lda);
if (sequence->status == MORSE_SUCCESS && info != 0)
RUNTIME_sequence_flush(quark, sequence, request, iinfo+info);
if ( (sequence->status == MORSE_SUCCESS) && (info != 0) ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
void MORSE_TASK_zsytrf_nopiv(const MORSE_option_t *options,
......
......@@ -47,7 +47,7 @@ void CORE_ztile_zero_quark(Quark *quark)
}
void MORSE_TASK_ztile_zero(const const MORSE_option_t *options,
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)
{
......
......@@ -48,8 +48,9 @@ void CORE_ztrtri_quark(Quark *quark)
quark_unpack_args_8(quark, uplo, diag, N, A, LDA, sequence, request, iinfo);
CORE_ztrtri(uplo, diag, N, A, LDA, &info);
if ((sequence->status == MORSE_SUCCESS) && (info > 0))
RUNTIME_sequence_flush(quark, sequence, request, iinfo + info);
if ( (sequence->status == MORSE_SUCCESS) && (info > 0) ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
void MORSE_TASK_ztrtri(const MORSE_option_t *options,
......
......@@ -58,8 +58,9 @@ void CORE_ztstrf_quark(Quark *quark)
quark_unpack_args_17(quark, m, n, ib, nb, U, ldu, A, lda, L, ldl, IPIV, WORK, ldwork, sequence, request, check_info, iinfo);
CORE_ztstrf(m, n, ib, nb, U, ldu, A, lda, L, ldl, IPIV, WORK, ldwork, &info);
if (info != MORSE_SUCCESS && check_info)
RUNTIME_sequence_flush(quark, sequence, request, iinfo + info);
if ( (info != MORSE_SUCCESS) && check_info ) {
RUNTIME_sequence_flush( (MORSE_context_t*)quark, sequence, request, iinfo+info );
}
}
/***************************************************************************//**
......
/**
*
* @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.
*
**/
/**
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @file runtime_async.c
*
......@@ -26,12 +21,13 @@
#include <stdlib.h>
#include "chameleon_quark.h"
/** *****************************************************************************
/*******************************************************************************
* Create a sequence
**/
int RUNTIME_sequence_create(MORSE_context_t *morse, MORSE_sequence_t *sequence)
int RUNTIME_sequence_create( MORSE_context_t *morse,
MORSE_sequence_t *sequence )
{
sequence->schedopt =(void*) QUARK_Sequence_Create((Quark*)(morse->schedopt));
sequence->schedopt = (void*)QUARK_Sequence_Create((Quark*)(morse->schedopt));
if (sequence->schedopt == NULL) {
morse_error("MORSE_Sequence_Create", "QUARK_Sequence_Create() failed");
......@@ -41,31 +37,39 @@ int RUNTIME_sequence_create(MORSE_context_t *morse, MORSE_sequence_t *sequence)
return MORSE_SUCCESS;
}
/** *****************************************************************************
/*******************************************************************************
* Destroy a sequence
**/
int RUNTIME_sequence_destroy(MORSE_context_t *morse, MORSE_sequence_t *sequence)
int RUNTIME_sequence_destroy( MORSE_context_t *morse,
MORSE_sequence_t *sequence )
{
QUARK_Sequence_Destroy((Quark*)(morse->schedopt), (Quark_Sequence *)(sequence->schedopt));
QUARK_Sequence_Destroy( (Quark*)(morse->schedopt),
(Quark_Sequence *)(sequence->schedopt) );
return MORSE_SUCCESS;
}
/** *****************************************************************************
/*******************************************************************************
* Wait for the completion of a sequence
**/
int RUNTIME_sequence_wait(MORSE_context_t *morse, MORSE_sequence_t *sequence )
int RUNTIME_sequence_wait( MORSE_context_t *morse,
MORSE_sequence_t *sequence )
{
QUARK_Sequence_Wait( (Quark*)(morse->schedopt), (Quark_Sequence *)(sequence->schedopt));
QUARK_Sequence_Wait( (Quark*)(morse->schedopt),
(Quark_Sequence *)(sequence->schedopt) );
return MORSE_SUCCESS;
}
/** *****************************************************************************
/*******************************************************************************
* Terminate a sequence
**/
void RUNTIME_sequence_flush(void *quark, MORSE_sequence_t *sequence, MORSE_request_t *request, int status)
void RUNTIME_sequence_flush( MORSE_context_t *morse,
MORSE_sequence_t *sequence,
MORSE_request_t *request,
int status )
{
sequence->request = request;
sequence->status = status;
request->status = status;
QUARK_Sequence_Cancel((Quark*) quark, (Quark_Sequence *)(sequence->schedopt));
QUARK_Sequence_Cancel( (Quark*)(morse),
(Quark_Sequence *)(sequence->schedopt) );
}
/**
*
* @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.
*
**/
/**
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @file runtime_context.c
*
......@@ -16,10 +11,10 @@
* MORSE is a software package provided by Univ. of Tennessee,
* Univ. of California Berkeley and Univ. of Colorado Denver
*
* @version
* @version 1.0.0
* @author Vijay Joshi
* @author Cedric Castagnede
* @date 2011-10-29
* @date 2011-10-29
*
**/
#include <stdlib.h>
......@@ -28,7 +23,7 @@
/*******************************************************************************
* Create new context
**/
void RUNTIME_context_create(MORSE_context_t *morse)
void RUNTIME_context_create( MORSE_context_t *morse )
{
morse->scheduler = RUNTIME_SCHED_QUARK;
/* Will require the static initialization if we want to use it in this code */
......@@ -38,8 +33,7 @@ void RUNTIME_context_create(MORSE_context_t *morse)
/*******************************************************************************
* Clean the context
**/
void RUNTIME_context_destroy(MORSE_context_t *morse)
void RUNTIME_context_destroy( MORSE_context_t *morse )
{
(void)morse;
return;
......@@ -48,7 +42,7 @@ void RUNTIME_context_destroy(MORSE_context_t *morse)
/*******************************************************************************
*
*/
void RUNTIME_enable(MORSE_enum lever)
void RUNTIME_enable( MORSE_enum lever )
{
switch (lever)
{
......@@ -67,7 +61,7 @@ void RUNTIME_enable(MORSE_enum lever)
/*******************************************************************************
*
**/
void RUNTIME_disable(MORSE_enum lever)
void RUNTIME_disable( MORSE_enum lever )
{
switch (lever)
{
......
/**
*
* @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-2015 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
/**
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @file runtime_control.c
*
......@@ -27,61 +22,36 @@
#include "chameleon_quark.h"
/*******************************************************************************
* Thread rank.
**/
int RUNTIME_rank(MORSE_context_t *morse)
{
return QUARK_Thread_Rank((Quark*)(morse->schedopt));
}
/*******************************************************************************
* Initialize MORSE
*
**/
int RUNTIME_init_scheduler(MORSE_context_t *morse, int nworkers, int ncudas, int nthreads_per_worker)
int RUNTIME_init( MORSE_context_t *morse,
int ncpus,
int ncudas,
int nthreads_per_worker )
{
int hres = 0;
if ( ncudas > 0 )
if ( ncudas > 0 ) {
morse_warning( "RUNTIME_init_scheduler(quark)", "GPUs are not supported for now");
}
if ( nthreads_per_worker > 0 )
if ( nthreads_per_worker > 0 ) {
morse_warning( "RUNTIME_init_scheduler(quark)", "Multi-threaded kernels are not supported for now");
}
morse->schedopt = (void*)QUARK_New(nworkers);
morse->schedopt = (void*)QUARK_New( ncpus );
return hres;
}
/*******************************************************************************
* Barrier MORSE.
**/
void RUNTIME_barrier(MORSE_context_t *morse)
{
QUARK_Barrier((Quark*)(morse->schedopt));
}
/*******************************************************************************
* Finalize MORSE
*
*/
void RUNTIME_finalize_scheduler(MORSE_context_t *morse)
void RUNTIME_finalize( MORSE_context_t *morse )
{
QUARK_Delete((Quark*)(morse->schedopt));
return;
}
/*******************************************************************************
* Set iteration numbers for traces
**/
void RUNTIME_iteration_push( MORSE_context_t *morse, unsigned long iteration )
{
(void)morse; (void)iteration;
return;
}
void RUNTIME_iteration_pop( MORSE_context_t *morse )
{
(void)morse;
return;
}
/*******************************************************************************
* To suspend the processing of new tasks by workers
**/
......@@ -102,31 +72,57 @@ void RUNTIME_resume( MORSE_context_t *morse )
}
/*******************************************************************************
* This returns the rank of this process
* Busy-waiting barrier
**/
void RUNTIME_comm_rank( int *rank )
void RUNTIME_barrier( MORSE_context_t *morse )
{
*rank = 0;
return;
QUARK_Barrier((Quark*)(morse->schedopt));
}
/*******************************************************************************
* This returns the size of the distributed computation
* Display a progress information when executing the tasks
**/
void RUNTIME_comm_size( int *size )
void RUNTIME_progress( MORSE_context_t *morse )
{
*size = 1;
(void)morse;
return;
}
/*******************************************************************************
* This returns the number of workers
* Thread rank.
**/
int RUNTIME_thread_rank( MORSE_context_t *morse )
{
return QUARK_Thread_Rank((Quark*)(morse->schedopt));
}
/*******************************************************************************
* Number of threads.
**/
int RUNTIME_get_thread_nbr()
int RUNTIME_thread_size( MORSE_context_t *morse )
{
(void)morse;
/*
* TODO: should add a function to Quark to get the number of thread from the
* data structure and not from the system function
*/
return quark_get_numthreads();
}
/*******************************************************************************
* The process rank
**/
int RUNTIME_comm_rank( MORSE_context_t *morse )
{
(void)morse;
return 0;
}
/*******************************************************************************
* This returns the size of the distributed computation
**/
int RUNTIME_comm_size( MORSE_context_t *morse )
{
(void)morse;
return 1;
}
/**
*
* @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, 2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
*
**/
/**
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @file runtime_descriptor.c
*
......@@ -25,26 +20,23 @@
#include <stdlib.h>
#include "chameleon_quark.h"
void RUNTIME_user_tag_size(int user_tag_width, int user_tag_sep) {
(void)user_tag_width;
(void)user_tag_sep;
}
void *RUNTIME_mat_alloc( size_t size)
void RUNTIME_comm_set_tag_sizes( int user_tag_width,
int user_tag_sep )
{
return malloc(size);
(void)user_tag_width;
(void)user_tag_sep;
}
void RUNTIME_mat_free( void *mat, size_t size)
void *RUNTIME_malloc( size_t size )
{
(void)size;
free(mat);
return;
return malloc( size );
}
void RUNTIME_desc_init( MORSE_desc_t *desc )
void RUNTIME_free( void *ptr,
size_t size )
{
(void)desc;
(void)size;
free( ptr );
return;
}
......@@ -60,27 +52,29 @@ void RUNTIME_desc_destroy( MORSE_desc_t *desc )
return;
}
void RUNTIME_desc_submatrix( MORSE_desc_t *desc )
int RUNTIME_desc_acquire( const MORSE_desc_t *desc )
{
(void)desc;
return;
return MORSE_SUCCESS;
}
int RUNTIME_desc_acquire( MORSE_desc_t *desc )
int RUNTIME_desc_release( const MORSE_desc_t *desc )
{
(void)desc;
return MORSE_SUCCESS;
}
int RUNTIME_desc_release( MORSE_desc_t *desc )
int RUNTIME_desc_getoncpu( const MORSE_desc_t *desc )
{
(void)desc;
return MORSE_SUCCESS;
}
int RUNTIME_desc_getoncpu( MORSE_desc_t *desc )
int RUNTIME_desc_getoncpu_async( const MORSE_desc_t *desc,
MORSE_sequence_t *sequence )
{
(void)desc;
(void)sequence;
return MORSE_SUCCESS;
}
......
/**
*
* @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.
*
**/
/**
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @file runtime_options.c
*
......
/**
*
* @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.
*
**/
/**
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @file runtime_profiling.c
*
......@@ -19,7 +14,7 @@
* @version 0.9.0
* @author Vijay Joshi
* @author Cedric Castagnede
* @date 2011-10-29
* @date 2011-10-29
*
**/
#include "chameleon_quark.h"
......@@ -122,3 +117,17 @@ void RUNTIME_kernelprofile_display(void)
{
morse_warning("RUNTIME_kernelprofile_display(quark)", "Kernel profiling is not available with Quark\n");
}
/*******************************************************************************
* Set iteration numbers for traces
**/
void RUNTIME_iteration_push( MORSE_context_t *morse, unsigned long iteration )
{
(void)morse; (void)iteration;
return;
}
void RUNTIME_iteration_pop( MORSE_context_t *morse )
{
(void)morse;
return;
}
/**
*
* @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.
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
**/
/**
*
* @file runtime_zlocality.c
* @file runtime_zlocality.c
*
* 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
* 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
* @author Vijay Joshi
* @date 2011-10-29
* @precisions normal z -> s d c
* @version
* @author Vijay Joshi
* @date 2011-10-29
* @precisions normal z -> s d c
*
**/
#include "chameleon_quark.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.
* @copyright 2009-2014 The University of Tennessee and The University of
* Tennessee Research Foundation. All rights reserved.
* @copyright 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
**/
/**
*
* @file runtime_zprofiling.c
* @file runtime_zprofiling.c
*
* 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
* 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 0.9.0
* @author Mathieu Faverge
* @author Cedric Augonnet
* @author Cedric Castagnede
* @date 2011-06-01
* @precisions normal z -> s d c
* @version 0.9.0
* @author Mathieu Faverge
* @author Cedric Augonnet
* @author Cedric Castagnede
* @date 2011-06-01
* @precisions normal z -> s d c
*
**/
#include "chameleon_quark.h"
......
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