Avoid UE iterations in the scheduler
Converted from comment https://gitlab.eurecom.fr/oai/openairinterface5g/-/merge_requests/3575#note_219359
In various places in the scheduler (e.g., `nr_csirs_scheduling()`, `nr_csi_meas_reporting()`, `nr_schedule_srs()`, etc.), we iterate over all UEs in each slot to verify that a given condition for individual UEs is valid. For many UEs (say, 100), that might be costly. In the three mentioned cases above, it comes down to something like
(frame * n_slots_frame + slot - offset) % period == 0
i.e., "is the current frame/slot the one in which this UE is configured to send/receive X"?
That is inefficient. In these cases, we have a clear frame/slot <-> UE association (possibly multiple UEs per frame/slot).
Instead, I suggest that for kind of periodic scheduling, we should instead maintain an array indexed by time (frame/slot) mapping to N UEs that need to be scheduled. For instance, in SR scheduleing [from the comment mentioned above], maintain
NR_UE_info_t *sr_per_UE[MAX_SLOTS_SR_PERIDIOCITY];
then lookup at given frame/slot
```
int slot = convert_to_slot_max_sr_periodicity(frame, slot);
NR_UE_info_t *srUE = sr_per_UE[slot];
// srUE != NULL => UE has SR in this slot
```
to lookup if a given UE is to be scheduled SR, then allocate. That translates the O(n) operation into O(1).
issue