![]() |
cacao
Release 0.1.03-dev
Compute And Control For Adaptive Optics
|
The function parameter structure (FPS) exposes a function's internal variables for read and/or write. It is stored in shared memory, in /tmp/<fpsname>.fps.shm.
Steps to run FPS-enabled processes:
$ vim fpslist.txt # Edit file, listing functions and corresponding FPS names that will be used $ fpsmkcmd # create FPS scripts in `./fpscmd/` $ ./fpscmd/fpsinitscript # create FPS shared memory structure(s) $ ./fpscmd/fpsconfstartscript # start FPS configuration process(es) $ fpsCTRL -m _ALL # FPS control tool, scan ALL FPSs (-m: force match with fpscmd/fpslist.txt) Type 'P' to im(P)ort configuration
FPS-enabled functions have the following elements:
<fpsname> consists of a root name (string), and a series of optional integers. Note that the number of digits matters and is part of the name:
<fpsname> = <fpsnameroot>.<opt0>.<opt1>...
Examples:
myfps # simple name, no optional integers myfps-000000 # optional integer 000000 myfps-000043-000020-000002 # 3 optional integers
name | Type | Description | Origin |
---|---|---|---|
/tmp/<fpsname>.fps.shm | shared memory | FP structure | Created by FPS init function |
./fpscmd/<fpsnameroot>-confinit | script | Initialize FPS | Built by fpsmkcmd, can be user-edited |
./fpscmd/<fpsnameroot>-confstart | script | Start CONF process | Built by fpsmkcmd, can be user-edited |
./fpscmd/<fpsnameroot>-runstart | script | Start RUN process | Built by fpsmkcmd, can be user-edited |
./fpscmd/<fpsnameroot>-runstop | script | Stop RUN process | Built by fpsmkcmd, can be user-edited |
<fpsname>-conf | tmux session | where CONF runs | Set up by fpsCTRL |
<fpsname>-run | tmux session | where RUN runs | Set up by fpsCTRL |
./fpsconf/<fpsname>/... | ASCII file | parameter value | <TBD> |
Main steps to enable FPS-enabled function for fpsCTRL:
These steps should ideally performed by a setup script.
The user-provided fpslist.txt
file lists the functions and corresponding FPS names that will be in use:
FPS command scripts are built by
$ fpsmkcmd
The command will create the FPS command scripts in directory ./fpscmd/
, which are then called by the 2.2. fpsCTRL tool to control the CONF and RUN processes.
The FPS control tool is started from the command line :
$ fpsCTRL
A single CLI function, named <functionname>_cli, will take the following arguments:
The command code is a string, and will determine the action to be executed:
_FPSINIT_
: Initialize FPS for the function_CONFSTART_
: Start the FPS configuration process_CONFSTOP_
: Stop the FPS configuration process_RUNSTART_
: Start the run process_RUNSTOP_
: Stop the run processExample source code below.
Check function_parameters.h for full list of flags.
The RUN function will connect to the FPS and execute the run loop.
In this example, the loop process supports both FPS and processinfo. This is the preferred way to code a loop process.
The example also shows using FPS to set the process realtime priority.