@@ -106,31 +106,34 @@ function get_processor_id_from_split_array(iter,val::Tuple,num_procs)
106
106
return 0
107
107
end
108
108
109
- function get_processor_range_from_split_array (arr₁:: AbstractVector ,arr₂:: AbstractVector ,
110
- iter_section,num_procs:: Integer )
109
+ get_processor_id_from_split_array (arr₁:: AbstractVector ,arr₂:: AbstractVector ,
110
+ val:: Tuple{Any,Any} ,num_procs:: Integer ) =
111
+ get_processor_id_from_split_array (Iterators. product (arr₁,arr₂),
112
+ val,num_procs)
113
+
114
+ function get_processor_range_from_split_array (iter,iter_section,num_procs:: Integer )
111
115
112
116
if isempty (iter_section)
113
117
return 0 : - 1 # empty range
114
118
end
115
119
116
- tasks_arr = collect (iter_section)
117
- proc_id_start = get_processor_id_from_split_array (arr₁,arr₂,first (tasks_arr),num_procs)
118
- proc_id_end = get_processor_id_from_split_array (arr₁,arr₂,last (tasks_arr),num_procs)
119
- return proc_id_start: proc_id_end
120
- end
120
+ first_task = first (iter_section)
121
+ proc_id_start = get_processor_id_from_split_array (iter,first_task,num_procs)
121
122
122
- function get_processor_range_from_split_array (iter,iter_section,num_procs:: Integer )
123
-
124
- if isempty (iter_section)
125
- return 0 : - 1 # empty range
123
+ last_task = first_task
124
+ for t in iter_section
125
+ last_task = t
126
126
end
127
127
128
- tasks_arr = collect (iter_section)
129
- proc_id_start = get_processor_id_from_split_array (iter,first (tasks_arr),num_procs)
130
- proc_id_end = get_processor_id_from_split_array (iter,last (tasks_arr),num_procs)
128
+ proc_id_end = get_processor_id_from_split_array (iter,last_task,num_procs)
131
129
return proc_id_start: proc_id_end
132
130
end
133
131
132
+ get_processor_range_from_split_array (arr₁:: AbstractVector ,arr₂:: AbstractVector ,
133
+ iter_section,num_procs:: Integer ) =
134
+ get_processor_range_from_split_array (Iterators. product (arr₁,arr₂),
135
+ iter_section,num_procs)
136
+
134
137
function get_index_in_split_array (iter_section,val:: Tuple )
135
138
if isnothing (iter_section)
136
139
return nothing
0 commit comments