diff --git a/projects/rdc/python_binding/RdcUtil.py b/projects/rdc/python_binding/RdcUtil.py index ef4dce0096..4bea3d7c2c 100644 --- a/projects/rdc/python_binding/RdcUtil.py +++ b/projects/rdc/python_binding/RdcUtil.py @@ -54,13 +54,13 @@ class RdcUtil: gpu_group_id = c_uint32() result = rdc.rdc_group_gpu_create(rdc_handle, rdc_group_type_t.RDC_GROUP_EMPTY, gpu_group_name, gpu_group_id) if rdc_status_t(result) != rdc_status_t.RDC_ST_OK: - raise Exception("Fail to create the GPU group " << group_name) + raise Exception("Fail to create the GPU group " + group_name) #Add GPU index to the group for gpu in gpu_indexes: result = rdc.rdc_group_gpu_add(rdc_handle, gpu_group_id, gpu) if rdc_status_t(result) != rdc_status_t.RDC_ST_OK: - raise Exception("Fail to add GPU index " << gpu <<" to group " << gpu_group_id) + raise Exception("Fail to add GPU index " + str(gpu) + " to group " + str(gpu_group_id)) return gpu_group_id, True @@ -75,7 +75,7 @@ class RdcUtil: group_info = rdc_field_group_info_t() result = rdc.rdc_group_field_get_info(rdc_handle, field_group_id_list[index], pointer(group_info)) if rdc_status_t(result) != rdc_status_t.RDC_ST_OK: - raise Exception("Fail to get field group " << field_group_id_list[index] <<" info") + raise Exception("Fail to get field group " + str(field_group_id_list[index]) + " info") if group_info.group_name.decode("utf-8") == field_group_name: field_ids_ori = [ e.value for e in group_info.field_ids[:group_info.count] ] # reuse the old field group @@ -84,7 +84,7 @@ class RdcUtil: else: result = rdc.rdc_group_field_destroy(rdc_handle, field_group_id_list[index]) if rdc_status_t(result) != rdc_status_t.RDC_ST_OK: - raise Exception("Fail to delete field group " << field_group_id_list[index]) + raise Exception("Fail to delete field group " + str(field_group_id_list[index])) #Create new field group fields_c_ids = [] diff --git a/projects/rdc/python_binding/rdc_prometheus.py b/projects/rdc/python_binding/rdc_prometheus.py index 08894d51aa..ec9e733e30 100644 --- a/projects/rdc/python_binding/rdc_prometheus.py +++ b/projects/rdc/python_binding/rdc_prometheus.py @@ -88,6 +88,9 @@ if __name__ == '__main__': rdc_ip_port = args.rdc_ip_port if args.rdc_embedded: rdc_ip_port = None + if args.rdc_gpu_indexes != None: + for i in range(0, len(args.rdc_gpu_indexes)): + args.rdc_gpu_indexes[i] = int(args.rdc_gpu_indexes[i]) reader = PrometheusReader(rdc_ip_port, field_ids, args.rdc_update_freq*1000000, args.rdc_max_keep_age, args.rdc_max_keep_samples,