static void list_status_header(STATUS_PKT *sp) { int len; char dt[MAX_TIME_LENGTH]; POOL_MEM msg(PM_MESSAGE); char b1[32], b2[32], b3[32], b4[32], b5[35]; #if defined(HAVE_WIN32) char buf[300]; #endif len = Mmsg(msg, _("%s Version: %s (%s) %s %s %s %s\n"), my_name, VERSION, BDATE, VSS, HOST_OS, DISTNAME, DISTVER); sendit(msg, len, sp); bstrftime_nc(dt, sizeof(dt), daemon_start_time); len = Mmsg(msg, _("Daemon started %s. Jobs: run=%d running=%d.\n"), dt, num_jobs_run, job_count()); sendit(msg, len, sp); #if defined(HAVE_WIN32) if (GetWindowsVersionString(buf, sizeof(buf))) { len = Mmsg(msg, "%s\n", buf); sendit(msg, len, sp); } if (debug_level > 0) { if (!privs) { privs = enable_backup_privileges(NULL, 1); } len = Mmsg(msg, "Priv 0x%x\n", privs); sendit(msg, len, sp); len = Mmsg(msg, "APIs=%sOPT,%sATP,%sLPV,%sCFA,%sCFW,\n", p_OpenProcessToken ? "" : "!", p_AdjustTokenPrivileges ? "" : "!", p_LookupPrivilegeValue ? "" : "!", p_CreateFileA ? "" : "!", p_CreateFileW ? "" : "!"); sendit(msg, len, sp); len = Mmsg(msg, " %sWUL,%sWMKD,%sGFAA,%sGFAW,%sGFAEA,%sGFAEW,%sSFAA,%sSFAW,%sBR,%sBW,%sSPSP,\n", p_wunlink ? "" : "!", p_wmkdir ? "" : "!", p_GetFileAttributesA ? "" : "!", p_GetFileAttributesW ? "" : "!", p_GetFileAttributesExA ? "" : "!", p_GetFileAttributesExW ? "" : "!", p_SetFileAttributesA ? "" : "!", p_SetFileAttributesW ? "" : "!", p_BackupRead ? "" : "!", p_BackupWrite ? "" : "!", p_SetProcessShutdownParameters ? "" : "!"); sendit(msg, len, sp); len = Mmsg(msg, " %sWC2MB,%sMB2WC,%sFFFA,%sFFFW,%sFNFA,%sFNFW,%sSCDA,%sSCDW,\n", p_WideCharToMultiByte ? "" : "!", p_MultiByteToWideChar ? "" : "!", p_FindFirstFileA ? "" : "!", p_FindFirstFileW ? "" : "!", p_FindNextFileA ? "" : "!", p_FindNextFileW ? "" : "!", p_SetCurrentDirectoryA ? "" : "!", p_SetCurrentDirectoryW ? "" : "!"); sendit(msg, len, sp); len = Mmsg(msg, " %sGCDA,%sGCDW,%sGVPNW,%sGVNFVMPW\n", p_GetCurrentDirectoryA ? "" : "!", p_GetCurrentDirectoryW ? "" : "!", p_GetVolumePathNameW ? "" : "!", p_GetVolumeNameForVolumeMountPointW ? "" : "!"); sendit(msg, len, sp); } #endif len = Mmsg(msg, _(" Heap: heap=%s smbytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"), edit_uint64_with_commas((char *)sbrk(0)-(char *)start_heap, b1), edit_uint64_with_commas(sm_bytes, b2), edit_uint64_with_commas(sm_max_bytes, b3), edit_uint64_with_commas(sm_buffers, b4), edit_uint64_with_commas(sm_max_buffers, b5)); sendit(msg, len, sp); len = Mmsg(msg, _(" Sizeof: boffset_t=%d size_t=%d debug=%d trace=%d " "bwlimit=%skB/s\n"), sizeof(boffset_t), sizeof(size_t), debug_level, get_trace(), edit_uint64_with_commas(me->max_bandwidth_per_job / 1024, b1)); sendit(msg, len, sp); if (me->secure_erase_cmdline) { len = Mmsg(msg, _(" secure erase command='%s'\n"), me->secure_erase_cmdline); sendit(msg, len, sp); } len = list_fd_plugins(msg); if (len > 0) { sendit(msg, len, sp); } }
void show_resource(int rsc_type) { unsigned int i; char buf[256]; fprintf(html_out, "<td width=%d valign=top>", WIDTH2); bool found = false; for (i=0; i<gstate.active_tasks.active_tasks.size(); i++) { ACTIVE_TASK* atp = gstate.active_tasks.active_tasks[i]; RESULT* rp = atp->result; if (atp->task_state() != PROCESS_EXECUTING) continue; double ninst=0; if (rsc_type) { if (rp->avp->gpu_usage.rsc_type != rsc_type) continue; ninst = rp->avp->gpu_usage.usage; } else { ninst = rp->avp->avg_ncpus; } PROJECT* p = rp->project; if (!found) { found = true; fprintf(html_out, "<table>\n" "<tr><th>#devs</th><th>Job name (* = high priority)</th><th>GFLOPs left</th>%s</tr>\n", rsc_type?"<th>GPU</th>":"" ); } if (rsc_type) { sprintf(buf, "<td>%d</td>", rp->coproc_indices[0]); } else { safe_strcpy(buf, ""); } fprintf(html_out, "<tr valign=top><td>%.2f</td><td bgcolor=%s><font color=#ffffff>%s%s</font></td><td>%.0f</td>%s</tr>\n", ninst, colors[p->index%NCOLORS], rp->edf_scheduled?"*":"", rp->name, rp->sim_flops_left/1e9, buf ); } if (found) { fprintf(html_out, "</table>\n"); } else { fprintf(html_out, "IDLE\n"); } fprintf(html_out, "<table><tr><td>Project</td><td>In progress</td><td>done</td><td>REC</td></tr>\n" ); found = false; for (i=0; i<gstate.projects.size(); i++) { PROJECT* p = gstate.projects[i]; int in_progress, done; job_count(p, rsc_type, in_progress, done); if (in_progress || done) { fprintf(html_out, "<td bgcolor=%s><font color=#ffffff>%s</font></td><td>%d</td><td>%d</td><td>%.3f</td></tr>\n", colors[p->index%NCOLORS], p->project_name, in_progress, done, p->pwf.rec ); found = true; } } //if (!found) fprintf(html_out, " ---\n"); fprintf(html_out, "</table></td>"); }