From 1b0b135f9579e253ddd5bf680d2ea70ad12f9bda Mon Sep 17 00:00:00 2001
From: David Bigagli <david@schedmd.com>
Date: Fri, 10 Jan 2014 15:16:48 -0800
Subject: [PATCH] Replace the hostlist_push() function with a more efficient
 hostlist_push_host().

---
 NEWS                                          |  1 +
 src/api/allocate.c                            |  4 ++--
 src/api/step_launch.c                         |  6 +++---
 src/common/forward.c                          |  4 ++--
 src/common/node_conf.c                        |  2 +-
 src/plugins/mpi/mvapich/mvapich.c             |  4 ++--
 src/plugins/sched/wiki2/get_nodes.c           |  2 +-
 src/plugins/select/alps/basil_interface.c     |  2 +-
 .../select/bluegene/ba/block_allocator.c      |  2 +-
 .../select/bluegene/ba_bgq/block_allocator.c  |  4 ++--
 .../select/bluegene/bl/bridge_linker.c        |  2 +-
 src/sbatch/opt.c                              |  2 +-
 src/sbcast/agent.c                            |  4 ++--
 src/sinfo/sinfo.c                             |  6 +++---
 src/slurmctld/agent.c                         |  8 ++++----
 src/slurmctld/controller.c                    |  2 +-
 src/slurmctld/job_mgr.c                       | 20 +++++++++----------
 src/slurmctld/node_mgr.c                      |  4 ++--
 src/slurmctld/node_scheduler.c                | 10 +++++-----
 src/slurmctld/ping_nodes.c                    | 16 +++++++--------
 src/slurmctld/port_mgr.c                      |  2 +-
 src/slurmctld/step_mgr.c                      | 14 ++++++-------
 src/srun/libsrun/srun_job.c                   |  2 +-
 src/sstat/sstat.c                             |  2 +-
 src/sview/part_info.c                         |  2 +-
 25 files changed, 64 insertions(+), 63 deletions(-)

diff --git a/NEWS b/NEWS
index d76d6992a0a..6535355041c 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ documents those changes that are of interest to users and admins.
     are not longer set DOWN, they are set to DRAIN instead.
  -- Modified 'sacctmgr show associations' command to show GrpCPURunMins
     by default.
+ -- Replace the hostlist_push() function with a more efficient hostlist_push_host().
 
 * Changes in Slurm 14.03.0pre5
 ==============================
diff --git a/src/api/allocate.c b/src/api/allocate.c
index 2e6a6d52dc1..9ab81c535bf 100644
--- a/src/api/allocate.c
+++ b/src/api/allocate.c
@@ -628,9 +628,9 @@ char *slurm_read_hostfile(char *filename, int n)
 			    (i = atoi(asterisk + 1))) {
 				asterisk[0] = '\0';
 				for (j = 0; j < i; j++)
-					hostlist_push(hostlist, host_name);
+					hostlist_push_host(hostlist, host_name);
 			} else {
-				hostlist_push(hostlist, host_name);
+				hostlist_push_host(hostlist, host_name);
 			}
 			host_name = strtok_r(NULL, ",", &save_ptr);
 		}
diff --git a/src/api/step_launch.c b/src/api/step_launch.c
index 972df013ad8..53137aaae99 100644
--- a/src/api/step_launch.c
+++ b/src/api/step_launch.c
@@ -748,13 +748,13 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo)
 			continue;
 
 		if (ctx->step_resp->step_layout->front_end) {
-			hostlist_push(hl,
+			hostlist_push_host(hl,
 				      ctx->step_resp->step_layout->front_end);
 			break;
 		} else {
 			name = nodelist_nth_host(sls->layout->node_list,
 						 node_id);
-			hostlist_push(hl, name);
+			hostlist_push_host(hl, name);
 			free(name);
 		}
 	}
@@ -1661,7 +1661,7 @@ static void _print_launch_msg(launch_tasks_request_msg_t *msg,
 
 	for (i=0; i<msg->tasks_to_launch[nodeid]; i++) {
 		sprintf(tmp_str, "%u", msg->global_task_ids[nodeid][i]);
-		hostlist_push(hl, tmp_str);
+		hostlist_push_host(hl, tmp_str);
 	}
 	task_list = hostlist_ranged_string_xmalloc(hl);
 	hostlist_destroy(hl);
diff --git a/src/common/forward.c b/src/common/forward.c
index 0b225b110f4..1b207d3d9c0 100644
--- a/src/common/forward.c
+++ b/src/common/forward.c
@@ -527,7 +527,7 @@ extern int forward_msg(forward_struct_t *forward_struct,
 			name = hostlist_shift(hl);
 			if (!name)
 				break;
-			hostlist_push(forward_hl, name);
+			hostlist_push_host(forward_hl, name);
 			free(name);
 		}
 
@@ -617,7 +617,7 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout)
 			name = hostlist_shift(hl);
 			if (!name)
 				break;
-			hostlist_push(fwd_tree->tree_hl, name);
+			hostlist_push_host(fwd_tree->tree_hl, name);
 			free(name);
 		}
 
diff --git a/src/common/node_conf.c b/src/common/node_conf.c
index c4df0f8402c..20d1683a666 100644
--- a/src/common/node_conf.c
+++ b/src/common/node_conf.c
@@ -506,7 +506,7 @@ char * bitmap2node_name_sortable (bitstr_t *bitmap, bool sort)
 	for (i = first; i <= last; i++) {
 		if (bit_test(bitmap, i) == 0)
 			continue;
-		hostlist_push(hl, node_record_table_ptr[i].name);
+		hostlist_push_host(hl, node_record_table_ptr[i].name);
 	}
 	if (sort)
 		hostlist_sort(hl);
diff --git a/src/plugins/mpi/mvapich/mvapich.c b/src/plugins/mpi/mvapich/mvapich.c
index d580aece6b8..44a1a9ba183 100644
--- a/src/plugins/mpi/mvapich/mvapich.c
+++ b/src/plugins/mpi/mvapich/mvapich.c
@@ -329,8 +329,8 @@ static void report_absent_tasks (mvapich_state_t *st, int check_do_poll)
 		if ((m == NULL) || (m->fd < 0) || (check_do_poll && m->do_poll)) {
 			const char *host = slurm_step_layout_host_name (sl, i);
 			sprintf (buf, "%d", i);
-			hostlist_push (tasks, buf);
-			hostlist_push (hosts, host);
+			hostlist_push_host (tasks, buf);
+			hostlist_push_host (hosts, host);
 		}
 	}
 
diff --git a/src/plugins/sched/wiki2/get_nodes.c b/src/plugins/sched/wiki2/get_nodes.c
index c62d263b9ed..159d45da2fb 100644
--- a/src/plugins/sched/wiki2/get_nodes.c
+++ b/src/plugins/sched/wiki2/get_nodes.c
@@ -195,7 +195,7 @@ static char *	_dump_all_nodes(int *node_cnt, time_t update_time)
 			if (rc == 0) {
 				uniq_node_ptr = node_ptr;
 				if (hl) {
-					hostlist_push(hl, node_ptr->name);
+					hostlist_push_host(hl, node_ptr->name);
 				} else {
 					hl = hostlist_create(node_ptr->name);
 					if (!hl) {
diff --git a/src/plugins/select/alps/basil_interface.c b/src/plugins/select/alps/basil_interface.c
index 682ac8f2efa..a3d227f0c51 100644
--- a/src/plugins/select/alps/basil_interface.c
+++ b/src/plugins/select/alps/basil_interface.c
@@ -193,7 +193,7 @@ extern int basil_node_ranking(struct node_record *node_array, int node_cnt)
 		}
 
 		sprintf(tmp, "nid%05u", node->node_id);
-		hostlist_push(hl, tmp);
+		hostlist_push_host(hl, tmp);
 	}
 	free_inv(inv);
 	if (bad_node) {
diff --git a/src/plugins/select/bluegene/ba/block_allocator.c b/src/plugins/select/bluegene/ba/block_allocator.c
index 1494323dc2b..17e9f4b26ed 100644
--- a/src/plugins/select/bluegene/ba/block_allocator.c
+++ b/src/plugins/select/bluegene/ba/block_allocator.c
@@ -2515,7 +2515,7 @@ static char *_set_internal_wires(List nodes, int size, int conn_type)
 	while ((ba_node[count] = list_next(itr))) {
 		if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP)
 			info("name = %s", ba_node[count]->coord_str);
-		hostlist_push(hostlist, ba_node[count]->coord_str);
+		hostlist_push_host(hostlist, ba_node[count]->coord_str);
 		count++;
 	}
 	list_iterator_destroy(itr);
diff --git a/src/plugins/select/bluegene/ba_bgq/block_allocator.c b/src/plugins/select/bluegene/ba_bgq/block_allocator.c
index 45f83199ca9..87c1f48768d 100644
--- a/src/plugins/select/bluegene/ba_bgq/block_allocator.c
+++ b/src/plugins/select/bluegene/ba_bgq/block_allocator.c
@@ -1777,7 +1777,7 @@ static char *_copy_from_main(List main_mps, List ret_list)
 				     "mp %s is used", new_mp->coord_str);
 			new_mp->used = BA_MP_USED_TRUE;
 			if (hostlist)
-				hostlist_push(hostlist, new_mp->coord_str);
+				hostlist_push_host(hostlist, new_mp->coord_str);
 			else
 				hostlist = hostlist_create(new_mp->coord_str);
 		}
@@ -1843,7 +1843,7 @@ static char *_reset_altered_mps(List main_mps, bool get_name)
 				     ba_mp->used);
 			if (get_name) {
 				if (hostlist)
-					hostlist_push(hostlist,
+					hostlist_push_host(hostlist,
 						      ba_mp->coord_str);
 				else
 					hostlist = hostlist_create(
diff --git a/src/plugins/select/bluegene/bl/bridge_linker.c b/src/plugins/select/bluegene/bl/bridge_linker.c
index 9818a8c65a4..e274838ba15 100644
--- a/src/plugins/select/bluegene/bl/bridge_linker.c
+++ b/src/plugins/select/bluegene/bl/bridge_linker.c
@@ -1234,7 +1234,7 @@ static bg_record_t *_translate_object_to_block(rm_partition_t *block_ptr,
 			 ba_mp->coord_str);
 
 
-		hostlist_push(hostlist, node_name_tmp);
+		hostlist_push_host(hostlist, node_name_tmp);
 	}
 	bg_record->mp_str = hostlist_ranged_string_xmalloc(hostlist);
 	hostlist_destroy(hostlist);
diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c
index e9fb33f702e..dd2d4f75dcd 100644
--- a/src/sbatch/opt.c
+++ b/src/sbatch/opt.c
@@ -1894,7 +1894,7 @@ static void _parse_pbs_nodes_opts(char *node_opts)
 			_get_next_pbs_node_part(node_opts, &i);
 		} else if (isalpha(node_opts[i])) {
 			temp = _get_pbs_node_name(node_opts, &i);
-			hostlist_push(hl, temp);
+			hostlist_push_host(hl, temp);
 			xfree(temp);
 		} else
 			i++;
diff --git a/src/sbcast/agent.c b/src/sbcast/agent.c
index fc939c14bef..13d5fbd0d9a 100644
--- a/src/sbcast/agent.c
+++ b/src/sbcast/agent.c
@@ -159,11 +159,11 @@ extern void send_rpc(file_bcast_msg_t *bcast_msg,
 				name = hostlist_shift(hl);
 				if (!name)
 					break;
-				hostlist_push(new_hl, name);
+				hostlist_push_host(new_hl, name);
 				free(name);
 				i++;
 			}
-			thread_info[threads_used].nodelist = 
+			thread_info[threads_used].nodelist =
 				hostlist_ranged_string_xmalloc(new_hl);
 			hostlist_destroy(new_hl);
 			slurm_msg_t_init(&thread_info[threads_used].msg);
diff --git a/src/sinfo/sinfo.c b/src/sinfo/sinfo.c
index 3ad059d69e3..46af7c3e593 100644
--- a/src/sinfo/sinfo.c
+++ b/src/sinfo/sinfo.c
@@ -895,11 +895,11 @@ static void _update_sinfo(sinfo_data_t *sinfo_ptr, node_info_t *node_ptr,
 			sinfo_ptr->max_cpu_load = node_ptr->cpu_load;
 	}
 
-	hostlist_push(sinfo_ptr->nodes, node_ptr->name);
+	hostlist_push_host(sinfo_ptr->nodes, node_ptr->name);
 	if (params.match_flags.node_addr_flag)
-		hostlist_push(sinfo_ptr->node_addr, node_ptr->node_addr);
+		hostlist_push_host(sinfo_ptr->node_addr, node_ptr->node_addr);
 	if (params.match_flags.hostnames_flag)
-		hostlist_push(sinfo_ptr->hostnames, node_ptr->node_hostname);
+		hostlist_push_host(sinfo_ptr->hostnames, node_ptr->node_hostname);
 
 	total_cpus = node_ptr->cpus;
 	total_nodes = node_scaling;
diff --git a/src/slurmctld/agent.c b/src/slurmctld/agent.c
index 1b30e0ca207..8d58059e29d 100644
--- a/src/slurmctld/agent.c
+++ b/src/slurmctld/agent.c
@@ -445,12 +445,12 @@ static agent_info_t *_make_agent_info(agent_arg_t *agent_arg_ptr)
 			name = hostlist_shift(agent_arg_ptr->hostlist);
 			if (!name)
 				break;
-			hostlist_push(hl, name);
+			hostlist_push_host(hl, name);
 			free(name);
 			i++;
 		}
 		hostlist_uniq(hl);
-		thread_ptr[thr_count].nodelist = 
+		thread_ptr[thr_count].nodelist =
 			hostlist_ranged_string_xmalloc(hl);
 		hostlist_destroy(hl);
 #if 0
@@ -1061,7 +1061,7 @@ static int _setup_requeue(agent_arg_t *agent_arg_ptr, thd_t *thread_ptr,
 		      ret_data_info->node_name, count);
 
 		if (agent_arg_ptr) {
-			hostlist_push(agent_arg_ptr->hostlist,
+			hostlist_push_host(agent_arg_ptr->hostlist,
 				      ret_data_info->node_name);
 
 			if ((++(*spot)) == count) {
@@ -1106,7 +1106,7 @@ static void _queue_agent_retry(agent_info_t * agent_info_ptr, int count)
 
 			debug("got the name %s to resend",
 			      thread_ptr[i].nodelist);
-			hostlist_push(agent_arg_ptr->hostlist,
+			hostlist_push_host(agent_arg_ptr->hostlist,
 				      thread_ptr[i].nodelist);
 
 			if ((++j) == count)
diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c
index 5fcb97258a9..d6932625251 100644
--- a/src/slurmctld/controller.c
+++ b/src/slurmctld/controller.c
@@ -1308,7 +1308,7 @@ static void _queue_reboot_msg(void)
 			reboot_agent_args->retry = 0;
 			reboot_agent_args->hostlist = hostlist_create("");
 		}
-		hostlist_push(reboot_agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(reboot_agent_args->hostlist, node_ptr->name);
 		reboot_agent_args->node_count++;
 		node_ptr->node_state = NODE_STATE_FUTURE |
 				(node_ptr->node_state & NODE_STATE_FLAGS);
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index e1e3cda9359..38a628edb24 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -6192,7 +6192,7 @@ extern int pack_one_job(char **buffer_ptr, int *buffer_size,
 	} else {
 		/* Job ID not found. It could reference a job array. */
 		job_iterator = list_iterator_create(job_list);
-		while ((job_ptr = (struct job_record *) 
+		while ((job_ptr = (struct job_record *)
 				  list_next(job_iterator))) {
 			if ((job_ptr->job_id != job_id) &&
 			    ((job_ptr->array_task_id ==  NO_VAL) ||
@@ -9048,7 +9048,7 @@ static void _send_job_kill(struct job_record *job_ptr)
 #ifdef HAVE_FRONT_END
 	if (job_ptr->batch_host &&
 	    (front_end_ptr = job_ptr->front_end_ptr)) {
-		hostlist_push(agent_args->hostlist, job_ptr->batch_host);
+		hostlist_push_host(agent_args->hostlist, job_ptr->batch_host);
 		agent_args->node_count++;
 	}
 #else
@@ -9058,7 +9058,7 @@ static void _send_job_kill(struct job_record *job_ptr)
 	     i < node_record_count; i++, node_ptr++) {
 		if (!bit_test(job_ptr->node_bitmap_cg, i))
 			continue;
-		hostlist_push(agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(agent_args->hostlist, node_ptr->name);
 		agent_args->node_count++;
 	}
 #endif
@@ -9626,13 +9626,13 @@ _xmit_new_end_time(struct job_record *job_ptr)
 
 #ifdef HAVE_FRONT_END
 	xassert(job_ptr->batch_host);
-	hostlist_push(agent_args->hostlist, job_ptr->batch_host);
+	hostlist_push_host(agent_args->hostlist, job_ptr->batch_host);
 	agent_args->node_count  = 1;
 #else
 	for (i = 0; i < node_record_count; i++) {
 		if (bit_test(job_ptr->node_bitmap, i) == 0)
 			continue;
-		hostlist_push(agent_args->hostlist,
+		hostlist_push_host(agent_args->hostlist,
 			      node_record_table_ptr[i].name);
 		agent_args->node_count++;
 	}
@@ -10071,13 +10071,13 @@ static void _signal_job(struct job_record *job_ptr, int signal)
 
 #ifdef HAVE_FRONT_END
 	xassert(job_ptr->batch_host);
-	hostlist_push(agent_args->hostlist, job_ptr->batch_host);
+	hostlist_push_host(agent_args->hostlist, job_ptr->batch_host);
 	agent_args->node_count = 1;
 #else
 	for (i = 0; i < node_record_count; i++) {
 		if (bit_test(job_ptr->node_bitmap, i) == 0)
 			continue;
-		hostlist_push(agent_args->hostlist,
+		hostlist_push_host(agent_args->hostlist,
 			      node_record_table_ptr[i].name);
 		agent_args->node_count++;
 	}
@@ -10142,14 +10142,14 @@ static void _suspend_job(struct job_record *job_ptr, uint16_t op,
 
 #ifdef HAVE_FRONT_END
 	xassert(job_ptr->batch_host);
-	hostlist_push(agent_args->hostlist, job_ptr->batch_host);
+	hostlist_push_host(agent_args->hostlist, job_ptr->batch_host);
 	agent_args->node_count = 1;
 #else
 	for (i = 0; i < node_record_count; i++) {
 		if (bit_test(job_ptr->node_bitmap, i) == 0)
 			continue;
-		hostlist_push(agent_args->hostlist,
-			      node_record_table_ptr[i].name);
+		hostlist_push_host(agent_args->hostlist,
+						   node_record_table_ptr[i].name);
 		agent_args->node_count++;
 	}
 #endif
diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c
index 86e1bb0b4ec..ce068a571c4 100644
--- a/src/slurmctld/node_mgr.c
+++ b/src/slurmctld/node_mgr.c
@@ -2739,7 +2739,7 @@ void msg_to_slurmd (slurm_msg_type_t msg_type)
 #ifdef HAVE_FRONT_END
 	for (i = 0, front_end_ptr = front_end_nodes;
 	     i < front_end_node_cnt; i++, front_end_ptr++) {
-		hostlist_push(kill_agent_args->hostlist, front_end_ptr->name);
+		hostlist_push_host(kill_agent_args->hostlist, front_end_ptr->name);
 		kill_agent_args->node_count++;
 	}
 #else
@@ -2749,7 +2749,7 @@ void msg_to_slurmd (slurm_msg_type_t msg_type)
 			continue;
 		if (IS_NODE_CLOUD(node_ptr) && IS_NODE_POWER_SAVE(node_ptr))
 			continue;
-		hostlist_push(kill_agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(kill_agent_args->hostlist, node_ptr->name);
 		kill_agent_args->node_count++;
 	}
 #endif
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 62b5ed593bd..daebd2fc2ed 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -554,7 +554,7 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout,
 			}
 		}
 
-		hostlist_push(agent_args->hostlist, job_ptr->batch_host);
+		hostlist_push_host(agent_args->hostlist, job_ptr->batch_host);
 		agent_args->node_count++;
 	}
 #else
@@ -583,7 +583,7 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout,
 		}
 		make_node_comp(node_ptr, job_ptr, suspended);
 
-		hostlist_push(agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(agent_args->hostlist, node_ptr->name);
 		agent_args->node_count++;
 	}
 #endif
@@ -2645,9 +2645,9 @@ extern void re_kill_job(struct job_record *job_ptr)
 				}
 			}
 		} else if (!IS_NODE_NO_RESPOND(front_end_ptr)) {
-			(void) hostlist_push_host(kill_hostlist,
+			(void) hostlist_push_host_host(kill_hostlist,
 						  job_ptr->batch_host);
-			hostlist_push(agent_args->hostlist,
+			hostlist_push_host(agent_args->hostlist,
 				      job_ptr->batch_host);
 			agent_args->node_count++;
 		}
@@ -2674,7 +2674,7 @@ extern void re_kill_job(struct job_record *job_ptr)
 			}
 		} else if (!IS_NODE_NO_RESPOND(node_ptr)) {
 			(void)hostlist_push_host(kill_hostlist, node_ptr->name);
-			hostlist_push(agent_args->hostlist, node_ptr->name);
+			hostlist_push_host(agent_args->hostlist, node_ptr->name);
 			agent_args->node_count++;
 		}
 	}
diff --git a/src/slurmctld/ping_nodes.c b/src/slurmctld/ping_nodes.c
index 085d3e94ec8..063792b2a72 100644
--- a/src/slurmctld/ping_nodes.c
+++ b/src/slurmctld/ping_nodes.c
@@ -218,7 +218,7 @@ void ping_nodes (void)
 		 * can generate a flood of incoming RPCs. */
 		if (IS_NODE_UNKNOWN(front_end_ptr) || restart_flag ||
 		    ((i >= offset) && (i < (offset + max_reg_threads)))) {
-			hostlist_push(reg_agent_args->hostlist,
+			hostlist_push_host(reg_agent_args->hostlist,
 				      front_end_ptr->name);
 			reg_agent_args->node_count++;
 			continue;
@@ -234,7 +234,7 @@ void ping_nodes (void)
 		    IS_NODE_DOWN(front_end_ptr))
 			continue;
 
-		hostlist_push(ping_agent_args->hostlist, front_end_ptr->name);
+		hostlist_push_host(ping_agent_args->hostlist, front_end_ptr->name);
 		ping_agent_args->node_count++;
 	}
 #else
@@ -283,7 +283,7 @@ void ping_nodes (void)
 		 * can generate a flood of incoming RPCs. */
 		if (IS_NODE_UNKNOWN(node_ptr) || restart_flag ||
 		    ((i >= offset) && (i < (offset + max_reg_threads)))) {
-			hostlist_push(reg_agent_args->hostlist,
+			hostlist_push_host(reg_agent_args->hostlist,
 				      node_ptr->name);
 			reg_agent_args->node_count++;
 			continue;
@@ -298,7 +298,7 @@ void ping_nodes (void)
 		if (IS_NODE_NO_RESPOND(node_ptr) && IS_NODE_DOWN(node_ptr))
 			continue;
 
-		hostlist_push(ping_agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(ping_agent_args->hostlist, node_ptr->name);
 		ping_agent_args->node_count++;
 	}
 #endif
@@ -362,7 +362,7 @@ extern void run_health_check(void)
 	     i < front_end_node_cnt; i++, front_end_ptr++) {
 		if (IS_NODE_NO_RESPOND(front_end_ptr))
 			continue;
-		hostlist_push(check_agent_args->hostlist, front_end_ptr->name);
+		hostlist_push_host(check_agent_args->hostlist, front_end_ptr->name);
 		check_agent_args->node_count++;
 	}
 #else
@@ -403,7 +403,7 @@ extern void run_health_check(void)
 			}
 		}
 
-		hostlist_push(check_agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(check_agent_args->hostlist, node_ptr->name);
 		check_agent_args->node_count++;
 	}
 #endif
@@ -444,7 +444,7 @@ extern void update_nodes_acct_gather_data(void)
 	     i < front_end_node_cnt; i++, front_end_ptr++) {
 		if (IS_NODE_NO_RESPOND(front_end_ptr))
 			continue;
-		hostlist_push(agent_args->hostlist, front_end_ptr->name);
+		hostlist_push_host(agent_args->hostlist, front_end_ptr->name);
 		agent_args->node_count++;
 	}
 #else
@@ -453,7 +453,7 @@ extern void update_nodes_acct_gather_data(void)
 		if (IS_NODE_NO_RESPOND(node_ptr) || IS_NODE_FUTURE(node_ptr) ||
 		    IS_NODE_POWER_SAVE(node_ptr))
 			continue;
-		hostlist_push(agent_args->hostlist, node_ptr->name);
+		hostlist_push_host(agent_args->hostlist, node_ptr->name);
 		agent_args->node_count++;
 	}
 #endif
diff --git a/src/slurmctld/port_mgr.c b/src/slurmctld/port_mgr.c
index ba7aa926783..688a4e6876e 100644
--- a/src/slurmctld/port_mgr.c
+++ b/src/slurmctld/port_mgr.c
@@ -263,7 +263,7 @@ extern int resv_port_alloc(struct step_record *step_ptr)
 		       step_ptr->step_node_bitmap);
 		port_array[i] += port_resv_min;
 		snprintf(port_str, sizeof(port_str), "[%d]", port_array[i]);
-		hostlist_push(hl, port_str);
+		hostlist_push_host(hl, port_str);
 	}
 	hostlist_sort(hl);
 	step_ptr->resv_ports = hostlist_ranged_string_xmalloc(hl);
diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c
index 5f4ba852b37..84681cf260d 100644
--- a/src/slurmctld/step_mgr.c
+++ b/src/slurmctld/step_mgr.c
@@ -133,7 +133,7 @@ static int  _opt_cpu_cnt(uint32_t step_min_cpus, bitstr_t *node_bitmap,
 	return rem_cpus;
 }
 
-/* Select the optimal node count for a job step based upon it's min and 
+/* Select the optimal node count for a job step based upon it's min and
  * max target, available resources, and nodes already picked */
 static int _opt_node_cnt(uint32_t step_min_nodes, uint32_t step_max_nodes,
 			 int nodes_avail, int nodes_picked_cnt)
@@ -534,13 +534,13 @@ void signal_step_tasks(struct step_record *step_ptr, uint16_t signal,
 
 #ifdef HAVE_FRONT_END
 	xassert(step_ptr->job_ptr->batch_host);
-	hostlist_push(agent_args->hostlist, step_ptr->job_ptr->batch_host);
+	hostlist_push_host(agent_args->hostlist, step_ptr->job_ptr->batch_host);
 	agent_args->node_count = 1;
 #else
 	for (i = 0; i < node_record_count; i++) {
 		if (bit_test(step_ptr->step_node_bitmap, i) == 0)
 			continue;
-		hostlist_push(agent_args->hostlist,
+		hostlist_push_host(agent_args->hostlist,
 			      node_record_table_ptr[i].name);
 		agent_args->node_count++;
 	}
@@ -1442,7 +1442,7 @@ _pick_step_nodes (struct job_record  *job_ptr,
 			}
 			goto cleanup;
 		}
-	} 
+	}
 	if (step_spec->cpu_count) {
 		/* make sure the selected nodes have enough cpus */
 		cpus_picked_cnt = _count_cpus(job_ptr, nodes_picked,
@@ -3063,7 +3063,7 @@ static hostlist_t _step_range_to_hostlist(struct step_record *step_ptr,
 		node_inx++;
 		if ((node_inx >= range_first)
 		&&  (node_inx <= range_last)) {
-			hostlist_push(hl,
+			hostlist_push_host(hl,
 				node_record_table_ptr[i].name);
 		}
 	}
@@ -3672,13 +3672,13 @@ static void _signal_step_timelimit(struct job_record *job_ptr,
 
 #ifdef HAVE_FRONT_END
 	xassert(job_ptr->batch_host);
-	hostlist_push(agent_args->hostlist, job_ptr->batch_host);
+	hostlist_push_host(agent_args->hostlist, job_ptr->batch_host);
 	agent_args->node_count++;
 #else
 	for (i = 0; i < node_record_count; i++) {
 		if (bit_test(step_ptr->step_node_bitmap, i) == 0)
 			continue;
-		hostlist_push(agent_args->hostlist,
+		hostlist_push_host(agent_args->hostlist,
 			node_record_table_ptr[i].name);
 		agent_args->node_count++;
 	}
diff --git a/src/srun/libsrun/srun_job.c b/src/srun/libsrun/srun_job.c
index 20b1c036f3e..83cebae5c70 100644
--- a/src/srun/libsrun/srun_job.c
+++ b/src/srun/libsrun/srun_job.c
@@ -276,7 +276,7 @@ job_step_create_allocation(resource_allocation_response_msg_t *resp)
 				xfree(buf);
 				while ((node_name = hostlist_shift(tmp_hl)) &&
 				       (i < diff)) {
-					hostlist_push(inc_hl, node_name);
+					hostlist_push_host(inc_hl, node_name);
 					i++;
 				}
 				hostlist_destroy(tmp_hl);
diff --git a/src/sstat/sstat.c b/src/sstat/sstat.c
index a5fb3057d8e..e2e38463d50 100644
--- a/src/sstat/sstat.c
+++ b/src/sstat/sstat.c
@@ -156,7 +156,7 @@ int _do_stat(uint32_t jobid, uint32_t stepid, char *nodelist,
 			print_fields(&step);
 			xfree(step.pid_str);
 		} else {
-			hostlist_push(hl, step_stat->step_pids->node_name);
+			hostlist_push_host(hl, step_stat->step_pids->node_name);
 			ntasks += step_stat->num_tasks;
 			if (step_stat->jobacct) {
 				jobacctinfo_2_stats(&temp_stats,
diff --git a/src/sview/part_info.c b/src/sview/part_info.c
index 2a71fa9ec23..c27d872c9f9 100644
--- a/src/sview/part_info.c
+++ b/src/sview/part_info.c
@@ -1594,7 +1594,7 @@ static void _update_sview_part_sub(sview_part_sub_t *sview_part_sub,
 	sview_part_sub->mem_total  += node_ptr->real_memory;
 	sview_part_sub->node_cnt   += node_scaling;
 	list_append(sview_part_sub->node_ptr_list, node_ptr);
-	hostlist_push(sview_part_sub->hl, node_ptr->name);
+	hostlist_push_host(sview_part_sub->hl, node_ptr->name);
 }
 
 /*
-- 
GitLab