ExaGeoStat
ExaGeoStat is a parallel high performance unified framework for geostatistics on manycore systems.
codelet_ddotp.c
Go to the documentation of this file.
1 
20 #include "../include/starpu_exageostat.h"
21 static void CORE_ddotp_starpu(void *buffers[], void *cl_arg){
22  int m, m0;
23  double * A;
24  double * dotproduct;
25 
26  dotproduct = (double *)STARPU_MATRIX_GET_PTR(buffers[0]);
27  A = (double *)STARPU_MATRIX_GET_PTR(buffers[1]);
28  starpu_codelet_unpack_args(cl_arg, &m, &m0);
29  double local_dot=cblas_ddot(m, A, 1, A, 1);
30  *dotproduct += local_dot;
31 }
32 
33 static struct starpu_codelet cl_ddotp =
34 {
35  .where = STARPU_CPU,
36  .cpu_funcs = {CORE_ddotp_starpu},
37  .nbuffers = 2,
38  .modes = {STARPU_RW,STARPU_R},
39  .name = "ddotp"
40 };
41 
42 /***************************************************************************/
75 int MORSE_MLE_ddotp_Async(MORSE_desc_t *descA, MORSE_desc_t *descproduct, MORSE_sequence_t *sequence, MORSE_request_t *request) {
76 
77  MORSE_context_t *morse;
78  MORSE_option_t options;
79  morse = morse_context_self();
80  if (sequence->status != MORSE_SUCCESS)
81  return -2;
82  RUNTIME_options_init(&options, morse, sequence, request);
83 
84  int m, m0;
85  int tempmm;
86  MORSE_desc_t A = *descA;
87 
88  struct starpu_codelet *cl=&cl_ddotp;
89 
90  for (m = 0; m < A.mt; m++) {
91  tempmm = m == A.mt-1 ? A.m - m * A.mb : A.mb;
92 
93  m0 = m * A.mb;
94 
95 
96  starpu_insert_task(starpu_mpi_codelet(cl),
97  STARPU_VALUE, &tempmm, sizeof(int),
98  STARPU_VALUE, &m0, sizeof(int),
99  STARPU_RW, RTBLKADDR(descproduct, sizeof(double), 0, 0),
100  STARPU_R, RTBLKADDR(descA, sizeof(double)*tempmm, m, 0),
101  0);
102  }
103 
104  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descA);
105  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descproduct);
106  RUNTIME_options_ws_free(&options);
107  RUNTIME_options_finalize(&options, morse);
108  //MORSE_TASK_dataflush_all();
109  MORSE_Sequence_Wait(sequence);
110  return MORSE_SUCCESS;
111 }
112 
113 
#define RTBLKADDR(desc, type, m, n)
int MORSE_MLE_ddotp_Async(MORSE_desc_t *descA, MORSE_desc_t *descproduct, MORSE_sequence_t *sequence, MORSE_request_t *request)
Definition: codelet_ddotp.c:75
#define starpu_mpi_codelet(_codelet_)
#define A(m, n)
Definition: pdpotrf_diag.c:34