DrizzlePac : [Errno 24] Too many open files

BorlaffBorlaff Member Posts: 1
Hi,

I'm trying to reprocess the HUDF F850LP raw images. I successfully run Calacs to get the corrected fits of BIAS and DARK but when I try to combine them with AstroDrizzle always get the same error, no matter what version of DrizzlePac I use (I tried several versions of Ureka and non-Ureka installations):

##############################################################################
# #
# ERROR: #
# AstroDrizzle Version 2.0.2.dev44898 encountered a problem! Processing #
# terminated at 12:44:26.752 (01/10/2015). #
# #
##############################################################################
-------------------- --------------------
Step Elapsed time
-------------------- --------------------
Initialization 1823.8660 sec.
Static Mask 610.0484 sec.
Subtract Sky 44.6236 sec.
Separate Drizzle 386.2608 sec.
Create Median 0.0000 sec.
==================== ====================
Total 2864.7988 sec.
Trailer file written to: astrodrizzle.log

[...] Long python traceback error log [...]

error: [Errno 24] Too many open files

I already changed the number of open file descriptors on my computer. The current specifications of the workstation I use are:

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 44
Model name: Intel(R) Xeon(R) CPU X5650 @ 2.67GHz
Stepping: 2
CPU MHz: 2659.963
BogoMIPS: 5319.79
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 12288K
NUMA node0 CPU(s): 0-23

Hope that helps. If you need more information, please ask me. Thank you so much.
Borlaff

Comments

  • mack@stsci.edumack@stsci.edu Member, Institute_Staff, Moderator_DrizzlePac Posts: 29
    edited October 2015
    Hi Borlaff,

    Another user having a similar issue with creating the median image when combining 100 frames, and the lead software developer gave her this advice below. Maybe it could work for you?

    ##############################################################################
    # ERROR: #
    # AstroDrizzle Version 4.3.0 encountered a problem! Processing terminated #
    #############################################################################

    Initialization 297.5194 sec.
    Static Mask 72.6987 sec.
    Subtract Sky 269.0797 sec.
    Separate Drizzle 163.3763 sec.
    Create Median 0.0000 sec.
    ==================== ====================
    ...
    File "/usr/stsci/pyssgx/2.7/numpy/core/memmap.py", line 237, in __new__
    mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
    mmap.error: [Errno 24] Too many open files

    ---From Warren Hack---:
    It took me a while to work out the details behind this error, but it comes down to the way astrodrizzle manages the input images when creating the median image. The median image code was originally developed prior to the use of 64-bit OS and prior to the proper implementation of memory mapped file I/O in PyFITS. This resulted in the need to work on only a 1Mb section of each image at a time to minimize memory usage, a solution which works quite well, especially on 32-bit machines. However, recent updates to PyFITS resulted in a change of behavior of those sections due to the default use of memory mapping.

    One possible workaround may be to turn off the use of memory mapping in PyFITS by defining the following OS (not Python) environment variable:

    setenv PYFITS_USE_MEMMAP 0 # under tcsh linux shell

    This would be the mode which most closely matches the configuration under which this code was originally developed and should work for you.
    ----------------------

    The user reported that this resolved his problem. Please let me know if it doesn't work for you and we can assist further.
    Also, if you can send the full error log, that could be useful.

    Jennifer
  • mcaramcara Member Posts: 4
    Previously suggested solution to use "setenv PYFITS_USE_MEMMAP 0" may have limited success since this sets the default behavior to not use memory mapping only when software does not explicitly specifies opening mode. Unfortunately sky matching module explicitly opens files in memory mapped mode.

    Borlaff says: "I already changed the number of open file descriptors on my computer. The current specifications of the workstation I use are: ..." but the text that follows actually does not show maximum possible number of opened file handles. To get this number run "ulimit -n" or "ulimit -a" (for a more detailed information).

    You can change this limit per shell session by running, e.g., "ulimit -n 1024" (or a higher number) in the terminal. See some examples on how to do this in RedHat Linux 5 here and in Mac OS X: http://docs.basho.com/riak/latest/ops/tuning/open-files-limit/ or http://unix.stackexchange.com/questions/108174/how-to-persist-ulimit-settings-in-osx-mavericks

    Each ACS/WFC image needs about 14 file handles depending on the number of extensions in the file.
Sign In or Register to comment.