MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
morse.h File Reference
#include <inttypes.h>
#include "morse_kernels.h"
#include "morse_z.h"
#include "morse_d.h"
#include "morse_c.h"
#include "morse_s.h"
Include dependency graph for morse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MorseOption_s

Macros

#define morse_desc_getoncpu(desc)   { morse_desc_acquire( desc ); morse_desc_release( desc ); }
#define MORSE_PRIORITY_MIN   0
#define MORSE_PRIORITY_MAX   INT_MAX

Typedefs

typedef struct MorseOption_s MorseOption_t

Functions

void morse_init_scheduler (magma_context_t *, int, int, int)
void morse_finalize_scheduler (magma_context_t *)
void morse_context_create (magma_context_t *)
void morse_context_destroy (magma_context_t *)
void morse_enable (magma_context_t *, MAGMA_enum)
void morse_disable (magma_context_t *, MAGMA_enum)
void morse_barrier (magma_context_t *)
void morse_desc_create (magma_desc_t *)
void morse_desc_destroy (magma_desc_t *)
void morse_desc_init (magma_desc_t *)
void morse_desc_submatrix (magma_desc_t *)
int morse_desc_acquire (magma_desc_t *)
int morse_desc_release (magma_desc_t *)
void * morse_desc_getaddr (magma_desc_t *, int, int)
int morse_sequence_create (magma_context_t *, magma_sequence_t *)
int morse_sequence_destroy (magma_context_t *, magma_sequence_t *)
int morse_sequence_wait (magma_context_t *, magma_sequence_t *)
void morse_sequence_flush (void *, magma_sequence_t *, magma_request_t *, int)
void morse_options_init (MorseOption_t *, magma_context_t *, magma_sequence_t *, magma_request_t *)
void morse_options_finalize (MorseOption_t *, magma_context_t *)
int morse_options_ws_alloc (MorseOption_t *, size_t, size_t)
int morse_options_ws_free (MorseOption_t *)
void morse_schedprofile_display (void)
void morse_zlocality_allrestrict (uint32_t)
void morse_zlocality_onerestrict (morse_kernel_t, uint32_t)
void morse_zlocality_allrestore ()
void morse_zlocality_onerestore (morse_kernel_t)
void morse_zdisplay_allprofile ()
void morse_zdisplay_oneprofile (morse_kernel_t)
void morse_clocality_allrestrict (uint32_t)
void morse_clocality_onerestrict (morse_kernel_t, uint32_t)
void morse_clocality_allrestore ()
void morse_clocality_onerestore (morse_kernel_t)
void morse_cdisplay_allprofile ()
void morse_cdisplay_oneprofile (morse_kernel_t)
void morse_dlocality_allrestrict (uint32_t)
void morse_dlocality_onerestrict (morse_kernel_t, uint32_t)
void morse_dlocality_allrestore ()
void morse_dlocality_onerestore (morse_kernel_t)
void morse_ddisplay_allprofile ()
void morse_ddisplay_oneprofile (morse_kernel_t)
void morse_slocality_allrestrict (uint32_t)
void morse_slocality_onerestrict (morse_kernel_t, uint32_t)
void morse_slocality_allrestore ()
void morse_slocality_onerestore (morse_kernel_t)
void morse_sdisplay_allprofile ()
void morse_sdisplay_oneprofile (morse_kernel_t)

Detailed Description

MAGMA codelets kernel MAGMA 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
Cedric Augonnet
Date:
2011-06-01

Definition in file morse.h.


Macro Definition Documentation

#define morse_desc_getoncpu (   desc)    { morse_desc_acquire( desc ); morse_desc_release( desc ); }

Definition at line 70 of file morse.h.

#define MORSE_PRIORITY_MAX   INT_MAX

Definition at line 84 of file morse.h.

#define MORSE_PRIORITY_MIN   0

Definition at line 83 of file morse.h.


Typedef Documentation

typedef struct MorseOption_s MorseOption_t

Function Documentation

void morse_barrier ( magma_context_t magma)

Busy-waiting barrier

Definition at line 21 of file control.c.

References magma_context_s::quark, QUARK_Barrier(), and magma_context_s::schedopt.

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_cdisplay_allprofile ( )
void morse_cdisplay_oneprofile ( morse_kernel_t  )
void morse_clocality_allrestore ( )
void morse_clocality_allrestrict ( uint32_t  )
void morse_clocality_onerestore ( morse_kernel_t  )
void morse_clocality_onerestrict ( morse_kernel_t  ,
uint32_t   
)
void morse_context_create ( magma_context_t magma)

Create new context

Definition at line 20 of file context.c.

References MAGMA_SCHED_QUARK, MAGMA_SCHED_STARPU, magma_context_s::schedopt, magma_context_s::scheduler, and magma_context_s::starpu.

{
/* Will require the static initialization if we want to use it in this code */
return;
}

Here is the caller graph for this function:

void morse_context_destroy ( magma_context_t magma)

Clean the context

Definition at line 31 of file context.c.

References magma_context_s::schedopt, and magma_context_s::starpu.

{
return;
}

Here is the caller graph for this function:

void morse_ddisplay_allprofile ( )
void morse_ddisplay_oneprofile ( morse_kernel_t  )
int morse_desc_acquire ( magma_desc_t )
void morse_desc_create ( magma_desc_t )

Definition at line 17 of file descriptor.c.

References BLKLDD, magma_desc_s::desc, magma_getaddr(), magma_desc_s::occurences, plasma_element_size(), magma_desc_s::schedopt, and magma_desc_s::starpu_handles.

{
return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_desc_destroy ( magma_desc_t )

Definition at line 22 of file descriptor.c.

References magma_desc_s::desc, magma_desc_s::occurences, magma_desc_s::schedopt, and magma_desc_s::starpu_handles.

{
return;
}

Here is the caller graph for this function:

void* morse_desc_getaddr ( magma_desc_t ,
int  ,
int   
)

Definition at line 48 of file descriptor.c.

References magma_desc_s::desc, magma_getaddr(), magma_desc_s::schedopt, and magma_desc_s::starpu_handles.

{
return magma_getaddr( desc, m, n );
}

Here is the call graph for this function:

void morse_desc_init ( magma_desc_t )

Definition at line 27 of file descriptor.c.

{
return;
}

Here is the caller graph for this function:

int morse_desc_release ( magma_desc_t )
void morse_desc_submatrix ( magma_desc_t )

Definition at line 32 of file descriptor.c.

References magma_desc_s::occurences.

{
return;
}

Here is the caller graph for this function:

void morse_disable ( magma_context_t ,
MAGMA_enum   
)

Definition at line 55 of file context.c.

References MAGMA_PROFILING_MODE.

{
switch (lever)
{
fprintf(stderr, "Profiling is not available with Quark\n");
break;
default:
return;
}
return;
}

Here is the caller graph for this function:

void morse_dlocality_allrestore ( )
void morse_dlocality_allrestrict ( uint32_t  )
void morse_dlocality_onerestore ( morse_kernel_t  )
void morse_dlocality_onerestrict ( morse_kernel_t  ,
uint32_t   
)
void morse_enable ( magma_context_t ,
MAGMA_enum   
)

Definition at line 39 of file context.c.

References MAGMA_PROFILING_MODE.

{
switch (lever)
{
fprintf(stderr, "Profiling is not available with Quark\n");
break;
default:
return;
}
return;
}

Here is the caller graph for this function:

void morse_finalize_scheduler ( magma_context_t )

Definition at line 42 of file control.c.

References morse_starpu_finalize_plasma_on_worker(), magma_context_s::parallel_enabled, magma_context_s::quark, QUARK_Delete(), and magma_context_s::schedopt.

{
QUARK_Delete(magma->schedopt.quark);
return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_init_scheduler ( magma_context_t ,
int  ,
int  ,
int   
)

Definition at line 26 of file control.c.

References MAGMA_FALSE, MAGMA_TRUE, magma_warning, morse_starpu_init_plasma_on_worker(), magma_context_s::nthreads_per_worker, magma_context_s::nworkers, magma_context_s::parallel_enabled, magma_context_s::quark, QUARK_New(), magma_context_s::schedopt, and magma_context_s::starpu.

{
if ( ncudas > 0 )
magma_warning( "morse_init_scheduler(quark)", "GPUs are not supported for now");
if ( nthreads_per_worker > 0 )
magma_warning( "morse_init_scheduler(quark)", "Multi-threaded kernels are not supported for now");
magma->schedopt.quark = QUARK_New(nworkers);
return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_options_finalize ( MorseOption_t ,
magma_context_t  
)

Definition at line 53 of file options.c.

References MorseOption_s::task_flags.

{
/* we can free the task_flags without waiting for quark
because they should have been copied for every task */
free( options->task_flags );
return;
}

Here is the caller graph for this function:

void morse_options_init ( MorseOption_t ,
magma_context_t ,
magma_sequence_t ,
magma_request_t  
)

Definition at line 18 of file options.c.

References MAGMA_NB, MAGMA_PARALLEL, MAGMA_PROFILING, MAGMA_TRUE, MORSE_PRIORITY_MIN, MorseOption_s::nb, MorseOption_s::parallel, MorseOption_s::priority, MorseOption_s::profiling, magma_context_s::quark, MorseOption_s::quark, magma_sequence_s::quark_sequence, QUARK_Task_Flag_Set(), MorseOption_s::request, magma_sequence_s::schedopt, magma_context_s::schedopt, MorseOption_s::sequence, MorseOption_s::task_flags, quark_task_flags_s::task_lock_to_thread, TASK_SEQUENCE, quark_task_flags_s::task_thread_count, MorseOption_s::ws_device, MorseOption_s::ws_dsize, MorseOption_s::ws_host, and MorseOption_s::ws_hsize.

{
/* Create the task flag */
Quark_Task_Flags *task_flags = (Quark_Task_Flags*) malloc(sizeof(Quark_Task_Flags));
/* Initialize task_flags */
memset( task_flags, 0, sizeof(Quark_Task_Flags) );
task_flags->task_lock_to_thread = -1;
task_flags->task_thread_count = 1;
task_flags->thread_set_to_manual_scheduling = -1;
/* Initialize options */
options->sequence = sequence;
options->request = request;
options->profiling = MAGMA_PROFILING == MAGMA_TRUE;
options->parallel = MAGMA_PARALLEL == MAGMA_TRUE;
options->priority = MORSE_PRIORITY_MIN;
/* quark in options */
options->quark = magma->schedopt.quark;
options->nb = MAGMA_NB;
options->ws_hsize = 0;
options->ws_dsize = 0;
options->ws_host = NULL;
options->ws_device = NULL;
options->task_flags = task_flags;
QUARK_Task_Flag_Set(task_flags, TASK_SEQUENCE, (intptr_t)sequence->schedopt.quark_sequence);
return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int morse_options_ws_alloc ( MorseOption_t ,
size_t  ,
size_t   
)

Definition at line 61 of file options.c.

References MAGMA_CPU, MAGMA_CUDA, MAGMA_HOST_MEM, MAGMA_SUCCESS, MAGMA_WORKER_MEM, morse_starpu_ws_alloc(), MorseOption_s::ws_device, MorseOption_s::ws_dsize, MorseOption_s::ws_host, and MorseOption_s::ws_hsize.

{
options->ws_hsize = hsize;
options->ws_dsize = dsize;
return MAGMA_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int morse_options_ws_free ( MorseOption_t )

Definition at line 68 of file options.c.

References MAGMA_SUCCESS, morse_starpu_ws_free(), MorseOption_s::ws_device, MorseOption_s::ws_dsize, MorseOption_s::ws_host, and MorseOption_s::ws_hsize.

{
options->ws_hsize = 0;
options->ws_dsize = 0;
return MAGMA_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_schedprofile_display ( void  )

Definition at line 16 of file profiling.c.

References magma_warning, and profiling_display_efficiency().

{
magma_warning("morse_schedprofile_display(quark)", "Scheduler profiling is not available with Quark\n");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_sdisplay_allprofile ( )
void morse_sdisplay_oneprofile ( morse_kernel_t  )
int morse_sequence_create ( magma_context_t magma,
magma_sequence_t sequence 
)

Create a sequence

Definition at line 21 of file async.c.

References MAGMA_ERR_OUT_OF_RESOURCES, magma_error, MAGMA_SUCCESS, magma_context_s::quark, magma_sequence_s::quark_sequence, QUARK_Sequence_Create(), magma_context_s::schedopt, magma_sequence_s::schedopt, and magma_sequence_s::status.

{
if((sequence->schedopt.quark_sequence = QUARK_Sequence_Create(magma->schedopt.quark)) == NULL){
magma_error("MAGMA_Sequence_Create", "QUARK_Sequence_Create() failed");
}
sequence->status = MAGMA_SUCCESS;
return MAGMA_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int morse_sequence_destroy ( magma_context_t magma,
magma_sequence_t sequence 
)

Destroy a sequence

Definition at line 34 of file async.c.

References MAGMA_SUCCESS, magma_context_s::quark, magma_sequence_s::quark_sequence, QUARK_Sequence_Destroy(), magma_sequence_s::schedopt, and magma_context_s::schedopt.

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_sequence_flush ( void *  schedopt,
magma_sequence_t sequence,
magma_request_t request,
int  status 
)

Terminate a sequence

Definition at line 52 of file async.c.

References magma_sequence_s::quark_sequence, QUARK_Sequence_Cancel(), magma_sequence_s::request, magma_sequence_s::schedopt, magma_request_s::status, and magma_sequence_s::status.

{
sequence->request = request;
sequence->status = status;
request->status = status;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int morse_sequence_wait ( magma_context_t magma,
magma_sequence_t sequence 
)

Wait for the completion of a sequence

Definition at line 43 of file async.c.

References MAGMA_SUCCESS, magma_context_s::quark, magma_sequence_s::quark_sequence, QUARK_Sequence_Wait(), magma_sequence_s::schedopt, and magma_context_s::schedopt.

Here is the call graph for this function:

Here is the caller graph for this function:

void morse_slocality_allrestore ( )
void morse_slocality_allrestrict ( uint32_t  )
void morse_slocality_onerestore ( morse_kernel_t  )
void morse_slocality_onerestrict ( morse_kernel_t  ,
uint32_t   
)
void morse_zdisplay_allprofile ( )

Definition at line 19 of file zprofiling.c.

References magma_warning.

{
magma_warning("morse_zdisplay_allprofile(quark)", "Profiling is not available with Quark");
}

Here is the caller graph for this function:

void morse_zdisplay_oneprofile ( morse_kernel_t  )

Definition at line 24 of file zprofiling.c.

References magma_warning, MORSE_GEMM, MORSE_GEQRT, MORSE_GESSM, MORSE_GETRL, MORSE_HERK, MORSE_LACPY, MORSE_PLGHE, MORSE_PLGSY, MORSE_PLRNT, MORSE_POTRF, MORSE_SSSSM, MORSE_TRSM, MORSE_TSMQR, MORSE_TSQRT, MORSE_TSTRF, and MORSE_UNMQR.

{
magma_warning("morse_zdisplay_oneprofile(quark)", "Profiling is not available with Quark\n");
}
void morse_zlocality_allrestore ( )

Definition at line 28 of file zlocality.c.

References magma_warning.

{
magma_warning("morse_zlocality_allrestore(quark)", "Kernel locality cannot be specified with Quark");
}

Here is the caller graph for this function:

void morse_zlocality_allrestrict ( uint32_t  )

Definition at line 18 of file zlocality.c.

References magma_warning.

{
magma_warning("morse_zlocality_allrestrict(quark)", "Kernel locality cannot be specified with Quark");
}

Here is the caller graph for this function:

void morse_zlocality_onerestore ( morse_kernel_t  )

Definition at line 33 of file zlocality.c.

References magma_warning, MORSE_GEMM, MORSE_GESSM, MORSE_GETRL, MORSE_HERK, MORSE_LACPY, MORSE_POTRF, MORSE_SSSSM, MORSE_TRSM, and MORSE_TSTRF.

{
magma_warning("morse_zlocality_onerestore(quark)", "Kernel locality cannot be specified with Quark");
}
void morse_zlocality_onerestrict ( morse_kernel_t  ,
uint32_t   
)

Definition at line 23 of file zlocality.c.

References magma_warning, MORSE_GEMM, MORSE_GESSM, MORSE_GETRL, MORSE_HERK, MORSE_LACPY, MORSE_POTRF, MORSE_SSSSM, MORSE_TRSM, and MORSE_TSTRF.

{
magma_warning("morse_zlocality_onerestrict(quark)", "Kernel locality cannot be specified with Quark");
}