Skip to content

Commit 17f2a54

Browse files
committed
Merge branch 'develop' of github.com:trilinos/Trilinos into develop
2 parents 7b22ec3 + 18524ec commit 17f2a54

24 files changed

+1402
-683
lines changed

packages/framework/get_dependencies.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,27 @@ fi
9696
# Set up symlinks to the desired *.ini files
9797
echo
9898
cd ${script_dir}/GenConfig/deps/LoadEnv/ini_files
99+
relative_path_to_script_dir="../../../.."
99100
if [[ -d ${script_dir}/srn-ini-files ]] && [[ "$ini_file_option" == "--srn" ]]; then
100101
echo "STATUS: Link files from srn-ini-files"
101-
ln -sf ${script_dir}/srn-ini-files/trilinos/framework/environment-specs.ini
102-
ln -sf ${script_dir}/srn-ini-files/trilinos/framework/supported-systems.ini
102+
ln -sf ${relative_path_to_script_dir}/srn-ini-files/trilinos/framework/environment-specs.ini
103+
ln -sf ${relative_path_to_script_dir}/srn-ini-files/trilinos/framework/supported-systems.ini
103104
elif [[ -d ${script_dir}/son-ini-files ]] && [[ "$ini_file_option" == "--son" ]]; then
104105
echo "STATUS: Link files from son-ini-files"
105-
ln -sf ${script_dir}/son-ini-files/trilinos/framework/environment-specs.ini
106-
ln -sf ${script_dir}/son-ini-files/trilinos/framework/supported-systems.ini
106+
ln -sf ${relative_path_to_script_dir}/son-ini-files/trilinos/framework/environment-specs.ini
107+
ln -sf ${relative_path_to_script_dir}/son-ini-files/trilinos/framework/supported-systems.ini
107108
else
108109
echo "STATUS: Link files from ini-files"
109-
[ -e ${script_dir}/ini-files/environment-specs.ini ] && ln -sf ${script_dir}/ini-files/environment-specs.ini
110-
[ -e ${script_dir}/ini-files/supported-systems.ini ] && ln -sf ${script_dir}/ini-files/supported-systems.ini
110+
[ -e ${relative_path_to_script_dir}/ini-files/environment-specs.ini ] && ln -sf ${relative_path_to_script_dir}/ini-files/environment-specs.ini
111+
[ -e ${relative_path_to_script_dir}/ini-files/supported-systems.ini ] && ln -sf ${relative_path_to_script_dir}/ini-files/supported-systems.ini
111112
fi
112-
ln -sf ${script_dir}/ini-files/supported-envs.ini
113+
ln -sf ${relative_path_to_script_dir}/ini-files/supported-envs.ini
113114
cd - > /dev/null
114115

115116
cd ${script_dir}/GenConfig/ini_files
116-
ln -sf ${script_dir}/ini-files/config-specs.ini
117-
ln -sf ${script_dir}/ini-files/supported-config-flags.ini
117+
relative_path_to_script_dir="../.."
118+
ln -sf ${relative_path_to_script_dir}/ini-files/config-specs.ini
119+
ln -sf ${relative_path_to_script_dir}/ini-files/supported-config-flags.ini
118120

119121
# Print summary of ini file settings
120122
cd ${script_dir}

packages/shylu/shylu_node/basker/src/shylubasker_decl.hpp

Lines changed: 87 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,16 @@ namespace BaskerNS
7777
int Factor_Inc(Int option);
7878

7979
BASKER_INLINE
80-
int Solve(Entry *b, Entry *x);
80+
int Solve(Entry *b, Entry *x, bool transpose = false);
8181

8282
BASKER_INLINE
83-
int Solve(Int nrhs, Entry *b, Entry *x);
83+
int Solve(Int nrhs, Entry *b, Entry *x, bool transpose = false);
8484

8585
BASKER_INLINE
86-
int Solve(ENTRY_1DARRAY b, ENTRY_1DARRAY x);
86+
int Solve(ENTRY_1DARRAY b, ENTRY_1DARRAY x, bool transpose = false);
8787

8888
BASKER_INLINE
89-
int Solve(Int nrhs, Entry *b, Entry *x, Int option);
90-
91-
BASKER_INLINE
92-
int SolveTest();
89+
int Solve(Int nrhs, Entry *b, Entry *x, Int option, bool transpose = false);
9390

9491
BASKER_INLINE
9592
int SetThreads(Int nthreads);
@@ -298,6 +295,11 @@ namespace BaskerNS
298295
BASKER_INLINE
299296
int permute(INT_1DARRAY, INT_1DARRAY, Int);
300297

298+
BASKER_INLINE
299+
int permute_array_with_workspace(Entry * vec,
300+
INT_1DARRAY & p,
301+
Int n);
302+
301303
BASKER_INLINE
302304
int permute_with_workspace(INT_1DARRAY & vec,
303305
INT_1DARRAY & p,
@@ -318,6 +320,9 @@ namespace BaskerNS
318320
BASKER_INLINE
319321
int permute_inv_with_workspace(ENTRY_1DARRAY&, INT_1DARRAY&, Int);
320322

323+
BASKER_INLINE
324+
int permute_inv_array_with_workspace(Entry*, INT_1DARRAY&, Int);
325+
321326
BASKER_INLINE
322327
int permute_inv_and_init_for_solve
323328
(
@@ -328,6 +333,26 @@ namespace BaskerNS
328333
Int
329334
);
330335

336+
BASKER_INLINE
337+
int permute_and_init_for_solve
338+
(
339+
Entry* y,
340+
ENTRY_1DARRAY &xcon,
341+
ENTRY_1DARRAY &ycon,
342+
INT_1DARRAY &p,
343+
Int n
344+
);
345+
346+
BASKER_INLINE
347+
int permute_inv_and_finalcopy_after_solve
348+
(
349+
Entry* x,
350+
ENTRY_1DARRAY &xconv,
351+
ENTRY_1DARRAY &yconv,
352+
INT_1DARRAY &p,
353+
Int n
354+
);
355+
331356
BASKER_INLINE
332357
int permute_and_finalcopy_after_solve
333358
(
@@ -1151,6 +1176,9 @@ namespace BaskerNS
11511176
BASKER_INLINE
11521177
void printVec(std::string, ENTRY_1DARRAY, Int);
11531178

1179+
BASKER_INLINE
1180+
void printVec(std::string, BASKER_ENTRY*, Int);
1181+
11541182
void get_total_perm(INT_1DARRAY, INT_1DARRAY);
11551183

11561184
//inline
@@ -1193,9 +1221,6 @@ namespace BaskerNS
11931221
INT_1DARRAY &vals_transpose_local);
11941222

11951223
//basker_solve_rhs.hpp
1196-
BASKER_INLINE
1197-
int test_solve();
1198-
11991224
BASKER_INLINE
12001225
int solve_interface(Entry *, Entry*);
12011226

@@ -1251,6 +1276,58 @@ namespace BaskerNS
12511276
ENTRY_1DARRAY &y,
12521277
bool full = true);
12531278

1279+
1280+
BASKER_INLINE
1281+
int solve_interfacetr(Entry *, Entry*);
1282+
1283+
//BASKER_INLINE
1284+
int solve_interfacetr(Int, Entry *, Entry*);
1285+
1286+
BASKER_INLINE
1287+
int solve_interfacetr(ENTRY_1DARRAY &, ENTRY_1DARRAY &);
1288+
1289+
BASKER_INLINE
1290+
int serial_btf_solve_tr(ENTRY_1DARRAY &, ENTRY_1DARRAY &);
1291+
1292+
BASKER_INLINE
1293+
int l_tran_brfa_solve(ENTRY_1DARRAY &, ENTRY_1DARRAY &);
1294+
1295+
BASKER_INLINE
1296+
int u_tran_btfa_solve(ENTRY_1DARRAY &, ENTRY_1DARRAY &);
1297+
1298+
BASKER_INLINE
1299+
int neg_spmv_tr(BASKER_MATRIX &M,
1300+
ENTRY_1DARRAY x,
1301+
ENTRY_1DARRAY y,
1302+
Int offset = 0);
1303+
1304+
BASKER_INLINE
1305+
int neg_spmv_perm_tr(BASKER_MATRIX &M,
1306+
ENTRY_1DARRAY &y,
1307+
ENTRY_1DARRAY &x,
1308+
Int offset = 0);
1309+
1310+
BASKER_INLINE
1311+
int lower_tri_solve_tr(BASKER_MATRIX &M,
1312+
ENTRY_1DARRAY &x,
1313+
ENTRY_1DARRAY &y,
1314+
Int offset = 0);
1315+
1316+
BASKER_INLINE
1317+
int upper_tri_solve_tr(BASKER_MATRIX &M,
1318+
ENTRY_1DARRAY &x,
1319+
ENTRY_1DARRAY &y,
1320+
Int offset = 0);
1321+
1322+
BASKER_INLINE
1323+
int spmv_BTF_tr(Int tab,
1324+
BASKER_MATRIX &M,
1325+
ENTRY_1DARRAY &x, // modified rhs
1326+
ENTRY_1DARRAY &y,
1327+
bool full = true);
1328+
1329+
1330+
12541331
//basker_stats.hpp
12551332
BASKER_INLINE
12561333
void print_local_time_stats();
@@ -1298,7 +1375,6 @@ namespace BaskerNS
12981375
INT_1DARRAY LL_size; // tracks the number of 2D blocks ('rows') in a given 'column'
12991376
INT_1DARRAY LU_size;
13001377

1301-
13021378
//Used for BTF
13031379
#define BASKER_SPLIT_A
13041380
#if defined(BASKER_SPLIT_A)

packages/shylu/shylu_node/basker/src/shylubasker_def.hpp

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "shylubasker_stats.hpp"
1818
#include "shylubasker_order.hpp"
1919

20+
#include "shylubasker_solve_rhs_tr.hpp"
21+
2022
/*Kokkos Includes*/
2123
#ifdef BASKER_KOKKOS
2224
#include <Kokkos_Core.hpp>
@@ -963,8 +965,11 @@ namespace BaskerNS
963965
Kokkos::Timer copyperm_timer;
964966
//printf( " A.nnz= %d vs (%d, %d) nblks=%d, btfa_nnz=%d, btfb_nnz=%d, btfc_nnz=%d\n",(int)nnz, (int)A.nnz,(int)A.val.extent(0),
965967
// btf_nblks,btfa_nnz,btfb_nnz,btfc_nnz );
966-
967-
if ( btf_nblks > 1 ) { //non-single block case
968+
if (btf_nblks == 0) {
969+
std::cout << "Basker Factor error: Case for btf_nbkls = 0 is not implemented" << std::endl;
970+
//A.val(i) = val[ i ]; // may need to apply matching or nd order permutation...
971+
return BASKER_ERROR;
972+
} else {
968973
#ifdef KOKKOS_ENABLE_OPENMP
969974
#pragma omp parallel for
970975
#endif
@@ -1011,21 +1016,6 @@ namespace BaskerNS
10111016
}
10121017
} //end for
10131018
} //end if
1014-
else if ( btf_nblks == 1 )
1015-
{
1016-
#ifdef KOKKOS_ENABLE_OPENMP
1017-
#pragma omp parallel for
1018-
#endif
1019-
for( Int i = 0; i < nnz; ++i ) {
1020-
BTF_A.val( inv_vals_order_ndbtfa_array(i) ) = val[ vals_perm_composition(i) ];
1021-
}
1022-
//BTF_A = A; //unnecessary - this equality was set during break_into_parts2, they point to the same data; for safety, should this simply be copied instead (i.e. deep copy the data)?
1023-
} //end single block case
1024-
else {
1025-
std::cout << "Basker Factor error: Case for btf_nbkls = 0 is not implemented" << std::endl;
1026-
//A.val(i) = val[ i ]; // may need to apply matching or nd order permutation...
1027-
return BASKER_ERROR;
1028-
}
10291019
if(Options.verbose == BASKER_TRUE) {
10301020
std::cout << "Basker Factor: Time to permute and copy from input vals to new vals and blocks: "
10311021
<< copyperm_timer.seconds() << std::endl;
@@ -2029,19 +2019,9 @@ namespace BaskerNS
20292019
}
20302020

20312021

2032-
//Interface for solve.... only doing parallel solve right now.
2033-
template <class Int, class Entry, class Exe_Space>
2034-
BASKER_INLINE
2035-
int Basker<Int,Entry,Exe_Space>::SolveTest()
2036-
{
2037-
test_solve();
2038-
return 0;
2039-
}//end SolveTest
2040-
2041-
20422022
template <class Int, class Entry, class Exe_Space>
20432023
BASKER_INLINE
2044-
int Basker<Int, Entry, Exe_Space>::Solve(Entry *b, Entry *x)
2024+
int Basker<Int, Entry, Exe_Space>::Solve(Entry *b, Entry *x, bool transpose)
20452025
{
20462026
#ifdef BASKER_TIMER
20472027
Kokkos::Timer timer;
@@ -2050,7 +2030,7 @@ namespace BaskerNS
20502030

20512031
if(Options.verbose == BASKER_TRUE)
20522032
{
2053-
printf("Basker Solve Called\n");
2033+
printf("Basker Solve Called (%s)\n",(transpose ? " transpose" : "non-transpose"));
20542034
}
20552035

20562036
if(factor_flag != BASKER_TRUE)
@@ -2061,7 +2041,10 @@ namespace BaskerNS
20612041
return BASKER_ERROR;
20622042
}
20632043

2064-
solve_interface(x,b);
2044+
if (transpose == false)
2045+
solve_interface(x,b);
2046+
else
2047+
solve_interfacetr(x,b);
20652048

20662049
if(Options.verbose == BASKER_TRUE)
20672050
{
@@ -2079,7 +2062,7 @@ namespace BaskerNS
20792062

20802063
template <class Int, class Entry, class Exe_Space>
20812064
BASKER_INLINE
2082-
int Basker<Int,Entry,Exe_Space>::Solve(Int _nrhs, Entry *b, Entry *x)
2065+
int Basker<Int,Entry,Exe_Space>::Solve(Int _nrhs, Entry *b, Entry *x, bool transpose)
20832066
{
20842067
#ifdef BASKER_TIMER
20852068
Kokkos::Timer timer;
@@ -2088,7 +2071,7 @@ namespace BaskerNS
20882071

20892072
if(Options.verbose == BASKER_TRUE)
20902073
{
2091-
printf("Basker MultiSolve Called\n");
2074+
printf("Basker MultiSolve Called with %d RHSs (%s)\n",(int)_nrhs,(transpose ? "transpose" : "non-transpose"));
20922075
}
20932076

20942077
if(factor_flag != BASKER_TRUE)
@@ -2099,7 +2082,10 @@ namespace BaskerNS
20992082
return BASKER_ERROR;
21002083
}
21012084

2102-
solve_interface(_nrhs,x,b);
2085+
if (transpose == false)
2086+
solve_interface(_nrhs,x,b);
2087+
else
2088+
solve_interfacetr(_nrhs,x,b);
21032089

21042090
if(Options.verbose == BASKER_TRUE)
21052091
{
@@ -2117,7 +2103,7 @@ namespace BaskerNS
21172103

21182104
template <class Int, class Entry, class Exe_Space>
21192105
BASKER_INLINE
2120-
int Basker<Int, Entry, Exe_Space>::Solve(ENTRY_1DARRAY b, ENTRY_1DARRAY x)
2106+
int Basker<Int, Entry, Exe_Space>::Solve(ENTRY_1DARRAY b, ENTRY_1DARRAY x, bool transpose)
21212107
{
21222108
printf("Basker: This solve call not implemented\n");
21232109
return -1;
@@ -2126,7 +2112,7 @@ namespace BaskerNS
21262112

21272113
template <class Int, class Entry, class Exe_Space>
21282114
BASKER_INLINE
2129-
int Basker<Int, Entry, Exe_Space>::Solve(Int _nrhs, Entry *b, Entry *x, Int option)
2115+
int Basker<Int, Entry, Exe_Space>::Solve(Int _nrhs, Entry *b, Entry *x, Int option, bool transpose)
21302116
{
21312117
int err = 0;
21322118
printf("Basker: This solve call not implemented\n");

packages/shylu/shylu_node/basker/src/shylubasker_matrix_decl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace BaskerNS
7575
void convert2D(BASKER_MATRIX &M,
7676
BASKER_BOOL alloc,
7777
Int kid,
78-
bool remove_zeros = false);
78+
bool keep_zeros = false);
7979

8080

8181
//just set shape, do not init

packages/shylu/shylu_node/basker/src/shylubasker_matrix_def.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,21 @@ namespace BaskerNS
562562
continue;
563563
}
564564

565+
Int skipped_count = 0;
566+
Int kept_count = 0;
565567
Mag anorm_k (0.0);
566568
for(Int i = col_ptr(k-scol); i < M.col_ptr(k+1); i++)
567569
{
568570
Int j = M.row_idx(i);
569571
if(j >= srow+nrow)
570572
{
573+
if (!keep_zeros && (kept_count == 0 && skipped_count > 0)) {
574+
// if all were zero, then add the last entry to avoid empty column.
575+
row_idx(temp_count) = M.row_idx(i-1)-srow;
576+
val(temp_count) = M.val(i-1);
577+
anorm_k += abs(M.val(i-1));
578+
temp_count++;
579+
}
571580
break;
572581
}
573582

@@ -594,6 +603,9 @@ namespace BaskerNS
594603

595604
anorm_k += abs(M.val(i));
596605
temp_count++;
606+
kept_count ++;
607+
} else {
608+
skipped_count ++;
597609
}
598610
}
599611
anorm = (anorm > anorm_k ? anorm : anorm_k);

0 commit comments

Comments
 (0)