Intel® C++ Compiler 16.0 User and Reference Guide
__cilkrts_get_pedigree(void);
This function returns the latest significant node in the current pedigree.
Intel® Cilk™ Plus identifies a strand of execution by a pedigree, a sequence of 64-bit integers that reflects the history of spawns and syncs in the computation leading up to that strand. Two strands always have distinct pedigrees. The current pedigree for a strand will change at each cilk_spawn, cilk_sync, or cilk_for, and will be different in each grain of a cilk_for loop. The current pedigree also changes after any call to __clkrts_bump_worker_rank().
The pedigree is represented as a linked list of pedigree nodes, each of type __cilkrts_pedigree. This list is singly linked and stores the pedigree nodes in reverse order, that is, from the least significant node to the most significant node. Each pedigree node is a structure containing a 64-bit integer rank and a const "parent" pointer to the next (more significant) pedigree node, or null if the node is the end of the list. The return value of this function is a copy of the least significant node of the current pedigree, that is, the head of the list.
In a serial execution of a program, the pedigrees increase lexicographically at each strand transition. In any parallel execution of the same program that generates the same set of strands as the serial execution, the pedigrees of the corresponding strands in the two executions should match.
The following guidelines apply to __cilkrts_get_pedigree():
Applications that want to inspect the pedigree should walk the linked list of __cilkrts_pedigree nodes, saving the rank values.
Applications should never modify the entries in the __cilkrts_pedigree list. The list remains valid for traversal until the end of the function that called __cilkrts_get_pedigree().
Applications should never save pointers to __cilkrts_pedigree entries. To save the pedigree, applications should copy the pedigree rank values into their own structures.
For an Intel® Cilk™ Plus program that executes using multiple OS threads not created by the Intel® Cilk™ Plus runtime, strands that execute on different OS threads differ in their most significant pedigree node. The runtime makes no guarantees that the most significant pedigree node will be the same across multiple runs of a such a program.
Applications should generally rely only on the results of comparing two pedigrees, rather than the specific rank values in a pedigree. The rank values of pedigrees may change slightly if a program is compiled using different flags, in part because redundant or implicit cilk_sync statements may be eliminated during optimizations.