allGroups: Configure All Resources

This function enables you to send commands and configure parameters on all resources at the same time.

This command allows the experimenter to address all the groups of resources defined in the experiment, in order to configure them or send them some given sub-commands.

Syntax

allGroups.subcommand(param1, param2, ...)

allGroups.resource_path = value

allGroups.resource_path(param1, param2,...)

where:

  • subcommand: The sub-command to send to all the resources within all the defined groups.
  • resource_path: A valid Resource Path to access/configure a given parameter of the resources within all the defined groups. Please refer to the Resource Path section of the OEDL Reference page for a list of valid Resource Paths.

Note: This 'allGroups' command is equivalent to using the 'group' command with a wild-card group selector "*".

allGroups Sub-Commands Description
startApplications Start all the applications which are associated with the resources in all the defined groups.
stopApplications Stop all the applications which are associated with the resources in all the defined groups.
sendMessage(name, arg1, arg2, ...) Send a message to a given application associated with the resources in all the defined groups. This message will be sent on the standard-in (STDIN) input of this application.
sendMessage(name, arg1, arg2, ...)

name               - the name of the application to sent the message to 
arg1, arg2, etc... - the list of arguments to send to the standard-in of the application

Note: the argX will be concatenated in a single text message separated by a blank space.
Thus if arg1="Hello" and arg2="There", the application will receive "Hello There" on its STDIN.
This is also equivalent to using only arg1="Hello There" 
Some examples below.

Usage Examples

Example 1

Usage of 'allGroups' with a Resource Path to set the ESSIDs and channels of the resource within all the defined groups. The resources here are wifi-enabled nodes.

Please refer to the Resource Path section of the OEDL Reference page for a list of valid Resource Paths

 1 
 2 # Defines 2 groups of nodes: 'one_wifi_node' and 'two_wifi_nodes'
 3 #
 4 defGroup('one_wifi_node', [1,1])
 5 defGroup('two_wifi_nodes', [[1,2],[1,3]])
 6 
 7 # Use 'allGroups' to set the ESSIDs for the 1st wifi interface w0
 8 #
 9 allGroups.net.w0.essid = "network_alpha" 
10 
11 # Now do the same to set the channels...
12 #
13 allGroups.net.w0.channel = '6'
14 
15 #
16 # Another way to do the above operation in one go...
17 #
18 allGroups.net.w0 { |w|
19   w.essid = "network_alpha" 
20   w.channel = '6'
21 }
22 

Example 2

Usage of 'allGroups' with a sub-command to start, stop, and send message to an application associated with the resource within all the defined groups. The resources here are PC-based nodes.

Please refer to the description of the defGroup command for more detailed information of the 'defGroup' syntax.

 1 
 2 # Defines a group of nodes: 'one_node'
 3 # and associate the application "audiogen" to the nodes in this group
 4 # (audiogen is a fictif application, which generate audio packets)
 5 #
 6 defGroup('one_node', [1,1]) { |n|
 7   n.prototype('audiogen')
 8 }
 9 
10 # Defines a group of nodes: 'two_nodes'
11 # and associate the application "videogen" to the nodes in this group
12 # (videogen is a fictif application, which generate video packets)
13 #
14 defGroup('two_nodes', [[1,2],[1,3]]) { |n|
15   n.prototype('videogen')
16 }
17 
18 # Use 'allGroups' to start the applications on the nodes 
19 #
20 allGroups.startApplications
21 
22 # Now use 'allGroups' to send a message to the applications on the nodes 
23 # The application will receive this message on its standard-in input
24 #
25 allGroups.sendMessage('videogen', 'increase pkt rate to 1024')
26 
27 # Note: the following line also does the exact same thing...
28 #
29 allGroups.sendMessage('videogen', 'increase', 'pkt', 'rate', 'to', '1024')
30 
31 # Finally, use 'allGroups' to stop the applications on the nodes 
32 #
33 allGroups.stopApplications
34