Max Imakaev

Results 33 comments of Max Imakaev

what seems to work for me on both platforms: ``` import ctypes import os if os.name == 'nt': mkl_rt = ctypes.CDLL("mkl_Rt.dll") else: mkl_rt = ctypes.CDLL("libmkl_rt.so") mkl_rt.mkl_set_num_threads(ctypes.byref(ctypes.c_int(1))) ```

What is the issue with macOS? Does it require different code?

We probably shouldn't list mkl as a requirement though. Not everybody is using conda. Is there any danger with doing it using ctypes? If someone with a MacOS can check...

So I borrowed a Macbook and there "libmkl_rt.dylib" works

how about a simpler solution: just iterate over all possible names ``` import ctypes for name in ["mkl_Rt.dll", "libmkl_rt.so", "libmkl_rt.dylib"]: try: mkl_rt = ctypes.CDLL(name) mkl_rt.mkl_set_num_threads(ctypes.byref(ctypes.c_int(1))) except OSError: pass ```

This does work as well... but will be reliable only for CLI users. If you import cooler, and if you import it after you import numpy, it may not work...

Perhaps, this solution: ``` import os, ctypes def set_mkl_threads(): try: import mkl mkl.set_num_threads(1) return 0 except: pass for name in [ "libmkl_rt.so", "libmkl_rt.dylib", "mkl_Rt.dll"]: try: mkl_rt = ctypes.CDLL(name) mkl_rt.mkl_set_num_threads(ctypes.byref(ctypes.c_int(1))) return...

Somebody tried to compile the most complete solution for interacting with DLLs directly... https://github.com/tomMoral/loky/pull/135/files#diff-e49a2eb30dd7db1ee9023b8f7306b9deR110

This is strange. Is there something after the header in the pairs file?

Also, I generally start with 1kb resolution, not 10kb. It does not generate that much extra space, but may end up being useful for averages/pileups even in low-coverage datasets. On...