Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: fix bug where avg_ncpus for anonymous platform apps defaults to zero #6013

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions client/client_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,14 +709,15 @@ int CLIENT_STATE::init() {
}
}

// fill in avp->flops for anonymous platform projects
// fill in resource usage for app versions that are missing it
// (typically anonymous platform)
//
for (i=0; i<app_versions.size(); i++) {
APP_VERSION* avp = app_versions[i];
if (!avp->resource_usage.avg_ncpus) {
avp->resource_usage.avg_ncpus = 1;
}
if (!avp->resource_usage.flops) {
if (!avp->resource_usage.avg_ncpus) {
avp->resource_usage.avg_ncpus = 1;
}
avp->resource_usage.flops = avp->resource_usage.avg_ncpus * host_info.p_fpops;

// for GPU apps, use conservative estimate:
Expand Down
2 changes: 1 addition & 1 deletion client/client_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ void RESOURCE_USAGE::clear() {
rsc_type = 0;
coproc_usage = 0;
gpu_ram = 0;
flops = gstate.host_info.p_fpops;
flops = 0;
cmdline[0] = 0;
missing_coproc = false;
missing_coproc_name[0] = 0;
Expand Down
3 changes: 2 additions & 1 deletion client/cs_statefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,8 @@ int CLIENT_STATE::write_state_file_if_needed() {

// look for app_versions.xml file in project dir.
// If find, get app versions from there,
// and use "anonymous platform" mechanism for this project
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for being the grammar police, but shouldn't the line above say "If found" instead of "If find"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that 'If find' is comment-shorthand for 'If you find it'.

// and mark project as "anonymous platform".
// This is called before parsing client_state.xml
//
void CLIENT_STATE::check_anonymous() {
unsigned int i;
Expand Down
Loading