Comments (5)
Thanks Tom,
Glad you managed to get it working with multiprocessing
(my python parallel framework of choice). The joblib
error you're seeing is similar to a recent upstream bug report:
joblib/joblib#1529 (comment)
The joblib developers are claiming it's nothing to do with them but that is unlikely, it looks to me like a relatively rare genuine upstream bug (the fact that you and someone else on a different platform both experience a very similar issue is too much of a coincidence).
from pycutest.
Hmm this looks suspiciously like an upstream issue to me:
Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
OSError: [Errno 9] Bad file descriptor
Could you also try parallel compilation on macOS with another Python extension?
EDIT: also probably worth trying with a newer Python version (11/12).
from pycutest.
Hi Jari @jfowkes,
I made some tests, and the same problem occurred for Python3.11 and Python3.12. However, it seems that the following code works:
import logging
import multiprocessing
import pycutest
def get_logger(name):
logger = logging.getLogger(__name__)
if len(logger.handlers) == 0:
logger.setLevel(logging.INFO)
# Attach a console handler (thread-safe).
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('[%(levelname)-8s] %(message)s'))
logger.addHandler(handler)
return logger
def load_problem(problem_name):
logger = get_logger(__name__)
logger.info(f'Loading {problem_name}')
try:
pycutest.import_problem(problem_name)
logger.info(f'{problem_name} successfully loaded')
except Exception as exc:
logger.warning(f'{problem_name} failed to load: {exc}')
if __name__ == '__main__':
problem_names = pycutest.find_problems(constraints='unconstrained', n=[1, 10])
with multiprocessing.Pool() as p:
p.map(load_problem, problem_names[:5])
I tried to change the name of all the Python files in PyCUTEst (I was particularly worried that system_paths
might conflict with some other module), but this did not do the trick. I am not sure what is happening.
Cheers,
Tom.
from pycutest.
Hey @jfowkes @ragonneau,
Any news/updates the topic? We are having a similar issue on our library!
Thank you!
from pycutest.
Hi @LacombeLouis, this is an upstream issue as far as we are concerned. As a workaround I would recommend switching over to multiprocessing
.
from pycutest.
Related Issues (20)
- module 'pycutest_cache_holder.X' has no attribute 'setup' HOT 1
- error when Installing on Linux HOT 10
- Better handling of incompatible Fortran compilers
- System state isn't restored after loading failure (`FileNotFoundError`) HOT 2
- How to find problems with equality constraints only? HOT 5
- Support for ARM-based Mac HOT 2
- import_problem HOT 5
- Release of memory HOT 6
- Facing error when attempting to run the given example HOT 2
- Conversion of an array with ndim > 0 to a scalar is deprecated and will error in future
- Pycutest with Knitro solver HOT 1
- Add new CUTEst routines for the John function HOT 2
- Add missing sparse routines (sobj, sgrad)
- Setuptools not installed by default HOT 3
- Switch to `pyproject.toml`
- Python Headers on Ubuntu HOT 3
- Inconsistency in problem dimensions between description and problem HOT 6
- Switch to installing CUTEst via Meson HOT 1
- [macOS] Bizarre CUTEst u/creport() bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycutest.