00001
00014 #ifndef _PLASMA_CONTEXT_H_
00015 #define _PLASMA_CONTEXT_H_
00016
00017 #include <stdio.h>
00018 #include "quark.h"
00019
00020 struct plasma_context_struct;
00021
00022
00025 typedef struct plasma_context_struct {
00026
00027 PLASMA_bool initialized;
00028
00029
00030 int world_size, group_size;
00031 int thread_bind[CONTEXT_THREADS_MAX];
00032 int thread_rank[CONTEXT_THREADS_MAX];
00033 pthread_attr_t thread_attr;
00034 pthread_t thread_id[CONTEXT_THREADS_MAX];
00035
00036
00037 pthread_mutex_t action_mutex;
00038 pthread_cond_t action_condt;
00039 volatile PLASMA_enum action;
00040 void (*parallel_func_ptr)(struct plasma_context_struct*);
00041 unsigned char args_buff[ARGS_BUFF_SIZE];
00042
00043
00044 PLASMA_bool errors_enabled;
00045 PLASMA_bool warnings_enabled;
00046 PLASMA_bool autotuning_enabled;
00047 PLASMA_bool dynamic_section;
00048
00049
00050 PLASMA_enum scheduling;
00051 PLASMA_enum householder;
00052 PLASMA_enum translation;
00053
00054
00055 int nb;
00056 int ib;
00057 int nbnbsize;
00058 int ibnbsize;
00059 int info;
00060 int iinfo;
00061 int rhblock;
00062
00063
00064 #ifdef BUSY_WAITING
00065 volatile int barrier_in[CONTEXT_THREADS_MAX];
00066 volatile int barrier_out[CONTEXT_THREADS_MAX];
00067 #else
00068 int volatile barrier_id;
00069 int volatile barrier_nblocked_thrds;
00070 pthread_mutex_t barrier_synclock;
00071 pthread_cond_t barrier_synccond;
00072 #endif
00073
00074
00075 int ss_ld;
00076 volatile int ss_abort;
00077 volatile int *ss_progress;
00078
00079
00080 Quark *quark;
00081 } plasma_context_t;
00082
00083
00086 typedef struct plasma_context_map_struct {
00087 pthread_t thread_id;
00088 plasma_context_t *context;
00089 } plasma_context_map_t;
00090
00091 #ifdef __cplusplus
00092 extern "C" {
00093 #endif
00094
00095
00098 plasma_context_t *plasma_context_create();
00099 int plasma_context_insert(plasma_context_t *context, pthread_t thread_id);
00100 int plasma_context_remove(plasma_context_t *context, pthread_t thread_id);
00101 plasma_context_t *plasma_context_self();
00102
00103 #ifdef __cplusplus
00104 }
00105 #endif
00106
00107 #endif