Skip to main content
. 2019 Nov 21;19(23):5083. doi: 10.3390/s19235083
Algorithm 1 Hierarchical Job Scheduling Strategy
Input: Wait for scheduling job queue
Output: Job scheduling sequence
1. Set flag = 0;
2. Sort jobs in SJobs by priority from high to low;
3. for each Ji in SJobs do
4.   if NumJi <= freeNum then
5.      Allocate the free CPUs to Ji;
6.      Update the state of CPUs and Rjobs;
7      if flag ==1 then
8.        Set Ji as fill-in job and corresponding CPUs as reservation CPUs;
9.        Update order N;
10.     endif
11. break
12.  else
13.     if NumJi > freeN && NumJi <= (freeN + orderN) then
14.        Select jobs paused in IJobs and put them to bJobs;
15.        Select CPUs corresponding to jobs in bJobs and put them to bCs;
16.        Update bCsN;
17.     if bCs ! = NULL then
19.        Change the state of CPUs to free and CPUs as no reservation CPUs;
20.        Update freeN, orderN;
21.    endif
22.    endif
22.     if NumJi <= freeN then
23.        Allocate the free CPUs to Ji and update the state of CPUs;
24.        Update busyN;
25.     if flag == 1 then
26.        Set Ji as fill-in job and corresponding CPUs as reservation CPUs;
27.        Update orderN;
28.     
29.     endif
30.     endif
33. flag = 1;
34. endfor