Skip to content

Commit e5ef1d8

Browse files
committed
Got rid of parfor_progress(), which didn't work well for multiple simultaneous jobs
1 parent 7201d4c commit e5ef1d8

24 files changed

+94
-180
lines changed

build_full_trees_as_named_tree_mats.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
components_to_process_in_parallel_count = length(component_id_from_parallel_will_process_index) ;
100100

101101
fprintf('Starting the serial for loop, going to process %d components...\n', components_to_process_serially_count) ;
102-
parfor_progress(components_to_process_serially_count) ;
102+
pbo = progress_bar_object(components_to_process_serially_count) ;
103103

104104
% Do the big ones in a regular for loop, since each requires a lot of
105105
% memory
@@ -134,16 +134,16 @@
134134
end
135135

136136
% Update the progress bar
137-
parfor_progress() ;
137+
pbo.update() ;
138138
end
139-
parfor_progress(0) ;
139+
%pbo = progress_bar_object(0) ;
140140

141141

142142
% Do the small ones in a parfor loop, since memory is less of an issue
143143
% for them
144144
fprintf('Starting the parallel for loop, will process %d components...\n', components_to_process_in_parallel_count) ;
145145
use_this_many_cores(maximum_core_count_desired) ;
146-
parfor_progress(components_to_process_in_parallel_count) ;
146+
pbo = progress_bar_object(components_to_process_in_parallel_count) ;
147147
component_from_component_id_as_parpool_constant = parallel.pool.Constant(component_from_component_id) ;
148148
skeleton_xyzs_as_parpool_constant = parallel.pool.Constant(skeleton_xyzs) ;
149149
A_as_parpool_constant = parallel.pool.Constant(A) ;
@@ -180,8 +180,8 @@
180180
end
181181

182182
% Update the progress bar
183-
parfor_progress() ;
183+
pbo.update() ;
184184
end
185-
parfor_progress(0) ;
185+
%pbo = progress_bar_object(0) ;
186186

187187
toc(runtic) ;

build_full_trees_as_named_tree_mats_function.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function build_full_trees_as_named_tree_mats_function(sample_date, ...
116116
components_to_process_in_parallel_count = length(component_id_from_parallel_will_process_index) ;
117117

118118
fprintf('Starting the serial for loop, going to process %d components...\n', components_to_process_serially_count) ;
119-
parfor_progress(components_to_process_serially_count) ;
119+
pbo = progress_bar_object(components_to_process_serially_count) ;
120120

121121
% Do the big ones in a regular for loop, since each requires a lot of
122122
% memory
@@ -151,16 +151,16 @@ function build_full_trees_as_named_tree_mats_function(sample_date, ...
151151
end
152152

153153
% Update the progress bar
154-
parfor_progress() ;
154+
pbo.update() ;
155155
end
156-
parfor_progress(0) ;
156+
%pbo = progress_bar_object(0) ;
157157

158158

159159
% Do the small ones in a parfor loop, since memory is less of an issue
160160
% for them
161161
fprintf('Starting the parallel for loop, will process %d components...\n', components_to_process_in_parallel_count) ;
162162
use_this_many_cores(maximum_core_count_desired) ;
163-
parfor_progress(components_to_process_in_parallel_count) ;
163+
pbo = progress_bar_object(components_to_process_in_parallel_count) ;
164164
component_from_component_id_as_parpool_constant = parallel.pool.Constant(component_from_component_id) ;
165165
skeleton_xyzs_as_parpool_constant = parallel.pool.Constant(skeleton_xyzs) ;
166166
A_as_parpool_constant = parallel.pool.Constant(A) ;
@@ -197,9 +197,9 @@ function build_full_trees_as_named_tree_mats_function(sample_date, ...
197197
end
198198

199199
% Update the progress bar
200-
parfor_progress() ;
200+
pbo.update() ;
201201
end
202-
parfor_progress(0) ;
202+
%pbo = progress_bar_object(0) ;
203203

204204
toc(runtic) ;
205205

clean_up_skeleton_graph.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function clean_up_skeleton_graph(skeleton_graph, ...
111111
components_to_process_in_parallel_count = length(component_id_from_parallel_will_process_index) ;
112112

113113
fprintf('Starting the serial for loop, going to process %d components...\n', components_to_process_serially_count) ;
114-
parfor_progress(components_to_process_serially_count) ;
114+
pbo = progress_bar_object(components_to_process_serially_count) ;
115115

116116
% Do the big ones in a regular for loop, since each requires a lot of
117117
% memory
@@ -146,16 +146,16 @@ function clean_up_skeleton_graph(skeleton_graph, ...
146146
end
147147

148148
% Update the progress bar
149-
parfor_progress() ;
149+
pbo.update() ;
150150
end
151-
parfor_progress(0) ;
151+
%pbo = progress_bar_object(0) ;
152152

153153

154154
% Do the small ones in a parfor loop, since memory is less of an issue
155155
% for them
156156
fprintf('Starting the parallel for loop, will process %d components...\n', components_to_process_in_parallel_count) ;
157157
use_this_many_cores(maximum_core_count_desired) ;
158-
parfor_progress(components_to_process_in_parallel_count) ;
158+
pbo = progress_bar_object(components_to_process_in_parallel_count) ;
159159
component_from_component_id_as_parpool_constant = parallel.pool.Constant(component_from_component_id) ;
160160
skeleton_xyzs_as_parpool_constant = parallel.pool.Constant(skeleton_xyzs) ;
161161
A_as_parpool_constant = parallel.pool.Constant(A) ;
@@ -192,9 +192,9 @@ function clean_up_skeleton_graph(skeleton_graph, ...
192192
end
193193

194194
% Update the progress bar
195-
parfor_progress() ;
195+
pbo.update() ;
196196
end
197-
parfor_progress(0) ;
197+
%pbo = progress_bar_object(0) ;
198198

199199
toc(runtic) ;
200200
end

collect_fragments_into_single_mat_file.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ function collect_fragments_into_single_mat_file(sample_date)
1414
tree_count = length(frag_mat_file_names) ;
1515
fragments_from_tree_id = cell(1, tree_count) ;
1616
%tic_id = tic() ;
17-
parfor_progress(tree_count) ;
17+
pbo = progress_bar_object(tree_count) ;
1818
parfor tree_index = 1 : tree_count ,
1919
frag_mat_file_name = frag_mat_file_names{tree_index} ;
2020
frag_mat_file_path = fullfile(input_folder_path, frag_mat_file_name) ;
2121
fragments_from_tree_id{tree_index} = load_anonymous(frag_mat_file_path) ;
22-
parfor_progress() ;
22+
pbo.update() ;
2323
end
24-
parfor_progress(0) ;
24+
%pbo = progress_bar_object(0) ;
2525
%elapsed_time = toc(tic_id) ;
2626
%fprintf('Elapsed time to read in all fragment .mats was %g seconds\n', elapsed_time) ;
2727

convert_full_named_trees_as_mat_to_swc.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function convert_full_named_trees_as_mat_to_swc(trees_as_swc_folder_path, trees_
77
file_count = length(mat_file_names) ;
88

99
fprintf('Converting %d trees as .mat to .swc...\n', file_count) ;
10-
parfor_progress(file_count) ;
10+
pbo = progress_bar_object(file_count) ;
1111
parfor i = 1 : file_count ,
1212
mat_file_name = mat_file_names{i} ;
1313
swc_base_name = base_name_from_file_name(mat_file_name) ;
@@ -19,9 +19,9 @@ function convert_full_named_trees_as_mat_to_swc(trees_as_swc_folder_path, trees_
1919
named_tree = mat_contents.named_tree ;
2020
save_named_tree_as_swc(swc_file_path, named_tree) ;
2121
end
22-
parfor_progress() ;
22+
pbo.update() ;
2323
end
24-
parfor_progress(0) ;
24+
%pbo = progress_bar_object(0) ;
2525
elapsed_time = toc(tic_id) ;
2626
fprintf('Elapsed time for convert_full_named_trees_as_mat_to_swc() was %g seconds\n', elapsed_time) ;
2727
end

generate_fragments.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function generate_fragments(input_folder_path, ...
2424
full_trees_to_process_count = length(full_tree_file_names) ;
2525
%tic_id = tic() ;
2626
fprintf('Starting the fragment generation outer for loop, going to process %d full trees...\n', full_trees_to_process_count) ;
27-
%parfor_progress(full_trees_to_process_count) ;
27+
%pbo = progress_bar_object(full_trees_to_process_count) ;
2828
pbo = progress_bar_object(full_trees_to_process_count) ;
2929
for full_tree_index = 1 : full_trees_to_process_count ,
3030
%for full_tree_index = full_trees_to_process_count : -1 : 1 , % good for debugging, process small ones first to make sure loop body runs
@@ -40,9 +40,9 @@ function generate_fragments(input_folder_path, ...
4040

4141
% Update the progress bar
4242
pbo.update(full_tree_index) ;
43-
%parfor_progress() ;
43+
%pbo.update() ;
4444
end
4545
pbo.finish_up() ;
46-
%parfor_progress(0) ;
46+
%%pbo = progress_bar_object(0) ;
4747
%toc(tic_id) ;
4848
end

generate_fragments_as_one_mat_per_tree.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function generate_fragments_as_one_mat_per_tree(input_folder_path, ...
1313
full_trees_to_process_count = length(full_tree_file_names) ;
1414
tic_id = tic() ;
1515
fprintf('Starting the big parfor loop, going to process %d full trees...\n', full_trees_to_process_count) ;
16-
parfor_progress(full_trees_to_process_count) ;
16+
pbo = progress_bar_object(full_trees_to_process_count) ;
1717
parfor full_tree_index = 1 : full_trees_to_process_count ,
1818
full_tree_file_name = full_tree_file_names{full_tree_index} ;
1919
full_tree_mat_file_path = fullfile(input_folder_path, full_tree_file_name) ;
@@ -25,8 +25,8 @@ function generate_fragments_as_one_mat_per_tree(input_folder_path, ...
2525
bounding_box_high_corner_xyz) ;
2626

2727
% Update the progress bar
28-
parfor_progress() ;
28+
pbo.update() ;
2929
end
30-
parfor_progress(0) ;
30+
%pbo = progress_bar_object(0) ;
3131
toc(tic_id) ;
3232
end

generate_fragments_as_swcs.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function generate_fragments_as_swcs(input_folder_path, ...
1515
full_trees_to_process_count = length(full_tree_file_names) ;
1616
tic_id = tic() ;
1717
fprintf('Starting the big parfor loop, going to process %d full trees...\n', full_trees_to_process_count) ;
18-
parfor_progress(full_trees_to_process_count) ;
18+
pbo = progress_bar_object(full_trees_to_process_count) ;
1919
for full_tree_index = 1 : full_trees_to_process_count ,
2020
full_tree_file_name = full_tree_file_names{full_tree_index} ;
2121
full_tree_mat_file_path = fullfile(input_folder_path, full_tree_file_name) ;
@@ -27,8 +27,8 @@ function generate_fragments_as_swcs(input_folder_path, ...
2727
bounding_box_high_corner_xyz) ;
2828

2929
% Update the progress bar
30-
parfor_progress() ;
30+
pbo.update() ;
3131
end
32-
parfor_progress(0) ;
32+
%pbo = progress_bar_object(0) ;
3333
toc(tic_id) ;
3434
end

landmark-matching/landmark_match_all_tiles_in_z.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function landmark_match_all_tiles_in_z( ...
7373
is_to_be_matched_from_pair_index = true(pair_count, 1) ;
7474
else
7575
is_to_be_matched_from_pair_index = true(pair_count,1) ;
76-
parfor_progress(pair_count) ;
76+
pbo = progress_bar_object(pair_count) ;
7777
parfor pair_index = 1 : pair_count
7878
central_tile_relative_path = central_tile_relative_path_from_pair_index{pair_index} ;
7979
channel_0_tile_file_name = sprintf('channel-%d-match-Z.mat', 0) ;
@@ -83,9 +83,9 @@ function landmark_match_all_tiles_in_z( ...
8383
is_to_be_matched = ...
8484
~(exist(channel_0_tile_file_path, 'file') && exist(channel_1_tile_file_path, 'file')) ;
8585
is_to_be_matched_from_pair_index(pair_index) = is_to_be_matched ;
86-
parfor_progress() ;
86+
pbo.update() ;
8787
end
88-
parfor_progress(0) ;
88+
%pbo = progress_bar_object(0) ;
8989
end
9090
fprintf('Done determining which of the %d eligible tiles need to be landmark-matched.\n', pair_count) ;
9191
pair_index_from_tile_to_be_matched_index = find(is_to_be_matched_from_pair_index) ;
@@ -97,7 +97,7 @@ function landmark_match_all_tiles_in_z( ...
9797

9898
% Run z point match on all tiles
9999
fprintf('Running z-point-matching on %d tile pairs...\n', tile_to_be_matched_count) ;
100-
parfor_progress(tile_to_be_matched_count) ;
100+
pbo = progress_bar_object(tile_to_be_matched_count) ;
101101
parfor tile_to_be_matched_index = 1 : tile_to_be_matched_count ,
102102
center_tile_relative_path = central_tile_relative_path_from_tile_to_be_matched_index{tile_to_be_matched_index} ;
103103
other_tile_relative_path = other_tile_relative_path_from_tile_to_be_matched_index{tile_to_be_matched_index} ;
@@ -108,9 +108,9 @@ function landmark_match_all_tiles_in_z( ...
108108
center_tile_relative_path, ...
109109
central_tile_ijk1, ...
110110
other_tile_relative_path)
111-
parfor_progress() ;
111+
pbo.update() ;
112112
end
113-
parfor_progress(0) ;
113+
%pbo = progress_bar_object(0) ;
114114

115115
% Declare victory
116116
fprintf('Done running z-point-match for all tiles.\n') ;

landmark-matching/pointmatch_all_pairs_2021_11_26.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
% Run z point match on all tiles
5151
fprintf('Running z-point-matching on %d valid tile pairs...\n', pair_count) ;
52-
parfor_progress(pair_count) ;
52+
pbo = progress_bar_object(pair_count) ;
5353
parfor pair_index = 1 : pair_count ,
5454
center_tile_relative_path = central_tile_relative_path_from_pair_index{pair_index} ;
5555
other_tile_relative_path = other_tile_relative_path_from_pair_index{pair_index} ;
@@ -60,9 +60,9 @@
6060
center_tile_relative_path, ...
6161
central_tile_ijk1, ...
6262
other_tile_relative_path)
63-
parfor_progress() ;
63+
pbo.update() ;
6464
end
65-
parfor_progress(0) ;
65+
%pbo = progress_bar_object(0) ;
6666

6767
% Declare victory
6868
fprintf('Done running z-point-match for all tiles.\n') ;

0 commit comments

Comments
 (0)