9
#define _MAX_PROB_SIZE_ 10000 /* 100x100 */
12
# define gai_lu_solve_alt_ F77_FUNC_(gai_lu_solve_alt,GAI_LU_SOLVE_ALT)
13
# define gai_llt_solve_ F77_FUNC_(gai_llt_solve,GAI_LLT_SOLVE)
14
# define gai_solve_ F77_FUNC_(gai_solve,GAI_SOLVE)
15
# define gai_spd_invert_ F77_FUNC_(gai_spd_invert,GAI_SPD_INVERT)
19
# if SIZEOF_SHORT == 8
21
# elif SIZEOF_INT == 8
23
# elif SIZEOF_LONG == 8
25
# elif SIZEOF_LONG_LONG == 8
26
# define SL_INT long long
31
# if SIZEOF_SHORT == 4
33
# elif SIZEOF_INT == 4
35
# elif SIZEOF_LONG == 4
37
# elif SIZEOF_LONG_LONG == 4
38
# define SL_INT long long
44
#if HAVE_SYS_WEAK_ALIAS_PRAGMA
45
# pragma weak wnga_lu_solve_alt = pnga_lu_solve_alt
47
void pnga_lu_solve_alt(Integer tran, Integer g_a, Integer g_b) {
50
gai_lu_solve_alt_(&tran, &g_a, &g_b);
52
pnga_error("ga_lu_solve:scalapack interfaced, need configure --enable-f77",0L);
55
pnga_error("ga_lu_solve:scalapack not interfaced",0L);
59
#if HAVE_SYS_WEAK_ALIAS_PRAGMA
60
# pragma weak wnga_lu_solve = pnga_lu_solve
62
void pnga_lu_solve(char *tran, Integer g_a, Integer g_b) {
64
Integer dimA1, dimA2, typeA;
65
Integer dimB1, dimB2, typeB;
66
Integer dimsA[2], dimsB[2], ndim;
68
/** check GA info for input arrays */
69
pnga_check_handle(g_a, "ga_lu_solve: a");
70
pnga_check_handle(g_b, "ga_lu_solve: b");
71
pnga_inquire (g_a, &typeA, &ndim, dimsA);
72
pnga_inquire (g_b, &typeB, &ndim, dimsB);
78
if( (dimA1*dimA2 > _MAX_PROB_SIZE_) || (dimB1*dimB2 > _MAX_PROB_SIZE_) )
79
pnga_error("ga_lu_solve:Array size too large. Use scalapack for optimum performance. configure --with-scalapack or --with-scalapack-i8 for ga_lu_solve to use Scalapack interface",0L);
81
pnga_lu_solve_seq(tran, g_a, g_b);
84
#if HAVE_SYS_WEAK_ALIAS_PRAGMA
85
# pragma weak wnga_llt_solve = pnga_llt_solve
87
Integer pnga_llt_solve(Integer g_a, Integer g_b) {
90
return gai_llt_solve_(&g_a, &g_b);
92
pnga_error("ga_lu_solve:scalapack interfaced, need configure --enable-f77",0L);
96
pnga_error("ga_lu_solve:scalapack not interfaced",0L);
101
#if HAVE_SYS_WEAK_ALIAS_PRAGMA
102
# pragma weak wnga_solve = pnga_solve
104
Integer pnga_solve(Integer g_a, Integer g_b) {
107
return gai_solve_(&g_a, &g_b);
109
pnga_error("ga_lu_solve:scalapack interfaced, need configure --enable-f77",0L);
113
pnga_error("ga_lu_solve:scalapack not interfaced",0L);
118
#if HAVE_SYS_WEAK_ALIAS_PRAGMA
119
# pragma weak wnga_spd_invert = pnga_spd_invert
121
Integer pnga_spd_invert(Integer g_a) {
124
return gai_spd_invert_(&g_a);
126
pnga_error("ga_lu_solve:scalapack interfaced, need configure --enable-f77",0L);
130
pnga_error("ga_lu_solve:scalapack not interfaced",0L);