ExaGeoStat
ExaGeoStat is a parallel high performance unified framework for geostatistics on manycore systems.
codelet_hicma_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 /***************************************************************************/
81 int HICMA_MLE_dmdet_Tile_Async(MORSE_desc_t *descA, MORSE_sequence_t *sequence, MORSE_request_t *request, MORSE_desc_t * descdet) {
82 
83  MORSE_context_t *morse;
84  MORSE_option_t options;
85  morse = morse_context_self();
86  if (sequence->status != MORSE_SUCCESS)
87  return -2;
88 
89  RUNTIME_options_init(&options, morse, sequence, request);
90 
91  int m, m0, n0;
92  int tempmm;
93  MORSE_desc_t A = *descA;
94  struct starpu_codelet *cl=&cl_dmdet;
95 
96 
97  for(m=0; m < A.mt; m++)
98  {
99  tempmm = m == A.mt-1 ? A.m-m*A.mb : A.mb;
100  starpu_insert_task(starpu_mpi_codelet(cl),
101  STARPU_VALUE, &tempmm, sizeof(int),
102  STARPU_VALUE, &tempmm, sizeof(int),
103  STARPU_R, RTBLKADDR(descA,sizeof(double)*tempmm, m, 0),
104  STARPU_VALUE, &m0, sizeof(int),
105  STARPU_VALUE, &n0, sizeof(int),
106  STARPU_RW,RTBLKADDR(descdet,sizeof(double), 0, 0),
107  0);
108  }
109 
110  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descA);
111  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descdet);
112  RUNTIME_options_ws_free(&options);
113  RUNTIME_options_finalize(&options, morse);
114  //MORSE_TASK_flush_all();
115  //MORSE_TASK_dataflush_all();
116  return MORSE_SUCCESS;
117 }
118 
119 
#define RTBLKADDR(desc, type, m, n)
int HICMA_MLE_dmdet_Tile_Async(MORSE_desc_t *descA, MORSE_sequence_t *sequence, MORSE_request_t *request, MORSE_desc_t *descdet)
#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