Skip to content
Snippets Groups Projects
Commit 4ea7e781 authored by Moe Jette's avatar Moe Jette
Browse files

Added functions to print job steps to API.

parent 0cb57aab
No related branches found
No related tags found
No related merge requests found
/*****************************************************************************\
* job_info.c - get/print the job state information of slurm
* job_info.c - get/print the job step state information of slurm
*****************************************************************************
* Copyright (C) 2002 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Moe Jette <jette1@llnl.gov> et. al.
* Written by Moe Jette <jette1@llnl.gov>, Joey Ekstrom <ekstrom1@llnl.gov> et. al.
* UCRL-CODE-2002-040.
*
* This file is part of SLURM, a resource management program.
......@@ -35,6 +35,34 @@
#include <src/api/slurm.h>
#include <src/common/slurm_protocol_api.h>
/* slurm_print_job_step_info_msg - output information about all Slurm job steps */
void
slurm_print_job_step_info_msg ( FILE* out, job_step_info_response_msg_t * job_step_info_msg_ptr )
{
int i;
job_step_info_t * job_step_ptr = job_step_info_msg_ptr -> job_steps ;
fprintf( out, "Job steps updated at %ld, record count %d\n",
(long) job_step_info_msg_ptr ->last_update, job_step_info_msg_ptr->job_step_count);
for (i = 0; i < job_step_info_msg_ptr-> job_step_count; i++)
{
slurm_print_job_step_info ( out, & job_step_ptr[i] ) ;
}
}
/* slurm_print_job_step_info - output information about a specific Slurm job step */
void
slurm_print_job_step_info ( FILE* out, job_step_info_t * job_step_ptr )
{
int j;
fprintf ( out, "JobId=%u StepId=%u UserId=%u ",
job_step_ptr->job_id, job_step_ptr->step_id, job_step_ptr->user_id);
fprintf ( out, "StartTime=%ld Partition=%s Nodes=%s\n\n",
(long)job_step_ptr->start_time, job_step_ptr->partition, job_step_ptr->nodes);
}
/* slurm_load_job_steps - issue RPC to get Slurm job_step state information */
int
slurm_get_job_steps ( uint32_t job_id, int16_t step_id, job_step_info_response_msg_t **step_response_pptr)
......
......@@ -118,6 +118,9 @@ extern int slurm_submit_batch_job (job_desc_msg_t * job_desc_msg,
submit_response_msg_t ** slurm_alloc_msg );
extern int slurm_get_job_steps ( uint32_t job_id, int16_t step_id, job_step_info_response_msg_t **step_response_pptr);
extern void slurm_print_job_step_info_msg ( FILE* out, job_step_info_response_msg_t * job_step_info_msg_ptr );
extern void slurm_print_job_step_info ( FILE* out, job_step_info_t * job_step_ptr );
/*
* slurm_will_run - determine if a job would execute immediately
* if submitted.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment