ExaGeoStat
ExaGeoStat is a parallel high performance unified framework for geostatistics on manycore systems.
codelet_dcmg.c
Go to the documentation of this file.
1 
20 #include "../include/starpu_exageostat.h"
21 
22 static void CORE_dcmg_starpu(void *buffers[],void *cl_arg){
23  int m, n, m0, n0;
24  location * l1;
25  location * l2;
26  double * theta;
27  double * A;
28  int distance_metric;
29  theta = (double *) malloc(3* sizeof(double));
30  A = (double *)STARPU_MATRIX_GET_PTR(buffers[0]);
31 
32  starpu_codelet_unpack_args(cl_arg, &m, &n, &m0, &n0, &l1, &l2, &theta[0], &theta[1], &theta[2], &distance_metric);
33 
34 
35  core_dcmg(A, m, n, m0, n0, l1, l2, theta, distance_metric);
36 
37 }
38 
39 static struct starpu_codelet cl_dcmg =
40 {
41  .where = STARPU_CPU,
42  .cpu_funcs = {CORE_dcmg_starpu},
43  .nbuffers = 1,
44  .modes = {STARPU_W},
45  .name = "dcmg"
46 };
47 
48 /***************************************************************************/
93 int MORSE_MLE_dcmg_Tile_Async(MORSE_enum uplo, MORSE_desc_t *descA, MORSE_sequence_t *sequence, MORSE_request_t *request, location *l1, location *l2, double *theta , char *dm) {
94 
95  MORSE_context_t *morse;
96  MORSE_option_t options;
97  morse = morse_context_self();
98 
99 
100  if (sequence->status != MORSE_SUCCESS)
101  return -2;
102  RUNTIME_options_init(&options, morse, sequence, request);
103 
104 
105  int m, n, m0, n0;
106  int distance_metric = strcmp(dm,"gc")==0? 1 : 0 ;
107  int tempmm, tempnn;
108  MORSE_desc_t A = *descA;
109  struct starpu_codelet *cl=&cl_dcmg;
110 
111 
112  for(m = 0; m < A.mt; m++)
113  {
114  tempmm = m == A.mt -1 ? A.m- m* A.mb : A.mb;
115 
116  for (n = 0; n < A.nt; n++) {
117  tempnn = n == A.nt -1 ? A.n - n * A.nb : A.nb;
118 
119  m0= m * A.mb;
120  n0= n * A.nb;
121  starpu_insert_task(starpu_mpi_codelet(cl),
122  STARPU_VALUE, &tempmm, sizeof(int),
123  STARPU_VALUE, &tempnn, sizeof(int),
124  STARPU_VALUE, &m0, sizeof(int),
125  STARPU_VALUE, &n0, sizeof(int),
126  STARPU_W, RTBLKADDR(descA, sizeof(double)*ldam*tempnn, m, n),
127  STARPU_VALUE, &l1, sizeof(location*),
128  STARPU_VALUE, &l2, sizeof(location*),
129  STARPU_VALUE, &theta[0], sizeof(double),
130  STARPU_VALUE, &theta[1], sizeof(double),
131  STARPU_VALUE, &theta[2], sizeof(double),
132  STARPU_VALUE, &distance_metric, sizeof(int),
133  0);
134 
135  }
136 
137  }
138 
139  //MORSE_TASK_flush_desc( &options, MorseUpperLower, descA );
140  RUNTIME_options_ws_free(&options);
141  RUNTIME_options_finalize(&options, morse);
142  //MORSE_TASK_dataflush_all();
143  return MORSE_SUCCESS;
144 }
145 
146 
147 
#define RTBLKADDR(desc, type, m, n)
#define starpu_mpi_codelet(_codelet_)
void core_dcmg(double *A, int m, int n, int m0, int n0, location *l1, location *l2, double *localtheta, int distance_metric)
Definition: core_dcmg.c:95
#define A(m, n)
Definition: pdpotrf_diag.c:34
int MORSE_MLE_dcmg_Tile_Async(MORSE_enum uplo, MORSE_desc_t *descA, MORSE_sequence_t *sequence, MORSE_request_t *request, location *l1, location *l2, double *theta, char *dm)
Definition: codelet_dcmg.c:93