ExaGeoStat
ExaGeoStat is a parallel high performance unified framework for geostatistics on manycore systems.
codelet_dgemv.c
Go to the documentation of this file.
1 
20 #include "../include/starpu_exageostat.h"
21 
22 static void CORE_dgemv_starpu(void *buffers[], void *cl_arg){
23  int m, n, ldam;
24  int m0, n0;
25  double * A;
26  double * Z;
27  double * Zout;
28 
29  A = (double *)STARPU_MATRIX_GET_PTR(buffers[0]);
30  Z = (double *)STARPU_MATRIX_GET_PTR(buffers[1]);
31  Zout = (double *)STARPU_MATRIX_GET_PTR(buffers[2]);
32  starpu_codelet_unpack_args(cl_arg, &m, &n, &ldam, &m0, &n0);
33 
34  cblas_dgemv(CblasColMajor , CblasNoTrans , m, n, 1 , A, m, Z, 1, 0, Zout, 1);
35 
36 }
37 
38 static struct starpu_codelet cl_dgemv =
39 {
40  .where = STARPU_CPU,
41  .cpu_funcs = {CORE_dgemv_starpu},
42  .nbuffers = 3,
43  .modes = {STARPU_R,STARPU_R,STARPU_RW},
44  .name = "dgemv"
45 };
46 
47 /***************************************************************************/
83 int MORSE_MLE_dgemv_Tile_Async(MORSE_desc_t *descA, MORSE_desc_t *descZ, MORSE_desc_t *descZout, MORSE_sequence_t *sequence, MORSE_request_t *request) {
84 
85  MORSE_context_t *morse;
86  MORSE_option_t options;
87  morse = morse_context_self();
88 
89  if (sequence->status != MORSE_SUCCESS)
90  return -2;
91  RUNTIME_options_init(&options, morse, sequence, request);
92 
93  int m, n, ldam, m0, n0;
94  int tempmm, tempnn;
95  MORSE_desc_t A = *descA;
96 
97  struct starpu_codelet *cl=&cl_dgemv;
98  for (n = 0; n < A.nt; n++) {
99  tempnn = n == A.nt -1 ? A.n - n * A.nb : A.nb;
100  for(m = 0; m < A.mt; m++)
101  {
102  tempmm = m == A.mt - 1 ? A.m - m* A.mb : A.mb;
103  ldam= mBLKLDD(descA, m);
104  m0= m * A.mb;
105  n0= n * A.nb;
106  starpu_insert_task(starpu_mpi_codelet(cl),
107  STARPU_VALUE, &tempmm, sizeof(int),
108  STARPU_VALUE, &tempnn, sizeof(int),
109  STARPU_VALUE, &ldam, sizeof(int),
110  STARPU_VALUE, &m0, sizeof(int),
111  STARPU_VALUE, &n0, sizeof(int),
112  STARPU_R, RTBLKADDR(descA, sizeof(double)*A.mt, A.mt, n),
113  STARPU_R, RTBLKADDR(descZ, sizeof(double)*tempnn, 0, n),
114  STARPU_RW, RTBLKADDR(descZout, sizeof(double)*tempnn, 0, n),
115  #if defined(CHAMELEON_CODELETS_HAVE_NAME)
116  STARPU_NAME, "dgemv",
117  #endif
118  0);
119  }
120 
121  }
122 
123  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descA);
124  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descZ);
125  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descZout);
126  RUNTIME_options_ws_free(&options);
127  RUNTIME_options_finalize(&options, morse);
128  //MORSE_TASK_dataflush_all();
129  MORSE_Sequence_Wait(sequence);
130  return MORSE_SUCCESS;
131 }
132 
133 
#define RTBLKADDR(desc, type, m, n)
#define mBLKLDD(A, k)
int MORSE_MLE_dgemv_Tile_Async(MORSE_desc_t *descA, MORSE_desc_t *descZ, MORSE_desc_t *descZout, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: codelet_dgemv.c:83
#define starpu_mpi_codelet(_codelet_)
#define A(m, n)
Definition: pdpotrf_diag.c:34