ExaGeoStat
ExaGeoStat is a parallel high performance unified framework for geostatistics on manycore systems.
codelet_dmdet.c
Go to the documentation of this file.
1 
20 #include "../include/starpu_exageostat.h"
21 static void CORE_dmdet_starpu(void *buffers[],void *cl_arg){
22  int m;
23  int n;
24  double *A;
25  int m0;
26  int n0;
27  double det = 0;
28  double *determinant=&det;
29 
30  *determinant = 0;
31  A = (double *)STARPU_MATRIX_GET_PTR(buffers[0]);
32  determinant = (double *)STARPU_MATRIX_GET_PTR(buffers[1]);
33  starpu_codelet_unpack_args(cl_arg, &m, &n, &m0, &n0);
34 
35  double local_det=core_dmdet(A, m, n, m0, n0);
36 
37  *determinant += local_det;
38 }
39 
40 static struct starpu_codelet cl_dmdet =
41 {
42  .where = STARPU_CPU,
43  .cpu_funcs = {CORE_dmdet_starpu},
44  .nbuffers = 2,
45  .modes = {STARPU_R,STARPU_RW},
46  .name = "dmdet"
47 };
48 
49 /***************************************************************************/
83 int MORSE_MLE_dmdet_Tile_Async(MORSE_desc_t *descA, MORSE_sequence_t *sequence, MORSE_request_t *request, MORSE_desc_t * descdet) {
84 
85  MORSE_context_t *morse;
86  MORSE_option_t options;
87  morse = morse_context_self();
88  if (sequence->status != MORSE_SUCCESS)
89  return -2;
90 
91  RUNTIME_options_init(&options, morse, sequence, request);
92 
93  int m, m0, n0;
94  int tempmm;
95  MORSE_desc_t A = *descA;
96  struct starpu_codelet *cl=&cl_dmdet;
97 
98 
99  for(m=0; m < A.mt; m++)
100  {
101  tempmm = m == A.mt-1 ? A.m-m*A.mb : A.mb;
102  starpu_insert_task(starpu_mpi_codelet(cl),
103  STARPU_VALUE, &tempmm, sizeof(int),
104  STARPU_VALUE, &tempmm, sizeof(int),
105  STARPU_R, RTBLKADDR(descA,sizeof(double)*tempmm, m, m),
106  STARPU_VALUE, &m0, sizeof(int),
107  STARPU_VALUE, &n0, sizeof(int),
108  STARPU_RW,RTBLKADDR(descdet,sizeof(double), 0, 0),
109  0);
110  }
111 
112  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descA);
113  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descdet);
114  RUNTIME_options_ws_free(&options);
115  RUNTIME_options_finalize(&options, morse);
116  //MORSE_TASK_flush_all();
117  //MORSE_TASK_dataflush_all();
118  return MORSE_SUCCESS;
119 }
120 
121 
#define RTBLKADDR(desc, type, m, n)
#define starpu_mpi_codelet(_codelet_)
#define A(m, n)
Definition: pdpotrf_diag.c:34
double core_dmdet(double *A, int m, int n, int m0, int n0)
Definition: core_dmdet.c:51
int MORSE_MLE_dmdet_Tile_Async(MORSE_desc_t *descA, MORSE_sequence_t *sequence, MORSE_request_t *request, MORSE_desc_t *descdet)
Definition: codelet_dmdet.c:83