From a7c1f63568638c3379798b904c7e8822397deaad Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Wed, 28 May 2003 22:27:58 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=1254 --- api/boinc_api.C | 17 +++++++++-------- api/boinc_api.h | 4 ++-- test/test_uc_win.php | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/api/boinc_api.C b/api/boinc_api.C index 7d442cc8cf..e9cbd76c74 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -253,7 +253,7 @@ void boinc_quit(int sig) { #endif int boinc_finish(int status) { - double cur_mem; + int cur_mem; boinc_cpu_time(last_checkpoint_cpu_time, cur_mem); update_app_progress(fraction_done, last_checkpoint_cpu_time, last_checkpoint_cpu_time, cur_mem); @@ -317,7 +317,8 @@ bool boinc_time_to_checkpoint() { #endif if (write_frac_done) { - double cur_cpu, cur_mem; + double cur_cpu; + int cur_mem; boinc_cpu_time(cur_cpu, cur_mem); update_app_progress(fraction_done, cur_cpu, last_checkpoint_cpu_time, cur_mem); time_until_fraction_done_update = aid.fraction_done_update_period; @@ -334,7 +335,7 @@ bool boinc_time_to_checkpoint() { } int boinc_checkpoint_completed() { - double cur_mem; + int cur_mem; boinc_cpu_time(last_checkpoint_cpu_time, cur_mem); update_app_progress(fraction_done, last_checkpoint_cpu_time, last_checkpoint_cpu_time, cur_mem); ready_to_checkpoint = false; @@ -362,7 +363,7 @@ int boinc_child_done(double cpu) { return 0; } -int boinc_cpu_time(double &cpu_t, double &ws_t) { +int boinc_cpu_time(double &cpu_t, int &ws_t) { double cpu_secs; // Start with the CPU time from previous runs, then @@ -381,7 +382,7 @@ int boinc_cpu_time(double &cpu_t, double &ws_t) { cpu_secs += (double)ru.ru_utime.tv_sec + (((double)ru.ru_utime.tv_usec) / ((double)1000000.0)); cpu_secs += (double)ru.ru_stime.tv_sec + (((double)ru.ru_stime.tv_usec) / ((double)1000000.0)); cpu_t = cpu_secs; - ws_t = getpagesize()*ru.ru_maxrss; + ws_t = ru.ru_idrss; return 0; #else #ifdef _WIN32 @@ -553,14 +554,14 @@ void cleanup_shared_mem(void) { } -int update_app_progress(double frac_done, double cpu_t, double cp_cpu_t, double ws_t) { +int update_app_progress(double frac_done, double cpu_t, double cp_cpu_t, int ws_t) { char msg_buf[SHM_SEG_SIZE]; sprintf( msg_buf, "%2.8f\n" "%10.4f\n" - "%10.4f\n", - "%10.4f\n", + "%10.4f\n" + "%d\n", frac_done, cpu_t, cp_cpu_t, ws_t ); diff --git a/api/boinc_api.h b/api/boinc_api.h index f887d37ce5..97855e7c86 100755 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -87,9 +87,9 @@ extern int boinc_child_done(double); #define SHM_PREFIX "shm_" #define QUIT_PREFIX "quit_" -extern int boinc_cpu_time(double &, double &); // CPU time and memory usage for this process +extern int boinc_cpu_time(double &, int &); // CPU time and memory usage for this process extern int boinc_install_signal_handlers(); -extern int update_app_progress(double, double, double, double); +extern int update_app_progress(double, double, double, int); #define STDERR_FILE "stderr.txt" diff --git a/test/test_uc_win.php b/test/test_uc_win.php index 51c15703cd..d05e37d7ae 100644 --- a/test/test_uc_win.php +++ b/test/test_uc_win.php @@ -13,7 +13,7 @@ $platform->name = "windows_intelx86"; $platform->user_friendly_name = "Windows"; $app_version->platform = $platform; - $app_version->exec_name = "upper_case.exe"; + array_push($app_version->exec_names, "upper_case.exe"); $work = new Work($app); $work->wu_template = "uc_wu";