Changes between Version 9 and Version 10 of PhalUserGuide

Show
Ignore:
Timestamp:
11/19/08 00:28:09 (16 years ago)
Author:
ismael (IP: 62.57.188.40)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PhalUserGuide

    v9 v10  
    4141More optional arguments can be passed to runph in the shell. The command accepts the following arguments: 
    4242{{{ 
    43 runph [repository_path] -c [platform_cfg_file] -i [xitf_cfg_file] -p [priority] -d [debug_level] -r [fifo_report] 
     43runph [repository_path] -c [platform_cfg_file] -i [xitf_cfg_file] -p [priority] -d [debug_level] -r [fifo_report] [--daemon] [-o output_file] 
    4444}}} 
    4545Where: 
     
    5050 * ''-d [debug_level]'': Sets platform debug level. Currently only 2 modes are supported, level=0 or level!=0, where the first means normal operation and the second prevents EXEC daemon to kill processes which violated real time policies. ''Default'': 0 
    5151 * ''-r [fifo_report]'': File where the platform will log (in columns, for Matlab compatibility) the instantaneous waveform internal fifo utilization (in kilobytes). ''Default'': No report. 
     52 * ''--daemon'': Run PHAL in background. You should specify an output file (for standard output) so you can track what's happening. Also '''cmdman''' daemon should be launched as a daemon preventing to read from input (see below, Launching P-HAL as a Daemon). ''Default'': Foreground. 
     53 * ''-o [output_file]'': File to redirect standard output. ''Default'': None, terminal stdout. 
     54 
    5255 
    5356[[BR]] 
     
    9699}}} 
    97100 
    98 Now the waveform is running. We can see some hardware information or current processes information typing: 
    99 {{{ 
    100 runph$: hwcmd info 
    101 runph$: hwcmd ps 
     101Now the waveform is running. We can see current processes information typing: 
     102{{{ 
     103runph$: appinfo wimax 
    102104}}} 
    103105 
     
    114116P-HAL Linux launcher admits two configuration files as arguments which modify certain Platform parameters. In this section we describe how to configure such parameters and what implications do they have: 
    115117 
    116 '''Platform Configuration File''': This file has one mandatory section, ''[cpu_info]'', and N optional sections, ''[daemon]''. The second selects which daemons (and their path) will be launched by runph. You can add or remove them according to which daemons you need in your platform (see PhalManual). The CPU configuration section, has two fields: 
     118'''Platform Configuration File''': This file has one mandatory section, ''[cpu_info]'', and N optional sections, ''[daemon]''. The second selects which daemons (and their path) will be launched by runph. You can add or remove them according to which daemons you need in your platform (see PhalManual). This sections have two fields only: 
     119 * ''path'': Path where the executable is. 
     120 * ''output'': File to redirect standard output (for loggin purposes) 
     121 
     122In the CPU section, you can specify some default P-HAL configuration parameters. '''Note''': This parameters are overriden by the ones passed as arguments to the P-HAL Launcher. See section above for more details. 
    117123 * ''mips'': Capacity in MIPS of your computer. 
    118124 * ''tslot'': Duration of the time slot, in microseconds. 
     125 * ''run_as_daemon'': Run in background. 
     126 * ''output_file'': File to redirect standard output. 
     127 * ''report_file'': File where save hw info reports 
     128 * ''debug_level'': Debug level 
     129 * ''priority'': Prioriry level for objects 
    119130  
    120131'''External Interfaces Configuration File''': This files has one section for each external TCP interface of your platform. Before creating a network of P-HAL platforms, you should be very familiar with the P-HAL Environment concepts as it compromises selecting which daemons will run every platform, which depends on your network architecture. The format of the file is a set of sections (''[xitf]'') with the following mandatory fields: 
     
    133144[[BR]] 
    134145 
     146== Launching P-HAL as a Daemon == 
     147 
     148Running P-HAL in background is often interesing when long time executions are going to be performed. In foreground executions, disconnecting user terminal (or ssh session) will kill P-HAL processes as they inherit from user session. This can be prevented to happen if the user launches P-HAL with the ''daemon'' option (as an argument or in the platform configuration file, see above) and appropiate selects an output for text messages. 
     149 
     150When running in this mode, '''CMDMANAGER''' daemon must be also launched as daemon. It can't read commands from standard input anymore and a tcp socket should be created. Thus, another CMDMANAGER process (local or remote) can connect to it and send normal P-HAL commands (as if it was local). 
     151 
     152To do so, make sure you follow these steps: 
     153 1. Modify Platform configuration file, adding the field '''run_as_daemon'''=''yes'' to the CPU section or launch P-HAL with the '''--daemon''' argument. 
     154 2. Modify Platform configuration file, adding the field '''output_file'''=''hwapi_log_file'' to the CPU section or launch P-HAL with the '''-o''' ''hwapi_log_file'' argument. 
     155 3. Modify Platform configuration file, changing the arguments of the '''cmdman''' enabling it to listen to input connections ('''-l''') and run as daemon ('''-d'''). At this step, your configuration file should show something like the following: 
     156  {{{ 
     157  [cpu_info] 
     158   mips=... 
     159   tslot=... 
     160   ... 
     161   run_as_daemon=yes 
     162   output_file=/path/to/mylog/hwapi_output.log 
     163   work_path=/path/to/phal-repositories/ 
     164   ... 
     165  [daemon] 
     166   ... 
     167  [daemon] 
     168   path=cmdman -l -p 
     169  }}} 
     170 4.Then, if you specified '''work_path''' field in your configuration file, you can launch P-HAL just by typing: 
     171  {{{ 
     172  runph 
     173  }}} 
     174  from any directory. This would launch P-HAL and send it to background. 
     175 5. Now to perform commands you must connect to it (from local or remote machine): 
     176  {{{ 
     177  cmdman -c 192.168.1.1 
     178  }}} 
     179  where 192.168.1.1 should obviously be replaced by the IP address where you launched the daemon. In this screen, you can type commands as usual and exit typing Ctrl+C. You will notice as you can re-connect with the same command and perform more commands. 
     180  At this point, you can exit your ssh session normally. P-HAL will keep running at background. When you login again, connect again with the previous cmdman command. Also, keep track of the output files (specifiyed at the configuration file) for errors or unusual behaviour. 
     181 6. Finally, you can kill PHAL by sending a INT signal. This can be done typing: 
     182  {{{ 
     183  killall -s INT runph 
     184  }}} 
     185  
     186 
     187[[BR]] 
     188 
    135189== Performance Notes == 
    136190