Skip to content

Commit 79fac63

Browse files
authored
Merge pull request #6901 from BOINC/dpa_batch_collect
terminology and filename change
2 parents 52ece40 + 4a71134 commit 79fac63

File tree

14 files changed

+95
-47
lines changed

14 files changed

+95
-47
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ sched/get_file
196196
sched/make_work
197197
sched/message_handler
198198
sched/put_file
199-
sched/sample_assimilator
199+
sched/batch_collect_assimilator
200200
sched/sample_bitwise_validator
201201
sched/sample_dummy_assimilator
202202
sched/sample_substr_validator

gl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BOINC.
22
// https://boinc.berkeley.edu
3-
// Copyright (C) 2025 University of California
3+
// Copyright (C) 2026 University of California
44
//
55
// BOINC is free software; you can redistribute it and/or modify it
66
// under the terms of the GNU Lesser General Public License

html/inc/submit_util.inc

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ function get_outfile_phys_names($result) {
285285
return $names;
286286
}
287287

288+
// return two corresponding lists:
289+
// - logical names of output files
290+
// - whether files are gzipped (they may not have .gz extension)
291+
// TODO: return a list of pairs
292+
//
288293
function get_outfile_log_names($result) {
289294
$xml = "<a>".$result->xml_doc_in."</a>";
290295
$r = simplexml_load_string($xml);
@@ -302,7 +307,7 @@ function get_outfile_log_names($result) {
302307
return [$names, $gzip];
303308
}
304309

305-
// get output file paths for non-assim-move apps
310+
// get output file paths for batch-static apps
306311
//
307312
function get_outfile_paths($result) {
308313
$fanout = parse_config(get_config(), "<uldl_dir_fanout>");
@@ -319,15 +324,19 @@ function get_outfile_paths($result) {
319324
return $paths;
320325
}
321326

322-
// the path of an output file in the 'assim move' scheme.
327+
// Return the path of an output file in the 'batch-collect' paradigm.
323328
// This must agree with the corresponding assimilators:
324-
// tools/sample_assimilate.py
325-
// sched/sample_assimilator.cpp
329+
// tools/batch_collect_assimilate.py
330+
// sched/batch_collect_assimilator.cpp
326331
// and with tools/query_job
327332
//
328-
function assim_move_outfile_path($wu, $index, $log_names, $gzip) {
329-
if (!is_valid_filename($wu->name)) error_page("bad WU name");
330-
if (!is_valid_filename($log_names[$index])) error_page("bad logical name");
333+
function batch_collect_outfile_path($wu, $index, $log_names, $gzip) {
334+
if (!is_valid_filename($wu->name)) {
335+
error_page("bad WU name");
336+
}
337+
if (!is_valid_filename($log_names[$index])) {
338+
error_page("bad logical name");
339+
}
331340
return sprintf('../../results/%d/%s__file_%s%s',
332341
$wu->batch, $wu->name, $log_names[$index],
333342
$gzip[$index]?'.gz':''
@@ -424,10 +433,12 @@ function retire_batch($batch) {
424433
}
425434
}
426435

436+
// batches can have 'expiration times' when they automatically get retired
437+
// if you run html/ops/expire_batches
438+
//
427439
function expire_batch($batch) {
428440
abort_batch($batch);
429441
retire_batch($batch);
430-
$batch->update("state=".BATCH_STATE_EXPIRED);
431442
}
432443

433444
function batch_state_string($state) {
@@ -440,7 +451,7 @@ function batch_state_string($state) {
440451
}
441452
return "unknown state $state";
442453
}
443-
// get the total size of output files of a batch for non-assim-move apps
454+
// get the total size of output files of a batch for batch-static apps
444455
// (i.e. files are in the upload hier)
445456
//
446457
function batch_output_file_size($batchid) {

html/user/get_output2.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
1919

2020
// web API for fetching output files.
21-
// This is for apps that don't use an assimilator
22-
// that moves output files into project/results/...
21+
// This is for apps that don't use the batch-collect paradigm.
2322
// I.e., the output files are in the upload hierarchy with physical names
2423
//
25-
// For assim_move apps, use get_output3.php instead of this.
24+
// For batch_collect apps, use get_output3.php instead of this.
2625

2726
// This is an updated version of get_output.php;
2827
// I didn't want to change that on the (unlikely) chance

html/user/get_output3.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
1919

2020
// get output files, individually or zipped groups,
21-
// for apps that use the 'assim move' scheme
21+
// for apps that use the 'batch-collect' paradigm
22+
// implemented by batch_collect_assimilator.cpp and batch_collect_assimilate.py:
23+
// <project>/results/<batchid>/ (0 if not in a batch)
2224
//
2325
// args:
2426
// action: get_file or get_batch
@@ -28,9 +30,6 @@
2830
// get_batch:
2931
// batch_id
3032
// downloads zip of batch's output files
31-
// Assumes the layout used by sample_assimilator.cpp
32-
// and sample_assimilate.py:
33-
// <project>/results/<batchid>/ (0 if not in a batch)
3433

3534
require_once("../inc/util.inc");
3635
require_once("../inc/submit_util.inc");
@@ -68,7 +67,7 @@ function get_file() {
6867
if ($index >= count($log_names)) {
6968
error_page('bad index');
7069
}
71-
$path = assim_move_outfile_path($wu, $index, $log_names, $gzip);
70+
$path = batch_collect_outfile_path($wu, $index, $log_names, $gzip);
7271

7372
if (get_str('download', true)) {
7473
do_download($path);

html/user/show_apps.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
<?php
2+
// This file is part of BOINC.
3+
// https://boinc.berkeley.edu
4+
// Copyright (C) 2026 University of California
5+
//
6+
// BOINC is free software; you can redistribute it and/or modify it
7+
// under the terms of the GNU Lesser General Public License
8+
// as published by the Free Software Foundation,
9+
// either version 3 of the License, or (at your option) any later version.
10+
//
11+
// BOINC is distributed in the hope that it will be useful,
12+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
// See the GNU Lesser General Public License for more details.
15+
//
16+
// You should have received a copy of the GNU Lesser General Public License
17+
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
18+
19+
// Show a list of applications provided by the project,
20+
// including BUDA science apps.
21+
// This assumes that you have created a file html/project/remote_apps.inc
22+
// describing these applications.
23+
// Intended for BOINC Central type projects.
224

325
require_once('../inc/util.inc');
426
require_once('../inc/buda.inc');

html/user/submit.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ function handle_query_batch($user) {
677677
$owner = BoincUser::lookup_id($batch->user_id);
678678
}
679679

680-
$is_assim_move = is_assim_move($app);
680+
$is_batch_collect = is_batch_collect($app);
681681

682682
page_head("Batch $batch_id");
683683
text_start(800);
@@ -708,15 +708,15 @@ function handle_query_batch($user) {
708708
}
709709
row2("GFLOP/hours, estimated", number_format(credit_to_gflop_hours($batch->credit_estimate), 2));
710710
row2("GFLOP/hours, actual", number_format(credit_to_gflop_hours($batch->credit_canonical), 2));
711-
if (!$is_assim_move) {
711+
if (!$is_batch_collect) {
712712
row2("Total size of output files",
713713
size_string(batch_output_file_size($batch->id))
714714
);
715715
}
716716
end_table();
717717

718718
echo "<p>";
719-
if ($is_assim_move) {
719+
if ($is_batch_collect) {
720720
//if (is_batch_gzipped($wus)) {
721721
if (true) {
722722
$url = "get_output3.php?action=get_batch_tar&batch_id=$batch->id";
@@ -824,16 +824,15 @@ function handle_query_batch($user) {
824824
page_tail();
825825
}
826826

827-
// Does the assimilator for the given app move output files
828-
// to a results/<batchid>/ directory?
827+
// Does the app use the batch-collect paradigm?
829828
// This info is stored in the $remote_apps data structure in project.inc
830829
//
831-
function is_assim_move($app) {
830+
function is_batch_collect($app) {
832831
global $remote_apps;
833832
foreach ($remote_apps as $category => $apps) {
834833
foreach ($apps as $web_app) {
835834
if ($web_app->app_name == $app->name) {
836-
return $web_app->is_assim_move;
835+
return $web_app->batch_collect;
837836
}
838837
}
839838
}
@@ -848,7 +847,7 @@ function handle_query_job($user) {
848847
if (!$wu) error_page("no such job");
849848

850849
$app = BoincApp::lookup_id($wu->appid);
851-
$is_assim_move = is_assim_move($app);
850+
$is_batch_collect = is_batch_collect($app);
852851

853852
page_head("Job '$wu->name'");
854853

@@ -886,13 +885,15 @@ function handle_query_job($user) {
886885
$result->priority
887886
];
888887
$files = [];
889-
if ($is_assim_move) {
888+
if ($is_batch_collect) {
890889
if ($result->id == $wu->canonical_resultid) {
891890
[$log_names, $gzip] = get_outfile_log_names($result);
892891
$nfiles = count($log_names);
893892
for ($i=0; $i<$nfiles; $i++) {
894893
$name = $log_names[$i];
895-
$path = assim_move_outfile_path($wu, $i, $log_names, $gzip);
894+
$path = batch_collect_outfile_path(
895+
$wu, $i, $log_names, $gzip
896+
);
896897
if (file_exists($path)) {
897898
$y = sprintf('%s (%s): ',
898899
$name, size_string(filesize($path))

py/Boinc/setup_project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def dest(*dirs):
405405
'pshelper',
406406
'put_file',
407407
'pymw_assimilator.py',
408-
'sample_assimilator',
408+
'batch_collect_assimilator',
409409
'sample_bitwise_validator',
410410
'sample_dummy_assimilator',
411411
'sample_substr_validator',
@@ -442,7 +442,7 @@ def dest(*dirs):
442442
'parse_config',
443443
'query_job',
444444
'run_in_ops',
445-
'sample_assimilate.py',
445+
'batch_collect_assimilate.py',
446446
'sign_executable',
447447
'stage_file',
448448
'stage_file_native',

sched/Makefile.am

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ schedbin_PROGRAMS = \
103103

104104
schedshare_PROGRAMS = \
105105
antique_file_deleter \
106+
batch_collect_assimilator \
106107
census \
107108
credit_test \
108109
db_dump \
@@ -111,7 +112,6 @@ schedshare_PROGRAMS = \
111112
feeder_user \
112113
file_deleter \
113114
message_handler \
114-
sample_assimilator \
115115
sample_bitwise_validator \
116116
sample_dummy_assimilator \
117117
sample_substr_validator \
@@ -188,6 +188,10 @@ cgi_sources = \
188188
cgi_SOURCES = $(cgi_sources)
189189
cgi_LDADD = $(SERVERLIBS)
190190

191+
batch_collect_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
192+
batch_collect_assimilator.cpp
193+
batch_collect_assimilator_LDADD = $(SERVERLIBS)
194+
191195
census_SOURCES = \
192196
census.cpp \
193197
hr.cpp \
@@ -248,10 +252,6 @@ sample_dummy_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
248252
sample_dummy_assimilator.cpp
249253
sample_dummy_assimilator_LDADD = $(SERVERLIBS)
250254

251-
sample_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
252-
sample_assimilator.cpp
253-
sample_assimilator_LDADD = $(SERVERLIBS)
254-
255255
single_job_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
256256
single_job_assimilator.cpp
257257
single_job_assimilator_LDADD = $(SERVERLIBS)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// You should have received a copy of the GNU Lesser General Public License
1616
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
1717

18-
// A sample assimilator that:
18+
// An assimilator that implements the batch-collect paradigm:
1919
// 1) if success, copy the output file(s) to a directory
2020
// ../results/<batchid>/<wu_name>__file_<log_name>
2121
// where <log_name> is the file's logical name

0 commit comments

Comments
 (0)