Skip to content

Commit

Permalink
Merge pull request #4291 from BOINC/RH_RPC_fix
Browse files Browse the repository at this point in the history
Client: fix app_config write from RPC
  • Loading branch information
AenBleidd authored and Charlie Fenton committed Jun 2, 2021
1 parent 5738127 commit 8ebfa90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
1 change: 0 additions & 1 deletion client/gui_rpc_server_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,6 @@ static void handle_get_app_config(GUI_RPC_CONN& grc) {
return;
}
sprintf(path, "%s/%s", p->project_dir(), APP_CONFIG_FILE_NAME);
printf("path: %s\n", path);
int retval = read_file_string(path, s);
if (retval) {
grc.mfout.printf("<error>app_config.xml not found</error>\n");
Expand Down
40 changes: 21 additions & 19 deletions lib/cc_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,19 +864,21 @@ int APP_CONFIGS::parse_file(FILE* f, MSG_VEC& mv, LOG_FLAGS& log_flags) {

void APP_CONFIGS::write(MIOFILE& out) {
out.printf(
" <app_config>\n"
"<app_config>\n"
);
for (unsigned int i=0; i<app_configs.size(); i++) {
APP_CONFIG& ac = app_configs[i];
out.printf(
" <app>\n"
" <name>%s</name>\n"
" <max_concurrent>%d</max_concurrent>\n"
" <gpu_gpu_usage>%f</gpu_gpu_usage>\n"
" <gpu_cpu_usage>%f</gpu_cpu_usage>\n"
" <fraction_done_exact>%d</fraction_done_exact>\n"
" <report_results_immediately>%d</report_results_immediately>\n"
" </app>\n",
" <app>\n"
" <name>%s</name>\n"
" <max_concurrent>%d</max_concurrent>\n"
" <gpu_versions>\n"
" <gpu_usage>%f</gpu_usage>\n"
" <cpu_usage>%f</cpu_usage>\n"
" </gpu_versions>\n"
" <fraction_done_exact>%d</fraction_done_exact>\n"
" <report_results_immediately>%d</report_results_immediately>\n"
" </app>\n",
ac.name,
ac.max_concurrent,
ac.gpu_gpu_usage,
Expand All @@ -888,13 +890,13 @@ void APP_CONFIGS::write(MIOFILE& out) {
for (unsigned int i=0; i<app_version_configs.size(); i++) {
APP_VERSION_CONFIG& avc = app_version_configs[i];
out.printf(
" <app_version>\n"
" <app_name>%s</app_name>\n"
" <plan_class>%s</plan_class>\n"
" <cmdline>%s</cmdline>\n"
" <avg_ncpus>%f</avg_ncpus>\n"
" <ngpus>%f</ngpus>\n"
" </app_version>\n",
" <app_version>\n"
" <app_name>%s</app_name>\n"
" <plan_class>%s</plan_class>\n"
" <cmdline>%s</cmdline>\n"
" <avg_ncpus>%f</avg_ncpus>\n"
" <ngpus>%f</ngpus>\n"
" </app_version>\n",
avc.app_name,
avc.plan_class,
avc.cmdline,
Expand All @@ -903,9 +905,9 @@ void APP_CONFIGS::write(MIOFILE& out) {
);
}
out.printf(
" <project_max_concurrent>%d</project_max_concurrent>\n"
" <report_results_immediately>%d</report_results_immediately>\n"
" </app_config>\n",
" <project_max_concurrent>%d</project_max_concurrent>\n"
" <report_results_immediately>%d</report_results_immediately>\n"
"</app_config>\n",
project_max_concurrent,
report_results_immediately?1:0
);
Expand Down

0 comments on commit 8ebfa90

Please sign in to comment.