Task allocation for heterogenous computing CPU-GPU using integer programming
numpy, pulp
python3 allocation.py [arg1] [arg2] [arg3] [arg4]
arg1 the number of unit counts.
e.g. for one CPU within N cores and one GPU, arg1 = N
arg2 the filename of tasks number. e.g. tasks.txt
format: task1 batch size, task2 batch size, task3 batch size, ...
arg3 the filename of task time cost. e.g. cost.txt
format:
cost_g1 cost_c1
cost_g2 cost_c2
...
cost_gi means the time cost of i-th task assigned to gpu
cost_ci means the time cost of i-th task assigned to cpu (one core)
arg4 the time limit of whole prgram
python3 allocation.py 8 tasks.txt cost.txt 10
At present only support one single CPU within multiple cores and one single GPU.
If want to support CPUs-GPUs, need to modify function 'generate_t' in allocation.py, which means generating time cost matrix.