MONSOON FAQs

Tao Qian
University of Illinois at Urbana-Champaign
Created on November 12, 2006

MONSOON is an image acquisition system developed at NOAO. The Dark Energy Survey project will adopt this acquisition system. A collection of the common questions are listed in this site according to my experience.

Content

Calculate the Required Shared Memory Size for a Focal Plane

MONSOON system uses shared memory in the PAN Linux kernel to transfer information/data between the PAN processes. The shared memory size is calculated based on the parameters in <focal_plane_name>.arr file. Here is the example of .arr file which we will use to calculate the minimum shared memory requirement in the Linux kernel:

     
# Example acq1ch4.arr -- 1 CCDACQ board 4 ADC channel = 2 ccds ################################################################################ # Monsoon Array Description File ################################################################################ ################################################################################ # Mosaic Description Section ################################################################################ arrayType = generic #arrayRows = 1 # obsolete #arrayCols = 2 # obsolete variables mosaicRows = 1 # mosaicCols = 2 # 2 ccd # largest number of rows which will be produced, Include ref, pre and overscan pxlRows = 4196 # 4096 + 50x2 # largest number of cols which will be produced, Include ref, pre and overscan pxlCols = 2248 # 2048 + 50x2x2 chnlsPerArr = 2 # how many outputs per ccd ################################################################################ # Memory Buffer section ################################################################################ bpRawPxl = 4 # bytes per pixel bpFinPxl = 4 numRawBufs = 1 # should set to be 1 in DES numFinBufs = 1 # should set to be 1 in DES
The formula to calculate the required shared memory size is:

( pxlRows × pxlCols × bpRawPxl ) × ( mosaicRows × mosaicCols ) × ( numRawBufs + numFinBufs )

For a 2kx4k CCD without pre-scan and post-scan pixels, its image size is 2048 × 4096 × 4 = 33554432 (32MB). When including the 50 pre-scan pixel and 50 post-scan pixels in each channel, the image size becomes 2248 × 4196 × 4 = 37730432 (~36 MB). In Dark Energy Survey project, the memory buffer setting numRawBufs = 1 and numFinBufs = 1 will be sufficient, therefore the total buffer number is 2 (two). We need to set the shared memory size depending on CCD number mosaicRows × mosaicCols.

Table for the minimum value of the max total shared memory (shmmax) for Focal Planes with different number of 2k×4k CCDs.
CCD numbersshmmax value w/o pre & post scanshmmax w/ pre & post scan
167108864 ( 64 MB)75460864 (71 MB)
2134217728 (128 MB)150921728 (142 MB)
3201326592 (192 MB)226382592 (213 MB)
4268435456 (256 MB)301843456 (284 MB)
5335544320 (320 MB)377304320 (355 MB)
6402653184 (384 MB)452765184 (426 MB)
7469762048 (448 MB)528226048 (497 MB)
8536870912 (512 MB)603686912 (568 MB)
9603979776 (576 MB)679147776 (639 MB)
10671088640 (640 MB)754608640 (710 MB)
11738197504 (704 MB)830069504 (781 MB)
12805306368 (768 MB)905530368 (852 MB)
13872415232 (832 MB)980991232 (923 MB)
14939524096 (896 MB)1056452096 (994 MB)
151006632960 (960 MB)1131912960 (1065 MB)
161073741824 (1024 MB)1207373824 (1136 MB)
171140850688 (1088 MB)1282834688 (1207 MB)
181207959552 (1152 MB)1358295552 (1278 MB)
Note: the above calculation assumes the "minimum memory segment size is 1 byte". The listed value in this table is the minimum size for the max total shared memory (shmmax) on the PAN corresponding to the focal plane. [Back to Top]

Check and Set the Max Shared Memory (shmmax) on PAN

To Check the current shared memory size:
      []%cat /proc/sys/kernel/shmmax 
    
The typical default value is 33554432, i.e. 32MB. If the shmmax value is smaller than that the focal plane requires, you need to increase the shmmax value by doing following steps.
To Increase the size to 320MB (for example):
      []%/sbin/sysctl -w kernel.shmmax=335544320
    
To make your change permanent by adding the line into /etc/sysctl.conf:
      []%echo "kernel.shmmax=335544320" >> /etc/sysctl.conf 
    
The minimum value of the max total shared memory (shmmax) must be set according to the number of CCDs in the focal plane. [Back to Top]


Created by Tao Qian: Wed Oct 1 15:12:25 CDT 2003.
Last modified: Wed Nov 29 16:26:52 CST 2006