Menu

#134 ipc_alloc errors when trying to have DSPSR run on a DADABuffer

version_1.0
open
nobody
None
5
2026-03-25
2026-03-23
No

Hello,

I've been trying to use the latest versions of PSRDADA and DSPSR for our setup at the CHIME telescope. Both were compiled following the nominal instructions, and linking to the CUDA-13.1 installation of our latest/test NVIDIA GPU seems successful when running make check. I'm happy to pass along logistical info if you would find it helpful.

When running "make check", the results indicate all tests pass. However, when I look at the log for OutputDADABufferTest, I see the folllowing:

[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from OutputDADABufferTest
[ RUN      ] OutputDADABufferTest.test_create_destroy
ipc_alloc: shmget (key=a001, size=528, flag=1b6) No such file or directory
ipcsync_get: ipc_alloc error
ipcbuf_connect: ipcsync_get error
[2026-03-23-20:18:26] ERR: Failed to connect to Header Block

It seems likely that the underlying DADA and/or DSPSR utilities are not estimating the size value correctly. This idea is somewhat substantiated when following the tutorial outlined here, where the dspsr call produces an apparent "file not recognized" error but actually produces the same shmget error when running dspsr -V.

Again, please do let me know if you'd like any info from me.

Cheers,

  • e.f.

Discussion

  • Emmanuel Fonseca

    As a follow-up, I've been trying different things and have a likely related view of the above issue. I tried out the following lines to load test data into a PSRDADA ring buffer and then execute dspsr:

    dada_db -b 33554432 -n 16
    dada_example_writer header.txt
    dada_diskdb -f 1644-4559.dada &
    

    (Using the commands given in the dspsr-DADA tutorial linked above did not work; I can indeed retrieve the header data when running the above and then executing dada_header -v.) When running dspsr, I see the following:

    opening dada.info
    dsp::SourceFactory::create filename='dada.info
    dsp::File::create filename='dada.info
    dsp::File::create with 7 registered sub-classes
    dsp::File::create testing Dummy
    dsp::DummyFile::is_valid first line != DUMMY
    dsp::File::create testing DADABlock
    dsp::DADABlockFile::is_valid fread (nbyte=4096)
    dsp::File::create testing DADA
    dsp::DADAFile::is_valid fread (nbyte=4096)
    dsp::File::create testing CPSR2
    CPSR2File::get_header - failed read: Successdsp::File::create testing DADABuffer
    dsp::File::create DADABuffer::is_valid() returned true
    dsp::Input ctor this=0x5cd0ab6a1ff0
    dsp::File::open filename=dada.info
    dsp::DADABuffer::close start
    dsp::DADABuffer::open_file
    dsp::DADABuffer::open_file key=dada passive=1
    dsp::DADABuffer::reopen start
    dsp::DADABuffer::load_header calling dada_hdu_open
    dsp::DADABuffer::load_header size=4096 content=
    HDR_SIZE     4096                   
    
    END OF HEADER
    ASCIIObservation::load required keywords:
      TELESCOPE
      SOURCE
      FREQ
      BW
      NPOL
      NBIT
      TSAMP
      UTC_START
      OBS_OFFSET
    ASCIIObservation: failed read HDR_VERSION
    dsp::File::create failed while testing DADABuffer
    

    it looks like dspsr is able to recognize the input-file format and obtain shm-related data needed to instantiate some of the DADA-related routines, but is nonetheless not able to retrieve header data (whereas dada_header can output header data fine).

     
  • Willem van Straten

    Hi Emmanuel,

    I need to have a closer look at the first error that you reported, but the clue to the second error is

    ASCIIObservation: failed read HDR_VERSION
    

    It appears that your ASCII header contains only the text

    HDR_SIZE     4096
    

    Does this sound correct to you? DSPSR is expecting

    HDR_VERSION 1.0
    

    and the required keywords listed above:

    ASCIIObservation::load required keywords:
      TELESCOPE
      SOURCE
      FREQ
      BW
      NPOL
      NBIT
      TSAMP
      UTC_START
      OBS_OFFSET
    

    ... hope this helps!

     
  • Emmanuel Fonseca

    Hi @straten,

    Thanks so much for your prompt response! For clarity, I'm basically running dspsr in the same way suggested in this tutorial, i.e., by supplying a key file to dspsr after having run the dada_ utilities described above so that dspsr can process data stored in a ring buffer; the specific dspsr command I use is:

    dspsr -F 128:D -E 1644-4559.eph -P 1644-4559.polyco dada.info -V
    

    So I'm not supplying the 1644-4559.dada test file directly to dspsr, but instead (trying to) load the data into a DADA-formated buffer and supplying a key file to dspsr. I still get the above error despite having a .hdr file, containing the header data below, in the same subdirectory containing the test data.

    Key file (dada.info):

    DADA INFO:
    key dada
    viewer
    

    Header file (dada.hdr):

    HDR_VERSION  1.0
    HDR_SIZE     4096
    
    TELESCOPE    PKS                    # telescope name
    PRIMARY      cpsr1                  # primary node host name
    
    # time of the rising edge of the first time sample
    UTC_START    2007-05-18-15:55:58    # yyyy-mm-dd-hh:mm:ss.fs
    MJD_START    54238.6638657407407    # MJD equivalent to the start UTC
    
    OFFSET       5368709120             # bytes offset from the start MJD/UTC
    
    SOURCE       J1644-4559             # name of the astronomical source
    RA           16:44:49.28            # Right Ascension of the source
    DEC          -45:59:09.5            # Declination of the source
    
    FREQ         1405.000000            # centre frequency on sky in MHz
    BW           -64                    # bandwidth of in MHz (-ve lower sb)
    TSAMP        0.00781250             # sampling interval in microseconds
    
    NBIT         2                      # number of bits per sample
    NDIM         1                      # dimension of samples (2=complex, 1=real)
    NPOL         2                      # number of polarizations observed
    
    EDGE         0                      
    LEVEL        300                    
    CALFREQ      11.123000              
    MODE         SURVEY                 
    NMBYTES      5120                   
    BUFFERSIZE   33554432               
    HALT         0                      
    OBS_OFFSET   0                      
    INSTRUMENT   CPSR2                  
    FILE_SIZE    536870912
    
     
  • Willem van Straten

    Hi Emmanuel, thank you for this additional information. I could reproduce the error on my end (tutorial failure) and have just checked in some fixes to psrdada: the psrdada library has been evolving and at some point it stopped understanding the old CPSR2 data files. This backward compatibility has been restored.

    Could you please git pull the latest version of psrdada and compile and install it? You might also need to recompile dspsr and install it again too.

     

Log in to post a comment.

MongoDB Logo MongoDB