/*----------------------------------------------------------------------------*/ void gw_host_print(FILE *fd, gw_host_t *host) { int i; char str[500]; if (host != NULL) { pthread_mutex_lock(&(host->mutex)); gw_print (fd,"IM",'I',"\t-------------- Host info. --------------\n"); gw_print (fd,"IM",'I',"\tName = %s\n", GWNSTR(host->hostname)); gw_print (fd,"IM",'I',"\tOS = %s %s\n", GWNSTR(host->os_name), GWNSTR(host->os_version)); gw_print (fd,"IM",'I',"\tCPU = %s (%s) at %i MHz\n", GWNSTR(host->cpu_model), GWNSTR(host->arch), host->cpu_mhz); gw_print (fd,"IM",'I',"\tMem = %i of %i MB\n", host->free_mem_mb, host->size_mem_mb); gw_print (fd,"IM",'I',"\tDisk = %i of %i MB\n", host->free_disk_mb, host->size_disk_mb); gw_print (fd,"IM",'I',"\tLRMS = %s (%s) with %i nodes\n", GWNSTR(host->lrms_type), GWNSTR(host->lrms_name), host->nodecount); if (host->queue_name[0] != NULL) gw_print (fd,"IM",'I',"\t NC FNC MT MCT MC MRJ MJQ\n"); for (i = 0; i<GW_HOST_MAX_QUEUES; i++) { if (host->queue_name[i] != NULL) { sprintf (str,"QUEUE= %-8s (%3i %3i %5i %5i %3i %3i %3i)", GWNSTR(host->queue_name[i]), host->queue_nodecount[i], host->queue_freenodecount[i], host->queue_maxtime[i], host->queue_maxcputime[i], host->queue_maxcount[i], host->queue_maxrunningjobs[i], host->queue_maxjobsinqueue[i]); if (host->queue_status[i] != NULL) sprintf (str, "%s, %s status", str, GWNSTR(host->queue_status[i])); if (host->queue_dispatchtype[i] != NULL) sprintf (str, "%s, %s type", str, GWNSTR(host->queue_dispatchtype[i])); if (host->queue_priority[i] != NULL) sprintf (str, "%s, %s priority", str, GWNSTR(host->queue_priority[i])); gw_print (fd, "IM",'I',"\t%s\n", str); } } gw_print (fd,"IM",'I',"\t-----------------------------------------\n"); pthread_mutex_unlock(&(host->mutex)); } }
//! //! @brief Sets up a print preview for the results //! G_MODULE_EXPORT void gw_print_preview_cb (GtkWidget *widget, gpointer data) { GwSearchWindow *window; GwApplication *application; window = GW_SEARCHWINDOW (gtk_widget_get_ancestor (GTK_WIDGET (data), GW_TYPE_SEARCHWINDOW)); if (window == NULL) return; application = gw_window_get_application (GW_WINDOW (window)); gw_application_block_searches (application); gw_print (GTK_PRINT_OPERATION_ACTION_PREVIEW, window); gw_application_unblock_searches (application); }
//! //! @brief Sets up a print operation for the current results //! //! The function checks the results of the results text buffer, and then attempts //! to set up a print operation. If a section of the search results are highlighted //! only those results are printed. //! G_MODULE_EXPORT void gw_print_cb (GSimpleAction *action, GVariant *parameter, gpointer data) { GwSearchWindow *window; GwApplication *application; window = GW_SEARCHWINDOW (gtk_widget_get_ancestor (GTK_WIDGET (data), GW_TYPE_SEARCHWINDOW)); if (window == NULL) return; application = gw_window_get_application (GW_WINDOW (window)); gw_application_block_searches (application); gw_print (GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, window); gw_application_unblock_searches (application); }
void gw_job_history_print_record(FILE *fd, gw_history_t *job_history) { gw_print (fd,"DM",'I',"----------- Job history record -----------\n"); if (job_history->host != NULL) gw_host_print(fd, job_history->host); gw_print (fd,"DM",'I',"\tHost GRAM contact = %s\n",job_history->em_rc); gw_print (fd,"DM",'I',"\tRemote job dir = %s\n",job_history->rdir); gw_print (fd,"DM",'I',"\tHost Rank = %i\n",job_history->rank); gw_print (fd,"DM",'I',"\tSubmission tries = %i\n",job_history->tries); gw_print (fd,"DM",'I',"\tStart time = %i\n", (int) job_history->stats[START_TIME]); gw_print (fd,"DM",'I',"\tExit Time = %i\n", (int) job_history->stats[EXIT_TIME]); gw_print (fd,"DM",'I',"\tProlog Time = %i\n", (int) job_history->stats[PROLOG_EXIT_TIME] - (int) job_history->stats[PROLOG_START_TIME]); gw_print (fd,"DM",'I',"\tWrapper Time = %i\n", (int) job_history->stats[WRAPPER_EXIT_TIME] - (int) job_history->stats[WRAPPER_START_TIME]); gw_print (fd,"DM",'I',"\tEpilog Time = %i\n", (int) job_history->stats[EPILOG_EXIT_TIME] - (int) job_history->stats[EPILOG_START_TIME]); gw_print (fd,"DM",'I',"\tMigration Time = %i\n", (int) job_history->stats[MIGRATION_EXIT_TIME] - (int) job_history->stats[MIGRATION_START_TIME]); gw_print (fd,"DM",'I',"------------------------------------------\n"); }