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:
The formula to calculate the required shared memory size is:# 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
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.
CCD numbers | shmmax value w/o pre & post scan | shmmax w/ pre & post scan |
---|---|---|
1 | 67108864 ( 64 MB) | 75460864 (71 MB) |
2 | 134217728 (128 MB) | 150921728 (142 MB) |
3 | 201326592 (192 MB) | 226382592 (213 MB) |
4 | 268435456 (256 MB) | 301843456 (284 MB) |
5 | 335544320 (320 MB) | 377304320 (355 MB) |
6 | 402653184 (384 MB) | 452765184 (426 MB) |
7 | 469762048 (448 MB) | 528226048 (497 MB) |
8 | 536870912 (512 MB) | 603686912 (568 MB) |
9 | 603979776 (576 MB) | 679147776 (639 MB) |
10 | 671088640 (640 MB) | 754608640 (710 MB) |
11 | 738197504 (704 MB) | 830069504 (781 MB) |
12 | 805306368 (768 MB) | 905530368 (852 MB) |
13 | 872415232 (832 MB) | 980991232 (923 MB) |
14 | 939524096 (896 MB) | 1056452096 (994 MB) |
15 | 1006632960 (960 MB) | 1131912960 (1065 MB) |
16 | 1073741824 (1024 MB) | 1207373824 (1136 MB) |
17 | 1140850688 (1088 MB) | 1282834688 (1207 MB) |
18 | 1207959552 (1152 MB) | 1358295552 (1278 MB) |
[]%cat /proc/sys/kernel/shmmaxThe 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.
[]%/sbin/sysctl -w kernel.shmmax=335544320To make your change permanent by adding the line into
/etc/sysctl.conf
:
[]%echo "kernel.shmmax=335544320" >> /etc/sysctl.confThe 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]