diff --git a/src/api/job_step_info.c b/src/api/job_step_info.c index e240350c1e716062ba0b99e3f3f10f99dc58ab7a..d6224016151fbd94a6878fcbe013a839c09895fe 100644 --- a/src/api/job_step_info.c +++ b/src/api/job_step_info.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * job_info.c - get/print the job step state information of slurm + * job_step_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). diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c index 09a48ea35a01aef1f668c687cca70fc634959317..7b709ed62687c9cb59d8dc4a48b810ed27c38eb9 100644 --- a/src/common/slurm_protocol_defs.c +++ b/src/common/slurm_protocol_defs.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * slurm_protocol_defs.c - functions for initializing and releasing + * slurm_protocol_defs.c - functions for initializing and releasing * storage for RPC data structures ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c index cbe9e687dfc8bdeb2afbde3f08a3642cd12fa2f2..947c60acc98b197a2a1e4a06c438f6179d9ec580 100644 --- a/src/common/slurm_protocol_pack.c +++ b/src/common/slurm_protocol_pack.c @@ -1,5 +1,5 @@ /****************************************************************************\ - * slurm_protocol_pack.c - functions to pack and unpack structures for RPCs + * slurm_protocol_pack.c - functions to pack and unpack structures for RPCs ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 3312c82b2a4622e4b55e98694f2888e68f19d036..189b705a628b640fcdc214fe5ea0af47351cd13e 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -214,7 +214,7 @@ delete_job_details (struct job_record *job_entry) delete_job_desc_files (job_entry->job_id); if (job_entry->details->magic != DETAILS_MAGIC) - fatal ("list_delete_job: passed invalid job details pointer"); + fatal ("delete_job_details: passed invalid job details pointer"); if (job_entry->details->req_nodes) xfree(job_entry->details->req_nodes); if (job_entry->details->req_node_bitmap) @@ -1201,11 +1201,11 @@ list_delete_job (void *job_entry) delete_job_details (job_record_point); if (job_record_point->nodes) - xfree(job_record_point->nodes); + xfree (job_record_point->nodes); if (job_record_point->node_bitmap) - bit_free(job_record_point->node_bitmap); + bit_free (job_record_point->node_bitmap); if (job_record_point->step_list) - list_destroy(job_record_point->step_list); + delete_all_step_records (job_record_point); job_count--; xfree(job_record_point); } diff --git a/src/slurmctld/pack.c b/src/slurmctld/pack.c index 32ae18e67fd1b48614e3eb69f7a8a3c438216b0d..ce56ac27c822f18681b618960f0c18c429dba05f 100644 --- a/src/slurmctld/pack.c +++ b/src/slurmctld/pack.c @@ -4,7 +4,7 @@ ***************************************************************************** * 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>, Joseph Ekstrom (ekstrom1@llnl.gov) + * Written by Moe Jette <jette1@llnl.gov>, Joseph Ekstrom (ekstrom1@llnl.gov) * UCRL-CODE-2002-040. * * This file is part of SLURM, a resource management program. @@ -63,12 +63,14 @@ inline void buffer_realloc( void** buffer, void** current, int* size, int* len_l void pack_ctld_job_step_info( struct step_record* step, void **buf_ptr, int *buf_len) { - char node_list[BUF_SIZE]; + char *node_list; if (step->node_bitmap) - bit_fmt (node_list, BUF_SIZE, step->node_bitmap); - else + node_list = bitmap2node_name (step->node_bitmap); + else { + node_list = xmalloc(1); node_list[0] = '\0'; + } pack_job_step_info_members( step->job_ptr->job_id, @@ -80,6 +82,7 @@ pack_ctld_job_step_info( struct step_record* step, void **buf_ptr, int *buf_len buf_ptr, buf_len ); + xfree (node_list); } /* pack_ctld_job_step_info_reponse_msg - packs the message @@ -96,12 +99,11 @@ pack_ctld_job_step_info_reponse_msg( List steps, void** buffer_base, int* buffer int buffer_size = BUF_SIZE * REALLOC_MULTIPLIER; int current_size = buffer_size; void* current = NULL; - time_t current_time = time(NULL); uint32_t list_size = list_count(steps); current = *buffer_base = xmalloc( buffer_size ); - pack32( current_time, ¤t, ¤t_size ); /* FIXME What am I really suppose to put as the time?*/ - debug("job_step_count = %u\n", list_size); + debug3("job_step_count = %u\n", list_size); + pack32( last_job_update, ¤t, ¤t_size ); pack32( list_size , ¤t, ¤t_size ); /* Pack the Steps */ diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h index 9ccb2cb678bb44d9e8972f07d023de9f4fe39e66..306be775d837798ab590cf81561b7f598c5996bc 100644 --- a/src/slurmctld/slurmctld.h +++ b/src/slurmctld/slurmctld.h @@ -1,5 +1,5 @@ /*****************************************************************************\ - * slurmctld.h - definitions of functions and structures for slurmcltd use + * slurmctld.h - definitions of functions and structures for slurmcltd use ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -241,18 +241,15 @@ extern struct part_record *create_part_record (void); extern struct step_record * create_step_record (struct job_record *job_ptr); /* deallocate_nodes - for a given job, deallocate its nodes and make their state IDLE */ -void deallocate_nodes (struct job_record * job_ptr); +extern void deallocate_nodes (struct job_record * job_ptr); -/* - * delete_job_details - delete a job's detail record and clear it's pointer - */ +/* delete_all_step_records - delete all step record for specified job_ptr */ +extern void delete_all_step_records (struct job_record *job_ptr); + +/* delete_job_details - delete a job's detail record and clear it's pointer */ extern void delete_job_details (struct job_record *job_entry); -/* - * delete_node_record - delete record for node with specified name - * to avoid invalidating the bitmaps and hash table, we just clear the name - * set its state to STATE_DOWN - */ +/* delete_node_record - delete record for node with specified name */ extern int delete_node_record (char *name); /* delete_part_record - delete record for partition with specified name */ diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c index da33410cb6441eab97fb0a8a9243a10d3e21b124..ab21bbacb5a84a80893a2838d91ac1b05820ca2e 100644 --- a/src/slurmctld/step_mgr.c +++ b/src/slurmctld/step_mgr.c @@ -1,5 +1,5 @@ /*****************************************************************************\ - * step_mgr.c - manage the job step information of slurm + * step_mgr.c - manage the job step information of slurm ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -69,8 +69,39 @@ create_step_record (struct job_record *job_ptr) /* - * delete_step_record - delete record for job step for specified job_ptr and step_id + * delete_all_step_records - delete all step record for specified job_ptr * input: job_ptr - pointer to job table entry to have step record added + * output: return 0 on success, errno otherwise + */ +void +delete_all_step_records (struct job_record *job_ptr) +{ + ListIterator step_record_iterator; + struct step_record *step_record_point; + + assert (job_ptr); + step_record_iterator = list_iterator_create (job_ptr->step_list); + + while ((step_record_point = + (struct step_record *) list_next (step_record_iterator))) { + list_remove (step_record_iterator); +#ifdef HAVE_LIBELAN3 + qsw_free_jobinfo (step_record_point->qsw_job); +#endif + if (step_record_point->node_bitmap) + bit_free (step_record_point->node_bitmap); + xfree (step_record_point); + } + + list_iterator_destroy (step_record_iterator); + list_destroy (job_ptr->step_list); + job_ptr->step_list = NULL; +} + + +/* + * delete_step_record - delete record for job step for specified job_ptr and step_id + * input: job_ptr - pointer to job table entry to have step record removed * step_id - id of the desired job step * output: return 0 on success, errno otherwise */