*** empty log message ***

svn path=/trunk/boinc/; revision=6048
This commit is contained in:
Rom Walton 2005-05-05 22:28:17 +00:00
parent 31b1dbbc02
commit 8d7b398b00
7 changed files with 63 additions and 12 deletions

View File

@ -6199,3 +6199,23 @@ David 5 May 2005
team.inc
user/
team_display.php
Rom 5 May 2005
- When running benchmarks, close down and remove science applications
from memory. If a science application isn't listening to the quit request
it may not be responding to suspend/resume either which would cause problems
during the benchmark process.
- If a science application doesn't shutdown within 10 seconds, kill it.
- Fix the bug I introduced last night with the view statistics tab.
- Make suspend_all call atp->preempt() instead of doing the same thing itself.
- Move the starting benchmark message to a place right before the benchmarks
start. We were receiving a few process control messages and people might
interpret that to mean other stuff was going on during the benchmarks.
client/
app.C, .h
app_control.C
cs_benchmark.C
cs_prefs.C
clientgui/
ViewStatistics.cpp

View File

@ -212,6 +212,7 @@ bool ACTIVE_TASK_SET::poll(double now) {
graphics_poll();
process_control_poll();
action |= check_rsc_limits_exceeded();
action |= check_quit_timeout_exceeded();
if (get_msgs()) {
action = true;
}

View File

@ -124,6 +124,8 @@ public:
bool have_trickle_down;
bool send_upload_file_status;
bool pending_suspend_via_quit; // waiting for task to suspend via quit
double pending_suspend_via_quit_time; // check to see if the application has quit
// before timing out, otherwise kill it.
APP_CLIENT_SHM app_client_shm; // core/app shared mem
MSG_QUEUE graphics_request_queue;
@ -203,6 +205,7 @@ public:
bool get_msgs();
bool check_app_exited();
bool check_rsc_limits_exceeded();
bool check_quit_timeout_exceeded();
bool vm_limit_exceeded(double);
int get_free_slot();
void send_heartbeats();

View File

@ -171,6 +171,7 @@ int ACTIVE_TASK::preempt(bool quit_task) {
if (quit_task) {
retval = request_exit();
pending_suspend_via_quit = true;
pending_suspend_via_quit_time = dtime();
} else {
retval = suspend();
}
@ -541,6 +542,29 @@ bool ACTIVE_TASK_SET::check_rsc_limits_exceeded() {
return false;
}
// Check if any of the active tasks have exceeded their
// timeout to quit gracefully
//
bool ACTIVE_TASK_SET::check_quit_timeout_exceeded() {
unsigned int j;
ACTIVE_TASK *atp;
double now = dtime();
for (j=0;j<active_tasks.size();j++) {
atp = active_tasks[j];
if (atp->task_state != PROCESS_EXECUTING) continue;
if (atp->scheduler_state != CPU_SCHED_PREEMPTED) continue;
if (atp->pending_suspend_via_quit) {
if ((now - atp->pending_suspend_via_quit_time) > 10.0) {
atp->kill_task();
return true;
}
}
}
return false;
}
// If process is running, send it a kill signal
// This is done when app has exceeded CPU, disk, or mem limits
//
@ -723,12 +747,7 @@ void ACTIVE_TASK_SET::suspend_all(bool leave_apps_in_memory) {
atp = active_tasks[i];
if (atp->task_state != PROCESS_EXECUTING) continue;
if (atp->result->project->non_cpu_intensive) continue;
if (leave_apps_in_memory) {
atp->suspend();
} else {
atp->request_exit();
atp->pending_suspend_via_quit = true;
}
atp->preempt(!leave_apps_in_memory);
}
}

View File

@ -186,7 +186,6 @@ void CLIENT_STATE::start_cpu_benchmarks() {
remove_benchmark_file(BM_TYPE_INT);
cpu_benchmarks_start = dtime();
msg_printf(NULL, MSG_INFO, "Running CPU benchmarks");
if (!benchmark_descs) {
benchmark_descs = (BENCHMARK_DESC*)calloc(
host_info.p_ncpus, sizeof(BENCHMARK_DESC)
@ -297,6 +296,7 @@ bool CLIENT_STATE::cpu_benchmarks_poll() {
switch (bm_state) {
case BM_FP_INIT:
if (now - cpu_benchmarks_start > FP_START) {
msg_printf(NULL, MSG_INFO, "Running CPU benchmarks");
make_benchmark_file(BM_TYPE_FP);
bm_state = BM_FP;
}

View File

@ -188,7 +188,11 @@ int CLIENT_STATE::suspend_activities(int reason) {
s_reason += " - out of disk space - change global prefs";
}
msg_printf(NULL, MSG_INFO, const_cast<char*>(s_reason.c_str()));
active_tasks.suspend_all(global_prefs.leave_apps_in_memory);
if (reason & SUSPEND_REASON_BENCHMARKS) {
active_tasks.suspend_all(false);
} else {
active_tasks.suspend_all(global_prefs.leave_apps_in_memory);
}
pers_file_xfers->suspend();
return 0;
}

View File

@ -361,7 +361,6 @@ void CViewStatistics::OnStatisticsUserTotal( wxCommandEvent& event ) {
pFrame->UpdateStatusText(_("Updating charts..."));
m_PaintStatistics->heading=_("User Total");
m_PaintStatistics->m_SelectedStatistic=0;
m_PaintStatistics->Refresh();
pFrame->UpdateStatusText(wxT(""));
UpdateSelection();
@ -382,7 +381,6 @@ void CViewStatistics::OnStatisticsUserAverage( wxCommandEvent& event ) {
pFrame->UpdateStatusText(_("Updating charts..."));
m_PaintStatistics->heading=_("User Average");
m_PaintStatistics->m_SelectedStatistic=1;
m_PaintStatistics->Refresh();
pFrame->UpdateStatusText(wxT(""));
UpdateSelection();
@ -403,7 +401,6 @@ void CViewStatistics::OnStatisticsHostTotal( wxCommandEvent& event ) {
pFrame->UpdateStatusText(_("Updating charts..."));
m_PaintStatistics->heading=_("Host Total");
m_PaintStatistics->m_SelectedStatistic=2;
m_PaintStatistics->Refresh();
pFrame->UpdateStatusText(wxT(""));
UpdateSelection();
@ -424,7 +421,6 @@ void CViewStatistics::OnStatisticsHostAverage( wxCommandEvent& event ) {
pFrame->UpdateStatusText(_("Updating charts..."));
m_PaintStatistics->heading=_("Host Average");
m_PaintStatistics->m_SelectedStatistic=3;
m_PaintStatistics->Refresh();
pFrame->UpdateStatusText(wxT(""));
UpdateSelection();
@ -461,6 +457,14 @@ bool CViewStatistics::OnRestoreState(wxConfigBase* pConfig) {
void CViewStatistics::OnListRender( wxTimerEvent& event ) {
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
if (pDoc->GetStatisticsCount()) {
m_PaintStatistics->Refresh();
}
}