Skip to content

Commit

Permalink
adapt to change from long to int64_t in spral structs
Browse files Browse the repository at this point in the history
  • Loading branch information
svigerske committed Aug 18, 2023
1 parent 391b771 commit 249f670
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ More detailed information about incremental changes can be found in the
### 3.14.13 (2023-xx-yy)

- Reduced priority for making Spral the default value for option linear_solver [#677].
- Adapted to change of integer types in Spral interface. Minimal required Spral version is now v2023.03.29.

### 3.14.12 (2023-04-05)

Expand Down
13 changes: 7 additions & 6 deletions src/Algorithm/LinearSolvers/IpSpralSolverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <cassert>
#include <cmath>
#include <cinttypes>

using namespace std;

Expand Down Expand Up @@ -318,7 +319,7 @@ bool SpralSolverInterface::InitializeImpl(
// Set min_gpu_work.
double min_gpu_work_tmp = 5.0e9;
options.GetNumericValue("spral_min_gpu_work", min_gpu_work_tmp, prefix);
control_.min_gpu_work = (long)min_gpu_work_tmp;
control_.min_gpu_work = (int64_t)min_gpu_work_tmp;

// Set the pivot method.
std::string pivot_method;
Expand All @@ -328,7 +329,7 @@ bool SpralSolverInterface::InitializeImpl(
// Set small_subtree_threshold.
double small_subtree_threshold_tmp = 4.0e6;
options.GetNumericValue("spral_small_subtree_threshold", small_subtree_threshold_tmp, prefix);
control_.small_subtree_threshold = (long)small_subtree_threshold_tmp;
control_.small_subtree_threshold = (int64_t)small_subtree_threshold_tmp;

// Reset all private data.
pivtol_changed_ = false;
Expand Down Expand Up @@ -487,7 +488,7 @@ ESymSolverStatus SpralSolverInterface::InitializeStructure(

spral_ssids_analyse_ptr32(false, ndim_, NULL, ia, ja, NULL, &akeep_, &control_, &info);

Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA, "nfactor = %ld, nflops = %ld:\n",
Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA, "nfactor = %" PRId64 ", nflops = %" PRId64 ":\n",
info.num_factor, info.num_flops);

if( HaveIpData() )
Expand Down Expand Up @@ -545,7 +546,7 @@ ESymSolverStatus SpralSolverInterface::MultiSolve(

spral_ssids_analyse_ptr32(false, ndim_, NULL, ia, ja, val_, &akeep_, &control_, &info);

Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA, "nfactor = %ld, nflops = %ld:\n",
Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA, "nfactor = %" PRId64 ", nflops = %" PRId64 ":\n",
info.num_factor, info.num_flops);

if( HaveIpData() )
Expand Down Expand Up @@ -577,8 +578,8 @@ ESymSolverStatus SpralSolverInterface::MultiSolve(

spral_ssids_factor_ptr32(false, ia, ja, val_, scaling_, akeep_, &fkeep_, &control_, &info);

Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA, "SPRAL: delays %d, nfactor %ld, "
"nflops %ld, maxfront %d\n", info.num_delay, info.num_factor, info.num_flops,
Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA, "SPRAL: delays %d, nfactor %" PRId64 ", "
"nflops %" PRId64 ", maxfront %d\n", info.num_delay, info.num_factor, info.num_flops,
info.maxfront);

if( HaveIpData() )
Expand Down

0 comments on commit 249f670

Please sign in to comment.