How to start a brand new RTS model

(reference: aLIGO wiki, "how to add a brand-new front-end model")

  1. Determine what's already in use
    • ssh [front-end,host] computer where you want to start a brand new model.
    • Run 'lsmod' command on the [front-end,host] computer to determine what models are running. All of displayed models by lsmod are running.
    • Open CDS status medm screen (K1CDS-FE_CPU_STAT.adl) from sitemap medm.
    • Look at the model names running and go look at the corresponding simulink models and look at the parameters block (cpu, dcuid number, etc). These parameters are summarized in CDS status medm screen.
    • Check what CPUs are available, the ones actually displayed when you run 'cat /proc/cpuinfo' on the [front-end,host] computer. Note always leave a CPU (usually 0) free for the OS. CPU 1 is for the IOP.
  2. Create the new model
    • Open Matlab and make new mdl file
    • Fill in the cdsParameters block appropriately.
    • Rates are 2K, 4K, 16K, 32K, 64K
    • Two filter minimum in the model or else doesn't run. 1 ADC minimum. Get parts from CDS_PARTS.mdl
    • Model files(*.mdl) exist in /opt/rtcds/userapps/trunk
  3. Go to the build computer usually k1boot (will be changed in the future) and build the model
    • Go to the build directory (cd /opt/rtcds/rtscore/release/ /opt/rtcds/kamioka/k1/rtuild/current or just type "cdscode" as an alias)

    • make clean-MODELNAME
    • make MODELNAME
    • make install-MODELNAME
    • Be aware if you are using IPC (dolhpin,RFM, shared memory), build the sender first. If you have senders sending to each other, build one, then the other, then build the first again.
  4. Add the model to the rtsystab and edit master file
    • Login to k1boot and modify the rtsystab (sudo emacs /diskless/root/etc/rtsystab)
    • Add model name to the right of the computer name (example: computername MODELNAME MODELNAME)
    • Add the model's channel and tp files to the framebuilder master file (usually located something like /opt/rtcds/kamioka/k1/target/fb/master
      • Only attempt this with the assistance of the cds admin or equivalent*
    • Check if the .ini files (i.e. the files in /opt/rtcds/kamioka/k1/chans/daq/, such as K1EDCU_MODELNAME.ini and MODELNAME.ini) are added under the appropriate IOP file.
    • Check if the .par files (i.e. the tpch_MODELNAME.par file which lives in /opt/rtcds/kamioka/k1/target/gds/param/) are added, also under the appropriate IOP file.
    • Restart the frame builder process so the channels get recorded

      • Only attempt this with the assistance of the cds admin or equivalent*

    • Restart the "daqd"
      • login k1dc0
        • $ ssh k1dc0
      • check process ID
        • k1dc0$ ps -ef | grep daqd | grep controls
      • kill process
        • k1dc0$ kill process_id

  5. Start the model on the front end computer for the first time
    • Have the GDS_TP screen up first (usually located in /opt/rtcds/kamioka/k1/medm/MODELNAME/MODELNAME_GDS_TP.adl)
    • startMODELNAME (located in i.e. /opt/rtcds/kamioka/k1/scripts/)
    • Hit the BURT button soon after the EPICS come up (you usually have 5-10 seconds), so the front end code will think a burt restore has been done and actually start - this procedure is changed after RTS2.9.
    • Update the appropriate MEDM screens via the MEDM update screen from the sitemap (under the 'MEDM' button).
    • Setup your safe.snap (a burt snapshot of a safe state) so you don't need hit BURT each time (generally soft-linked from userapps to target/MODELNAME/MODELNAMEepics/burt/safe.snap file) example: login as controls in a terminal, then enter: makeBackup vis MODELNAME
  6. Set BURT_RESTORE channel as 1
    • execute following command

      > caput K1:FEC-(dcuid)_BURT_RESTORE 1

  7. Save safe.snap and modified safe.snap
    1. Open the GDS_TP screen
    2. Click the "SDF TABLE" button
    3. Follow the instruction of attached figures
  8. Restart new model
    • > startk1(modelname)

Old information

6. generate snap file

7. Re-start model

KAGRA/Subgroups/DGS/RTPC/How_to_start_a_brand_new_model (last edited 2022-09-09 14:51:44 by satoru.ikeda)