-
Notifications
You must be signed in to change notification settings - Fork 4
Description
We have several cases in which we need to instrument numerical properties of threads which are integers that can reach zero. At the same time, we also need to control when we don't show anything. This is what I want to do:
thread 0 ---------0000000---------
^ ^
null zero
The NULL section should appear as empty (same color as background) while the zero section should have some color and the semantic value zero.
Currently, Paraver uses the value 0 to represent "the empty space". So far we have been able to more or less avoid this problem by shifting the positive values so there is never a zero, and use zero only to mean "Null". However, this causes the internal values to mismatch the values of the trace and it is really confusing in some cases.
I propose adding support for the NULL value, which is different than 0, so the value 0 can appear in the timeline as the other values. It would also be nice if we can keep the null value short, so we don't increase the size of the .PRV files. So I suggest using the ASCII value N:
#Paraver (19/01/38 at 03:14):500_ns:0:1:1(20:1)
2:0:1:1:1:0:7:N
2:0:1:1:1:100:7:0
2:0:1:1:1:200:7:N
The usefulness of using N is that you can detect it by scanning just one byte, so the parser overhead should be minimal.
Internally, you still need to represent NULL differently than zero. One option is to map it to an unusual value such as 2^64 - 1. I'm not sure if there are cases in which it is needed to show those high values, if so, you could let the user define what numerical value is internally used as NULL. If the trace contatains those numerical values, they are used as NULL as well (you may want to emit a warning in case they are unexpected collisions).
By using a reserved value as NULL we avoid adding an extra bit per record, so the size in memory is the same.
This would break the current traces, so by default traces should use 0 as NULL (as they do currently) unless this mode is enabled by using a flag somewhere, then it will use N as NULL with value 2^64-1. The PCF file may be suitable to specify this.