This example demonstrates how to use a group scheduling configuration file to create a group scheduling hierarchy on the system. After a group scheduling hierarchy is created, the components that make up the example are automatically added to the hierarchy when they declare themselves using CCSM.
This API provides the CCSM namespace without requiring additional group scheduling code to be added to the applicatino.
This example is a descendent of the signal pipeline under group scheduling and CCSM. It is recommended to examine that example first. It is located here:
Signal Pipeline Group Scheduling & CCSM
In this example, no code in the ‘use_gs’ if-statements is executed. No calls are made to group scheduling directly from the application. Only the ‘use_ccsm’ code is executed.
The group scheduling configuration file used to set up the hierarchy is shown below. This configuration creates a group called “pipeline_group” then adds 7 threads to the group with descending priority. The group uses the sequential sdf and the sequential sdf considers lower priorities to be better.
This configuration is reproducing the same configuration present in the other signal pipeline examples. However, in this example, the group scheduling calls take place before the application starts to execute and then the application makes calls to CCSM. Therefore, the calls occur in the reverse order from the previous example which created CCSM sets and then asked group scheduling to use the names of those sets to identify tasks. In this example, before execution, we tell group scheduling about what groups we want created and the names of the threads that will go into those groups. Then, at execution time, we identify the threads by name using CCSM and they get automatically added to group scheduling.:
<gsh-installation>
local-root = "socket_pipeline"
attachment-point = "sockpipe"
<sdf-specification>
sdf_seq = {
name = "Sequential"
per_group_data = {}
per_member_data = {
priority = {
type = "Integer"
value = 0
doc = "Progress of the member."
index = 0
attributes = []
}
}
}
#
# GROUPS are defined as:
#
# <group-name> = {
# sdf = "<sdf-name>"
# attributes = [<attr0,
# <...>]
# per_group_data = { <datum_name> = <value> }
# members = [ <member-0>,
# <member-2>,
# ... ,
# <member-n>
# ]
# member_name = "<member-name>"
# comment = "I'm a group that does _____"
# }
#
# All fields within the group specification are required,
# but attributes, per_group_data, and members are allowed
# empty dictionary and list values.
#
<groups>
#
# Create socket_pipeline group with 7 Thread members.
#
pipeline_group = {
sdf = "sdf_seq"
attributes = [managed]
per_group_data = {}
members = [
thread-0,
thread-1,
thread-2,
thread-3,
thread-4,
thread-5,
thread-6
]
member_name = "pipeline_group_mem"
comment = ""
}
# Creates seven Threads that use simple-thread as a specfication
# (template).
# <desired-thread-name> = <thread-specification-name>
#
<threads>
thread-0 = "thread6"
thread-1 = "thread5"
thread-2 = "thread4"
thread-3 = "thread3"
thread-4 = "thread2"
thread-5 = "thread1"
thread-6 = "thread6"
<thread-specification>
thread0 = {
attributes = [exclusive]
per_member_data = {
priority = 0
}
comment = "should create a member with priority 0"
}
thread1 = {
attributes = [exclusive]
per_member_data = {
priority = 1
}
comment = "should create a member with priority 1"
}
thread2 = {
attributes = [exclusive]
per_member_data = {
priority = 2
}
comment = "should create a member with priority 1"
}
thread3 = {
attributes = [exclusive]
per_member_data = {
priority = 3
}
comment = "should create a member with priority 1"
}
thread4 = {
attributes = [exclusive]
per_member_data = {
priority = 4
}
comment = "should create a member with priority 1"
}
thread5 = {
attributes = [exclusive]
per_member_data = {
priority = 5
}
comment = "should create a member with priority 1"
}
thread6 = {
attributes = [exclusive]
per_member_data = {
priority = 6
}
comment = "should create a member with priority 1"
}
A bash script is provided to run the example. It will execute the program and perform postprocessing. Use:
./run
Optionally, the program can be run without postprocessing using:
./run exec
Also, the postprocessing can be run by itself u sing:
./run postprocess
The process started by dskictrl has changed. Now, the start of the dski configuration file (sigpipe_gschedctrl.dski) looks like:
<dski>
output_base = "./tmp/sigpipe_gschedctrl.dski.bin"
child = "gschedexec sigpipe_gschedctrl.gsh ./sigpipe_gschedctrl --threads=7 --stimuli=500 -c --dsui-output ./tmp/sigpipe_gschedctrl.dsui.bin"
A tool named gschedexec is used to set set up the group scheduling hierarchy, using the group scheduling configuration file, and then execute the process all in one command. This tool is a thin wrapper around another tool called gschedctrl which loads a group scheduling configuration file on the system.
Here, the setting up of the hierarchy by gschedexec is monitored to obtain the group scheduling events and provide a narrative similar to the group scheduling narratives in the previous examples.