Beispiel #1
0
// write the timeline row(s) for this time
//
void html_rec() {
    if (html_msg.size()) {
        html_write_message();
        html_msg = "";
    }

    if (!active) {
        fprintf(html_out,
            "<tr>"
            "    <td valign=top>%s</td>"
            "    <td colspan=99 valign=top bgcolor=#aaaaaa>BOINC not running</td>"
            "</tr>",
            sim_time_string(gstate.now)
        );
    } else {
        html_device_header();
        fprintf(html_out,
            "<tr><td> </td>\n"
        );
        show_resource(0);
        if (gpu_active) {
            for (int i=1; i<coprocs.n_rsc; i++) {
                show_resource(i);
            }
        } else {
            for (int i=1; i<coprocs.n_rsc; i++) {
                fprintf(html_out, "<td valign=top bgcolor=#aaaaaa>GPUs disabled</td>");
            }
        }
        fprintf(html_out,
            "</tr>\n"
        );
    }
}
Beispiel #2
0
void html_write_message() {
    fprintf(html_out,
        "<tr>"
        "    <td valign=top>%s</td>"
        "    <td colspan=99 valign=top><font size=-2>%s</font></td>"
        "</tr>\n",
        sim_time_string(gstate.now),
        html_msg.c_str()
    );
}
Beispiel #3
0
int ACTIVE_TASK::resume_or_start(bool first_time) {
    if (log_flags.task) {
        msg_printf(result->project, MSG_INFO,
            "[task] %s task %s: FLOPS left %.2fG",
            first_time?"Starting":"Resuming",
            result->name, result->sim_flops_left/1e9
        );
    }
    set_task_state(PROCESS_EXECUTING, "start");
    char buf[256];
    sprintf(buf, "Starting %s<br>&nbsp;&nbsp;%s<br>&nbsp;&nbsp;deadline %s<br>",
        result->name, result->project->get_project_name(),
        sim_time_string(result->report_deadline)
    );
    html_msg += buf;
    return 0;
}
Beispiel #4
0
void html_device_header() {
    fprintf(html_out,
        "<tr>"
        "   <td valign=top>%s</td>"
        "   <th>CPU</th>",
        sim_time_string(gstate.now)
    );
    for (int i=1; i<coprocs.n_rsc; i++) {
        int pt = coproc_type_name_to_num(coprocs.coprocs[i].type);
        const char* name;
        if (pt) {
            name = proc_type_name(pt);
        } else {
            name = coprocs.coprocs[i].type;
        }
        fprintf(html_out, "<th>%s</th>\n", name);
    }
    fprintf(html_out,
        "</tr>\n"
    );
}
Beispiel #5
0
void show_message(PROJ_AM *p, char* msg, int priority, bool, const char*) {
    const char* x;
    char message[1024];

    if (priority == MSG_INTERNAL_ERROR) {
        strcpy(message, "[error] ");
        strlcpy(message+8, msg, sizeof(message)-8);
    } else {
        strlcpy(message, msg, sizeof(message));
    }
    while (strlen(message)&&message[strlen(message)-1] == '\n') {
        message[strlen(message)-1] = 0;
    }

    if (p) {
        x = p->get_project_name();
    } else {
        x = "---";
    }

    fprintf(logfile, "%s [%s] %s\n", sim_time_string(gstate.now), x, message);
}