diff --git a/doc/dev/fig/mux.pdf b/doc/dev/fig/mux.pdf deleted file mode 100644 index 8a6e88b..0000000 Binary files a/doc/dev/fig/mux.pdf and /dev/null differ diff --git a/doc/dev/fig/mux.svg b/doc/dev/fig/mux.svg index 8f272f7..2bc5cf1 100644 --- a/doc/dev/fig/mux.svg +++ b/doc/dev/fig/mux.svg @@ -2,9 +2,9 @@ + originx="-5.2916663" + originy="-23.812499" /> @@ -68,14 +68,23 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(-5.2916665,-7.9375)"> + transform="translate(-5.2916665,-23.8125)"> + - nanos6.thread0.subsystem - thread0.state - mux0 - - nanos6.thread0.subsystem.run - cpu0.th_running + id="tspan2727">cpu0.th_runningvalue=0 mux1 + x="61.100502" + y="72.721657">mux0 cpu0 cpu1 cpu2 cpu3 thread0 + x="130.6277" + y="133.23389">thread0 thread1 + x="130.67334" + y="138.5023">thread1 thread2 + x="130.62769" + y="143.81721">thread2 thread3 + x="130.67332" + y="149.08563">thread3 CPU: Nanos6 subsystem of the RUNNING thread Thread: Nanos6 subsystem of the ACTIVE thread + x="127.12749" + y="125.13274">Thread: Nanos6 subsystem of the ACTIVE thread thread0.state + id="tspan3201">thread0.statevalue=Running mux2 + x="61.146149" + y="141.49007">mux1 thread0 thread1 thread2 thread3 Thread: Thread state thread0.state thread1.state thread2.state thread3.state @@ -602,8 +575,8 @@ id="rect4212" width="5.2916636" height="5.2916675" - x="246.0625" - y="145.52083" + x="177.27083" + y="145.52081" rx="1.4210855e-14" ry="7.1054274e-15" /> + style="fill:#ff0000;stroke:#ff0000;stroke-width:0.4;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:0.8, 0.4;stroke-dashoffset:0;stroke-opacity:1" + d="M 153.45833,39.687501 V 174.625" + id="path3425" + sodipodi:nodetypes="cc" /> nanos6.cpu0.subsystem.run + + diff --git a/doc/dev/fig/mux1.svg b/doc/dev/fig/mux1.svg new file mode 100644 index 0000000..61fe06d --- /dev/null +++ b/doc/dev/fig/mux1.svg @@ -0,0 +1,628 @@ + + + + + + + + + + + + + + + + + + + nanos6.thread0.subsystem + + + + + + + + cpu0.th_runningvalue=null + + mux0 + cpu0 + cpu1 + + + + + cpu2 + cpu3 + + + + thread0 + thread1 + + thread2 + thread3 + + CPU: Nanos6 subsystem of the RUNNING thread + Thread: Nanos6 subsystem of the ACTIVE thread + + + thread0.statevalue=Cooling + mux1 + nanos6.thread0.subsystem.act + + + thread0 + thread1 + + thread2 + thread3 + + Thread: Thread state + + thread0.state + thread1.state + + + + + + + + thread2.state + thread3.state + + + + + nanos6.cpu0.subsystem.run + + + + + + diff --git a/doc/dev/mux.md b/doc/dev/mux.md index 28847f8..63b226c 100644 --- a/doc/dev/mux.md +++ b/doc/dev/mux.md @@ -18,30 +18,38 @@ selected. This allows a multiplexer to act as a filter too. ## Tracking The typical use of multiplexers is to implement the tracking modes of channels. -As an example, the following diagram shows three multiplexers used to implement +As an example, the following diagram shows two multiplexers used to implement the subsystem view of [Nanos6](../nanos6): -![Patch bay](fig/mux.svg) +![Mux example](fig/mux.svg) -The first mux0 uses the thread state channel to filter the value of the -subsystem channel and only pass it to the output when the thread is in the -Running state (green). Then the filtered subsystem channel is connected to an -input of a second mux (mux1) which selects the current input of the thread -running in the CPU0. The output *nanos6.cpu.subsystem.run* is then connected to -the Paraver timeline in the row corresponding to the CPU0, which shows the -subsystem of the currently running thread. +The first mux0 selects the input corresponding to the thread running in that +CPU (thread0), and forwards the value to the output. If no thread is running the +output is set to null. The output channel *nanos6.cpu0.subsystem.run* is then +connected to the Paraver timeline in the row corresponding to the CPU0, which +shows the subsystem of the currently **running** thread. -The Nanos6 subsystem channel is also connected to the mux2, which forwards the -value to the output only when the thread state is Active. The output is directly -connected to the Paraver row assigned to that thread. This channels shows the -subsystem of the thread by only when is active (not paused nor dead). You can -see that the subsystem is shown in the thread0 at the current time (red dotted -line) when in the CPU0 the subsystem has been hidden when the thread stops being -in the Running state (yellow). +The Nanos6 subsystem channel is also connected to the second mux1, which forwards the +value to the output only when the thread state is **Active** (not paused or +dead). The output is directly connected to the Paraver row assigned to that +thread. This view shows the subsystem of the thread when is active. + +![Mux example](fig/mux1.svg) + +Notice that when the thread0 is no longer Running (switches to the Cooling +state shown in yellow) the CPU subsystem timeline no longer shows the subsystem, +as the mux0 is not selecting any input (because there are no threads in the CPU0 +in the Running state at that moment). + +However, the thread view still shows the subsystem, as the thread0 is still +active (not paused yet). The mux1 is still selecting the thread subsystem +channel as input. + +## Separation of concerns Multiplexers allow models to interact with each other in a controlled way. In the example, the blue channel (*nanos6.thread0.subsystem*) is directly modified by the Nanos6 model when a new event is received. While the red channels are -controled by the ovni model. The rest of the channels are automatically updated +controlled by the ovni model. The rest of the channels are automatically updated in the propagation phase of the [bay](../patchbay) allowing the ovni model to modify the Nanos6 Paraver view of the subsystems.