(rec)
| 156 | totals = [None] * 3 |
| 157 | |
| 158 | def proc(rec): |
| 159 | # executed once |
| 160 | with ops.task_init(): |
| 161 | counter1 = ops.CreateCounter([], ['global_counter']) |
| 162 | counter2 = ops.CreateCounter([], ['global_counter2']) |
| 163 | counter3 = ops.CreateCounter([], ['global_counter3']) |
| 164 | # executed once per thread |
| 165 | with ops.task_instance_init(): |
| 166 | task_counter = ops.CreateCounter([], ['task_counter']) |
| 167 | # executed on each iteration |
| 168 | ops.CountUp(counter1) |
| 169 | ops.CountUp(task_counter) |
| 170 | # executed once per thread |
| 171 | with ops.task_instance_exit(): |
| 172 | with ops.loop(ops.RetrieveCount(task_counter)): |
| 173 | ops.CountUp(counter2) |
| 174 | ops.CountUp(counter3) |
| 175 | # executed once |
| 176 | with ops.task_exit(): |
| 177 | totals[0] = final_output(ops.RetrieveCount(counter1)) |
| 178 | totals[1] = final_output(ops.RetrieveCount(counter2)) |
| 179 | totals[2] = final_output(ops.RetrieveCount(counter3)) |
| 180 | return rec |
| 181 | |
| 182 | # Read full data set from original reader |
| 183 | with TaskGroup() as tg: |
nothing calls this directly
no test coverage detected