PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
psplrnt.c
Go to the documentation of this file.
1 
15 #include "common.h"
16 
17 #define A(m, n) BLKADDR(A, float, m, n)
18 /***************************************************************************/
22 {
23  PLASMA_desc A;
24  unsigned long long int seed;
25  PLASMA_sequence *sequence;
26  PLASMA_request *request;
27 
28  int m, n;
29  int next_m;
30  int next_n;
31  int ldam;
32  int tempmm, tempnn;
33 
34  plasma_unpack_args_4(A, seed, sequence, request);
35  if (sequence->status != PLASMA_SUCCESS)
36  return;
37 
38  n = 0;
39  m = PLASMA_RANK;
40  while (m >= A.mt) {
41  n++;
42  m = m - A.mt;
43  }
44 
45  while ( n < A.nt ) {
46  next_n = n;
47  next_m = m;
48 
49  next_m += PLASMA_SIZE;
50  while ( next_m >= A.mt && next_n < A.nt ) {
51  next_n++;
52  next_m = next_m - A.mt;
53  }
54 
55  tempmm = m == A.mt-1 ? A.m-m*A.mb : A.mb;
56  tempnn = n == A.nt-1 ? A.n-n*A.nb : A.nb;
57  ldam = BLKLDD(A, m);
58 
59  CORE_splrnt(
60  tempmm, tempnn, A(m, n), ldam,
61  A.m, m*A.mb, n*A.nb, seed );
62 
63  m = next_m;
64  n = next_n;
65  }
66 }
67 
68 /***************************************************************************/
71 void plasma_psplrnt_quark( PLASMA_desc A, unsigned long long int seed,
72  PLASMA_sequence *sequence, PLASMA_request *request )
73 {
76 
77  int m, n;
78  int ldam;
79  int tempmm, tempnn;
80 
81  plasma = plasma_context_self();
82  if (sequence->status != PLASMA_SUCCESS)
83  return;
84  QUARK_Task_Flag_Set(&task_flags, TASK_SEQUENCE, (intptr_t)sequence->quark_sequence);
85 
86  for (m = 0; m < A.mt; m++) {
87  tempmm = m == A.mt-1 ? A.m-m*A.mb : A.mb;
88  ldam = BLKLDD(A, m);
89 
90  for (n = 0; n < A.nt; n++) {
91  tempnn = n == A.nt-1 ? A.n-n*A.nb : A.nb;
92 
94  plasma->quark, &task_flags,
95  tempmm, tempnn, A(m, n), ldam,
96  A.m, m*A.mb, n*A.nb, seed );
97  }
98  }
99 }