MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
quark.h File Reference
#include <limits.h>
#include <stdio.h>
#include <inttypes.h>
#include "quark_unpack_args.h"
Include dependency graph for quark.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  quark_task_flags_s
 

Macros

#define QUARK_SUCCESS   0
 
#define QUARK_ERR   -1
 
#define QUARK_ERR_UNEXPECTED   -1
 
#define QUARK_ERR_NOT_SUPPORTED   -2
 
#define INPUT   0x01
 
#define LOCALITY   ( 1 << 3 )
 
#define NOLOCALITY   0x00
 
#define ACCUMULATOR   ( 1 << 4 )
 
#define NOACCUMULATOR   0x00
 
#define GATHERV   ( 1 << 5 )
 
#define NOGATHERV   0x00
 
#define TASK_LABEL   ( 1 << 6 )
 
#define TASKLABEL   ( 1 << 6 ) /* depreciated label */
 
#define TASK_COLOR   ( 1 << 7 )
 
#define TASKCOLOR   ( 1 << 7 ) /* depreciated label */
 
#define TASK_PRIORITY   ( 1 << 8 )
 
#define TASK_LOCK_TO_THREAD   ( 1 << 9 )
 
#define TASK_SEQUENCE   ( 1 << 10 )
 
#define TASK_THREAD_COUNT   ( 1 << 11 )
 
#define QUARK_TASK_MIN_PRIORITY   0
 
#define QUARK_TASK_MAX_PRIORITY   INT_MAX
 
#define Quark_Task_Flags_Initializer   { (int)0, (int)-1, (char *)NULL, (char *)NULL, (void *)NULL, (int)1 }
 

Typedefs

typedef struct quark_s Quark
 
typedef struct quark_task_s Quark_Task
 
typedef struct quark_task_flags_s Quark_Task_Flags
 
typedef struct Quark_sequence_s Quark_Sequence
 

Enumerations

enum  quark_direction_t {
  QINPUT =0x01, OUTPUT =0x02, INOUT =0x03, VALUE =0x04,
  NODEP =0x05, SCRATCH =0x06
}
 

Functions

QuarkQUARK_Setup (int num_threads)
 
QuarkQUARK_New (int num_threads)
 
unsigned long long QUARK_Insert_Task (Quark *quark, void(*function)(Quark *), Quark_Task_Flags *task_flags,...)
 
void QUARK_Worker_Loop (Quark *quark, int thread_rank)
 
void QUARK_Barrier (Quark *quark)
 
void QUARK_Waitall (Quark *quark)
 
void QUARK_Delete (Quark *quark)
 
void QUARK_Free (Quark *quark)
 
int QUARK_Cancel_Task (Quark *quark, unsigned long long taskid)
 
void * QUARK_Args_List (Quark *quark)
 
void * QUARK_Args_Pop (void *args_list, void **last_arg)
 
int QUARK_Thread_Rank (Quark *quark)
 
Quark_TaskQUARK_Task_Init (Quark *quark, void(*function)(Quark *), Quark_Task_Flags *task_flags)
 
void QUARK_Task_Pack_Arg (Quark *quark, Quark_Task *task, int arg_size, void *arg_ptr, int arg_flags)
 
unsigned long long QUARK_Insert_Task_Packed (Quark *quark, Quark_Task *task)
 
unsigned long long QUARK_Execute_Task (Quark *quark, void(*function)(Quark *), Quark_Task_Flags *task_flags,...)
 
char * QUARK_Get_Task_Label (Quark *quark)
 
Quark_Task_FlagsQUARK_Task_Flag_Set (Quark_Task_Flags *flags, int flag, intptr_t val)
 
Quark_SequenceQUARK_Sequence_Create (Quark *quark)
 
int QUARK_Sequence_Cancel (Quark *quark, Quark_Sequence *sequence)
 
Quark_SequenceQUARK_Sequence_Destroy (Quark *quark, Quark_Sequence *sequence)
 
int QUARK_Sequence_Wait (Quark *quark, Quark_Sequence *sequence)
 
Quark_SequenceQUARK_Get_Sequence (Quark *quark)
 

Detailed Description

Dynamic scheduler functions

PLASMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver

Version
2.3.1
Author
Asim YarKhan
Date
2010-11-15

Definition in file quark.h.

Macro Definition Documentation

#define ACCUMULATOR   ( 1 << 4 )

Definition at line 60 of file quark.h.

#define GATHERV   ( 1 << 5 )

Definition at line 64 of file quark.h.

#define INPUT   0x01

Definition at line 53 of file quark.h.

#define LOCALITY   ( 1 << 3 )

Definition at line 56 of file quark.h.

#define NOACCUMULATOR   0x00

Definition at line 61 of file quark.h.

#define NOGATHERV   0x00

Definition at line 65 of file quark.h.

#define NOLOCALITY   0x00

Definition at line 57 of file quark.h.

#define QUARK_ERR   -1

Definition at line 43 of file quark.h.

#define QUARK_ERR_NOT_SUPPORTED   -2

Definition at line 45 of file quark.h.

#define QUARK_ERR_UNEXPECTED   -1

Definition at line 44 of file quark.h.

#define QUARK_SUCCESS   0

Definition at line 42 of file quark.h.

#define Quark_Task_Flags_Initializer   { (int)0, (int)-1, (char *)NULL, (char *)NULL, (void *)NULL, (int)1 }

Definition at line 108 of file quark.h.

#define QUARK_TASK_MAX_PRIORITY   INT_MAX

Definition at line 87 of file quark.h.

#define QUARK_TASK_MIN_PRIORITY   0

Definition at line 86 of file quark.h.

#define TASK_COLOR   ( 1 << 7 )

Definition at line 72 of file quark.h.

#define TASK_LABEL   ( 1 << 6 )

Definition at line 69 of file quark.h.

#define TASK_LOCK_TO_THREAD   ( 1 << 9 )

Definition at line 77 of file quark.h.

#define TASK_PRIORITY   ( 1 << 8 )

Definition at line 75 of file quark.h.

#define TASK_SEQUENCE   ( 1 << 10 )

Definition at line 79 of file quark.h.

#define TASK_THREAD_COUNT   ( 1 << 11 )

Definition at line 81 of file quark.h.

#define TASKCOLOR   ( 1 << 7 ) /* depreciated label */

Definition at line 73 of file quark.h.

#define TASKLABEL   ( 1 << 6 ) /* depreciated label */

Definition at line 70 of file quark.h.

Typedef Documentation

typedef struct quark_s Quark

Definition at line 90 of file quark.h.

Definition at line 175 of file quark.h.

typedef struct quark_task_s Quark_Task

Definition at line 93 of file quark.h.

Definition at line 106 of file quark.h.

Enumeration Type Documentation

Enumerator
QINPUT 
OUTPUT 
INOUT 
VALUE 
NODEP 
SCRATCH 

Definition at line 52 of file quark.h.

52 { QINPUT=0x01, OUTPUT=0x02, INOUT=0x03, VALUE=0x04, NODEP=0x05, SCRATCH=0x06 } quark_direction_t;
Definition: quark.h:52
quark_direction_t
Definition: quark.h:52
Definition: quark.h:52
Definition: quark.h:52
Definition: quark.h:52
Definition: quark.h:52
Definition: quark.h:52

Function Documentation

int QUARK_Thread_Rank ( Quark quark)

Return the rank of a thread

Definition at line 377 of file quark.c.

References quark_s::num_threads, pthread_equal(), pthread_self(), worker_s::thread_id, and quark_s::worker.

378 {
379  pthread_t self_id = pthread_self();
380  int i;
381  for (i=0; i<quark->num_threads; i++)
382  if (pthread_equal(quark->worker[i]->thread_id, self_id))
383  return i;
384  return -1;
385 }
struct worker_s ** worker
Definition: quark.c:100
int num_threads
Definition: quark.c:99
pthread_t thread_id
Definition: quark.c:131
MAGMA_DLLPORT pthread_t MAGMA_CDECL pthread_self(void)
MAGMA_DLLPORT int MAGMA_CDECL pthread_equal(pthread_t thread1, pthread_t thread2)

Here is the call graph for this function:

Here is the caller graph for this function: