Fixing case where pinning is a list of ranges

This was happening with intel MPI when mpiexec is also matched.  Example
of pinning: 0-3,16-19,32-35,48-51
This commit is contained in:
Paul Edwards 2023-05-19 11:49:39 +01:00
Родитель 5da70fef67
Коммит a4ee7dcd7b
1 изменённых файлов: 12 добавлений и 9 удалений

Просмотреть файл

@ -355,14 +355,17 @@ def find_last_core_id(process_d):
def conv_indx_str_to_list(indx_str):
indx_l = []
if "-" in indx_str:
indx_str_l = indx_str.split("-")
return list(range(int(indx_str_l[0]),int(indx_str_l[1])+1))
elif "," in indx_str:
return list(map(int, indx_str.split(",")))
if "," in indx_str:
parts = indx_str.split(",")
else:
indx_l.append(int(indx_str))
parts = [indx_str]
indx_l = []
for part in parts:
if "-" in part:
indx_str_l = part.split("-")
indx_l += list(range(int(indx_str_l[0]),int(indx_str_l[1])+1))
else:
indx_l.append(int(part))
return indx_l