Solver Parameters

HPRLP provides extensive customization through the HPRLP_parameters type. This guide explains all available parameters and their effects on solver behavior.

Parameter Summary Table

ParameterTypeDefaultRange/ValuesPurpose
stoptolFloat641e-4> 0Convergence tolerance
max_iterInt~2.1B> 0Maximum iterations
time_limitFloat643600.0> 0Time limit (seconds)
check_iterInt150> 0Convergence check interval
use_Ruiz_scalingBooltruetrue/falseRuiz equilibration
use_Pock_Chambolle_scalingBooltruetrue/falsePock-Chambolle scaling
use_bc_scalingBooltruetrue/falseb/c vector scaling
use_gpuBooltruetrue/falseGPU acceleration
device_numberInt0≥ 0GPU device selection
warm_upBooltruetrue/falseGPU warm-up
print_frequencyInt-1-1 or > 0Print interval (-1=auto)
verboseBooltruetrue/falseEnable output
initial_xVector/Nothingnothing-Initial primal solution
initial_yVector/Nothingnothing-Initial dual solution
auto_saveBoolfalsetrue/falseAuto-save best solution
save_filenameString"hprlp_autosave.h5"-HDF5 filename for auto-save

Creating Parameters

using HPRLP

# Create with default values
params = HPRLP_parameters()

# Customize as needed
params.stoptol = 1e-6
params.use_gpu = true
params.verbose = true

Convergence Parameters

stoptol::Float64

Default: 1e-4

Stopping tolerance for convergence. The solver terminates when the optimality conditions are satisfied within this tolerance.

params.stoptol = 1e-9  # Higher accuracy (slower)
params.stoptol = 1e-2  # Lower accuracy (faster)

max_iter::Int

Default: typemax(Int32) (≈2.1 billion)

Maximum number of iterations before stopping.

params.max_iter = 100000  # Limit to 100k iterations

time_limit::Float64

Default: 3600.0 (1 hour)

Maximum solve time in seconds.

params.time_limit = 600.0   # 10 minutes
params.time_limit = 7200.0  # 2 hours

check_iter::Int

Default: 150

Interval for checking convergence criteria. Lower values check more frequently (higher overhead), higher values check less often (potentially more wasted iterations).

params.check_iter = 100  # Check more frequently
params.check_iter = 200  # Check less frequently

Scaling Parameters

Scaling improves numerical stability and convergence. HPRLP supports three types of scaling that can be combined.

use_Ruiz_scaling::Bool

Default: true

Enable Ruiz equilibration scaling, which balances the rows and columns of the constraint matrix.

params.use_Ruiz_scaling = true   # Recommended
params.use_Ruiz_scaling = false  # Disable if problem is already well-scaled

use_Pock_Chambolle_scaling::Bool

Default: true

Enable Pock-Chambolle scaling, a diagonal scaling for primal-dual algorithms.

params.use_Pock_Chambolle_scaling = true  # Recommended

use_bc_scaling::Bool

Default: true

Enable scaling for the objective vector (c) and constraint bounds (b).

params.use_bc_scaling = true  # Recommended for most problems
Scaling Recommendations
  • Keep all three scaling options enabled (default) for most problems
  • Disable only if you have a well-conditioned problem or specific numerical concerns
  • All three can be used simultaneously for best results

GPU Parameters

use_gpu::Bool

Default: true

Enable GPU acceleration. Requires CUDA-capable GPU.

params.use_gpu = true   # Use GPU (much faster for large problems)
params.use_gpu = false  # Use CPU only
When to Use GPU
  • Large problems (>10,000 variables): Significant speedup
  • Small problems (<1,000 variables): CPU may be faster due to overhead
  • Multiple GPUs available: Use device_number to select specific GPU

device_number::Int

Default: 0

GPU device number to use (0-indexed). Only relevant when use_gpu = true.

params.device_number = 0  # First GPU
params.device_number = 1  # Second GPU

warm_up::Bool

Default: true

To ensure accurate timing, due to Julia's JIT compilation, a warm-up phase can be performed before the actual solve. This is recommended for benchmarking.

params.warm_up = true   # Accurate timing (recommended)
params.warm_up = false  # Skip warm-up

Output Parameters

verbose::Bool

Default: true

Enable detailed solver output during optimization.

params.verbose = true   # Print iteration log
params.verbose = false  # Silent mode

Default: -1 (automatic)

Control how often to print iteration information. When set to -1, frequency is automatically determined.

params.print_frequency = -1    # Auto (default)
params.print_frequency = 100   # Print every 100 iterations
params.print_frequency = 1     # Print every iteration (very verbose)

Warm-Start Parameters

initial_x::Union{Vector{Float64},Nothing}

Default: nothing

Initial primal solution to warm-start the solver.

params.initial_x = x0  # From previous solve or heuristic

initial_y::Union{Vector{Float64},Nothing}

Default: nothing

Initial dual solution to warm-start the solver.

params.initial_y = y0  # Optional, can use with or without initial_x

Auto-Save Parameters

auto_save::Bool

Default: false

Automatically save the best solution found during optimization to HDF5.

params.auto_save = true

save_filename::String

Default: "hprlp_autosave.h5"

Filename for the HDF5 file used by auto-save.

params.save_filename = "my_problem.h5"

Common Configurations

High Accuracy

params = HPRLP_parameters()
params.stoptol = 1e-9
params.time_limit = 15000.0

Fast Approximate Solutions

params = HPRLP_parameters()
params.stoptol = 1e-4
params.time_limit = 300.0

CPU-Only (No GPU Available)

params = HPRLP_parameters()
params.use_gpu = false

Production/Batch Processing

params = HPRLP_parameters()
params.verbose = false
params.warm_up = false

With Auto-Save and Warm-Start

params = HPRLP_parameters()
params.auto_save = true
params.save_filename = "backup.h5"
params.initial_x = x0

Debugging/Analysis

params = HPRLP_parameters()
params.verbose = true
params.print_frequency = 1
params.check_iter = 1
params.max_iter = 100