Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for scs-3.0.0 #221

Merged
merged 18 commits into from
Jan 7, 2022
Merged

add support for scs-3.0.0 #221

merged 18 commits into from
Jan 7, 2022

Conversation

kalmarek
Copy link
Collaborator

@kalmarek kalmarek commented Sep 17, 2021

TODO:

  • Update readme
  • Update scs_solve docstring
  • Bring back testing warmstarts and option setting

Closes #235

@kalmarek kalmarek mentioned this pull request Sep 17, 2021
@kalmarek kalmarek force-pushed the mk/scs_300 branch 2 times, most recently from 0338583 to a9b7f2d Compare September 17, 2021 13:17
@kalmarek
Copy link
Collaborator Author

kalmarek commented Sep 17, 2021

currently there are 27 "serious" failures in MOI tests:

test_DirectSolver

test_DirectSolver                                                            | 2852    27   2879
  test_add_constrained_variables_vector                                      |    6            6
  test_attribute_NumberThreads                                               |             No tests
  test_attribute_Silent                                                      |    4            4
  test_attribute_SolverName                                                  |    1            1
  test_attribute_TimeLimitSec                                                |             No tests
  test_attribute_after_empty                                                 |    4            4
  test_basic_ScalarAffineFunction_EqualTo                                    |   19           19
  test_basic_ScalarAffineFunction_GreaterThan                                |   19           19
  test_basic_ScalarAffineFunction_Interval                                   |   19           19
  test_basic_ScalarAffineFunction_LessThan                                   |   19           19
  test_basic_ScalarAffineFunction_Semicontinuous                             |             No tests
  test_basic_ScalarAffineFunction_Semiinteger                                |             No tests
  test_basic_ScalarAffineFunction_ZeroOne                                    |             No tests
  test_basic_ScalarQuadraticFunction_LessThan                                |   19           19
  test_basic_ScalarQuadraticFunction_Semicontinuous                          |             No tests
  test_basic_ScalarQuadraticFunction_Semiinteger                             |             No tests
  test_basic_ScalarQuadraticFunction_ZeroOne                                 |             No tests
  test_basic_VariableIndex_EqualTo                                           |   16           16
  test_basic_VariableIndex_GreaterThan                                       |   16           16
  test_basic_VariableIndex_Interval                                          |   16           16
  test_basic_VariableIndex_LessThan                                          |   16           16
  test_basic_VariableIndex_Semicontinuous                                    |             No tests
  test_basic_VariableIndex_Semiinteger                                       |             No tests
  test_basic_VariableIndex_ZeroOne                                           |             No tests
  test_basic_VectorAffineFunction_Complements                                |             No tests
  test_basic_VectorAffineFunction_DualExponentialCone                        |   19           19
  test_basic_VectorAffineFunction_DualPowerCone                              |   19           19
  test_basic_VectorAffineFunction_ExponentialCone                            |   19           19
  test_basic_VectorAffineFunction_GeometricMeanCone                          |   19           19
  test_basic_VectorAffineFunction_Indicator_GreaterThan                      |             No tests
  test_basic_VectorAffineFunction_Indicator_LessThan                         |             No tests
  test_basic_VectorAffineFunction_LogDetConeSquare                           |             No tests
  test_basic_VectorAffineFunction_LogDetConeTriangle                         |   19           19
  test_basic_VectorAffineFunction_Nonnegatives                               |   19           19
  test_basic_VectorAffineFunction_Nonpositives                               |   19           19
  test_basic_VectorAffineFunction_NormInfinityCone                           |   19           19
  test_basic_VectorAffineFunction_NormNuclearCone                            |   19           19
  test_basic_VectorAffineFunction_NormOneCone                                |   19           19
  test_basic_VectorAffineFunction_NormSpectralCone                           |   19           19
  test_basic_VectorAffineFunction_PositiveSemidefiniteConeSquare             |   19           19
  test_basic_VectorAffineFunction_PositiveSemidefiniteConeTriangle           |   19           19
  test_basic_VectorAffineFunction_PowerCone                                  |   19           19
  test_basic_VectorAffineFunction_RelativeEntropyCone                        |   19           19
  test_basic_VectorAffineFunction_RootDetConeSquare                          |             No tests
  test_basic_VectorAffineFunction_RootDetConeTriangle                        |   19           19
  test_basic_VectorAffineFunction_RotatedSecondOrderCone                     |   19           19
  test_basic_VectorAffineFunction_SOS1                                       |             No tests
  test_basic_VectorAffineFunction_SOS2                                       |             No tests
  test_basic_VectorAffineFunction_SecondOrderCone                            |   19           19
  test_basic_VectorAffineFunction_Zeros                                      |   19           19
  test_basic_VectorOfVariables_Complements                                   |             No tests
  test_basic_VectorOfVariables_DualExponentialCone                           |   16           16
  test_basic_VectorOfVariables_DualPowerCone                                 |   16           16
  test_basic_VectorOfVariables_ExponentialCone                               |   16           16
  test_basic_VectorOfVariables_GeometricMeanCone                             |   16           16
  test_basic_VectorOfVariables_LogDetConeSquare                              |             No tests
  test_basic_VectorOfVariables_LogDetConeTriangle                            |   16           16
  test_basic_VectorOfVariables_Nonnegatives                                  |   16           16
  test_basic_VectorOfVariables_Nonpositives                                  |   16           16
  test_basic_VectorOfVariables_NormInfinityCone                              |   16           16
  test_basic_VectorOfVariables_NormNuclearCone                               |    1            1
  test_basic_VectorOfVariables_NormOneCone                                   |   16           16
  test_basic_VectorOfVariables_NormSpectralCone                              |   16           16
  test_basic_VectorOfVariables_PositiveSemidefiniteConeSquare                |    1            1
  test_basic_VectorOfVariables_PositiveSemidefiniteConeTriangle              |    1            1
  test_basic_VectorOfVariables_PowerCone                                     |   16           16
  test_basic_VectorOfVariables_RelativeEntropyCone                           |   16           16
  test_basic_VectorOfVariables_RootDetConeSquare                             |             No tests
  test_basic_VectorOfVariables_RootDetConeTriangle                           |   16           16
  test_basic_VectorOfVariables_RotatedSecondOrderCone                        |   16           16
  test_basic_VectorOfVariables_SOS1                                          |             No tests
  test_basic_VectorOfVariables_SOS2                                          |             No tests
  test_basic_VectorOfVariables_SecondOrderCone                               |   16           16
  test_basic_VectorOfVariables_Zeros                                         |   16           16
  test_conic_DualExponentialCone_VectorAffineFunction                        |   19           19
  test_conic_DualExponentialCone_VectorOfVariables                           |   19           19
  test_conic_Exponential_VectorAffineFunction                                |   16           16
  test_conic_Exponential_VectorOfVariables                                   |   16           16
  test_conic_Exponential_hard                                                |   16           16
  test_conic_Exponential_hard_2                                              |   22           22
  test_conic_GeometricMeanCone_VectorAffineFunction                          |   12           12
  test_conic_GeometricMeanCone_VectorAffineFunction_2                        |   13           13
  test_conic_GeometricMeanCone_VectorAffineFunction_3                        |   13           13
  test_conic_GeometricMeanCone_VectorOfVariables                             |   12           12
  test_conic_GeometricMeanCone_VectorOfVariables_2                           |   13           13
  test_conic_GeometricMeanCone_VectorOfVariables_3                           |   13           13
  test_conic_LogDetConeSquare                                                |             No tests
  test_conic_LogDetConeSquare_VectorAffineFunction                           |             No tests
  test_conic_LogDetConeSquare_VectorOfVariables                              |             No tests
  test_conic_LogDetConeTriangle                                              |   11           11
  test_conic_LogDetConeTriangle_VectorAffineFunction                         |   21           21
  test_conic_LogDetConeTriangle_VectorOfVariables                            |   21           21
  test_conic_NormInfinityCone_3                                              |   18           18
  test_conic_NormInfinityCone_INFEASIBLE                                     |    6            6
  test_conic_NormInfinityCone_VectorAffineFunction                           |   20           20
  test_conic_NormInfinityCone_VectorOfVariables                              |   20           20
  test_conic_NormNuclearCone                                                 |   10           10
  test_conic_NormNuclearCone_2                                               |   10           10
  test_conic_NormOneCone                                                     |   17           17
  test_conic_NormOneCone_INFEASIBLE                                          |    6            6
  test_conic_NormOneCone_VectorAffineFunction                                |   20           20
  test_conic_NormOneCone_VectorOfVariables                                   |   20           20
  test_conic_NormSpectralCone                                                |   10           10
  test_conic_NormSpectralCone_2                                              |   10           10
  test_conic_PositiveSemidefiniteConeSquare_3                                |    7            7
  test_conic_PositiveSemidefiniteConeSquare_VectorAffineFunction             |   13           13
  test_conic_PositiveSemidefiniteConeSquare_VectorAffineFunction_2           |   21           21
  test_conic_PositiveSemidefiniteConeSquare_VectorOfVariables                |    1            1
  test_conic_PositiveSemidefiniteConeSquare_VectorOfVariables_2              |    2            2
  test_conic_PositiveSemidefiniteConeTriangle                                |   17           17
  test_conic_PositiveSemidefiniteConeTriangle_3                              |    7            7
  test_conic_PositiveSemidefiniteConeTriangle_VectorAffineFunction           |   13           13
  test_conic_PositiveSemidefiniteConeTriangle_VectorAffineFunction_2         |   21           21
  test_conic_PositiveSemidefiniteConeTriangle_VectorOfVariables              |    1            1
  test_conic_PositiveSemidefiniteConeTriangle_VectorOfVariables_2            |    2            2
  test_conic_RelativeEntropyCone                                             |   10           10
  test_conic_RootDetConeSquare                                               |             No tests
  test_conic_RootDetConeSquare_VectorAffineFunction                          |             No tests
  test_conic_RootDetConeSquare_VectorOfVariables                             |             No tests
  test_conic_RootDetConeTriangle                                             |   10           10
  test_conic_RootDetConeTriangle_VectorAffineFunction                        |   17           17
  test_conic_RootDetConeTriangle_VectorOfVariables                           |   17           17
  test_conic_RotatedSecondOrderCone_INFEASIBLE                               |   14           14
  test_conic_RotatedSecondOrderCone_INFEASIBLE_2                             |   34           34
  test_conic_RotatedSecondOrderCone_VectorAffineFunction                     |   12           12
  test_conic_RotatedSecondOrderCone_VectorOfVariables                        |   20           20
  test_conic_RotatedSecondOrderCone_out_of_order                             |   14           14
  test_conic_SecondOrderCone_INFEASIBLE                                      |    6            6
  test_conic_SecondOrderCone_Nonnegatives                                    |   18           18
  test_conic_SecondOrderCone_Nonpositives                                    |   18           18
  test_conic_SecondOrderCone_VectorAffineFunction                            |   18           18
  test_conic_SecondOrderCone_VectorOfVariables                               |   18           18
  test_conic_SecondOrderCone_negative_initial_bound                          |    2            2
  test_conic_SecondOrderCone_negative_post_bound                             |    2            2
  test_conic_SecondOrderCone_negative_post_bound_ii                          |    3            3
  test_conic_SecondOrderCone_negative_post_bound_iii                         |    3            3
  test_conic_SecondOrderCone_no_initial_bound                                |    2            2
  test_conic_SecondOrderCone_nonnegative_initial_bound                       |    2            2
  test_conic_SecondOrderCone_nonnegative_post_bound                          |    2            2
  test_conic_SecondOrderCone_out_of_order                                    |   13           13
  test_conic_linear_INFEASIBLE                                               |    4            4
  test_conic_linear_INFEASIBLE_2                                             |    4            4
  test_conic_linear_VectorAffineFunction                                     |   17           17
  test_conic_linear_VectorAffineFunction_2                                   |   24           24
  test_conic_linear_VectorOfVariables                                        |   17           17
  test_conic_linear_VectorOfVariables_2                                      |   24           24
  test_constraint_ConstraintDualStart                                        |             No tests
  test_constraint_ConstraintPrimalStart                                      |             No tests
  test_constraint_Indicator_ACTIVATE_ON_ONE                                  |             No tests
  test_constraint_Indicator_ACTIVATE_ON_ZERO                                 |             No tests
  test_constraint_Indicator_ConstraintName                                   |             No tests
  test_constraint_PrimalStart_DualStart_SecondOrderCone                      |    8            8
  test_constraint_ScalarAffineFunction_EqualTo                               |    8            8
  test_constraint_ScalarAffineFunction_GreaterThan                           |    8            8
  test_constraint_ScalarAffineFunction_Interval                              |    8            8
  test_constraint_ScalarAffineFunction_LessThan                              |    8            8
  test_constraint_ScalarAffineFunction_duplicate                             |    8            8
  test_constraint_VectorAffineFunction_duplicate                             |    8            8
  test_constraint_ZeroOne_bounds                                             |             No tests
  test_constraint_ZeroOne_bounds_2                                           |             No tests
  test_constraint_ZeroOne_bounds_3                                           |             No tests
  test_constraint_get_ConstraintIndex                                        |    7            7
  test_constraint_qcp_duplicate_diagonal                                     |    7            7
  test_constraint_qcp_duplicate_off_diagonal                                 |    7            7
  test_linear_DUAL_INFEASIBLE                                                |    5            5
  test_linear_DUAL_INFEASIBLE_2                                              |    6            6
  test_linear_FEASIBILITY_SENSE                                              |   12           12
  test_linear_INFEASIBLE                                                     |    6            6
  test_linear_INFEASIBLE_2                                                   |   10           10
  test_linear_Indicator_ON_ONE                                               |             No tests
  test_linear_Indicator_ON_ZERO                                              |             No tests
  test_linear_Indicator_constant_term                                        |             No tests
  test_linear_Indicator_integration                                          |             No tests
  test_linear_Interval_inactive                                              |   12           12
  test_linear_LessThan_and_GreaterThan                                       |   16           16
  test_linear_SOS1_integration                                               |             No tests
  test_linear_SOS2_integration                                               |             No tests
  test_linear_Semicontinuous_integration                                     |             No tests
  test_linear_Semiinteger_integration                                        |             No tests
  test_linear_VariablePrimalStart_partial                                    |          5      5
  test_linear_VectorAffineFunction                                           |   16           16
  test_linear_VectorAffineFunction_empty_row                                 |    7            7
  test_linear_add_constraints                                                |    5     3      8
  test_linear_inactive_bounds                                                |   20           20
  test_linear_integer_integration                                            |             No tests
  test_linear_integer_knapsack                                               |             No tests
  test_linear_integer_solve_twice                                            |             No tests
  test_linear_integration                                                    |  110          110
  test_linear_integration_2                                                  |   18           18
  test_linear_integration_Interval                                           |   21    11     32
  test_linear_integration_delete_variables                                   |   33           33
  test_linear_integration_modification                                       |   22           22
  test_linear_modify_GreaterThan_and_LessThan_constraints                    |   28           28
  test_linear_transform                                                      |   10           10
  test_model_ListOfConstraintAttributesSet                                   |    2            2
  test_model_ModelFilter_AbstractConstraintAttribute                         |             No tests
  test_model_ModelFilter_AbstractModelAttribute                              |    1            1
  test_model_ModelFilter_AbstractVariableAttribute                           |             No tests
  test_model_ModelFilter_ListOfConstraintIndices                             |   10           10
  test_model_ModelFilter_ListOfConstraintTypesPresent                        |    3            3
  test_model_Name                                                            |    7            7
  test_model_Name_VariableName_ConstraintName                                |   73           73
  test_model_ScalarAffineFunction_ConstraintName                             |    5            5
  test_model_ScalarFunctionConstantNotZero                                   |    2            2
  test_model_VariableIndex_ConstraintName                                    |    1            1
  test_model_VariableName                                                    |    6            6
  test_model_VariablePrimalStart                                             |             No tests
  test_model_copy_to_UnsupportedAttribute                                    |    6            6
  test_model_copy_to_UnsupportedConstraint                                   |    2            2
  test_model_default_DualStatus                                              |    1            1
  test_model_default_ObjectiveSense                                          |    1            1
  test_model_default_PrimalStatus                                            |    1            1
  test_model_default_TerminationStatus                                       |    1            1
  test_model_delete                                                          |   64           64
  test_model_duplicate_ScalarAffineFunction_ConstraintName                   |    6            6
  test_model_duplicate_VariableName                                          |    6            6
  test_model_empty                                                           |    3            3
  test_model_is_valid                                                        |    9            9
  test_model_ordered_indices                                                 |   12           12
  test_model_supports_constraint_ScalarAffineFunction_EqualTo                |    1            1
  test_model_supports_constraint_VariableIndex_EqualTo                       |    2            2
  test_model_supports_constraint_VectorOfVariables_Nonnegatives              |    2            2
  test_modification_affine_deletion_edge_cases                               |   24           24
  test_modification_coef_scalar_objective                                    |    8            8
  test_modification_coef_scalaraffine_lessthan                               |   16           16
  test_modification_const_scalar_objective                                   |    8            8
  test_modification_const_vectoraffine_nonpos                                |   14           14
  test_modification_delete_variable_with_single_variable_obj                 |    8            8
  test_modification_delete_variables_in_a_batch                              |    8            8
  test_modification_func_scalaraffine_lessthan                               |    8            8
  test_modification_func_vectoraffine_nonneg                                 |   15           15
  test_modification_incorrect                                                |    2            2
  test_modification_incorrect_VariableIndex                                  |    3            3
  test_modification_multirow_vectoraffine_nonpos                             |   12           12
  test_modification_set_function_single_variable                             |    2            2
  test_modification_set_scalaraffine_lessthan                                |   17           17
  test_modification_set_singlevariable_lessthan                              |   18           18
  test_modification_transform_singlevariable_lessthan                        |   19           19
  test_nonlinear_Feasibility_internal                                        |    9            9
  test_nonlinear_HS071_internal                                              |   11           11
  test_nonlinear_InvalidEvaluator_internal                                   |    3            3
  test_nonlinear_hs071                                                       |             No tests
  test_nonlinear_hs071_NLPBlockDual                                          |             No tests
  test_nonlinear_hs071_hessian_vector_product                                |             No tests
  test_nonlinear_hs071_no_hessian                                            |             No tests
  test_nonlinear_invalid                                                     |             No tests
  test_nonlinear_mixed_complementarity                                       |             No tests
  test_nonlinear_objective_and_moi_objective_test                            |             No tests
  test_nonlinear_qp_complementarity_constraint                               |             No tests
  test_nonlinear_without_objective                                           |             No tests
  test_objective_FEASIBILITY_SENSE_clears_objective                          |    2            2
  test_objective_ObjectiveFunction_VariableIndex                             |   10           10
  test_objective_ObjectiveFunction_constant                                  |    8            8
  test_objective_ObjectiveFunction_duplicate_terms                           |    9            9
  test_objective_ObjectiveSense_FEASIBILITY_SENSE                            |    1            1
  test_objective_ObjectiveSense_MAX_SENSE                                    |    1            1
  test_objective_ObjectiveSense_MIN_SENSE                                    |    1            1
  test_objective_get_ObjectiveFunction_ScalarAffineFunction                  |    5            5
  test_objective_qp_ObjectiveFunction_edge_cases                             |   21           21
  test_objective_qp_ObjectiveFunction_zero_ofdiag                            |    7            7
  test_objective_set_via_modify                                              |    2            2
  test_quadratic_Integer_SecondOrderCone                                     |             No tests
  test_quadratic_constraint_GreaterThan                                      |   17           17
  test_quadratic_constraint_LessThan                                         |   17           17
  test_quadratic_constraint_basic                                            |   12           12
  test_quadratic_constraint_integration                                      |    7     8     15
  test_quadratic_constraint_minimize                                         |   13           13
  test_quadratic_duplicate_terms                                             |   24           24
  test_quadratic_integration                                                 |   15           15
  test_quadratic_nonhomogeneous                                              |   23           23
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_EqualTo_lower              |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_EqualTo_upper              |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_GreaterThan                |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_Interval_lower             |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_Interval_upper             |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_LessThan                   |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_VariableIndex_LessThan     |    5            5
  test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_VariableIndex_LessThan_max |    5            5
  test_solve_ObjectiveBound_MAX_SENSE_IP                                     |             No tests
  test_solve_ObjectiveBound_MAX_SENSE_LP                                     |             No tests
  test_solve_ObjectiveBound_MIN_SENSE_IP                                     |             No tests
  test_solve_ObjectiveBound_MIN_SENSE_LP                                     |             No tests
  test_solve_SOS2_add_and_delete                                             |             No tests
  test_solve_VariableIndex_ConstraintDual_MAX_SENSE                          |    4            4
  test_solve_VariableIndex_ConstraintDual_MIN_SENSE                          |    4            4
  test_solve_conflict_EqualTo                                                |             No tests
  test_solve_conflict_NOT_IN_CONFLICT                                        |             No tests
  test_solve_conflict_affine_affine                                          |             No tests
  test_solve_conflict_bound_bound                                            |             No tests
  test_solve_conflict_feasible                                               |             No tests
  test_solve_conflict_invalid_interval                                       |             No tests
  test_solve_conflict_two_affine                                             |             No tests
  test_solve_conflict_zeroone                                                |             No tests
  test_solve_optimize_twice                                                  |             No tests
  test_solve_result_index                                                    |   15           15
  test_variable_VariableName                                                 |    4            4
  test_variable_add_variable                                                 |    3            3
  test_variable_add_variables                                                |    2            2
  test_variable_delete                                                       |    3            3
  test_variable_delete_Nonnegatives                                          |   13           13
  test_variable_delete_Nonnegatives_row                                      |   12           12
  test_variable_delete_SecondOrderCone                                       |   10           10
  test_variable_delete_variables                                             |    9            9
  test_variable_get_VariableIndex                                            |    2            2
  test_variable_solve_Integer_with_lower_bound                               |             No tests
  test_variable_solve_Integer_with_upper_bound                               |             No tests
  test_variable_solve_ZeroOne_with_0_upper_bound                             |             No tests
  test_variable_solve_ZeroOne_with_upper_bound                               |             No tests
  test_variable_solve_with_lowerbound                                        |   10           10
  test_variable_solve_with_upperbound                                        |   12           12

the remaining 112-27=85 failures seem to be accuracy tweaking thing.

Note that all of 53dd6f8 should be reverted, as the name suggests ;)

src/linear_solvers/indirect.jl Outdated Show resolved Hide resolved
src/linear_solvers/gpu_indirect.jl Outdated Show resolved Hide resolved
src/linear_solvers/direct.jl Outdated Show resolved Hide resolved
src/c_wrapper.jl Show resolved Hide resolved
src/c_wrapper.jl Show resolved Hide resolved
src/c_wrapper.jl Outdated Show resolved Hide resolved
src/c_wrapper.jl Outdated Show resolved Hide resolved
@kalmarek kalmarek changed the title add support for scs-3.0.0 at 1a7c3bfd add support for scs-3.0.0 Sep 21, 2021
@kalmarek
Copy link
Collaborator Author

in principle scsint_t could be written as

function scsint_t(::Type{DirectSolver})
    s = ccall((:scs_sizeof_int, direct), Culong, ())
    for T in (Int32, Int64)
        sizeof(T) == s && return T
    end
    throw("Unrecognized size of Integer: $s bytes")
end

but since we control the binaries I'm fine with hardcoding it as Int (or Int32 for the gpu indirect solver)
@odow

@kalmarek
Copy link
Collaborator Author

@odow scs-3.0.0 will be merged/released in a few days. Shouldn't we look into failures in MOI tests before?

@odow
Copy link
Member

odow commented Sep 25, 2021

but since we control the binaries I'm fine with hardcoding it

Yeah, what we have is good by me.

Shouldn't we look into failures in MOI tests before?

It'll be a lot easier to look into them once 3.0.0 is released and we can make a SCS_jll. The failures are likely just tolerance issues. It's also not the end of the world if there is a 3.0.1 release.

@kalmarek
Copy link
Collaborator Author

kalmarek commented Sep 27, 2021

just in case this is what I use to compile scs:

#!/bin/bash
JULIA_HOME="/opt/julias/julia-1.6"
JULIA_LD_PATH="$JULIA_HOME/lib/julia"
BLASLDFLAGS="-L$JULIA_LD_PATH -lopenblas64_"
SCSFLAGS="USE_OPENMP=1 BLAS64=1 BLASSUFFIX=_64_"
make purge

make -j4 CFLAGS="-march=native" DLONG=1 ${SCSFLAGS} BLASLDFLAGS="${BLASLDFLAGS}" direct
make -j4 CFLAGS="-march=native" DLONG=1 ${SCSFLAGS} BLASLDFLAGS="${BLASLDFLAGS}" indirect

LD_LIBRARY_PATH=$JULIA_LD_PATH ./out/demo_socp_direct 1000 0.5 0.5 1
LD_LIBRARY_PATH=$JULIA_LD_PATH ./out/demo_socp_indirect 1000 0.5 0.5 1

#make clean
#make -j4 CFLAGS="-march=native" DLONG=0 ${SCSFLAGS} BLASLDFLAGS="${BLASLDFLAGS}" gpu

then you need to set the env variable and Pkg.build:

ENV["JULIA_SCS_LIBRARY_PATH"] = "/home/kalmar/local/src/scs/out/"
using Pkg; Pkg.build(verbose=true)
using SCS; @assert SCS.scs_version() == "3.0.0"
using Test
include("test/test_problems.jl");
feasible_basic_problems(SCS.DirectSolver)

and here's yggdrasil draft pull: JuliaPackaging/Yggdrasil#3654

@kalmarek
Copy link
Collaborator Author

buildkite failure is related to bug in scs-3.0.0; however even with scs master there are still some issues with the gpu solver

@odow odow marked this pull request as ready for review December 2, 2021 03:55
kalmarek and others added 3 commits December 2, 2021 17:37
hack MOI support

store value,rowval,colptr for A and P directly

this removes the need for ManagedScsMatrix

add timing to ScsInfo

updates to scs@caaba4d

set default ScsSettings upon construction

align scs_* ccalls with scs.h

widen status in ScsInfo (scs@0218d11)

update binaries to 3.0

bump to 0.9

update cones description in README/scs_solve docs

re-add converts when constructing _ScsDataWrapper

re-add test/options.jl

pass a null ptr to scs if P is zero
Update build SHAs

Restore ScsSettings constructor

Change ScsSettings constructor

Revert  changes to build.jl

Various updates
test/runtests.jl Outdated Show resolved Hide resolved
@kalmarek
Copy link
Collaborator Author

kalmarek commented Dec 2, 2021

failure on 1.6 x86 suggests that we pass wrong size Int somewhere
https://github.com/jump-dev/SCS.jl/runs/4390895426?check_suite_focus=true#step:6:101

@matbesancon
Copy link
Contributor

what's the status on this? @odow should this drop 1.0 and only test on 1.6 and stable?

@kalmarek
Copy link
Collaborator Author

kalmarek commented Dec 24, 2021

@matbesancon the real blocker is failure on buildkite related to cvxgrp/scs#180
If you have access to CUDA enabled machine I'd love if you could try it and provide more input there

EDIT: dropping julia-1.0 is just fine with me

@kalmarek kalmarek force-pushed the mk/scs_300 branch 2 times, most recently from 4d39439 to a017e6e Compare December 26, 2021 01:35
@kalmarek
Copy link
Collaborator Author

but perhaps the current failure on buildkite is due to mismatch between OpenBLAS variants (LP64 vs ILP64). see JuliaPackaging/Yggdrasil#4113

@odow
Copy link
Member

odow commented Jan 5, 2022

@kalmarek I'm in favor of merging this even with the failing GPU build. It's not critical, and I think it should be fixed by your new SCS_GPU build.

As a next step, I'd like to remove all traces of /build. We can point people to https://jump.dev/JuMP.jl/dev/developers/custom_solver_binaries/ if they want to use a custom binary.

@matbesancon
Copy link
Contributor

@kalmarek sorry for the late response, I unfortunately don't have access to a GPU machine I could use for some tests

@kalmarek
Copy link
Collaborator Author

kalmarek commented Jan 6, 2022

@odow very well! merge at will!

@kalmarek
Copy link
Collaborator Author

kalmarek commented Jan 6, 2022

@odow I just had a quick look at https://jump.dev/JuMP.jl/dev/developers/custom_solver_binaries/ this looks really good.
Happy to get rid of custom build instructions!

I've been recently using https://docs.binarybuilder.org/stable/jll/#dev'ed-JLL-packages i.e. I Pkg.develop("SCS_jll"); using SCS_jll; SCS_jll.dev_jll() which populates .julia/dev/SCS_jll/override with artifact products ready to be rewritten ;)

src/c_wrapper.jl Outdated Show resolved Hide resolved
src/linear_solvers/indirect.jl Outdated Show resolved Hide resolved
@odow
Copy link
Member

odow commented Jan 7, 2022

I don't think this is a BLAS issue. The segfault is happening in the initialization routines, before anything reaches an optimize call.

@odow
Copy link
Member

odow commented Jan 7, 2022

Okay. I'll merge this, but we'll hold off tagging until the GPU issue is fixed.

@odow odow merged commit 061aa25 into master Jan 7, 2022
@odow odow deleted the mk/scs_300 branch January 7, 2022 23:29
@odow odow mentioned this pull request Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add M1 support
3 participants