cpu_opt.py 762 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @Auther :liuyuqi.gov@msn.cn
  5. @Time :2018/7/9 7:54
  6. @File :cpu_opt.py
  7. '''
  8. def getWij():
  9. global machine_resources
  10. # Wij矩阵表示第i个instance实例部署到j主机上
  11. Wij_size = np.zeros((68219, 6000))
  12. Wij = np.zeros_like(Wij_size)
  13. # inst_26195, app_147, machine_1149
  14. df3=pd.read_csv("../data/instance.csv", header=None,names=list(["instanceid", "appid", "machineid","disk"]))
  15. df2 = pd.read_csv(machine_resources, header=None, names=list(
  16. ["machineid", "cpu", "mem", "disk", "P", "M", "PM"]), encoding="utf-8")
  17. for i in range(0,68219):
  18. if df3[i]["machineid"]==None:
  19. pass
  20. else:
  21. # Wij[i][j]=
  22. pass