Closed moorepants closed 1 month ago
But this works:
conda create -n cyipopt-test cyipopt
conda activate cyipopt-test
python hs071.py
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit https://github.com/coin-or/Ipopt
******************************************************************************
This is Ipopt version 3.14.16, running with linear solver MUMPS 5.7.1.
Number of nonzeros in equality constraint Jacobian...: 4
Number of nonzeros in inequality constraint Jacobian.: 4
Number of nonzeros in Lagrangian Hessian.............: 10
Total number of variables............................: 4
variables with only lower bounds: 0
variables with lower and upper bounds: 4
variables with only upper bounds: 0
Total number of equality constraints.................: 1
Total number of inequality constraints...............: 1
inequality constraints with only lower bounds: 1
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0
Objective value at iteration #0 is - 16.1097
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 1.6109693e+01 1.12e+01 1.02e+00 0.0 0.00e+00 - 0.00e+00 0.00e+00 0
Objective value at iteration #1 is - 17.3461
1 1.7346108e+01 7.50e-01 2.37e+01 -0.3 7.22e-01 - 3.51e-01 1.00e+00f 1
Objective value at iteration #2 is - 17.9222
2 1.7922201e+01 7.70e-03 5.29e+00 -0.2 6.00e-02 2.0 9.96e-01 1.00e+00h 1
Objective value at iteration #3 is - 17.1673
3 1.7167308e+01 6.72e-02 1.66e+00 -0.8 1.37e+00 - 9.95e-01 6.98e-01f 1
Objective value at iteration #4 is - 16.9893
4 1.6989299e+01 1.02e-01 1.47e-01 -1.2 2.30e-01 - 9.92e-01 1.00e+00f 1
Objective value at iteration #5 is - 16.9944
5 1.6994402e+01 3.39e-02 1.19e-02 -2.3 8.69e-02 - 9.84e-01 1.00e+00h 1
Objective value at iteration #6 is - 17.014
6 1.7013957e+01 2.20e-04 3.14e-04 -3.8 1.15e-02 - 9.99e-01 1.00e+00h 1
Objective value at iteration #7 is - 17.014
7 1.7014017e+01 6.30e-07 1.31e-06 -9.7 3.43e-04 - 9.99e-01 9.99e-01h 1
Objective value at iteration #8 is - 17.014
8 1.7014017e+01 5.68e-13 8.43e-13 -11.0 5.69e-07 - 1.00e+00 1.00e+00h 1
Number of Iterations....: 8
(scaled) (unscaled)
Objective...............: 3.4028034280427242e+01 1.7014017140213621e+01
Dual infeasibility......: 8.4300285623552048e-13 4.2150142811776024e-13
Constraint violation....: 5.6843418860808015e-13 5.6843418860808015e-13
Variable bound violation: 9.9952566223748818e-09 9.9952566223748818e-09
Complementarity.........: 1.1688338036422999e-11 5.8441690182114995e-12
Overall NLP error.......: 1.1688338036422999e-11 5.8441690182114995e-12
Number of objective function evaluations = 9
Number of objective gradient evaluations = 9
Number of equality constraint evaluations = 9
Number of inequality constraint evaluations = 9
Number of equality constraint Jacobian evaluations = 9
Number of inequality constraint Jacobian evaluations = 9
Number of Lagrangian Hessian evaluations = 8
Total seconds in IPOPT = 0.062
EXIT: Optimal Solution Found.
Solution of the primal variables: x=array([0.99999999, 4.74299964, 3.82114998, 1.37940829])
Solution of the dual variables: lambda=array([-0.55229366, 0.16146856])
Objective=17.01401714021362
For some reason it is present in the env but not in the base env:
moorepants@nandi:examples(master)$ ls ~/miniconda/lib/ | grep mumps
libcmumps_seq.so
libdmumps_seq.so
libmumps_common_seq.so
libsmumps_seq.so
libzmumps_seq.so
moorepants@nandi:examples(master)$ ls ~/miniconda/envs/cyipopt-test/lib/ | grep mumps
libcmumps_seq.so
libdmumps_seq.so
libesmumps.so
libmumps_common_seq.so
libsmumps_seq.so
libzmumps_seq.so
I tried to just install mumps in the base env and got:
conda install mumps
Channels:
- conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: - warning libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
failed
LibMambaUnsatisfiableError: Encountered problems while solving:
- package numba-0.38.0-py27_0 requires python >=2.7,<2.8.0a0, but none of the providers can be installed
Could not solve for environment specs
The following packages are incompatible
├─ libopenblas is installable with the potential options
│ ├─ libopenblas 0.3.27 would require
│ │ └─ openblas >=0.3.27,<0.3.28.0a0 , which can be installed;
│ ├─ libopenblas 0.3.10 would require
│ │ └─ openblas >=0.3.10,<0.3.11.0a0 , which can be installed;
│ ├─ libopenblas 0.3.12 would require
│ │ └─ openblas >=0.3.12,<0.3.13.0a0 , which can be installed;
│ ├─ libopenblas 0.3.13 would require
│ │ └─ openblas >=0.3.13,<0.3.14.0a0 , which can be installed;
│ ├─ libopenblas 0.3.15 would require
│ │ └─ openblas >=0.3.15,<0.3.16.0a0 , which can be installed;
│ ├─ libopenblas 0.3.16 would require
│ │ └─ openblas >=0.3.16,<0.3.17.0a0 , which can be installed;
│ ├─ libopenblas 0.3.17 would require
│ │ └─ openblas >=0.3.17,<0.3.18.0a0 , which can be installed;
│ ├─ libopenblas 0.3.18 would require
│ │ └─ openblas >=0.3.18,<0.3.19.0a0 , which can be installed;
│ ├─ libopenblas 0.3.20 would require
│ │ └─ openblas >=0.3.20,<0.3.21.0a0 , which can be installed;
│ ├─ libopenblas 0.3.21 would require
│ │ └─ openblas >=0.3.21,<0.3.22.0a0 , which can be installed;
│ ├─ libopenblas 0.3.6, which can be installed;
│ ├─ libopenblas 0.3.7 would require
│ │ └─ openblas >=0.3.7,<0.3.8.0a0 , which can be installed;
│ ├─ libopenblas 0.3.8 would require
│ │ └─ openblas >=0.3.8,<0.3.9.0a0 , which can be installed;
│ ├─ libopenblas 0.3.9 would require
│ │ └─ openblas >=0.3.9,<0.3.10.0a0 , which can be installed;
│ ├─ libopenblas 0.3.23 would require
│ │ └─ openblas >=0.3.23,<0.3.24.0a0 , which can be installed;
│ ├─ libopenblas 0.3.24 would require
│ │ └─ openblas >=0.3.24,<0.3.25.0a0 , which can be installed;
│ ├─ libopenblas 0.3.25 would require
│ │ └─ openblas >=0.3.25,<0.3.26.0a0 , which can be installed;
│ └─ libopenblas 0.3.26 would require
│ └─ openblas >=0.3.26,<0.3.27.0a0 , which can be installed;
├─ mumps is not installable because there are no viable options
│ ├─ mumps [5.0.1|5.0.2] would require
│ │ └─ openblas 0.2.18|0.2.18.* , which conflicts with any installable versions previously reported;
│ ├─ mumps 5.0.2 would require
│ │ └─ openblas 0.2.19|0.2.19.* , which conflicts with any installable versions previously reported;
│ ├─ mumps [5.0.2|5.1.2] would require
│ │ └─ openblas [0.2.20|0.2.20.* |>=0.2.20,<0.2.21.0a0 ], which conflicts with any installable versions previously reported;
│ └─ mumps 5.1.2 would require
│ └─ openblas >=0.3.3,<0.3.4.0a0 , which conflicts with any installable versions previously reported;
├─ numba is installable with the potential options
│ ├─ numba [0.57.0|0.57.1|0.58.1|0.59.0|0.59.1] would require
│ │ └─ libopenblas !=0.3.6 , which conflicts with any installable versions previously reported;
│ ├─ numba [0.36.1|0.36.2|0.38.0|0.38.1|0.40.0] would require
│ │ └─ python >=3.5,<3.6.0a0 , which can be installed;
│ ├─ numba [0.36.1|0.36.2|...|0.53.1] would require
│ │ └─ python >=3.6,<3.7.0a0 , which can be installed;
│ ├─ numba [0.38.0|0.38.1|...|0.47.0] would require
│ │ └─ python >=2.7,<2.8.0a0 , which can be installed;
│ ├─ numba [0.40.0|0.40.1|...|0.56.3] would require
│ │ └─ python >=3.7,<3.8.0a0 , which can be installed;
│ ├─ numba [0.47.0|0.48.0|...|0.58.1] would require
│ │ └─ python >=3.8,<3.9.0a0 , which can be installed;
│ ├─ numba [0.53.0|0.53.1|...|0.59.1] would require
│ │ └─ python >=3.9,<3.10.0a0 , which can be installed;
│ ├─ numba [0.55.0|0.55.1|...|0.59.1] would require
│ │ └─ python >=3.10,<3.11.0a0 , which can be installed;
│ └─ numba [0.59.0|0.59.1] would require
│ └─ python >=3.12,<3.13.0a0 , which can be installed;
└─ pin-1 is not installable because it requires
└─ python 3.11.* , which conflicts with any installable versions previously reported.
If I remove numba I still get:
moorepants@nandi:examples(master)$ conda remove numba
Channels:
- conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/moorepants/miniconda
removed specs:
- numba
The following packages will be REMOVED:
numba-0.59.1-py311h96b013e_0
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
moorepants@nandi:examples(master)$ conda install mumps
Channels:
- conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed
LibMambaUnsatisfiableError: Encountered problems while solving:
- package mumps-5.0.1-0 requires openblas 0.2.18|0.2.18.*, but none of the providers can be installed
Could not solve for environment specs
The following packages are incompatible
├─ libopenblas is installable with the potential options
│ ├─ libopenblas 0.3.10 would require
│ │ └─ openblas >=0.3.10,<0.3.11.0a0 , which can be installed;
│ ├─ libopenblas 0.3.27 would require
│ │ └─ openblas >=0.3.27,<0.3.28.0a0 , which can be installed;
│ ├─ libopenblas 0.3.12 would require
│ │ └─ openblas >=0.3.12,<0.3.13.0a0 , which can be installed;
│ ├─ libopenblas 0.3.13 would require
│ │ └─ openblas >=0.3.13,<0.3.14.0a0 , which can be installed;
│ ├─ libopenblas 0.3.15 would require
│ │ └─ openblas >=0.3.15,<0.3.16.0a0 , which can be installed;
│ ├─ libopenblas 0.3.16 would require
│ │ └─ openblas >=0.3.16,<0.3.17.0a0 , which can be installed;
│ ├─ libopenblas 0.3.17 would require
│ │ └─ openblas >=0.3.17,<0.3.18.0a0 , which can be installed;
│ ├─ libopenblas 0.3.18 would require
│ │ └─ openblas >=0.3.18,<0.3.19.0a0 , which can be installed;
│ ├─ libopenblas 0.3.20 would require
│ │ └─ openblas >=0.3.20,<0.3.21.0a0 , which can be installed;
│ ├─ libopenblas 0.3.21 would require
│ │ └─ openblas >=0.3.21,<0.3.22.0a0 , which can be installed;
│ ├─ libopenblas 0.3.6 would require
│ │ └─ openblas 0.3.6 3, which can be installed;
│ ├─ libopenblas 0.3.6 would require
│ │ └─ openblas >=0.3.6,<0.3.7.0a0 , which can be installed;
│ ├─ libopenblas 0.3.7 would require
│ │ └─ openblas >=0.3.7,<0.3.8.0a0 , which can be installed;
│ ├─ libopenblas 0.3.8 would require
│ │ └─ openblas >=0.3.8,<0.3.9.0a0 , which can be installed;
│ ├─ libopenblas 0.3.9 would require
│ │ └─ openblas >=0.3.9,<0.3.10.0a0 , which can be installed;
│ ├─ libopenblas 0.3.23 would require
│ │ └─ openblas >=0.3.23,<0.3.24.0a0 , which can be installed;
│ ├─ libopenblas 0.3.24 would require
│ │ └─ openblas >=0.3.24,<0.3.25.0a0 , which can be installed;
│ ├─ libopenblas 0.3.25 would require
│ │ └─ openblas >=0.3.25,<0.3.26.0a0 , which can be installed;
│ └─ libopenblas 0.3.26 would require
│ └─ openblas >=0.3.26,<0.3.27.0a0 , which can be installed;
└─ mumps is not installable because there are no viable options
├─ mumps [5.0.1|5.0.2] would require
│ └─ openblas 0.2.18|0.2.18.* , which conflicts with any installable versions previously reported;
├─ mumps 5.0.2 would require
│ └─ openblas 0.2.19|0.2.19.* , which conflicts with any installable versions previously reported;
├─ mumps [5.0.2|5.1.2] would require
│ └─ openblas [0.2.20|0.2.20.* |>=0.2.20,<0.2.21.0a0 ], which conflicts with any installable versions previously reported;
└─ mumps 5.1.2 would require
└─ openblas >=0.3.3,<0.3.4.0a0 , which conflicts with any installable versions previously reported.
This says mumps isn't even installed!
moorepants@nandi:examples(master)$ conda update mumps
PackageNotInstalledError: Package is not installed in prefix.
prefix: /home/moorepants/miniconda
package name: mumps
The mumps packages seems to have had a name change so I had to do this and manually install the new mumps packages even though they should be dependencies of ipopt.
moorepants@nandi:examples(master)$ conda update ipopt
Channels:
- conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done
# All requested packages already installed.
moorepants@nandi:examples(master)$ conda install mumps-include mumps-mpi mumps-seq
Channels:
- conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/moorepants/miniconda
added / updated specs:
- mumps-include
- mumps-mpi
- mumps-seq
The following packages will be downloaded:
package | build
---------------------------|-----------------
libptscotch-7.0.4 | h4eaa18c_1 173 KB conda-forge
libscotch-7.0.4 | h0c89965_1 331 KB conda-forge
mpi-1.0 | openmpi 4 KB conda-forge
mumps-mpi-5.7.1 | hcb8ae40_0 2.2 MB conda-forge
openmpi-4.1.6 | hc5af2df_101 3.9 MB conda-forge
parmetis-4.0.3 | he9a3056_1005 277 KB conda-forge
ptscotch-7.0.4 | hd53efc5_1 30 KB conda-forge
scalapack-2.2.0 | h67de57e_1 2.2 MB conda-forge
scotch-7.0.4 | hd53efc5_1 90 KB conda-forge
------------------------------------------------------------
Total: 9.2 MB
The following NEW packages will be INSTALLED:
libptscotch conda-forge/linux-64::libptscotch-7.0.4-h4eaa18c_1
mpi conda-forge/linux-64::mpi-1.0-openmpi
mumps-mpi conda-forge/linux-64::mumps-mpi-5.7.1-hcb8ae40_0
openmpi conda-forge/linux-64::openmpi-4.1.6-hc5af2df_101
parmetis conda-forge/linux-64::parmetis-4.0.3-he9a3056_1005
ptscotch conda-forge/linux-64::ptscotch-7.0.4-hd53efc5_1
scalapack conda-forge/linux-64::scalapack-2.2.0-h67de57e_1
The following packages will be DOWNGRADED:
libscotch 7.0.4-h91e35bf_1 --> 7.0.4-h0c89965_1
scotch 7.0.4-h23d43cc_1 --> 7.0.4-hd53efc5_1
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: \
For Linux 64, Open MPI is built with CUDA awareness but this support is disabled by default.
To enable it, please set the environment variable OMPI_MCA_opal_cuda_support=true before
launching your MPI processes. Equivalently, you can set the MCA parameter in the command line:
mpiexec --mca opal_cuda_support 1 ...
In addition, the UCX support is also built but disabled by default.
To enable it, first install UCX (conda install -c conda-forge ucx). Then, set the environment
variables OMPI_MCA_pml="ucx" OMPI_MCA_osc="ucx" before launching your MPI processes.
Equivalently, you can set the MCA parameters in the command line:
mpiexec --mca pml ucx --mca osc ucx ...
Note that you might also need to set UCX_MEMTYPE_CACHE=n for CUDA awareness via UCX.
Please consult UCX's documentation for detail.
done
moorepants@nandi:examples(master)$ ls ~/miniconda/lib/ | grep mumps
libcmumps_seq.so
libcmumps.so
libdmumps_seq.so
libdmumps.so
libesmumps.so
libmumps_common_seq.so
libmumps_common.so
libptesmumps.so
libsmumps_seq.so
libsmumps.so
libzmumps_seq.so
libzmumps.so
Solution to issue cannot be found in the documentation.
Issue
Installed packages