Skip to content

Commit

Permalink
Merge pull request #5960 from BOINC/dpa_buda6
Browse files Browse the repository at this point in the history
client, server, web: enable BUDA GPU apps
  • Loading branch information
AenBleidd authored Dec 15, 2024
2 parents 4db6de6 + 8e8ccf8 commit 14f7546
Show file tree
Hide file tree
Showing 42 changed files with 783 additions and 441 deletions.
4 changes: 2 additions & 2 deletions client/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ int ACTIVE_TASK::init(RESULT* rp) {
result = rp;
wup = rp->wup;
app_version = rp->avp;
max_elapsed_time = rp->wup->rsc_fpops_bound/rp->avp->flops;
max_elapsed_time = rp->wup->rsc_fpops_bound/rp->resource_usage.flops;
if (max_elapsed_time < MIN_TIME_BOUND) {
msg_printf(wup->project, MSG_INFO,
"Elapsed time limit %f < %f; setting to %f",
Expand Down Expand Up @@ -790,7 +790,7 @@ int ACTIVE_TASK::write_gui(MIOFILE& fout) {
//
double fd = fraction_done;
if (((fd<=0)||(fd>1)) && elapsed_time > 60) {
double est_time = wup->rsc_fpops_est/app_version->flops;
double est_time = wup->rsc_fpops_est/result->resource_usage.flops;
double x = elapsed_time/est_time;
fd = 1 - exp(-x);
}
Expand Down
12 changes: 6 additions & 6 deletions client/app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ int APP_CONFIGS::config_app_versions(PROJECT* p, bool show_warnings) {
for (unsigned int j=0; j<gstate.app_versions.size(); j++) {
APP_VERSION* avp = gstate.app_versions[j];
if (avp->app != app) continue;
if (!avp->gpu_usage.rsc_type) continue;
avp->gpu_usage.usage = ac.gpu_gpu_usage;
avp->avg_ncpus = ac.gpu_cpu_usage;
if (!avp->resource_usage.rsc_type) continue;
avp->resource_usage.coproc_usage = ac.gpu_gpu_usage;
avp->resource_usage.avg_ncpus = ac.gpu_cpu_usage;
}
}
for (i=0; i<app_version_configs.size(); i++) {
Expand All @@ -79,13 +79,13 @@ int APP_CONFIGS::config_app_versions(PROJECT* p, bool show_warnings) {
if (strcmp(avp->plan_class, avc.plan_class)) continue;
found = true;
if (cmdline_len) {
safe_strcpy(avp->cmdline, avc.cmdline);
safe_strcpy(avp->resource_usage.cmdline, avc.cmdline);
}
if (avc.avg_ncpus) {
avp->avg_ncpus = avc.avg_ncpus;
avp->resource_usage.avg_ncpus = avc.avg_ncpus;
}
if (avc.ngpus) {
avp->gpu_usage.usage = avc.ngpus;
avp->resource_usage.coproc_usage = avc.ngpus;
}
}
if (!found) {
Expand Down
6 changes: 3 additions & 3 deletions client/app_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,11 @@ static void limbo_message(ACTIVE_TASK& at) {
// that use the GPU type, in case they're waiting for GPU RAM
//
static void clear_schedule_backoffs(ACTIVE_TASK* atp) {
int rt = atp->result->avp->rsc_type();
int rt = atp->result->resource_usage.rsc_type;
if (rt == RSC_TYPE_CPU) return;
for (unsigned int i=0; i<gstate.results.size(); i++) {
RESULT* rp = gstate.results[i];
if (rp->avp->rsc_type() == rt) {
if (rp->resource_usage.rsc_type == rt) {
rp->schedule_backoff = 0;
}
}
Expand Down Expand Up @@ -895,7 +895,7 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
snprintf(buf, sizeof(buf), "exceeded elapsed time limit %.2f (%.2fG/%.2fG)",
atp->max_elapsed_time,
atp->result->wup->rsc_fpops_bound/1e9,
atp->result->avp->flops/1e9
atp->result->resource_usage.flops/1e9
);
msg_printf(atp->result->project, MSG_INFO,
"Aborting task %s: %s", atp->result->name, buf
Expand Down
22 changes: 11 additions & 11 deletions client/app_start.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void ACTIVE_TASK::init_app_init_data(APP_INIT_DATA& aid) {
aid.rsc_memory_bound = wup->rsc_memory_bound;
aid.rsc_disk_bound = wup->rsc_disk_bound;
aid.computation_deadline = result->computation_deadline();
int rt = app_version->gpu_usage.rsc_type;
int rt = result->resource_usage.rsc_type;
if (rt) {
COPROC& cp = coprocs.coprocs[rt];
if (coproc_type_name_to_num(cp.type) >= 0) {
Expand All @@ -252,14 +252,14 @@ void ACTIVE_TASK::init_app_init_data(APP_INIT_DATA& aid) {
}
aid.gpu_device_num = cp.device_nums[k];
aid.gpu_opencl_dev_index = cp.opencl_device_indexes[k];
aid.gpu_usage = app_version->gpu_usage.usage;
aid.gpu_usage = result->resource_usage.coproc_usage;
} else {
safe_strcpy(aid.gpu_type, "");
aid.gpu_device_num = -1;
aid.gpu_opencl_dev_index = -1;
aid.gpu_usage = 0;
}
aid.ncpus = app_version->avg_ncpus;
aid.ncpus = result->resource_usage.avg_ncpus;
aid.vbox_window = cc_config.vbox_window;
aid.checkpoint_period = gstate.global_prefs.disk_interval;
aid.fraction_done_start = 0;
Expand Down Expand Up @@ -671,8 +671,8 @@ int ACTIVE_TASK::start() {
// - is a wrapper
//
high_priority = false;
if (app_version->rsc_type()) high_priority = true;
if (app_version->avg_ncpus < 1) high_priority = true;
if (result->resource_usage.rsc_type) high_priority = true;
if (result->resource_usage.avg_ncpus < 1) high_priority = true;
if (app_version->is_wrapper) high_priority = true;

current_cpu_time = checkpoint_cpu_time;
Expand Down Expand Up @@ -767,12 +767,12 @@ int ACTIVE_TASK::start() {

snprintf(cmdline, sizeof(cmdline),
"%s %s %s",
exec_path, wup->command_line.c_str(), app_version->cmdline
exec_path, wup->command_line.c_str(), result->resource_usage.cmdline
);
if (!app_version->api_version_at_least(7, 5)) {
int rt = app_version->gpu_usage.rsc_type;
int rt = result->resource_usage.rsc_type;
if (rt) {
coproc_cmdline(rt, result, app_version->gpu_usage.usage, cmdline, sizeof(cmdline));
coproc_cmdline(rt, result, result->resource_usage.coproc_usage, cmdline, sizeof(cmdline));
}
}

Expand Down Expand Up @@ -968,13 +968,13 @@ int ACTIVE_TASK::start() {

snprintf(cmdline, sizeof(cmdline),
"%s %s",
wup->command_line.c_str(), app_version->cmdline
wup->command_line.c_str(), result->resource_usage.cmdline
);

if (!app_version->api_version_at_least(7, 5)) {
int rt = app_version->gpu_usage.rsc_type;
int rt = result->resource_usage.rsc_type;
if (rt) {
coproc_cmdline(rt, result, app_version->gpu_usage.usage, cmdline, sizeof(cmdline));
coproc_cmdline(rt, result, result->resource_usage.coproc_usage, cmdline, sizeof(cmdline));
}
}

Expand Down
12 changes: 6 additions & 6 deletions client/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,17 +713,17 @@ int CLIENT_STATE::init() {
//
for (i=0; i<app_versions.size(); i++) {
APP_VERSION* avp = app_versions[i];
if (!avp->flops) {
if (!avp->avg_ncpus) {
avp->avg_ncpus = 1;
if (!avp->resource_usage.flops) {
if (!avp->resource_usage.avg_ncpus) {
avp->resource_usage.avg_ncpus = 1;
}
avp->flops = avp->avg_ncpus * host_info.p_fpops;
avp->resource_usage.flops = avp->resource_usage.avg_ncpus * host_info.p_fpops;

// for GPU apps, use conservative estimate:
// assume GPU runs at 10X peak CPU speed
//
if (avp->gpu_usage.rsc_type) {
avp->flops += avp->gpu_usage.usage * 10 * host_info.p_fpops;
if (avp->resource_usage.rsc_type) {
avp->resource_usage.flops += avp->resource_usage.coproc_usage * 10 * host_info.p_fpops;
}
}
}
Expand Down
Loading

0 comments on commit 14f7546

Please sign in to comment.