View | Details | Raw Unified | Return to ticket 198
Collapse All | Expand All

(-)a/src/plugins/gres/gpu/gres_gpu.c (-4 lines)
Lines 128-135 extern int node_config_load(List gres_conf_list) Link Here
128
128
129
	xassert(gres_conf_list);
129
	xassert(gres_conf_list);
130
	iter = list_iterator_create(gres_conf_list);
130
	iter = list_iterator_create(gres_conf_list);
131
	if (iter == NULL)
132
		fatal("list_iterator_create: malloc failure");
133
	while ((gres_slurmd_conf = list_next(iter))) {
131
	while ((gres_slurmd_conf = list_next(iter))) {
134
		if (strcmp(gres_slurmd_conf->name, gres_name))
132
		if (strcmp(gres_slurmd_conf->name, gres_name))
135
			continue;
133
			continue;
Lines 151-158 extern int node_config_load(List gres_conf_list) Link Here
151
	}
149
	}
152
150
153
	iter = list_iterator_create(gres_conf_list);
151
	iter = list_iterator_create(gres_conf_list);
154
	if (iter == NULL)
155
		fatal("list_iterator_create: malloc failure");
156
	while ((gres_slurmd_conf = list_next(iter))) {
152
	while ((gres_slurmd_conf = list_next(iter))) {
157
		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
153
		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
158
		    gres_slurmd_conf->file) {
154
		    gres_slurmd_conf->file) {
(-)a/src/plugins/gres/mic/gres_mic.c (-4 lines)
Lines 130-137 extern int node_config_load(List gres_conf_list) Link Here
130
130
131
	xassert(gres_conf_list);
131
	xassert(gres_conf_list);
132
	iter = list_iterator_create(gres_conf_list);
132
	iter = list_iterator_create(gres_conf_list);
133
	if (iter == NULL)
134
		fatal("list_iterator_create: malloc failure");
135
	while ((gres_slurmd_conf = list_next(iter))) {
133
	while ((gres_slurmd_conf = list_next(iter))) {
136
		if (strcmp(gres_slurmd_conf->name, gres_name))
134
		if (strcmp(gres_slurmd_conf->name, gres_name))
137
			continue;
135
			continue;
Lines 153-160 extern int node_config_load(List gres_conf_list) Link Here
153
	}
151
	}
154
152
155
	iter = list_iterator_create(gres_conf_list);
153
	iter = list_iterator_create(gres_conf_list);
156
	if (iter == NULL)
157
		fatal("list_iterator_create: malloc failure");
158
	while ((gres_slurmd_conf = list_next(iter))) {
154
	while ((gres_slurmd_conf = list_next(iter))) {
159
		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
155
		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
160
		    gres_slurmd_conf->file) {
156
		    gres_slurmd_conf->file) {
(-)a/src/plugins/gres/nic/gres_nic.c (-2 lines)
Lines 120-127 extern int node_config_load(List gres_conf_list) Link Here
120
120
121
	xassert(gres_conf_list);
121
	xassert(gres_conf_list);
122
	iter = list_iterator_create(gres_conf_list);
122
	iter = list_iterator_create(gres_conf_list);
123
	if (iter == NULL)
124
		fatal("list_iterator_create: malloc failure");
125
	while ((gres_slurmd_conf = list_next(iter))) {
123
	while ((gres_slurmd_conf = list_next(iter))) {
126
		if (strcmp(gres_slurmd_conf->name, gres_name) == 0) {
124
		if (strcmp(gres_slurmd_conf->name, gres_name) == 0) {
127
			rc = SLURM_SUCCESS;
125
			rc = SLURM_SUCCESS;
(-)a/src/plugins/job_submit/lua/job_submit_lua.c (-2 lines)
Lines 688-695 static void _push_partition_list(uint32_t user_id, uint32_t submit_uid) Link Here
688
688
689
	lua_newtable(L);
689
	lua_newtable(L);
690
	part_iterator = list_iterator_create(part_list);
690
	part_iterator = list_iterator_create(part_list);
691
	if (!part_iterator)
692
		fatal("list_iterator_create malloc");
693
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
691
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
694
		if (!_user_can_use_part(user_id, submit_uid, part_ptr))
692
		if (!_user_can_use_part(user_id, submit_uid, part_ptr))
695
			continue;
693
			continue;
(-)a/src/plugins/job_submit/partition/job_submit_partition.c (-2 lines)
Lines 144-151 extern int job_submit(struct job_descriptor *job_desc, uint32_t submit_uid) Link Here
144
		return SLURM_SUCCESS;
144
		return SLURM_SUCCESS;
145
145
146
	part_iterator = list_iterator_create(part_list);
146
	part_iterator = list_iterator_create(part_list);
147
	if (!part_iterator)
148
		fatal("list_iterator_create malloc");
149
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
147
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
150
		if (!(part_ptr->state_up & PARTITION_SUBMIT))
148
		if (!(part_ptr->state_up & PARTITION_SUBMIT))
151
			continue;	/* nobody can submit jobs here */
149
			continue;	/* nobody can submit jobs here */
(-)a/src/plugins/preempt/partition_prio/preempt_partition_prio.c (-2 lines)
Lines 122-129 extern List find_preemptable_jobs(struct job_record *job_ptr) Link Here
122
		/* This job is a preemption candidate */
122
		/* This job is a preemption candidate */
123
		if (preemptee_job_list == NULL) {
123
		if (preemptee_job_list == NULL) {
124
			preemptee_job_list = list_create(NULL);
124
			preemptee_job_list = list_create(NULL);
125
			if (preemptee_job_list == NULL)
126
				fatal("list_create malloc failure");
127
		}
125
		}
128
		list_append(preemptee_job_list, job_p);
126
		list_append(preemptee_job_list, job_p);
129
	}
127
	}
(-)a/src/plugins/preempt/qos/preempt_qos.c (-2 lines)
Lines 124-131 extern List find_preemptable_jobs(struct job_record *job_ptr) Link Here
124
		/* This job is a preemption candidate */
124
		/* This job is a preemption candidate */
125
		if (preemptee_job_list == NULL) {
125
		if (preemptee_job_list == NULL) {
126
			preemptee_job_list = list_create(NULL);
126
			preemptee_job_list = list_create(NULL);
127
			if (preemptee_job_list == NULL)
128
				fatal("list_create malloc failure");
129
		}
127
		}
130
		list_append(preemptee_job_list, job_p);
128
		list_append(preemptee_job_list, job_p);
131
	}
129
	}
(-)a/src/plugins/priority/multifactor/priority_multifactor.c (-4 lines)
Lines 709-716 void _init_grp_used_cpu_run_secs(time_t last_ran) Link Here
709
709
710
	lock_slurmctld(job_read_lock);
710
	lock_slurmctld(job_read_lock);
711
	itr = list_iterator_create(job_list);
711
	itr = list_iterator_create(job_list);
712
	if (itr == NULL)
713
		fatal("list_iterator_create: malloc failure");
714
712
715
	assoc_mgr_lock(&locks);
713
	assoc_mgr_lock(&locks);
716
	while ((job_ptr = list_next(itr))) {
714
	while ((job_ptr = list_next(itr))) {
Lines 1367-1374 extern List priority_p_get_priority_factors_list( Link Here
1367
		ret_list = list_create(slurm_destroy_priority_factors_object);
1365
		ret_list = list_create(slurm_destroy_priority_factors_object);
1368
		lock_slurmctld(job_read_lock);
1366
		lock_slurmctld(job_read_lock);
1369
		itr = list_iterator_create(job_list);
1367
		itr = list_iterator_create(job_list);
1370
		if (itr == NULL)
1371
			fatal("list_iterator_create: malloc failure");
1372
		while ((job_ptr = list_next(itr))) {
1368
		while ((job_ptr = list_next(itr))) {
1373
			/*
1369
			/*
1374
			 * We are only looking for pending jobs
1370
			 * We are only looking for pending jobs
(-)a/src/plugins/priority/multifactor2/priority_multifactor2.c (-40 / +24 lines)
Lines 3-9 Link Here
3
 *****************************************************************************
3
 *****************************************************************************
4
 *  Copyright (C) 2012  Aalto University
4
 *  Copyright (C) 2012  Aalto University
5
 *  Written by Janne Blomqvist <janne.blomqvist@aalto.fi>
5
 *  Written by Janne Blomqvist <janne.blomqvist@aalto.fi>
6
 * 
6
 *
7
 *  Based on priority_multifactor.c, whose copyright information is
7
 *  Based on priority_multifactor.c, whose copyright information is
8
 *  reproduced below:
8
 *  reproduced below:
9
 *
9
 *
Lines 173-180 static int _apply_decay(double decay_factor) Link Here
173
	xassert(assoc_mgr_qos_list);
173
	xassert(assoc_mgr_qos_list);
174
174
175
	itr = list_iterator_create(assoc_mgr_association_list);
175
	itr = list_iterator_create(assoc_mgr_association_list);
176
	if (!itr)
177
		fatal("list_iterator_create: malloc failure");
178
	/* We want to do this to all associations including
176
	/* We want to do this to all associations including
179
	 * root.  All usage_raws are calculated from the bottom up. */
177
	 * root.  All usage_raws are calculated from the bottom up. */
180
	while ((assoc = list_next(itr))) {
178
	while ((assoc = list_next(itr))) {
Lines 184-191 static int _apply_decay(double decay_factor) Link Here
184
	list_iterator_destroy(itr);
182
	list_iterator_destroy(itr);
185
183
186
	itr = list_iterator_create(assoc_mgr_qos_list);
184
	itr = list_iterator_create(assoc_mgr_qos_list);
187
	if (!itr)
188
		fatal("list_iterator_create: malloc failure");
189
	while ((qos = list_next(itr))) {
185
	while ((qos = list_next(itr))) {
190
		qos->usage->usage_raw *= decay_factor;
186
		qos->usage->usage_raw *= decay_factor;
191
		qos->usage->grp_used_wall *= decay_factor;
187
		qos->usage->grp_used_wall *= decay_factor;
Lines 217-224 static int _reset_usage(void) Link Here
217
	xassert(assoc_mgr_association_list);
213
	xassert(assoc_mgr_association_list);
218
214
219
	itr = list_iterator_create(assoc_mgr_association_list);
215
	itr = list_iterator_create(assoc_mgr_association_list);
220
	if (!itr)
221
		fatal("list_iterator_create: malloc failure");
222
	/* We want to do this to all associations including
216
	/* We want to do this to all associations including
223
	 * root.  All usage_raws are calculated from the bottom up. */
217
	 * root.  All usage_raws are calculated from the bottom up. */
224
	while ((assoc = list_next(itr))) {
218
	while ((assoc = list_next(itr))) {
Lines 381-399 static int _write_last_decay_ran(time_t last_ran, time_t last_reset) Link Here
381
/* Set the effective usage of a node. */
375
/* Set the effective usage of a node. */
382
static void _set_usage_efctv(slurmdb_association_rec_t *assoc)
376
static void _set_usage_efctv(slurmdb_association_rec_t *assoc)
383
{
377
{
384
        if ((assoc->shares_raw == SLURMDB_FS_USE_PARENT)
378
	if ((assoc->shares_raw == SLURMDB_FS_USE_PARENT)
385
            && assoc->usage->parent_assoc_ptr) {
379
	    && assoc->usage->parent_assoc_ptr) {
386
		assoc->usage->shares_norm =
380
		assoc->usage->shares_norm =
387
                        assoc->usage->parent_assoc_ptr->usage->shares_norm;
381
			assoc->usage->parent_assoc_ptr->usage->shares_norm;
388
                assoc->usage->usage_norm =
382
		assoc->usage->usage_norm =
389
                        assoc->usage->parent_assoc_ptr->usage->usage_norm;
383
			assoc->usage->parent_assoc_ptr->usage->usage_norm;
390
        }
384
	}
391
385
392
	if (assoc->usage->usage_norm > MIN_USAGE_FACTOR 
386
	if (assoc->usage->usage_norm > MIN_USAGE_FACTOR
393
		    * (assoc->shares_raw / assoc->usage->level_shares)) {
387
		    * (assoc->shares_raw / assoc->usage->level_shares)) {
394
		assoc->usage->usage_efctv = assoc->usage->usage_norm;
388
		assoc->usage->usage_efctv = assoc->usage->usage_norm;
395
	} else {
389
	} else {
396
		assoc->usage->usage_efctv =  MIN_USAGE_FACTOR 
390
		assoc->usage->usage_efctv =  MIN_USAGE_FACTOR
397
		  * (assoc->shares_raw / assoc->usage->level_shares);
391
		  * (assoc->shares_raw / assoc->usage->level_shares);
398
	}
392
	}
399
}
393
}
Lines 417-424 static int _set_children_usage_efctv(List childern_list) Link Here
417
		return SLURM_SUCCESS;
411
		return SLURM_SUCCESS;
418
412
419
	itr = list_iterator_create(childern_list);
413
	itr = list_iterator_create(childern_list);
420
	if (!itr)
421
		fatal("list_iterator_create: malloc failure");
422
	while ((assoc = list_next(itr))) {
414
	while ((assoc = list_next(itr))) {
423
		if (assoc->user) {
415
		if (assoc->user) {
424
			assoc->usage->usage_efctv = (long double)NO_VAL;
416
			assoc->usage->usage_efctv = (long double)NO_VAL;
Lines 446-486 static int _distribute_tickets(List childern_list, uint32_t tickets) Link Here
446
		return SLURM_SUCCESS;
438
		return SLURM_SUCCESS;
447
439
448
	itr = list_iterator_create(childern_list);
440
	itr = list_iterator_create(childern_list);
449
	if (!itr)
450
		fatal("list_iterator_create: malloc failure");
451
	while ((assoc = list_next(itr))) {
441
	while ((assoc = list_next(itr))) {
452
		if (assoc->usage->active_seqno 
442
		if (assoc->usage->active_seqno
453
		    != assoc_mgr_root_assoc->usage->active_seqno)
443
		    != assoc_mgr_root_assoc->usage->active_seqno)
454
			continue;
444
			continue;
455
		fs = priority_p_calc_fs_factor(assoc->usage->usage_efctv, 
445
		fs = priority_p_calc_fs_factor(assoc->usage->usage_efctv,
456
					       assoc->usage->shares_norm);
446
					       assoc->usage->shares_norm);
457
		sfsum += assoc->usage->shares_norm * fs;
447
		sfsum += assoc->usage->shares_norm * fs;
458
	}
448
	}
459
	list_iterator_destroy(itr);
449
	list_iterator_destroy(itr);
460
450
461
	itr = list_iterator_create(childern_list);
451
	itr = list_iterator_create(childern_list);
462
	if (!itr)
463
		fatal("list_iterator_create: malloc failure");
464
	while ((assoc = list_next(itr))) {
452
	while ((assoc = list_next(itr))) {
465
		if (assoc->usage->active_seqno 
453
		if (assoc->usage->active_seqno
466
		    != assoc_mgr_root_assoc->usage->active_seqno)
454
		    != assoc_mgr_root_assoc->usage->active_seqno)
467
			continue;
455
			continue;
468
		fs = priority_p_calc_fs_factor(assoc->usage->usage_efctv, 
456
		fs = priority_p_calc_fs_factor(assoc->usage->usage_efctv,
469
					       assoc->usage->shares_norm);
457
					       assoc->usage->shares_norm);
470
		assoc->usage->tickets = tickets * assoc->usage->shares_norm 
458
		assoc->usage->tickets = tickets * assoc->usage->shares_norm
471
			* fs / sfsum;
459
			* fs / sfsum;
472
		if (priority_debug) {
460
		if (priority_debug) {
473
			if (assoc->user)
461
			if (assoc->user)
474
				info("User %s in account %s gets %u tickets",
462
				info("User %s in account %s gets %u tickets",
475
				     assoc->user, assoc->acct, 
463
				     assoc->user, assoc->acct,
476
				     assoc->usage->tickets);
464
				     assoc->usage->tickets);
477
			else
465
			else
478
				info("Account %s gets %u tickets", 
466
				info("Account %s gets %u tickets",
479
				     assoc->acct, assoc->usage->tickets);
467
				     assoc->acct, assoc->usage->tickets);
480
		}
468
		}
481
		if (assoc->user && assoc->usage->tickets > max_tickets)
469
		if (assoc->user && assoc->usage->tickets > max_tickets)
482
			max_tickets = assoc->usage->tickets;
470
			max_tickets = assoc->usage->tickets;
483
		_distribute_tickets(assoc->usage->childern_list, 
471
		_distribute_tickets(assoc->usage->childern_list,
484
				    assoc->usage->tickets);
472
				    assoc->usage->tickets);
485
	}
473
	}
486
	list_iterator_destroy(itr);
474
	list_iterator_destroy(itr);
Lines 525-531 static double _get_fairshare_priority( struct job_record *job_ptr) Link Here
525
		priority_p_set_assoc_usage(fs_assoc);
513
		priority_p_set_assoc_usage(fs_assoc);
526
514
527
	/* Priority is 0 -> 1 */
515
	/* Priority is 0 -> 1 */
528
	if (fs_assoc->usage->active_seqno 
516
	if (fs_assoc->usage->active_seqno
529
	    == assoc_mgr_root_assoc->usage->active_seqno && max_tickets)
517
	    == assoc_mgr_root_assoc->usage->active_seqno && max_tickets)
530
		priority_fs = (double) fs_assoc->usage->tickets / max_tickets;
518
		priority_fs = (double) fs_assoc->usage->tickets / max_tickets;
531
	else
519
	else
Lines 728-739 static bool _mark_assoc_active(struct job_record *job_ptr) Link Here
728
		return false;
716
		return false;
729
	}
717
	}
730
718
731
	for (assoc = job_assoc; assoc != assoc_mgr_root_assoc; 
719
	for (assoc = job_assoc; assoc != assoc_mgr_root_assoc;
732
	     assoc = assoc->usage->parent_assoc_ptr) {
720
	     assoc = assoc->usage->parent_assoc_ptr) {
733
		if (assoc->usage->active_seqno 
721
		if (assoc->usage->active_seqno
734
		    == assoc_mgr_root_assoc->usage->active_seqno)
722
		    == assoc_mgr_root_assoc->usage->active_seqno)
735
			break;
723
			break;
736
		assoc->usage->active_seqno 
724
		assoc->usage->active_seqno
737
			= assoc_mgr_root_assoc->usage->active_seqno;
725
			= assoc_mgr_root_assoc->usage->active_seqno;
738
	}
726
	}
739
	return true;
727
	return true;
Lines 832-839 static void _init_grp_used_cpu_run_secs(time_t last_ran) Link Here
832
820
833
	lock_slurmctld(job_read_lock);
821
	lock_slurmctld(job_read_lock);
834
	itr = list_iterator_create(job_list);
822
	itr = list_iterator_create(job_list);
835
	if (itr == NULL)
836
		fatal("list_iterator_create: malloc failure");
837
823
838
	assoc_mgr_lock(&locks);
824
	assoc_mgr_lock(&locks);
839
	while ((job_ptr = list_next(itr))) {
825
	while ((job_ptr = list_next(itr))) {
Lines 1046-1052 static void *_decay_thread(void *no_data) Link Here
1046
	/* Write lock on jobs, read lock on nodes and partitions */
1032
	/* Write lock on jobs, read lock on nodes and partitions */
1047
	slurmctld_lock_t job_write_lock =
1033
	slurmctld_lock_t job_write_lock =
1048
		{ NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK };
1034
		{ NO_LOCK, WRITE_LOCK, READ_LOCK, READ_LOCK };
1049
	slurmctld_lock_t job_read_lock = 
1035
	slurmctld_lock_t job_read_lock =
1050
		{ NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
1036
		{ NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
1051
	assoc_mgr_lock_t locks = { WRITE_LOCK, NO_LOCK,
1037
	assoc_mgr_lock_t locks = { WRITE_LOCK, NO_LOCK,
1052
				   NO_LOCK, NO_LOCK, NO_LOCK };
1038
				   NO_LOCK, NO_LOCK, NO_LOCK };
Lines 1172-1178 static void *_decay_thread(void *no_data) Link Here
1172
				&& last_ran)
1158
				&& last_ran)
1173
				_apply_new_usage(job_ptr, decay_factor,
1159
				_apply_new_usage(job_ptr, decay_factor,
1174
						 last_ran, start_time);
1160
						 last_ran, start_time);
1175
					
1161
1176
			if (IS_JOB_PENDING(job_ptr) && job_ptr->assoc_ptr) {
1162
			if (IS_JOB_PENDING(job_ptr) && job_ptr->assoc_ptr) {
1177
				assoc_mgr_lock(&locks);
1163
				assoc_mgr_lock(&locks);
1178
				_mark_assoc_active(job_ptr);
1164
				_mark_assoc_active(job_ptr);
Lines 1190-1196 static void *_decay_thread(void *no_data) Link Here
1190
		assoc_mgr_lock(&locks);
1176
		assoc_mgr_lock(&locks);
1191
		max_tickets = 0;
1177
		max_tickets = 0;
1192
		assoc_mgr_root_assoc->usage->tickets = (uint32_t) -1;
1178
		assoc_mgr_root_assoc->usage->tickets = (uint32_t) -1;
1193
		_distribute_tickets (assoc_mgr_root_assoc->usage->childern_list, 
1179
		_distribute_tickets (assoc_mgr_root_assoc->usage->childern_list,
1194
				     (uint32_t) -1);
1180
				     (uint32_t) -1);
1195
		assoc_mgr_unlock(&locks);
1181
		assoc_mgr_unlock(&locks);
1196
1182
Lines 1504-1511 extern List priority_p_get_priority_factors_list( Link Here
1504
		ret_list = list_create(slurm_destroy_priority_factors_object);
1490
		ret_list = list_create(slurm_destroy_priority_factors_object);
1505
		lock_slurmctld(job_read_lock);
1491
		lock_slurmctld(job_read_lock);
1506
		itr = list_iterator_create(job_list);
1492
		itr = list_iterator_create(job_list);
1507
		if (itr == NULL)
1508
			fatal("list_iterator_create: malloc failure");
1509
		while ((job_ptr = list_next(itr))) {
1493
		while ((job_ptr = list_next(itr))) {
1510
			/*
1494
			/*
1511
			 * We are only looking for pending jobs
1495
			 * We are only looking for pending jobs
(-)a/src/plugins/sched/backfill/backfill.c (-4 lines)
Lines 226-233 static int _num_feature_count(struct job_record *job_ptr) Link Here
226
		return rc;
226
		return rc;
227
227
228
	feat_iter = list_iterator_create(detail_ptr->feature_list);
228
	feat_iter = list_iterator_create(detail_ptr->feature_list);
229
	if (feat_iter == NULL)
230
		fatal("list_iterator_create: malloc failure");
231
	while ((feat_ptr = (struct feature_record *) list_next(feat_iter))) {
229
	while ((feat_ptr = (struct feature_record *) list_next(feat_iter))) {
232
		if (feat_ptr->count)
230
		if (feat_ptr->count)
233
			rc++;
231
			rc++;
Lines 270-277 static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap, Link Here
270
		list_size = list_count(detail_ptr->feature_list);
268
		list_size = list_count(detail_ptr->feature_list);
271
		feat_cnt_orig = xmalloc(sizeof(uint16_t) * list_size);
269
		feat_cnt_orig = xmalloc(sizeof(uint16_t) * list_size);
272
		feat_iter = list_iterator_create(detail_ptr->feature_list);
270
		feat_iter = list_iterator_create(detail_ptr->feature_list);
273
		if (feat_iter == NULL)
274
			fatal("list_iterator_create: malloc failure");
275
		while ((feat_ptr =
271
		while ((feat_ptr =
276
			(struct feature_record *) list_next(feat_iter))) {
272
			(struct feature_record *) list_next(feat_iter))) {
277
			high_cnt = MAX(high_cnt, feat_ptr->count);
273
			high_cnt = MAX(high_cnt, feat_ptr->count);
(-)a/src/plugins/sched/builtin/builtin.c (-3 / +1 lines)
Lines 154-163 static void _compute_start_times(void) Link Here
154
	sched_start = now;
154
	sched_start = now;
155
	last_job_alloc = now - 1;
155
	last_job_alloc = now - 1;
156
	alloc_bitmap = bit_alloc(node_record_count);
156
	alloc_bitmap = bit_alloc(node_record_count);
157
	if (alloc_bitmap == NULL)
158
		fatal("bit_alloc: malloc failure");
159
	job_queue = build_job_queue(true);
157
	job_queue = build_job_queue(true);
160
	while ((job_queue_rec = (job_queue_rec_t *) 
158
	while ((job_queue_rec = (job_queue_rec_t *)
161
				list_pop_bottom(job_queue, sort_job_queue2))) {
159
				list_pop_bottom(job_queue, sort_job_queue2))) {
162
		job_ptr  = job_queue_rec->job_ptr;
160
		job_ptr  = job_queue_rec->job_ptr;
163
		part_ptr = job_queue_rec->part_ptr;
161
		part_ptr = job_queue_rec->part_ptr;
(-)a/src/plugins/sched/wiki2/get_nodes.c (-4 lines)
Lines 198-205 static char * _dump_all_nodes(int *node_cnt, time_t update_time) Link Here
198
					hostlist_push(hl, node_ptr->name);
198
					hostlist_push(hl, node_ptr->name);
199
				} else {
199
				} else {
200
					hl = hostlist_create(node_ptr->name);
200
					hl = hostlist_create(node_ptr->name);
201
					if (hl == NULL)
202
						fatal("malloc failure");
203
				}
201
				}
204
				continue;
202
				continue;
205
			} else {
203
			} else {
Lines 207-214 static char * _dump_all_nodes(int *node_cnt, time_t update_time) Link Here
207
						     update_time);
205
						     update_time);
208
				hostlist_destroy(hl);
206
				hostlist_destroy(hl);
209
				hl = hostlist_create(node_ptr->name);
207
				hl = hostlist_create(node_ptr->name);
210
				if (hl == NULL)
211
					fatal("malloc failure");
212
				uniq_node_ptr = node_ptr;
208
				uniq_node_ptr = node_ptr;
213
			}
209
			}
214
		} else {
210
		} else {
(-)a/src/plugins/select/bluegene/ba_common.c (-4 lines)
Lines 212-219 static ba_geo_combos_t *_build_geo_bitmap_arrays(int size) Link Here
212
	for (i = 1; i <= combos->elem_count; i++) {
212
	for (i = 1; i <= combos->elem_count; i++) {
213
		bool some_bit_set = false, some_gap_set = false;
213
		bool some_bit_set = false, some_gap_set = false;
214
		combos->set_bits_array[i-1] = bit_alloc(size);
214
		combos->set_bits_array[i-1] = bit_alloc(size);
215
		if (combos->set_bits_array[i-1] == NULL)
216
			fatal("bit_alloc: malloc failure");
217
215
218
		gap_count = 0;
216
		gap_count = 0;
219
		gap_start = -1;
217
		gap_start = -1;
Lines 1254-1261 extern void ba_free_geo_table(ba_geo_system_t *my_geo_system) Link Here
1254
extern bitstr_t *ba_node_map_alloc(ba_geo_system_t *my_geo_system)
1252
extern bitstr_t *ba_node_map_alloc(ba_geo_system_t *my_geo_system)
1255
{
1253
{
1256
	bitstr_t *cnode_map = bit_alloc(my_geo_system->total_size);
1254
	bitstr_t *cnode_map = bit_alloc(my_geo_system->total_size);
1257
	if (cnode_map == NULL)
1258
		fatal("bit_alloc: malloc failure");
1259
	return cnode_map;
1255
	return cnode_map;
1260
}
1256
}
1261
1257
(-)a/src/plugins/select/bluegene/bg_job_place.c (-3 lines)
Lines 1612-1620 static void _build_job_resources_struct( Link Here
1612
/* 	job_resrcs_ptr->nhosts = node_cnt; */
1612
/* 	job_resrcs_ptr->nhosts = node_cnt; */
1613
	job_resrcs_ptr->nhosts = bit_set_count(bitmap);
1613
	job_resrcs_ptr->nhosts = bit_set_count(bitmap);
1614
1614
1615
	if (!(job_resrcs_ptr->node_bitmap = bit_copy(bitmap)))
1616
		fatal("bit_copy malloc failure");
1617
1618
	job_resrcs_ptr->nodes = xstrdup(bg_record->mp_str);
1615
	job_resrcs_ptr->nodes = xstrdup(bg_record->mp_str);
1619
1616
1620
	job_resrcs_ptr->cpu_array_cnt = 1;
1617
	job_resrcs_ptr->cpu_array_cnt = 1;
(-)a/src/plugins/select/bluegene/select_bluegene.c (-11 lines)
Lines 1100-1108 static List _get_config(void) Link Here
1100
	config_key_pair_t *key_pair;
1100
	config_key_pair_t *key_pair;
1101
	List my_list = list_create(destroy_config_key_pair);
1101
	List my_list = list_create(destroy_config_key_pair);
1102
1102
1103
	if (!my_list)
1104
		fatal("malloc failure on list_create");
1105
1106
	key_pair = xmalloc(sizeof(config_key_pair_t));
1103
	key_pair = xmalloc(sizeof(config_key_pair_t));
1107
	key_pair->name = xstrdup("DefaultConnType");
1104
	key_pair->name = xstrdup("DefaultConnType");
1108
	key_pair->value = conn_type_string_full(bg_conf->default_conn_type);
1105
	key_pair->value = conn_type_string_full(bg_conf->default_conn_type);
Lines 1928-1935 extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, Link Here
1928
				     bg_record->bg_block_id, job_ptr->job_id);
1925
				     bg_record->bg_block_id, job_ptr->job_id);
1929
			goto end_it;
1926
			goto end_it;
1930
		}
1927
		}
1931
		if (!(picked_mps = bit_copy(job_ptr->node_bitmap)))
1932
			fatal("bit_copy malloc failure");
1933
1928
1934
		if (cluster_flags & CLUSTER_FLAG_BGQ) {
1929
		if (cluster_flags & CLUSTER_FLAG_BGQ) {
1935
			bitstr_t *used_bitmap;
1930
			bitstr_t *used_bitmap;
Lines 1992-1999 extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, Link Here
1992
			FREE_NULL_BITMAP(total_bitmap);
1987
			FREE_NULL_BITMAP(total_bitmap);
1993
1988
1994
		node_count = step_jobinfo->cnode_cnt;
1989
		node_count = step_jobinfo->cnode_cnt;
1995
		if (!(picked_mps = bit_copy(job_ptr->node_bitmap)))
1996
			fatal("bit_copy malloc failure");
1997
		bit_or(jobinfo->units_used, step_jobinfo->units_used);
1990
		bit_or(jobinfo->units_used, step_jobinfo->units_used);
1998
		for (dim = 0; dim < step_jobinfo->dim_cnt; dim++) {
1991
		for (dim = 0; dim < step_jobinfo->dim_cnt; dim++) {
1999
			/* The IBM software works off a relative
1992
			/* The IBM software works off a relative
Lines 2017-2024 extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr, Link Here
2017
		}
2010
		}
2018
	} else if ((ba_mp = ba_sub_block_in_record(
2011
	} else if ((ba_mp = ba_sub_block_in_record(
2019
			    bg_record, &node_count, step_jobinfo))) {
2012
			    bg_record, &node_count, step_jobinfo))) {
2020
		if (!(picked_mps = bit_alloc(bit_size(job_ptr->node_bitmap))))
2021
			fatal("bit_copy malloc failure");
2022
		bit_set(picked_mps, ba_mp->index);
2013
		bit_set(picked_mps, ba_mp->index);
2023
		for (dim = 0; dim < step_jobinfo->dim_cnt; dim++) {
2014
		for (dim = 0; dim < step_jobinfo->dim_cnt; dim++) {
2024
			/* The IBM software works off a relative
2015
			/* The IBM software works off a relative
Lines 3359-3366 extern bitstr_t *select_p_resv_test(bitstr_t *avail_bitmap, uint32_t node_cnt, Link Here
3359
	tmp_bitmap = bit_copy(avail_bitmap);
3350
	tmp_bitmap = bit_copy(avail_bitmap);
3360
3351
3361
	preemptee_candidates = list_create(NULL);
3352
	preemptee_candidates = list_create(NULL);
3362
	if (preemptee_candidates == NULL)
3363
		fatal("list_create: malloc failure");
3364
3353
3365
	rc = submit_job(&job_rec, tmp_bitmap, node_cnt, node_cnt, node_cnt,
3354
	rc = submit_job(&job_rec, tmp_bitmap, node_cnt, node_cnt, node_cnt,
3366
			SELECT_MODE_WILL_RUN, preemptee_candidates,
3355
			SELECT_MODE_WILL_RUN, preemptee_candidates,
(-)a/src/plugins/select/cons_res/job_test.c (-4 lines)
Lines 1816-1823 static int _choose_nodes(struct job_record *job_ptr, bitstr_t *node_map, Link Here
1816
		max_nodes = job_ptr->details->min_cpus;
1816
		max_nodes = job_ptr->details->min_cpus;
1817
1817
1818
	origmap = bit_copy(node_map);
1818
	origmap = bit_copy(node_map);
1819
	if (origmap == NULL)
1820
		fatal("bit_copy malloc failure");
1821
1819
1822
	ec = _eval_nodes(job_ptr, node_map, min_nodes, max_nodes,
1820
	ec = _eval_nodes(job_ptr, node_map, min_nodes, max_nodes,
1823
			 req_nodes, cr_node_cnt, cpu_cnt);
1821
			 req_nodes, cr_node_cnt, cpu_cnt);
Lines 2424-2431 alloc_job: Link Here
2424
	job_res                   = create_job_resources();
2422
	job_res                   = create_job_resources();
2425
	job_res->node_bitmap      = bit_copy(bitmap);
2423
	job_res->node_bitmap      = bit_copy(bitmap);
2426
	job_res->nodes            = bitmap2node_name(bitmap);
2424
	job_res->nodes            = bitmap2node_name(bitmap);
2427
	if (job_res->node_bitmap == NULL)
2428
		fatal("bit_copy malloc failure");
2429
	job_res->nhosts           = bit_set_count(bitmap);
2425
	job_res->nhosts           = bit_set_count(bitmap);
2430
	job_res->ncpus            = job_res->nhosts;
2426
	job_res->ncpus            = job_res->nhosts;
2431
	if (job_ptr->details->ntasks_per_node)
2427
	if (job_ptr->details->ntasks_per_node)
(-)a/src/plugins/select/cons_res/select_cons_res.c (-12 lines)
Lines 957-968 static int _job_expand(struct job_record *from_job_ptr, Link Here
957
	}
957
	}
958
958
959
	tmp_bitmap = bit_copy(to_job_resrcs_ptr->node_bitmap);
959
	tmp_bitmap = bit_copy(to_job_resrcs_ptr->node_bitmap);
960
	if (!tmp_bitmap)
961
		fatal("bit_copy: malloc failure");
962
	bit_or(tmp_bitmap, from_job_resrcs_ptr->node_bitmap);
960
	bit_or(tmp_bitmap, from_job_resrcs_ptr->node_bitmap);
963
	tmp_bitmap2 = bit_copy(to_job_ptr->node_bitmap);
961
	tmp_bitmap2 = bit_copy(to_job_ptr->node_bitmap);
964
	if (!tmp_bitmap)
965
		fatal("bit_copy: malloc failure");
966
	bit_or(tmp_bitmap2, from_job_ptr->node_bitmap);
962
	bit_or(tmp_bitmap2, from_job_ptr->node_bitmap);
967
	bit_and(tmp_bitmap, tmp_bitmap2);
963
	bit_and(tmp_bitmap, tmp_bitmap2);
968
	bit_free(tmp_bitmap2);
964
	bit_free(tmp_bitmap2);
Lines 1498-1505 static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
1498
1494
1499
	save_bitmap = bit_copy(bitmap);
1495
	save_bitmap = bit_copy(bitmap);
1500
top:	orig_map = bit_copy(save_bitmap);
1496
top:	orig_map = bit_copy(save_bitmap);
1501
	if (!orig_map)
1502
		fatal("bit_copy: malloc failure");
1503
1497
1504
	rc = cr_job_test(job_ptr, bitmap, min_nodes, max_nodes, req_nodes,
1498
	rc = cr_job_test(job_ptr, bitmap, min_nodes, max_nodes, req_nodes,
1505
			 SELECT_MODE_RUN_NOW, cr_type, job_node_req,
1499
			 SELECT_MODE_RUN_NOW, cr_type, job_node_req,
Lines 1589-1596 top: orig_map = bit_copy(save_bitmap); Link Here
1589
			 * actually used */
1583
			 * actually used */
1590
			if (*preemptee_job_list == NULL) {
1584
			if (*preemptee_job_list == NULL) {
1591
				*preemptee_job_list = list_create(NULL);
1585
				*preemptee_job_list = list_create(NULL);
1592
				if (*preemptee_job_list == NULL)
1593
					fatal("list_create malloc failure");
1594
			}
1586
			}
1595
			preemptee_iterator = list_iterator_create(
1587
			preemptee_iterator = list_iterator_create(
1596
				preemptee_candidates);
1588
				preemptee_candidates);
Lines 1644-1651 static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
1644
	time_t now = time(NULL);
1636
	time_t now = time(NULL);
1645
1637
1646
	orig_map = bit_copy(bitmap);
1638
	orig_map = bit_copy(bitmap);
1647
	if (!orig_map)
1648
		fatal("bit_copy: malloc failure");
1649
1639
1650
	/* Try to run with currently available nodes */
1640
	/* Try to run with currently available nodes */
1651
	rc = cr_job_test(job_ptr, bitmap, min_nodes, max_nodes, req_nodes,
1641
	rc = cr_job_test(job_ptr, bitmap, min_nodes, max_nodes, req_nodes,
Lines 1756-1763 static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
1756
		 * in selected plugin, but by Moab or something else. */
1746
		 * in selected plugin, but by Moab or something else. */
1757
		if (*preemptee_job_list == NULL) {
1747
		if (*preemptee_job_list == NULL) {
1758
			*preemptee_job_list = list_create(NULL);
1748
			*preemptee_job_list = list_create(NULL);
1759
			if (*preemptee_job_list == NULL)
1760
				fatal("list_create malloc failure");
1761
		}
1749
		}
1762
		preemptee_iterator =list_iterator_create(preemptee_candidates);
1750
		preemptee_iterator =list_iterator_create(preemptee_candidates);
1763
		if (preemptee_iterator == NULL)
1751
		if (preemptee_iterator == NULL)
(-)a/src/plugins/select/cray/basil_interface.c (-3 lines)
Lines 320-328 extern int basil_inventory(void) Link Here
320
		struct job_record *job_ptr;
320
		struct job_record *job_ptr;
321
		uint32_t resv_id;
321
		uint32_t resv_id;
322
322
323
		if (job_iter == NULL)
324
			fatal("list_iterator_create: malloc failure");
325
326
		while ((job_ptr = (struct job_record *)list_next(job_iter))) {
323
		while ((job_ptr = (struct job_record *)list_next(job_iter))) {
327
324
328
			if (_get_select_jobinfo(job_ptr->select_jobinfo->data,
325
			if (_get_select_jobinfo(job_ptr->select_jobinfo->data,
(-)a/src/plugins/select/linear/select_linear.c (-18 lines)
Lines 572-579 static void _build_select_struct(struct job_record *job_ptr, bitstr_t *bitmap) Link Here
572
	job_ptr->job_resrcs = job_resrcs_ptr = _create_job_resources(node_cnt);
572
	job_ptr->job_resrcs = job_resrcs_ptr = _create_job_resources(node_cnt);
573
	job_resrcs_ptr->node_bitmap = bit_copy(bitmap);
573
	job_resrcs_ptr->node_bitmap = bit_copy(bitmap);
574
	job_resrcs_ptr->nodes = bitmap2node_name(bitmap);
574
	job_resrcs_ptr->nodes = bitmap2node_name(bitmap);
575
	if (job_resrcs_ptr->node_bitmap == NULL)
576
		fatal("bit_copy malloc failure");
577
	job_resrcs_ptr->ncpus = job_ptr->total_cpus;
575
	job_resrcs_ptr->ncpus = job_ptr->total_cpus;
578
	if (build_job_resources(job_resrcs_ptr, (void *)select_node_ptr,
576
	if (build_job_resources(job_resrcs_ptr, (void *)select_node_ptr,
579
				select_fast_schedule))
577
				select_fast_schedule))
Lines 1619-1630 static int _job_expand(struct job_record *from_job_ptr, Link Here
1619
	}
1617
	}
1620
1618
1621
	tmp_bitmap = bit_copy(to_job_resrcs_ptr->node_bitmap);
1619
	tmp_bitmap = bit_copy(to_job_resrcs_ptr->node_bitmap);
1622
	if (!tmp_bitmap)
1623
		fatal("bit_copy: malloc failure");
1624
	bit_or(tmp_bitmap, from_job_resrcs_ptr->node_bitmap);
1620
	bit_or(tmp_bitmap, from_job_resrcs_ptr->node_bitmap);
1625
	tmp_bitmap2 = bit_copy(to_job_ptr->node_bitmap);
1621
	tmp_bitmap2 = bit_copy(to_job_ptr->node_bitmap);
1626
	if (!tmp_bitmap)
1627
		fatal("bit_copy: malloc failure");
1628
	bit_or(tmp_bitmap2, from_job_ptr->node_bitmap);
1622
	bit_or(tmp_bitmap2, from_job_ptr->node_bitmap);
1629
	bit_and(tmp_bitmap, tmp_bitmap2);
1623
	bit_and(tmp_bitmap, tmp_bitmap2);
1630
	bit_free(tmp_bitmap2);
1624
	bit_free(tmp_bitmap2);
Lines 2148-2155 static void _init_node_cr(void) Link Here
2148
2142
2149
	/* build partition records */
2143
	/* build partition records */
2150
	part_iterator = list_iterator_create(part_list);
2144
	part_iterator = list_iterator_create(part_list);
2151
	if (part_iterator == NULL)
2152
		fatal("list_iterator_create: malloc failure");
2153
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
2145
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
2154
		for (i = 0; i < select_node_cnt; i++) {
2146
		for (i = 0; i < select_node_cnt; i++) {
2155
			if (part_ptr->node_bitmap == NULL)
2147
			if (part_ptr->node_bitmap == NULL)
Lines 2302-2309 static int _test_only(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
2302
	uint32_t save_mem;
2294
	uint32_t save_mem;
2303
2295
2304
	orig_map = bit_copy(bitmap);
2296
	orig_map = bit_copy(bitmap);
2305
	if (!orig_map)
2306
		fatal("bit_copy: malloc failure");
2307
2297
2308
	/* Try to run with currently available nodes */
2298
	/* Try to run with currently available nodes */
2309
	i = _job_count_bitmap(cr_ptr, job_ptr, orig_map, bitmap,
2299
	i = _job_count_bitmap(cr_ptr, job_ptr, orig_map, bitmap,
Lines 2352-2359 static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
2352
	uint16_t pass_count = 0;
2342
	uint16_t pass_count = 0;
2353
2343
2354
	orig_map = bit_copy(bitmap);
2344
	orig_map = bit_copy(bitmap);
2355
	if (!orig_map)
2356
		fatal("bit_copy: malloc failure");
2357
2345
2358
	for (max_run_job=0; ((max_run_job<max_share) && (rc != SLURM_SUCCESS));
2346
	for (max_run_job=0; ((max_run_job<max_share) && (rc != SLURM_SUCCESS));
2359
	     max_run_job++) {
2347
	     max_run_job++) {
Lines 2457-2464 top: if ((rc != SLURM_SUCCESS) && preemptee_candidates && Link Here
2457
			 * actually used */
2445
			 * actually used */
2458
			if (*preemptee_job_list == NULL) {
2446
			if (*preemptee_job_list == NULL) {
2459
				*preemptee_job_list = list_create(NULL);
2447
				*preemptee_job_list = list_create(NULL);
2460
				if (*preemptee_job_list == NULL)
2461
					fatal("list_create malloc failure");
2462
			}
2448
			}
2463
			preemptee_iterator = list_iterator_create(
2449
			preemptee_iterator = list_iterator_create(
2464
				preemptee_candidates);
2450
				preemptee_candidates);
Lines 2503-2510 static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
2503
2489
2504
	max_run_jobs = MAX((max_share - 1), 1);	/* exclude this job */
2490
	max_run_jobs = MAX((max_share - 1), 1);	/* exclude this job */
2505
	orig_map = bit_copy(bitmap);
2491
	orig_map = bit_copy(bitmap);
2506
	if (!orig_map)
2507
		fatal("bit_copy: malloc failure");
2508
2492
2509
	/* Try to run with currently available nodes */
2493
	/* Try to run with currently available nodes */
2510
	i = _job_count_bitmap(cr_ptr, job_ptr, orig_map, bitmap,
2494
	i = _job_count_bitmap(cr_ptr, job_ptr, orig_map, bitmap,
Lines 2605-2612 static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
2605
		 * in selected plugin, but by Moab or something else. */
2589
		 * in selected plugin, but by Moab or something else. */
2606
		if (*preemptee_job_list == NULL) {
2590
		if (*preemptee_job_list == NULL) {
2607
			*preemptee_job_list = list_create(NULL);
2591
			*preemptee_job_list = list_create(NULL);
2608
			if (*preemptee_job_list == NULL)
2609
				fatal("list_create malloc failure");
2610
		}
2592
		}
2611
		preemptee_iterator =list_iterator_create(preemptee_candidates);
2593
		preemptee_iterator =list_iterator_create(preemptee_candidates);
2612
		while ((tmp_job_ptr = (struct job_record *)
2594
		while ((tmp_job_ptr = (struct job_record *)
(-)a/src/plugins/select/serial/job_test.c (-4 lines)
Lines 327-334 bitstr_t *_make_core_bitmap(bitstr_t *node_map) Link Here
327
	nodes = bit_size(node_map);
327
	nodes = bit_size(node_map);
328
	size = cr_get_coremap_offset(nodes);
328
	size = cr_get_coremap_offset(nodes);
329
	bitstr_t *core_map = bit_alloc(size);
329
	bitstr_t *core_map = bit_alloc(size);
330
	if (!core_map)
331
		fatal("bit_alloc: malloc failure");
332
330
333
	i_first = bit_ffs(node_map);
331
	i_first = bit_ffs(node_map);
334
	if (i_first >= 0)
332
	if (i_first >= 0)
Lines 853-860 alloc_job: Link Here
853
	job_res                   = create_job_resources();
851
	job_res                   = create_job_resources();
854
	job_res->node_bitmap      = bit_copy(bitmap);
852
	job_res->node_bitmap      = bit_copy(bitmap);
855
	job_res->nodes            = bitmap2node_name(bitmap);
853
	job_res->nodes            = bitmap2node_name(bitmap);
856
	if (job_res->node_bitmap == NULL)
857
		fatal("bit_copy malloc failure");
858
	job_res->nhosts           = bit_set_count(bitmap);
854
	job_res->nhosts           = bit_set_count(bitmap);
859
	job_res->ncpus            = job_res->nhosts;
855
	job_res->ncpus            = job_res->nhosts;
860
	if (job_ptr->details->ntasks_per_node)
856
	if (job_ptr->details->ntasks_per_node)
(-)a/src/plugins/select/serial/select_serial.c (-8 lines)
Lines 1083-1090 static int _run_now(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
1083
1083
1084
	save_bitmap = bit_copy(bitmap);
1084
	save_bitmap = bit_copy(bitmap);
1085
top:	orig_map = bit_copy(save_bitmap);
1085
top:	orig_map = bit_copy(save_bitmap);
1086
	if (!orig_map)
1087
		fatal("bit_copy: malloc failure");
1088
1086
1089
	rc = cr_job_test(job_ptr, bitmap,
1087
	rc = cr_job_test(job_ptr, bitmap,
1090
			 SELECT_MODE_RUN_NOW, cr_type, job_node_share,
1088
			 SELECT_MODE_RUN_NOW, cr_type, job_node_share,
Lines 1172-1179 top: orig_map = bit_copy(save_bitmap); Link Here
1172
			 * actually used */
1170
			 * actually used */
1173
			if (*preemptee_job_list == NULL) {
1171
			if (*preemptee_job_list == NULL) {
1174
				*preemptee_job_list = list_create(NULL);
1172
				*preemptee_job_list = list_create(NULL);
1175
				if (*preemptee_job_list == NULL)
1176
					fatal("list_create malloc failure");
1177
			}
1173
			}
1178
			preemptee_iterator = list_iterator_create(
1174
			preemptee_iterator = list_iterator_create(
1179
				preemptee_candidates);
1175
				preemptee_candidates);
Lines 1225-1232 static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
1225
	time_t now = time(NULL);
1221
	time_t now = time(NULL);
1226
1222
1227
	orig_map = bit_copy(bitmap);
1223
	orig_map = bit_copy(bitmap);
1228
	if (!orig_map)
1229
		fatal("bit_copy: malloc failure");
1230
1224
1231
	/* Try to run with currently available nodes */
1225
	/* Try to run with currently available nodes */
1232
	rc = cr_job_test(job_ptr, bitmap,
1226
	rc = cr_job_test(job_ptr, bitmap,
Lines 1335-1342 static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap, Link Here
1335
		 * in selected plugin, but by Moab or something else. */
1329
		 * in selected plugin, but by Moab or something else. */
1336
		if (*preemptee_job_list == NULL) {
1330
		if (*preemptee_job_list == NULL) {
1337
			*preemptee_job_list = list_create(NULL);
1331
			*preemptee_job_list = list_create(NULL);
1338
			if (*preemptee_job_list == NULL)
1339
				fatal("list_create malloc failure");
1340
		}
1332
		}
1341
		preemptee_iterator =list_iterator_create(preemptee_candidates);
1333
		preemptee_iterator =list_iterator_create(preemptee_candidates);
1342
		if (preemptee_iterator == NULL)
1334
		if (preemptee_iterator == NULL)
(-)a/src/plugins/switch/nrt/nrt.c (-6 lines)
Lines 1531-1538 _print_adapter_status(nrt_cmd_status_adapter_t *status_adapter) Link Here
1531
	hostset_t hs;
1531
	hostset_t hs;
1532
1532
1533
	hs = hostset_create("");
1533
	hs = hostset_create("");
1534
	if (hs == NULL)
1535
		fatal("hostset_create malloc failure");
1536
	info("--Begin Adapter Status--");
1534
	info("--Begin Adapter Status--");
1537
	info("  adapter_name: %s", status_adapter->adapter_name);
1535
	info("  adapter_name: %s", status_adapter->adapter_name);
1538
	info("  adapter_type: %s",
1536
	info("  adapter_type: %s",
Lines 1621-1628 _print_nodeinfo(slurm_nrt_nodeinfo_t *n) Link Here
1621
1619
1622
		info("    window_count: %hu", a->window_count);
1620
		info("    window_count: %hu", a->window_count);
1623
		hs = hostset_create("");
1621
		hs = hostset_create("");
1624
		if (hs == NULL)
1625
			fatal("hostset_create malloc failure");
1626
		w = a->window_list;
1622
		w = a->window_list;
1627
		for (j = 0; j < a->window_count; j++) {
1623
		for (j = 0; j < a->window_count; j++) {
1628
			if ((w[j].state == NRT_WIN_AVAILABLE) &&
1624
			if ((w[j].state == NRT_WIN_AVAILABLE) &&
Lines 4279-4286 nrt_clear_node_state(void) Link Here
4279
				}
4275
				}
4280
4276
4281
				hs = hostset_create("");
4277
				hs = hostset_create("");
4282
				if (hs == NULL)
4283
					fatal("hostset_create malloc failure");
4284
			}
4278
			}
4285
			for (k = 0; k < window_count; k++) {
4279
			for (k = 0; k < window_count; k++) {
4286
				if (debug_flags & DEBUG_FLAG_SWITCH) {
4280
				if (debug_flags & DEBUG_FLAG_SWITCH) {
(-)a/src/plugins/task/affinity/dist_tasks.c (-19 lines)
Lines 191-203 void batch_bind(batch_job_launch_msg_t *req) Link Here
191
			 (conf->sockets * conf->cores));
191
			 (conf->sockets * conf->cores));
192
	req_map = (bitstr_t *) bit_alloc(num_cpus);
192
	req_map = (bitstr_t *) bit_alloc(num_cpus);
193
	hw_map  = (bitstr_t *) bit_alloc(conf->block_map_size);
193
	hw_map  = (bitstr_t *) bit_alloc(conf->block_map_size);
194
	if (!req_map || !hw_map) {
195
		error("task/affinity: malloc error");
196
		FREE_NULL_BITMAP(req_map);
197
		FREE_NULL_BITMAP(hw_map);
198
		slurm_cred_free_args(&arg);
199
		return;
200
	}
201
194
202
#ifdef HAVE_FRONT_END
195
#ifdef HAVE_FRONT_END
203
{
196
{
Lines 497-507 static char *_alloc_mask(launch_tasks_request_msg_t *req, Link Here
497
		return NULL;
490
		return NULL;
498
491
499
	alloc_mask = bit_alloc(bit_size(alloc_bitmap));
492
	alloc_mask = bit_alloc(bit_size(alloc_bitmap));
500
	if (!alloc_mask) {
501
		error("malloc error");
502
		FREE_NULL_BITMAP(alloc_bitmap);
503
		return NULL;
504
	}
505
493
506
	i = 0;
494
	i = 0;
507
	for (s=0, s_miss=false; s<sockets; s++) {
495
	for (s=0, s_miss=false; s<sockets; s++) {
Lines 603-615 static bitstr_t *_get_avail_map(launch_tasks_request_msg_t *req, Link Here
603
	req_map = (bitstr_t *) bit_alloc(num_cpus);
591
	req_map = (bitstr_t *) bit_alloc(num_cpus);
604
	hw_map  = (bitstr_t *) bit_alloc(conf->block_map_size);
592
	hw_map  = (bitstr_t *) bit_alloc(conf->block_map_size);
605
593
606
	if (!req_map || !hw_map) {
607
		error("task/affinity: malloc error");
608
		FREE_NULL_BITMAP(req_map);
609
		FREE_NULL_BITMAP(hw_map);
610
		slurm_cred_free_args(&arg);
611
		return NULL;
612
	}
613
	/* Transfer core_bitmap data to local req_map.
594
	/* Transfer core_bitmap data to local req_map.
614
	 * The MOD function handles the case where fewer processes
595
	 * The MOD function handles the case where fewer processes
615
	 * physically exist than are configured (slurmd is out of
596
	 * physically exist than are configured (slurmd is out of
(-)a/src/plugins/topology/tree/topology_tree.c (-4 lines)
Lines 295-302 static void _validate_switches(void) Link Here
295
			if (switch_ptr->level != -1)
295
			if (switch_ptr->level != -1)
296
				continue;
296
				continue;
297
			hl = hostlist_create(switch_ptr->switches);
297
			hl = hostlist_create(switch_ptr->switches);
298
			if (!hl)
299
				fatal("hostlist_create: malloc failure");
300
			while ((child = hostlist_pop(hl))) {
298
			while ((child = hostlist_pop(hl))) {
301
				j = _get_switch_inx(child);
299
				j = _get_switch_inx(child);
302
				if ((j < 0) || (j == i)) {
300
				if ((j < 0) || (j == i)) {
Lines 548-555 static int _node_name2bitmap(char *node_names, bitstr_t **bitmap, Link Here
548
	hostlist_t host_list;
546
	hostlist_t host_list;
549
547
550
	my_bitmap = (bitstr_t *) bit_alloc(node_record_count);
548
	my_bitmap = (bitstr_t *) bit_alloc(node_record_count);
551
	if (my_bitmap == NULL)
552
		fatal("bit_alloc malloc failure");
553
	*bitmap = my_bitmap;
549
	*bitmap = my_bitmap;
554
550
555
	if (node_names == NULL) {
551
	if (node_names == NULL) {
(-)a/src/sbatch/mult_cluster.c (-2 lines)
Lines 174-181 extern int sbatch_set_first_avail_cluster(job_desc_msg_t *req) Link Here
174
	}
174
	}
175
175
176
	ret_list = list_create(_destroy_local_cluster_rec);
176
	ret_list = list_create(_destroy_local_cluster_rec);
177
	if (ret_list == NULL)
178
		fatal("list_create malloc failure");
179
	itr = list_iterator_create(opt.clusters);
177
	itr = list_iterator_create(opt.clusters);
180
	while ((working_cluster_rec = list_next(itr))) {
178
	while ((working_cluster_rec = list_next(itr))) {
181
		if ((local_cluster = _job_will_run(req)))
179
		if ((local_cluster = _job_will_run(req)))
(-)a/src/scancel/scancel.c (-2 lines)
Lines 126-133 _multi_cluster(List clusters) Link Here
126
	int rc = 0, rc2;
126
	int rc = 0, rc2;
127
127
128
	itr = list_iterator_create(clusters);
128
	itr = list_iterator_create(clusters);
129
	if (!itr)
130
		fatal("list_iterator_create: malloc failure");
131
	while ((working_cluster_rec = list_next(itr))) {
129
	while ((working_cluster_rec = list_next(itr))) {
132
		rc2 = _proc_cluster();
130
		rc2 = _proc_cluster();
133
		rc = MAX(rc, rc2);
131
		rc = MAX(rc, rc2);
(-)a/src/slurmctld/front_end.c (-2 lines)
Lines 368-375 extern void restore_front_end_state(int recover) Link Here
368
		return;		/* No front ends in slurm.conf */
368
		return;		/* No front ends in slurm.conf */
369
369
370
	iter = list_iterator_create(front_end_list);
370
	iter = list_iterator_create(front_end_list);
371
	if (iter == NULL)
372
		fatal("list_iterator_create: malloc failure");
373
	while ((slurm_conf_fe_ptr = (slurm_conf_frontend_t *)
371
	while ((slurm_conf_fe_ptr = (slurm_conf_frontend_t *)
374
				    list_next(iter))) {
372
				    list_next(iter))) {
375
		if (slurm_conf_fe_ptr->frontends == NULL)
373
		if (slurm_conf_fe_ptr->frontends == NULL)
(-)a/src/slurmctld/gang.c (-2 lines)
Lines 1051-1058 static void _scan_slurm_job_list(void) Link Here
1051
	if (gs_debug_flags & DEBUG_FLAG_GANG)
1051
	if (gs_debug_flags & DEBUG_FLAG_GANG)
1052
		info("gang: _scan_slurm_job_list: job_list exists...");
1052
		info("gang: _scan_slurm_job_list: job_list exists...");
1053
	job_iterator = list_iterator_create(job_list);
1053
	job_iterator = list_iterator_create(job_list);
1054
	if (job_iterator == NULL)
1055
		fatal("list_iterator_create: malloc failure");
1056
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
1054
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
1057
		if (gs_debug_flags & DEBUG_FLAG_GANG) {
1055
		if (gs_debug_flags & DEBUG_FLAG_GANG) {
1058
			info("gang: _scan_slurm_job_list: checking job %u",
1056
			info("gang: _scan_slurm_job_list: checking job %u",
(-)a/src/slurmctld/groups.c (-4 lines)
Lines 215-222 static uid_t *_get_group_cache(char *group_name) Link Here
215
	}
215
	}
216
216
217
	iter = list_iterator_create(group_cache_list);
217
	iter = list_iterator_create(group_cache_list);
218
	if (!iter)
219
		fatal("list_iterator_create: malloc failure");
220
	while ((cache_rec = (struct group_cache_rec *) list_next(iter))) {
218
	while ((cache_rec = (struct group_cache_rec *) list_next(iter))) {
221
		if (strcmp(group_name, cache_rec->group_name))
219
		if (strcmp(group_name, cache_rec->group_name))
222
			continue;
220
			continue;
Lines 250-257 static void _put_group_cache(char *group_name, void *group_uids, int uid_cnt) Link Here
250
	pthread_mutex_lock(&group_cache_mutex);
248
	pthread_mutex_lock(&group_cache_mutex);
251
	if (!group_cache_list) {
249
	if (!group_cache_list) {
252
		group_cache_list = list_create(_cache_del_func);
250
		group_cache_list = list_create(_cache_del_func);
253
		if (!group_cache_list)
254
			fatal("list_create: malloc failure:");
255
	}
251
	}
256
252
257
	sz = sizeof(uid_t) * (uid_cnt);
253
	sz = sizeof(uid_t) * (uid_cnt);
(-)a/src/slurmctld/job_mgr.c (-28 lines)
Lines 871-878 static void _dump_job_state(struct job_record *dump_job_ptr, Buf buffer) Link Here
871
871
872
	/* Dump job steps */
872
	/* Dump job steps */
873
	step_iterator = list_iterator_create(dump_job_ptr->step_list);
873
	step_iterator = list_iterator_create(dump_job_ptr->step_list);
874
	if (!step_iterator)
875
		fatal("list_iterator_create: malloc failure");
876
	while ((step_ptr = (struct step_record *)
874
	while ((step_ptr = (struct step_record *)
877
		list_next(step_iterator))) {
875
		list_next(step_iterator))) {
878
		if (step_ptr->state != JOB_RUNNING)
876
		if (step_ptr->state != JOB_RUNNING)
Lines 1923-1930 static void _rebuild_part_name_list(struct job_record *job_ptr) Link Here
1923
		job_pending = true;
1921
		job_pending = true;
1924
1922
1925
	part_iterator = list_iterator_create(job_ptr->part_ptr_list);
1923
	part_iterator = list_iterator_create(job_ptr->part_ptr_list);
1926
	if (part_iterator == NULL)
1927
		fatal("list_iterator_create malloc failure");
1928
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
1924
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
1929
		if (job_pending) {
1925
		if (job_pending) {
1930
			/* Reset job's one partition to a valid one */
1926
			/* Reset job's one partition to a valid one */
Lines 1970-1977 extern int kill_job_by_part_name(char *part_name) Link Here
1970
			bool rebuild_name_list = false;
1966
			bool rebuild_name_list = false;
1971
			part_iterator = list_iterator_create(job_ptr->
1967
			part_iterator = list_iterator_create(job_ptr->
1972
							     part_ptr_list);
1968
							     part_ptr_list);
1973
			if (part_iterator == NULL)
1974
				fatal("list_iterator_create malloc failure");
1975
			while ((part2_ptr = (struct part_record *)
1969
			while ((part2_ptr = (struct part_record *)
1976
					list_next(part_iterator))) {
1970
					list_next(part_iterator))) {
1977
				if (part2_ptr != part_ptr)
1971
				if (part2_ptr != part_ptr)
Lines 2219-2226 extern bool partition_in_use(char *part_name) Link Here
2219
		return false;
2213
		return false;
2220
2214
2221
	job_iterator = list_iterator_create(job_list);
2215
	job_iterator = list_iterator_create(job_list);
2222
	if (job_iterator == NULL)
2223
		fatal("list_iterator_create: malloc failure");
2224
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2216
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2225
		if (job_ptr->part_ptr == part_ptr) {
2217
		if (job_ptr->part_ptr == part_ptr) {
2226
			if (!IS_JOB_FINISHED(job_ptr)) {
2218
			if (!IS_JOB_FINISHED(job_ptr)) {
Lines 2252-2259 extern bool allocated_session_in_use(job_desc_msg_t *new_alloc) Link Here
2252
2244
2253
	lock_slurmctld(job_read_lock);
2245
	lock_slurmctld(job_read_lock);
2254
	job_iter = list_iterator_create(job_list);
2246
	job_iter = list_iterator_create(job_list);
2255
	if (job_iter == NULL)
2256
		fatal("list_iterator_create: malloc failure");
2257
2247
2258
	while ((job_ptr = (struct job_record *)list_next(job_iter))) {
2248
	while ((job_ptr = (struct job_record *)list_next(job_iter))) {
2259
		if (job_ptr->batch_flag || IS_JOB_FINISHED(job_ptr))
2249
		if (job_ptr->batch_flag || IS_JOB_FINISHED(job_ptr))
Lines 2290-2297 extern int kill_running_job_by_node_name(char *node_name) Link Here
2290
	bit_position = node_ptr - node_record_table_ptr;
2280
	bit_position = node_ptr - node_record_table_ptr;
2291
2281
2292
	job_iterator = list_iterator_create(job_list);
2282
	job_iterator = list_iterator_create(job_list);
2293
	if (job_iterator == NULL)
2294
		fatal("list_iterator_create: malloc failure");
2295
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2283
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2296
		bool suspended = false;
2284
		bool suspended = false;
2297
		if ((job_ptr->node_bitmap == NULL) ||
2285
		if ((job_ptr->node_bitmap == NULL) ||
Lines 3859-3866 static int _job_create(job_desc_msg_t * job_desc, int allocate, int will_run, Link Here
3859
		bitstr_t *tmp_bitmap = NULL;
3847
		bitstr_t *tmp_bitmap = NULL;
3860
		bitoff_t first_set;
3848
		bitoff_t first_set;
3861
		tmp_bitmap = bit_copy(exc_bitmap);
3849
		tmp_bitmap = bit_copy(exc_bitmap);
3862
		if (tmp_bitmap == NULL)
3863
			fatal("bit_copy malloc failure");
3864
		bit_and(tmp_bitmap, req_bitmap);
3850
		bit_and(tmp_bitmap, req_bitmap);
3865
		first_set = bit_ffs(tmp_bitmap);
3851
		first_set = bit_ffs(tmp_bitmap);
3866
		FREE_NULL_BITMAP(tmp_bitmap);
3852
		FREE_NULL_BITMAP(tmp_bitmap);
Lines 4868-4875 void job_time_limit(void) Link Here
4868
4854
4869
	begin_job_resv_check();
4855
	begin_job_resv_check();
4870
	job_iterator = list_iterator_create(job_list);
4856
	job_iterator = list_iterator_create(job_list);
4871
	if (!job_iterator)
4872
		fatal("list_iterator_create: malloc failure");
4873
	while ((job_ptr =(struct job_record *) list_next(job_iterator))) {
4857
	while ((job_ptr =(struct job_record *) list_next(job_iterator))) {
4874
		xassert (job_ptr->magic == JOB_MAGIC);
4858
		xassert (job_ptr->magic == JOB_MAGIC);
4875
4859
Lines 7747-7754 static void _send_job_kill(struct job_record *job_ptr) Link Here
7747
	agent_args->msg_type = REQUEST_TERMINATE_JOB;
7731
	agent_args->msg_type = REQUEST_TERMINATE_JOB;
7748
	agent_args->retry = 0;	/* re_kill_job() resends as needed */
7732
	agent_args->retry = 0;	/* re_kill_job() resends as needed */
7749
	agent_args->hostlist = hostlist_create("");
7733
	agent_args->hostlist = hostlist_create("");
7750
	if (agent_args->hostlist == NULL)
7751
		fatal("hostlist_create: malloc failure");
7752
	kill_job = xmalloc(sizeof(kill_job_msg_t));
7734
	kill_job = xmalloc(sizeof(kill_job_msg_t));
7753
	last_node_update    = time(NULL);
7735
	last_node_update    = time(NULL);
7754
	kill_job->job_id    = job_ptr->job_id;
7736
	kill_job->job_id    = job_ptr->job_id;
Lines 8331-8338 _xmit_new_end_time(struct job_record *job_ptr) Link Here
8331
	agent_args->msg_type = REQUEST_UPDATE_JOB_TIME;
8313
	agent_args->msg_type = REQUEST_UPDATE_JOB_TIME;
8332
	agent_args->retry = 1;
8314
	agent_args->retry = 1;
8333
	agent_args->hostlist = hostlist_create("");
8315
	agent_args->hostlist = hostlist_create("");
8334
	if (agent_args->hostlist == NULL)
8335
		fatal("hostlist_create: malloc failure");
8336
	job_time_msg_ptr = xmalloc(sizeof(job_time_msg_t));
8316
	job_time_msg_ptr = xmalloc(sizeof(job_time_msg_t));
8337
	job_time_msg_ptr->job_id          = job_ptr->job_id;
8317
	job_time_msg_ptr->job_id          = job_ptr->job_id;
8338
	job_time_msg_ptr->expiration_time = job_ptr->end_time;
8318
	job_time_msg_ptr->expiration_time = job_ptr->end_time;
Lines 8749-8756 static void _signal_job(struct job_record *job_ptr, int signal) Link Here
8749
	agent_args->msg_type = REQUEST_SIGNAL_JOB;
8729
	agent_args->msg_type = REQUEST_SIGNAL_JOB;
8750
	agent_args->retry = 1;
8730
	agent_args->retry = 1;
8751
	agent_args->hostlist = hostlist_create("");
8731
	agent_args->hostlist = hostlist_create("");
8752
	if (agent_args->hostlist == NULL)
8753
		fatal("hostlist_create: malloc failure");
8754
	signal_job_msg = xmalloc(sizeof(kill_tasks_msg_t));
8732
	signal_job_msg = xmalloc(sizeof(kill_tasks_msg_t));
8755
	signal_job_msg->job_id = job_ptr->job_id;
8733
	signal_job_msg->job_id = job_ptr->job_id;
8756
	signal_job_msg->signal = signal;
8734
	signal_job_msg->signal = signal;
Lines 8787-8794 static void *_switch_suspend_info(struct job_record *job_ptr) Link Here
8787
	void *switch_suspend_info = NULL;
8765
	void *switch_suspend_info = NULL;
8788
8766
8789
	step_iterator = list_iterator_create (job_ptr->step_list);
8767
	step_iterator = list_iterator_create (job_ptr->step_list);
8790
	if (!step_iterator)
8791
		fatal("list_iterator_create: malloc failure");
8792
	while ((step_ptr = (struct step_record *) list_next (step_iterator))) {
8768
	while ((step_ptr = (struct step_record *) list_next (step_iterator))) {
8793
		if (step_ptr->state != JOB_RUNNING)
8769
		if (step_ptr->state != JOB_RUNNING)
8794
			continue;
8770
			continue;
Lines 8822-8829 static void _suspend_job(struct job_record *job_ptr, uint16_t op, Link Here
8822
				 * quickly induce huge backlog
8798
				 * quickly induce huge backlog
8823
				 * of agent.c RPCs */
8799
				 * of agent.c RPCs */
8824
	agent_args->hostlist = hostlist_create("");
8800
	agent_args->hostlist = hostlist_create("");
8825
	if (agent_args->hostlist == NULL)
8826
		fatal("hostlist_create: malloc failure");
8827
	sus_ptr = xmalloc(sizeof(suspend_int_msg_t));
8801
	sus_ptr = xmalloc(sizeof(suspend_int_msg_t));
8828
	sus_ptr->job_id = job_ptr->job_id;
8802
	sus_ptr->job_id = job_ptr->job_id;
8829
	sus_ptr->op = op;
8803
	sus_ptr->op = op;
Lines 8967-8974 static int _job_suspend_switch_test(struct job_record *job_ptr) Link Here
8967
	struct step_record *step_ptr;
8941
	struct step_record *step_ptr;
8968
8942
8969
	step_iterator = list_iterator_create(job_ptr->step_list);
8943
	step_iterator = list_iterator_create(job_ptr->step_list);
8970
	if (!step_iterator)
8971
		fatal("list_iterator_create: malloc failure");
8972
	while ((step_ptr = (struct step_record *) list_next (step_iterator))) {
8944
	while ((step_ptr = (struct step_record *) list_next (step_iterator))) {
8973
		if (step_ptr->state != JOB_RUNNING)
8945
		if (step_ptr->state != JOB_RUNNING)
8974
			continue;
8946
			continue;
(-)a/src/slurmctld/job_scheduler.c (-25 / +4 lines)
Lines 117-124 static List _build_user_job_list(uint32_t user_id, char* job_name) Link Here
117
	if (job_queue == NULL)
117
	if (job_queue == NULL)
118
		fatal("list_create memory allocation failure");
118
		fatal("list_create memory allocation failure");
119
	job_iterator = list_iterator_create(job_list);
119
	job_iterator = list_iterator_create(job_list);
120
	if (job_iterator == NULL)
121
		fatal("list_iterator_create malloc failure");
122
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
120
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
123
		xassert (job_ptr->magic == JOB_MAGIC);
121
		xassert (job_ptr->magic == JOB_MAGIC);
124
		if (job_ptr->user_id != user_id)
122
		if (job_ptr->user_id != user_id)
Lines 234-242 extern List build_job_queue(bool clear_start) Link Here
234
		if (job_ptr->part_ptr_list) {
232
		if (job_ptr->part_ptr_list) {
235
			part_iterator = list_iterator_create(job_ptr->
233
			part_iterator = list_iterator_create(job_ptr->
236
							     part_ptr_list);
234
							     part_ptr_list);
237
			if (part_iterator == NULL)
235
	      			while ((part_ptr = (struct part_record *)
238
				fatal("list_iterator_create malloc failure");
239
			while ((part_ptr = (struct part_record *)
240
					list_next(part_iterator))) {
236
					list_next(part_iterator))) {
241
				job_ptr->part_ptr = part_ptr;
237
				job_ptr->part_ptr = part_ptr;
242
				if (job_limits_check(&job_ptr) !=
238
				if (job_limits_check(&job_ptr) !=
Lines 478-485 extern bool replace_batch_job(slurm_msg_t * msg, void *fini_job) Link Here
478
		if (job_ptr->part_ptr_list) {
474
		if (job_ptr->part_ptr_list) {
479
			part_iterator = list_iterator_create(job_ptr->
475
			part_iterator = list_iterator_create(job_ptr->
480
							     part_ptr_list);
476
							     part_ptr_list);
481
			if (!part_iterator)
482
				fatal("list_iterator_create: malloc failure");
483
next_part:		part_ptr = (struct part_record *)
477
next_part:		part_ptr = (struct part_record *)
484
				   list_next(part_iterator);
478
				   list_next(part_iterator);
485
			if (part_ptr) {
479
			if (part_ptr) {
Lines 499-505 next_part: part_ptr = (struct part_record *) Link Here
499
			if (job_ptr->part_ptr)
493
			if (job_ptr->part_ptr)
500
				assoc_rec.partition = job_ptr->part_ptr->name;
494
				assoc_rec.partition = job_ptr->part_ptr->name;
501
			assoc_rec.uid       = job_ptr->user_id;
495
			assoc_rec.uid       = job_ptr->user_id;
502
	
496
503
			if (!assoc_mgr_fill_in_assoc(acct_db_conn, &assoc_rec,
497
			if (!assoc_mgr_fill_in_assoc(acct_db_conn, &assoc_rec,
504
						     accounting_enforce,
498
						     accounting_enforce,
505
						     (slurmdb_association_rec_t **)
499
						     (slurmdb_association_rec_t **)
Lines 784-791 extern int schedule(uint32_t job_limit) Link Here
784
			if (job_ptr->part_ptr_list) {
778
			if (job_ptr->part_ptr_list) {
785
				part_iterator = list_iterator_create(
779
				part_iterator = list_iterator_create(
786
							job_ptr->part_ptr_list);
780
							job_ptr->part_ptr_list);
787
				if (!part_iterator)
788
					fatal("list_iterator_create: malloc failure");
789
next_part:			part_ptr = (struct part_record *)
781
next_part:			part_ptr = (struct part_record *)
790
					   list_next(part_iterator);
782
					   list_next(part_iterator);
791
				if (part_ptr) {
783
				if (part_ptr) {
Lines 834-840 next_part: part_ptr = (struct part_record *) Link Here
834
			if (job_ptr->part_ptr)
826
			if (job_ptr->part_ptr)
835
				assoc_rec.partition = job_ptr->part_ptr->name;
827
				assoc_rec.partition = job_ptr->part_ptr->name;
836
			assoc_rec.uid       = job_ptr->user_id;
828
			assoc_rec.uid       = job_ptr->user_id;
837
	
829
838
			if (!assoc_mgr_fill_in_assoc(acct_db_conn, &assoc_rec,
830
			if (!assoc_mgr_fill_in_assoc(acct_db_conn, &assoc_rec,
839
						    accounting_enforce,
831
						    accounting_enforce,
840
						    (slurmdb_association_rec_t **)
832
						    (slurmdb_association_rec_t **)
Lines 1322-1329 extern int test_job_dependency(struct job_record *job_ptr) Link Here
1322
							 job_ptr->name);
1314
							 job_ptr->name);
1323
 			run_now = true;
1315
 			run_now = true;
1324
			job_iterator = list_iterator_create(job_queue);
1316
			job_iterator = list_iterator_create(job_queue);
1325
			if (job_iterator == NULL)
1326
				fatal("list_iterator_create malloc failure");
1327
			while ((qjob_ptr = (struct job_record *)
1317
			while ((qjob_ptr = (struct job_record *)
1328
					   list_next(job_iterator))) {
1318
					   list_next(job_iterator))) {
1329
				/* already running/suspended job or previously
1319
				/* already running/suspended job or previously
Lines 1452-1459 extern int update_job_dependency(struct job_record *job_ptr, char *new_depend) Link Here
1452
	}
1442
	}
1453
1443
1454
	new_depend_list = list_create(_depend_list_del);
1444
	new_depend_list = list_create(_depend_list_del);
1455
	if (new_depend_list == NULL)
1456
		fatal("list_create: malloc failure");
1457
1445
1458
	/* validate new dependency string */
1446
	/* validate new dependency string */
1459
	while (rc == SLURM_SUCCESS) {
1447
	while (rc == SLURM_SUCCESS) {
Lines 1638-1645 static bool _scan_depend(List dependency_list, uint32_t job_id) Link Here
1638
1626
1639
	xassert(job_id);
1627
	xassert(job_id);
1640
	iter = list_iterator_create(dependency_list);
1628
	iter = list_iterator_create(dependency_list);
1641
	if (iter == NULL)
1629
1642
		fatal("list_iterator_create malloc failure");
1643
	while (!rc && (dep_ptr = (struct depend_spec *) list_next(iter))) {
1630
	while (!rc && (dep_ptr = (struct depend_spec *) list_next(iter))) {
1644
		if (dep_ptr->job_id == 0)	/* Singleton */
1631
		if (dep_ptr->job_id == 0)	/* Singleton */
1645
			continue;
1632
			continue;
Lines 1765-1772 extern int job_start_data(job_desc_msg_t *job_desc_msg, Link Here
1765
	if (job_ptr->details->exc_node_bitmap) {
1752
	if (job_ptr->details->exc_node_bitmap) {
1766
		bitstr_t *exc_node_mask = NULL;
1753
		bitstr_t *exc_node_mask = NULL;
1767
		exc_node_mask = bit_copy(job_ptr->details->exc_node_bitmap);
1754
		exc_node_mask = bit_copy(job_ptr->details->exc_node_bitmap);
1768
		if (exc_node_mask == NULL)
1769
			fatal("bit_copy malloc failure");
1770
		bit_not(exc_node_mask);
1755
		bit_not(exc_node_mask);
1771
		bit_and(avail_bitmap, exc_node_mask);
1756
		bit_and(avail_bitmap, exc_node_mask);
1772
		FREE_NULL_BITMAP(exc_node_mask);
1757
		FREE_NULL_BITMAP(exc_node_mask);
Lines 1848-1855 extern int job_start_data(job_desc_msg_t *job_desc_msg, Link Here
1848
			uint32_t *preemptee_jid;
1833
			uint32_t *preemptee_jid;
1849
			struct job_record *tmp_job_ptr;
1834
			struct job_record *tmp_job_ptr;
1850
			resp_data->preemptee_job_id=list_create(_pre_list_del);
1835
			resp_data->preemptee_job_id=list_create(_pre_list_del);
1851
			if (resp_data->preemptee_job_id == NULL)
1852
				fatal("list_create: malloc failure");
1853
			preemptee_iterator = list_iterator_create(
1836
			preemptee_iterator = list_iterator_create(
1854
							preemptee_job_list);
1837
							preemptee_job_list);
1855
			while ((tmp_job_ptr = (struct job_record *)
1838
			while ((tmp_job_ptr = (struct job_record *)
Lines 2381-2388 static int _valid_node_feature(char *feature) Link Here
2381
	/* Clear these nodes from the feature_list record,
2364
	/* Clear these nodes from the feature_list record,
2382
	 * then restore as needed */
2365
	 * then restore as needed */
2383
	feature_iter = list_iterator_create(feature_list);
2366
	feature_iter = list_iterator_create(feature_list);
2384
	if (feature_iter == NULL)
2385
		fatal("list_inerator_create malloc failure");
2386
	while ((feature_ptr = (struct features_record *)
2367
	while ((feature_ptr = (struct features_record *)
2387
			list_next(feature_iter))) {
2368
			list_next(feature_iter))) {
2388
		if (strcmp(feature_ptr->name, feature))
2369
		if (strcmp(feature_ptr->name, feature))
Lines 2409-2416 extern void rebuild_job_part_list(struct job_record *job_ptr) Link Here
2409
	job_ptr->partition = xstrdup(job_ptr->part_ptr->name);
2390
	job_ptr->partition = xstrdup(job_ptr->part_ptr->name);
2410
2391
2411
	part_iterator = list_iterator_create(job_ptr->part_ptr_list);
2392
	part_iterator = list_iterator_create(job_ptr->part_ptr_list);
2412
	if (part_iterator == NULL)
2413
		fatal("list_iterator_create malloc failure");
2414
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
2393
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
2415
		if (part_ptr == job_ptr->part_ptr)
2394
		if (part_ptr == job_ptr->part_ptr)
2416
			continue;
2395
			continue;
(-)a/src/slurmctld/licenses.c (-18 lines)
Lines 66-73 static inline void _licenses_print(char *header, List licenses, int job_id) Link Here
66
		return;
66
		return;
67
67
68
	iter = list_iterator_create(licenses);
68
	iter = list_iterator_create(licenses);
69
	if (iter == NULL)
70
		fatal("malloc failure from list_iterator_create");
71
  	while ((license_entry = (licenses_t *) list_next(iter))) {
69
  	while ((license_entry = (licenses_t *) list_next(iter))) {
72
		if (job_id == 0) {
70
		if (job_id == 0) {
73
			info("licenses: %s=%s total=%u used=%u", 
71
			info("licenses: %s=%s total=%u used=%u", 
Lines 176-183 static char * _build_license_string(List license_list) Link Here
176
		return licenses;
174
		return licenses;
177
175
178
	iter = list_iterator_create(license_list);
176
	iter = list_iterator_create(license_list);
179
	if (iter == NULL)
180
		fatal("malloc failure from list_iterator_create");
181
	while ((license_entry = (licenses_t *) list_next(iter))) {
177
	while ((license_entry = (licenses_t *) list_next(iter))) {
182
		if (licenses)
178
		if (licenses)
183
			sep = ",";
179
			sep = ",";
Lines 202-209 extern char *get_licenses_used(void) Link Here
202
	slurm_mutex_lock(&license_mutex);
198
	slurm_mutex_lock(&license_mutex);
203
	if (license_list) {
199
	if (license_list) {
204
		iter = list_iterator_create(license_list);
200
		iter = list_iterator_create(license_list);
205
		if (iter == NULL)
206
			fatal("malloc failure from list_iterator_create");
207
		while ((license_entry = (licenses_t *) list_next(iter))) {
201
		while ((license_entry = (licenses_t *) list_next(iter))) {
208
			if (licenses_used)
202
			if (licenses_used)
209
				xstrcat(licenses_used, ",");
203
				xstrcat(licenses_used, ",");
Lines 258-265 extern int license_update(char *licenses) Link Here
258
	}
252
	}
259
253
260
	iter = list_iterator_create(license_list);
254
	iter = list_iterator_create(license_list);
261
	if (iter == NULL)
262
		fatal("malloc failure from list_iterator_create");
263
	while ((license_entry = (licenses_t *) list_next(iter))) {
255
	while ((license_entry = (licenses_t *) list_next(iter))) {
264
		match = list_find_first(new_list, _license_find_rec,
256
		match = list_find_first(new_list, _license_find_rec,
265
			license_entry->name);
257
			license_entry->name);
Lines 314-321 extern List license_validate(char *licenses, bool *valid) Link Here
314
	slurm_mutex_lock(&license_mutex);
306
	slurm_mutex_lock(&license_mutex);
315
	_licenses_print("request_license", job_license_list, 0);
307
	_licenses_print("request_license", job_license_list, 0);
316
	iter = list_iterator_create(job_license_list);
308
	iter = list_iterator_create(job_license_list);
317
	if (iter == NULL)
318
		fatal("malloc failure from list_iterator_create");
319
	while ((license_entry = (licenses_t *) list_next(iter))) {
309
	while ((license_entry = (licenses_t *) list_next(iter))) {
320
		if (license_list) {
310
		if (license_list) {
321
			match = list_find_first(license_list,
311
			match = list_find_first(license_list,
Lines 377-384 extern int license_job_test(struct job_record *job_ptr, time_t when) Link Here
377
367
378
	slurm_mutex_lock(&license_mutex);
368
	slurm_mutex_lock(&license_mutex);
379
	iter = list_iterator_create(job_ptr->license_list);
369
	iter = list_iterator_create(job_ptr->license_list);
380
	if (iter == NULL)
381
		fatal("malloc failure from list_iterator_create");
382
	while ((license_entry = (licenses_t *) list_next(iter))) {
370
	while ((license_entry = (licenses_t *) list_next(iter))) {
383
		match = list_find_first(license_list, _license_find_rec,
371
		match = list_find_first(license_list, _license_find_rec,
384
			license_entry->name);
372
			license_entry->name);
Lines 428-435 extern int license_job_get(struct job_record *job_ptr) Link Here
428
416
429
	slurm_mutex_lock(&license_mutex);
417
	slurm_mutex_lock(&license_mutex);
430
	iter = list_iterator_create(job_ptr->license_list);
418
	iter = list_iterator_create(job_ptr->license_list);
431
	if (iter == NULL)
432
		fatal("malloc failure from list_iterator_create");
433
	while ((license_entry = (licenses_t *) list_next(iter))) {
419
	while ((license_entry = (licenses_t *) list_next(iter))) {
434
		match = list_find_first(license_list, _license_find_rec,
420
		match = list_find_first(license_list, _license_find_rec,
435
			license_entry->name);
421
			license_entry->name);
Lines 464-471 extern int license_job_return(struct job_record *job_ptr) Link Here
464
450
465
	slurm_mutex_lock(&license_mutex);
451
	slurm_mutex_lock(&license_mutex);
466
	iter = list_iterator_create(job_ptr->license_list);
452
	iter = list_iterator_create(job_ptr->license_list);
467
	if (iter == NULL)
468
		fatal("malloc failure from list_iterator_create");
469
	while ((license_entry = (licenses_t *) list_next(iter))) {
453
	while ((license_entry = (licenses_t *) list_next(iter))) {
470
		match = list_find_first(license_list, _license_find_rec,
454
		match = list_find_first(license_list, _license_find_rec,
471
			license_entry->name);
455
			license_entry->name);
Lines 505-512 extern bool license_list_overlap(List list_1, List list_2) Link Here
505
		return false;
489
		return false;
506
490
507
	iter = list_iterator_create(list_1);
491
	iter = list_iterator_create(list_1);
508
	if (iter == NULL)
509
		fatal("malloc failure from list_iterator_create");
510
	while ((license_entry = (licenses_t *) list_next(iter))) {
492
	while ((license_entry = (licenses_t *) list_next(iter))) {
511
		if (list_find_first(list_2, _license_find_rec,
493
		if (list_find_first(list_2, _license_find_rec,
512
				    license_entry->name)) {
494
				    license_entry->name)) {
(-)a/src/slurmctld/node_mgr.c (-8 lines)
Lines 1406-1413 static int _update_node_weight(char *node_names, uint32_t weight) Link Here
1406
	 * update it (if all nodes updated) or split it into
1406
	 * update it (if all nodes updated) or split it into
1407
	 * a new entry */
1407
	 * a new entry */
1408
	config_iterator = list_iterator_create(config_list);
1408
	config_iterator = list_iterator_create(config_list);
1409
	if (config_iterator == NULL)
1410
		fatal("list_iterator_create malloc failure");
1411
	while ((config_ptr = (struct config_record *)
1409
	while ((config_ptr = (struct config_record *)
1412
			list_next(config_iterator))) {
1410
			list_next(config_iterator))) {
1413
		if (config_ptr == first_new)
1411
		if (config_ptr == first_new)
Lines 1477-1484 static int _update_node_features(char *node_names, char *features) Link Here
1477
	 * update it (if all nodes updated) or split it into
1475
	 * update it (if all nodes updated) or split it into
1478
	 * a new entry */
1476
	 * a new entry */
1479
	config_iterator = list_iterator_create(config_list);
1477
	config_iterator = list_iterator_create(config_list);
1480
	if (config_iterator == NULL)
1481
		fatal("list_iterator_create malloc failure");
1482
	while ((config_ptr = (struct config_record *)
1478
	while ((config_ptr = (struct config_record *)
1483
			list_next(config_iterator))) {
1479
			list_next(config_iterator))) {
1484
		if (config_ptr == first_new)
1480
		if (config_ptr == first_new)
Lines 1554-1561 static int _update_node_gres(char *node_names, char *gres) Link Here
1554
	 * update it (if all nodes updated) or split it into
1550
	 * update it (if all nodes updated) or split it into
1555
	 * a new entry */
1551
	 * a new entry */
1556
	config_iterator = list_iterator_create(config_list);
1552
	config_iterator = list_iterator_create(config_list);
1557
	if (config_iterator == NULL)
1558
		fatal("list_iterator_create malloc failure");
1559
	while ((config_ptr = (struct config_record *)
1553
	while ((config_ptr = (struct config_record *)
1560
			list_next(config_iterator))) {
1554
			list_next(config_iterator))) {
1561
		if (config_ptr == first_new)
1555
		if (config_ptr == first_new)
Lines 2709-2716 void msg_to_slurmd (slurm_msg_type_t msg_type) Link Here
2709
	kill_agent_args->msg_type = msg_type;
2703
	kill_agent_args->msg_type = msg_type;
2710
	kill_agent_args->retry = 0;
2704
	kill_agent_args->retry = 0;
2711
	kill_agent_args->hostlist = hostlist_create("");
2705
	kill_agent_args->hostlist = hostlist_create("");
2712
	if (kill_agent_args->hostlist == NULL)
2713
		fatal("hostlist_create: malloc failure");
2714
	if (msg_type == REQUEST_SHUTDOWN) {
2706
	if (msg_type == REQUEST_SHUTDOWN) {
2715
 		shutdown_req = xmalloc(sizeof(shutdown_msg_t));
2707
 		shutdown_req = xmalloc(sizeof(shutdown_msg_t));
2716
		shutdown_req->options = 0;
2708
		shutdown_req->options = 0;
(-)a/src/slurmctld/node_scheduler.c (-42 lines)
Lines 394-401 extern void deallocate_nodes(struct job_record *job_ptr, bool timeout, Link Here
394
		agent_args->msg_type = REQUEST_TERMINATE_JOB;
394
		agent_args->msg_type = REQUEST_TERMINATE_JOB;
395
	agent_args->retry = 0;	/* re_kill_job() resends as needed */
395
	agent_args->retry = 0;	/* re_kill_job() resends as needed */
396
	agent_args->hostlist = hostlist_create("");
396
	agent_args->hostlist = hostlist_create("");
397
	if (agent_args->hostlist == NULL)
398
		fatal("hostlist_create: malloc failure");
399
	kill_job = xmalloc(sizeof(kill_job_msg_t));
397
	kill_job = xmalloc(sizeof(kill_job_msg_t));
400
	last_node_update    = time(NULL);
398
	last_node_update    = time(NULL);
401
	kill_job->job_id    = job_ptr->job_id;
399
	kill_job->job_id    = job_ptr->job_id;
Lines 939-946 _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, Link Here
939
	if ((job_ptr->details->min_nodes == 0) &&
937
	if ((job_ptr->details->min_nodes == 0) &&
940
	    (job_ptr->details->max_nodes == 0)) {
938
	    (job_ptr->details->max_nodes == 0)) {
941
		avail_bitmap = bit_alloc(node_record_count);
939
		avail_bitmap = bit_alloc(node_record_count);
942
		if (!avail_bitmap)
943
			fatal("bit_alloc: malloc failure");
944
		pick_code = select_g_job_test(job_ptr,
940
		pick_code = select_g_job_test(job_ptr,
945
					      avail_bitmap,
941
					      avail_bitmap,
946
					      0, 0, 0,
942
					      0, 0, 0,
Lines 1065-1072 _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, Link Here
1065
				} else {
1061
				} else {
1066
					avail_bitmap = bit_copy(node_set_ptr[i].
1062
					avail_bitmap = bit_copy(node_set_ptr[i].
1067
								my_bitmap);
1063
								my_bitmap);
1068
					if (avail_bitmap == NULL)
1069
						fatal("bit_copy malloc failure");
1070
				}
1064
				}
1071
			}
1065
			}
1072
			if (!bit_super_set(job_ptr->details->req_node_bitmap,
1066
			if (!bit_super_set(job_ptr->details->req_node_bitmap,
Lines 1078-1085 _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, Link Here
1078
			FREE_NULL_BITMAP(avail_bitmap);
1072
			FREE_NULL_BITMAP(avail_bitmap);
1079
			avail_bitmap = bit_copy(job_ptr->details->
1073
			avail_bitmap = bit_copy(job_ptr->details->
1080
						req_node_bitmap);
1074
						req_node_bitmap);
1081
			if (avail_bitmap == NULL)
1082
				fatal("bit_copy malloc failure");
1083
		}
1075
		}
1084
		for (i = 0; i < node_set_size; i++) {
1076
		for (i = 0; i < node_set_size; i++) {
1085
			int count1 = 0, count2 = 0;
1077
			int count1 = 0, count2 = 0;
Lines 1093-1100 _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, Link Here
1093
			} else {
1085
			} else {
1094
				total_bitmap = bit_copy(
1086
				total_bitmap = bit_copy(
1095
						node_set_ptr[i].my_bitmap);
1087
						node_set_ptr[i].my_bitmap);
1096
				if (total_bitmap == NULL)
1097
					fatal("bit_copy malloc failure");
1098
			}
1088
			}
1099
1089
1100
			bit_and(node_set_ptr[i].my_bitmap, avail_node_bitmap);
1090
			bit_and(node_set_ptr[i].my_bitmap, avail_node_bitmap);
Lines 1137-1144 _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, Link Here
1137
			} else {
1127
			} else {
1138
				avail_bitmap = bit_copy(node_set_ptr[i].
1128
				avail_bitmap = bit_copy(node_set_ptr[i].
1139
							my_bitmap);
1129
							my_bitmap);
1140
				if (avail_bitmap == NULL)
1141
					fatal("bit_copy malloc failure");
1142
			}
1130
			}
1143
			avail_nodes = bit_set_count(avail_bitmap);
1131
			avail_nodes = bit_set_count(avail_bitmap);
1144
			tried_sched = false;	/* need to test these nodes */
1132
			tried_sched = false;	/* need to test these nodes */
Lines 1253-1260 _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size, Link Here
1253
			if (!runable_avail && (avail_nodes >= min_nodes)) {
1241
			if (!runable_avail && (avail_nodes >= min_nodes)) {
1254
				FREE_NULL_BITMAP(avail_bitmap);
1242
				FREE_NULL_BITMAP(avail_bitmap);
1255
				avail_bitmap = bit_copy(total_bitmap);
1243
				avail_bitmap = bit_copy(total_bitmap);
1256
				if (avail_bitmap == NULL)
1257
					fatal("bit_copy malloc failure");
1258
				bit_and(avail_bitmap, avail_node_bitmap);
1244
				bit_and(avail_bitmap, avail_node_bitmap);
1259
				pick_code = select_g_job_test(job_ptr,
1245
				pick_code = select_g_job_test(job_ptr,
1260
						avail_bitmap,
1246
						avail_bitmap,
Lines 1324-1331 static void _preempt_jobs(List preemptee_job_list, int *error_code) Link Here
1324
	int job_cnt = 0, rc = SLURM_SUCCESS;
1310
	int job_cnt = 0, rc = SLURM_SUCCESS;
1325
1311
1326
	iter = list_iterator_create(preemptee_job_list);
1312
	iter = list_iterator_create(preemptee_job_list);
1327
	if (!iter)
1328
		fatal("list_iterator_create: malloc failure");
1329
	while ((job_ptr = (struct job_record *) list_next(iter))) {
1313
	while ((job_ptr = (struct job_record *) list_next(iter))) {
1330
		mode = slurm_job_preempt_mode(job_ptr);
1314
		mode = slurm_job_preempt_mode(job_ptr);
1331
		if (mode == PREEMPT_MODE_CANCEL) {
1315
		if (mode == PREEMPT_MODE_CANCEL) {
Lines 1838-1848 static bool _valid_feature_counts(struct job_details *detail_ptr, Link Here
1838
		return rc;
1822
		return rc;
1839
1823
1840
	feature_bitmap = bit_copy(node_bitmap);
1824
	feature_bitmap = bit_copy(node_bitmap);
1841
	if (feature_bitmap == NULL)
1842
		fatal("bit_copy malloc error");
1843
	job_feat_iter = list_iterator_create(detail_ptr->feature_list);
1825
	job_feat_iter = list_iterator_create(detail_ptr->feature_list);
1844
	if (job_feat_iter == NULL)
1845
		fatal("list_iterator_create malloc error");
1846
	while ((job_feat_ptr = (struct feature_record *)
1826
	while ((job_feat_ptr = (struct feature_record *)
1847
			list_next(job_feat_iter))) {
1827
			list_next(job_feat_iter))) {
1848
		feat_ptr = list_find_first(feature_list, list_find_feature,
1828
		feat_ptr = list_find_first(feature_list, list_find_feature,
Lines 1871-1878 static bool _valid_feature_counts(struct job_details *detail_ptr, Link Here
1871
	if (have_count) {
1851
	if (have_count) {
1872
		job_feat_iter = list_iterator_create(detail_ptr->
1852
		job_feat_iter = list_iterator_create(detail_ptr->
1873
						     feature_list);
1853
						     feature_list);
1874
		if (job_feat_iter == NULL)
1875
			fatal("list_iterator_create malloc error");
1876
		while ((job_feat_ptr = (struct feature_record *)
1854
		while ((job_feat_ptr = (struct feature_record *)
1877
				list_next(job_feat_iter))) {
1855
				list_next(job_feat_iter))) {
1878
			if (job_feat_ptr->count == 0)
1856
			if (job_feat_ptr->count == 0)
Lines 1885-1892 static bool _valid_feature_counts(struct job_details *detail_ptr, Link Here
1885
				break;
1863
				break;
1886
			}
1864
			}
1887
			tmp_bitmap = bit_copy(feature_bitmap);
1865
			tmp_bitmap = bit_copy(feature_bitmap);
1888
			if (tmp_bitmap == NULL)
1889
				fatal("bit_copy malloc error");
1890
			bit_and(tmp_bitmap, feat_ptr->node_bitmap);
1866
			bit_and(tmp_bitmap, feat_ptr->node_bitmap);
1891
			if (bit_set_count(tmp_bitmap) < job_feat_ptr->count)
1867
			if (bit_set_count(tmp_bitmap) < job_feat_ptr->count)
1892
				rc = false;
1868
				rc = false;
Lines 2064-2077 static int _build_node_list(struct job_record *job_ptr, Link Here
2064
		} else {
2040
		} else {
2065
			usable_node_mask =
2041
			usable_node_mask =
2066
				bit_copy(detail_ptr->exc_node_bitmap);
2042
				bit_copy(detail_ptr->exc_node_bitmap);
2067
			if (usable_node_mask == NULL)
2068
				fatal("bit_copy malloc failure");
2069
			bit_not(usable_node_mask);
2043
			bit_not(usable_node_mask);
2070
		}
2044
		}
2071
	} else if (usable_node_mask == NULL) {
2045
	} else if (usable_node_mask == NULL) {
2072
		usable_node_mask = bit_alloc(node_record_count);
2046
		usable_node_mask = bit_alloc(node_record_count);
2073
		if (usable_node_mask == NULL)
2074
			fatal("bit_alloc malloc failure");
2075
		bit_nset(usable_node_mask, 0, (node_record_count - 1));
2047
		bit_nset(usable_node_mask, 0, (node_record_count - 1));
2076
	}
2048
	}
2077
2049
Lines 2083-2090 static int _build_node_list(struct job_record *job_ptr, Link Here
2083
	}
2055
	}
2084
2056
2085
	config_iterator = list_iterator_create(config_list);
2057
	config_iterator = list_iterator_create(config_list);
2086
	if (config_iterator == NULL)
2087
		fatal("list_iterator_create malloc failure");
2088
2058
2089
	while ((config_ptr = (struct config_record *)
2059
	while ((config_ptr = (struct config_record *)
2090
			list_next(config_iterator))) {
2060
			list_next(config_iterator))) {
Lines 2118-2125 static int _build_node_list(struct job_record *job_ptr, Link Here
2118
2088
2119
		node_set_ptr[node_set_inx].my_bitmap =
2089
		node_set_ptr[node_set_inx].my_bitmap =
2120
			bit_copy(config_ptr->node_bitmap);
2090
			bit_copy(config_ptr->node_bitmap);
2121
		if (node_set_ptr[node_set_inx].my_bitmap == NULL)
2122
			fatal("bit_copy malloc failure");
2123
		bit_and(node_set_ptr[node_set_inx].my_bitmap,
2091
		bit_and(node_set_ptr[node_set_inx].my_bitmap,
2124
			part_ptr->node_bitmap);
2092
			part_ptr->node_bitmap);
2125
		if (usable_node_mask) {
2093
		if (usable_node_mask) {
Lines 2326-2333 static int _nodes_in_sets(bitstr_t *req_bitmap, Link Here
2326
		else {
2294
		else {
2327
			scratch_bitmap =
2295
			scratch_bitmap =
2328
			    bit_copy(node_set_ptr[i].my_bitmap);
2296
			    bit_copy(node_set_ptr[i].my_bitmap);
2329
			if (scratch_bitmap == NULL)
2330
				fatal("bit_copy malloc failure");
2331
		}
2297
		}
2332
	}
2298
	}
2333
2299
Lines 2426-2441 static bitstr_t *_valid_features(struct job_details *details_ptr, Link Here
2426
	int last_op = FEATURE_OP_AND, position = 0;
2392
	int last_op = FEATURE_OP_AND, position = 0;
2427
2393
2428
	result_bits = bit_alloc(MAX_FEATURES);
2394
	result_bits = bit_alloc(MAX_FEATURES);
2429
	if (result_bits == NULL)
2430
		fatal("bit_alloc malloc failure");
2431
	if (details_ptr->feature_list == NULL) {	/* no constraints */
2395
	if (details_ptr->feature_list == NULL) {	/* no constraints */
2432
		bit_set(result_bits, 0);
2396
		bit_set(result_bits, 0);
2433
		return result_bits;
2397
		return result_bits;
2434
	}
2398
	}
2435
2399
2436
	feat_iter = list_iterator_create(details_ptr->feature_list);
2400
	feat_iter = list_iterator_create(details_ptr->feature_list);
2437
	if (feat_iter == NULL)
2438
		fatal("list_iterator_create malloc failure");
2439
	while ((job_feat_ptr = (struct feature_record *)
2401
	while ((job_feat_ptr = (struct feature_record *)
2440
			list_next(feat_iter))) {
2402
			list_next(feat_iter))) {
2441
		if ((job_feat_ptr->op_code == FEATURE_OP_XAND) ||
2403
		if ((job_feat_ptr->op_code == FEATURE_OP_XAND) ||
Lines 2483-2496 extern void re_kill_job(struct job_record *job_ptr) Link Here
2483
	xassert(job_ptr->details);
2445
	xassert(job_ptr->details);
2484
2446
2485
	kill_hostlist = hostlist_create("");
2447
	kill_hostlist = hostlist_create("");
2486
	if (kill_hostlist == NULL)
2487
		fatal("hostlist_create: malloc failure");
2488
2448
2489
	agent_args = xmalloc(sizeof(agent_arg_t));
2449
	agent_args = xmalloc(sizeof(agent_arg_t));
2490
	agent_args->msg_type = REQUEST_TERMINATE_JOB;
2450
	agent_args->msg_type = REQUEST_TERMINATE_JOB;
2491
	agent_args->hostlist = hostlist_create("");
2451
	agent_args->hostlist = hostlist_create("");
2492
	if (agent_args->hostlist == NULL)
2493
		fatal("hostlist_create: malloc failure");
2494
	agent_args->retry = 0;
2452
	agent_args->retry = 0;
2495
	kill_job = xmalloc(sizeof(kill_job_msg_t));
2453
	kill_job = xmalloc(sizeof(kill_job_msg_t));
2496
	kill_job->job_id    = job_ptr->job_id;
2454
	kill_job->job_id    = job_ptr->job_id;
(-)a/src/slurmctld/partition_mgr.c (-8 lines)
Lines 117-129 static int _build_part_bitmap(struct part_record *part_ptr) Link Here
117
117
118
	if (part_ptr->node_bitmap == NULL) {
118
	if (part_ptr->node_bitmap == NULL) {
119
		part_ptr->node_bitmap = bit_alloc(node_record_count);
119
		part_ptr->node_bitmap = bit_alloc(node_record_count);
120
		if (part_ptr->node_bitmap == NULL)
121
			fatal("bit_alloc malloc failure");
122
		old_bitmap = NULL;
120
		old_bitmap = NULL;
123
	} else {
121
	} else {
124
		old_bitmap = bit_copy(part_ptr->node_bitmap);
122
		old_bitmap = bit_copy(part_ptr->node_bitmap);
125
		if (old_bitmap == NULL)
126
			fatal("bit_copy malloc failure");
127
		bit_nclear(part_ptr->node_bitmap, 0,
123
		bit_nclear(part_ptr->node_bitmap, 0,
128
			   node_record_count - 1);
124
			   node_record_count - 1);
129
	}
125
	}
Lines 313-320 int dump_all_part_state(void) Link Here
313
	/* write partition records to buffer */
309
	/* write partition records to buffer */
314
	lock_slurmctld(part_read_lock);
310
	lock_slurmctld(part_read_lock);
315
	part_iterator = list_iterator_create(part_list);
311
	part_iterator = list_iterator_create(part_list);
316
	if (!part_iterator)
317
		fatal("list_iterator_create malloc");
318
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
312
	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
319
		xassert (part_ptr->magic == PART_MAGIC);
313
		xassert (part_ptr->magic == PART_MAGIC);
320
		_dump_part_state(part_ptr, buffer);
314
		_dump_part_state(part_ptr, buffer);
Lines 662-669 extern List get_part_list(char *name) Link Here
662
		if (part_ptr) {
656
		if (part_ptr) {
663
			if (job_part_list == NULL) {
657
			if (job_part_list == NULL) {
664
				job_part_list = list_create(NULL);
658
				job_part_list = list_create(NULL);
665
				if (job_part_list == NULL)
666
					fatal("list_create: malloc failure");
667
			}
659
			}
668
			list_append(job_part_list, part_ptr);
660
			list_append(job_part_list, part_ptr);
669
		} else {
661
		} else {
(-)a/src/slurmctld/ping_nodes.c (-9 lines)
Lines 195-202 void ping_nodes (void) Link Here
195
			else {
195
			else {
196
				down_hostlist =
196
				down_hostlist =
197
					hostlist_create(front_end_ptr->name);
197
					hostlist_create(front_end_ptr->name);
198
				if (down_hostlist == NULL)
199
					fatal("hostlist_create: malloc error");
200
			}
198
			}
201
			set_front_end_down(front_end_ptr, "Not responding");
199
			set_front_end_down(front_end_ptr, "Not responding");
202
			front_end_ptr->not_responding = false;
200
			front_end_ptr->not_responding = false;
Lines 255-262 void ping_nodes (void) Link Here
255
			else {
253
			else {
256
				down_hostlist =
254
				down_hostlist =
257
					hostlist_create(node_ptr->name);
255
					hostlist_create(node_ptr->name);
258
				if (down_hostlist == NULL)
259
					fatal("hostlist_create: malloc error");
260
			}
256
			}
261
			set_node_down_ptr(node_ptr, "Not responding");
257
			set_node_down_ptr(node_ptr, "Not responding");
262
			node_ptr->not_responding = false;  /* logged below */
258
			node_ptr->not_responding = false;  /* logged below */
Lines 353-361 extern void run_health_check(void) Link Here
353
	check_agent_args->msg_type = REQUEST_HEALTH_CHECK;
349
	check_agent_args->msg_type = REQUEST_HEALTH_CHECK;
354
	check_agent_args->retry = 0;
350
	check_agent_args->retry = 0;
355
	check_agent_args->hostlist = hostlist_create("");
351
	check_agent_args->hostlist = hostlist_create("");
356
	if (check_agent_args->hostlist == NULL)
357
		fatal("hostlist_create: malloc failure");
358
359
#ifdef HAVE_FRONT_END
352
#ifdef HAVE_FRONT_END
360
	for (i = 0, front_end_ptr = front_end_nodes;
353
	for (i = 0, front_end_ptr = front_end_nodes;
361
	     i < front_end_node_cnt; i++, front_end_ptr++) {
354
	     i < front_end_node_cnt; i++, front_end_ptr++) {
Lines 437-444 extern void update_nodes_acct_gather_data(void) Link Here
437
	agent_args->msg_type = REQUEST_ACCT_GATHER_UPDATE;
430
	agent_args->msg_type = REQUEST_ACCT_GATHER_UPDATE;
438
	agent_args->retry = 0;
431
	agent_args->retry = 0;
439
	agent_args->hostlist = hostlist_create("");
432
	agent_args->hostlist = hostlist_create("");
440
	if (agent_args->hostlist == NULL)
441
		fatal("hostlist_create: malloc failure");
442
433
443
#ifdef HAVE_FRONT_END
434
#ifdef HAVE_FRONT_END
444
	for (i = 0, front_end_ptr = front_end_nodes;
435
	for (i = 0, front_end_ptr = front_end_nodes;
(-)a/src/slurmctld/port_mgr.c (-4 lines)
Lines 92-99 static void _rebuild_port_array(struct step_record *step_ptr) Link Here
92
	sprintf(tmp_char, "[%s]", step_ptr->resv_ports);
92
	sprintf(tmp_char, "[%s]", step_ptr->resv_ports);
93
	hl = hostlist_create(tmp_char);
93
	hl = hostlist_create(tmp_char);
94
	xfree(tmp_char);
94
	xfree(tmp_char);
95
	if (hl == NULL)
96
		fatal("malloc failure: hostlist_create");
97
95
98
	step_ptr->resv_port_array = xmalloc(sizeof(int) *
96
	step_ptr->resv_port_array = xmalloc(sizeof(int) *
99
					    step_ptr->resv_port_cnt);
97
					    step_ptr->resv_port_cnt);
Lines 256-263 extern int resv_port_alloc(struct step_record *step_ptr) Link Here
256
254
257
	/* Reserve selected ports */
255
	/* Reserve selected ports */
258
	hl = hostlist_create(NULL);
256
	hl = hostlist_create(NULL);
259
	if (hl == NULL)
260
		fatal("malloc: hostlist_create");
261
	for (i=0; i<port_inx; i++) {
257
	for (i=0; i<port_inx; i++) {
262
		/* NOTE: We give the port a name like "[1234]" rather than
258
		/* NOTE: We give the port a name like "[1234]" rather than
263
		 * just "1234" to avoid hostlists of the form "1[234-236]" */
259
		 * just "1234" to avoid hostlists of the form "1[234-236]" */
(-)a/src/slurmctld/proc_req.c (-4 lines)
Lines 3885-3892 int _launch_batch_step(job_desc_msg_t *job_desc_msg, uid_t uid, Link Here
3885
	agent_arg_ptr->retry = 0;
3885
	agent_arg_ptr->retry = 0;
3886
	xassert(job_ptr->batch_host);
3886
	xassert(job_ptr->batch_host);
3887
	agent_arg_ptr->hostlist = hostlist_create(job_ptr->batch_host);
3887
	agent_arg_ptr->hostlist = hostlist_create(job_ptr->batch_host);
3888
	if (agent_arg_ptr->hostlist == NULL)
3889
		fatal("hostlist_create: malloc failure");
3890
	agent_arg_ptr->msg_type = REQUEST_BATCH_JOB_LAUNCH;
3888
	agent_arg_ptr->msg_type = REQUEST_BATCH_JOB_LAUNCH;
3891
	agent_arg_ptr->msg_args = (void *) launch_msg_ptr;
3889
	agent_arg_ptr->msg_args = (void *) launch_msg_ptr;
3892
3890
Lines 4258-4265 inline static void _slurm_rpc_reboot_nodes(slurm_msg_t * msg) Link Here
4258
		nodelist = reboot_msg->node_list;
4256
		nodelist = reboot_msg->node_list;
4259
	if (!nodelist || !strcasecmp(nodelist, "ALL")) {
4257
	if (!nodelist || !strcasecmp(nodelist, "ALL")) {
4260
		bitmap = bit_alloc(node_record_count);
4258
		bitmap = bit_alloc(node_record_count);
4261
		if (!bitmap)
4262
			fatal("malloc failure");
4263
		bit_nset(bitmap, 0, (node_record_count - 1));
4259
		bit_nset(bitmap, 0, (node_record_count - 1));
4264
	} else if (node_name2bitmap(nodelist, false, &bitmap) != 0) {
4260
	} else if (node_name2bitmap(nodelist, false, &bitmap) != 0) {
4265
		FREE_NULL_BITMAP(bitmap);
4261
		FREE_NULL_BITMAP(bitmap);
(-)a/src/slurmctld/read_config.c (-20 / +3 lines)
Lines 292-304 static int _build_bitmaps(void) Link Here
292
	power_node_bitmap = (bitstr_t *) bit_alloc(node_record_count);
292
	power_node_bitmap = (bitstr_t *) bit_alloc(node_record_count);
293
	share_node_bitmap = (bitstr_t *) bit_alloc(node_record_count);
293
	share_node_bitmap = (bitstr_t *) bit_alloc(node_record_count);
294
	up_node_bitmap    = (bitstr_t *) bit_alloc(node_record_count);
294
	up_node_bitmap    = (bitstr_t *) bit_alloc(node_record_count);
295
	if ((avail_node_bitmap    == NULL) ||
296
	    (cg_node_bitmap       == NULL) ||
297
	    (idle_node_bitmap     == NULL) ||
298
	    (power_node_bitmap    == NULL) ||
299
	    (share_node_bitmap    == NULL) ||
300
	    (up_node_bitmap       == NULL))
301
		fatal ("bit_alloc malloc failure");
302
295
303
	/* initialize the configuration bitmaps */
296
	/* initialize the configuration bitmaps */
304
	config_iterator = list_iterator_create(config_list);
297
	config_iterator = list_iterator_create(config_list);
Lines 309-316 static int _build_bitmaps(void) Link Here
309
		FREE_NULL_BITMAP(config_ptr->node_bitmap);
302
		FREE_NULL_BITMAP(config_ptr->node_bitmap);
310
		config_ptr->node_bitmap =
303
		config_ptr->node_bitmap =
311
		    (bitstr_t *) bit_alloc(node_record_count);
304
		    (bitstr_t *) bit_alloc(node_record_count);
312
		if (config_ptr->node_bitmap == NULL)
313
			fatal ("bit_alloc malloc failure");
314
	}
305
	}
315
	list_iterator_destroy(config_iterator);
306
	list_iterator_destroy(config_iterator);
316
307
Lines 327-334 static int _build_bitmaps(void) Link Here
327
		    (job_ptr->details->shared != 0))
318
		    (job_ptr->details->shared != 0))
328
			continue;
319
			continue;
329
		tmp_bits = bit_copy(job_ptr->node_bitmap);
320
		tmp_bits = bit_copy(job_ptr->node_bitmap);
330
		if (tmp_bits == NULL)
331
			fatal ("bit_copy malloc failure");
332
		bit_not(tmp_bits);
321
		bit_not(tmp_bits);
333
		bit_and(share_node_bitmap, tmp_bits);
322
		bit_and(share_node_bitmap, tmp_bits);
334
		FREE_NULL_BITMAP(tmp_bits);
323
		FREE_NULL_BITMAP(tmp_bits);
Lines 683-690 static void _sync_part_prio(void) Link Here
683
672
684
	part_max_priority = 0;
673
	part_max_priority = 0;
685
	itr = list_iterator_create(part_list);
674
	itr = list_iterator_create(part_list);
686
	if (itr == NULL)
687
		fatal("list_iterator_create malloc failure");
688
	while ((part_ptr = list_next(itr))) {
675
	while ((part_ptr = list_next(itr))) {
689
		if (part_ptr->priority > part_max_priority)
676
		if (part_ptr->priority > part_max_priority)
690
			part_max_priority = part_ptr->priority;
677
			part_max_priority = part_ptr->priority;
Lines 693-700 static void _sync_part_prio(void) Link Here
693
680
694
	if (part_max_priority) {
681
	if (part_max_priority) {
695
		itr = list_iterator_create(part_list);
682
		itr = list_iterator_create(part_list);
696
		if (itr == NULL)
697
			fatal("list_iterator_create malloc failure");
698
		while ((part_ptr = list_next(itr))) {
683
		while ((part_ptr = list_next(itr))) {
699
			part_ptr->norm_priority = (double)part_ptr->priority /
684
			part_ptr->norm_priority = (double)part_ptr->priority /
700
						  (double)part_max_priority;
685
						  (double)part_max_priority;
Lines 1058-1064 static int _restore_node_state(int recover, Link Here
1058
			      node_ptr->config_ptr->cpus);
1043
			      node_ptr->config_ptr->cpus);
1059
		}
1044
		}
1060
#endif
1045
#endif
1061
		node_ptr->boot_time     = old_node_ptr->boot_time; 
1046
		node_ptr->boot_time     = old_node_ptr->boot_time;
1062
		node_ptr->cpus          = old_node_ptr->cpus;
1047
		node_ptr->cpus          = old_node_ptr->cpus;
1063
		node_ptr->cores         = old_node_ptr->cores;
1048
		node_ptr->cores         = old_node_ptr->cores;
1064
		node_ptr->last_idle     = old_node_ptr->last_idle;
1049
		node_ptr->last_idle     = old_node_ptr->last_idle;
Lines 1066-1072 static int _restore_node_state(int recover, Link Here
1066
		node_ptr->sockets       = old_node_ptr->sockets;
1051
		node_ptr->sockets       = old_node_ptr->sockets;
1067
		node_ptr->threads       = old_node_ptr->threads;
1052
		node_ptr->threads       = old_node_ptr->threads;
1068
		node_ptr->real_memory   = old_node_ptr->real_memory;
1053
		node_ptr->real_memory   = old_node_ptr->real_memory;
1069
		node_ptr->slurmd_start_time = old_node_ptr->slurmd_start_time; 
1054
		node_ptr->slurmd_start_time = old_node_ptr->slurmd_start_time;
1070
		node_ptr->tmp_disk      = old_node_ptr->tmp_disk;
1055
		node_ptr->tmp_disk      = old_node_ptr->tmp_disk;
1071
		node_ptr->weight        = old_node_ptr->weight;
1056
		node_ptr->weight        = old_node_ptr->weight;
1072
1057
Lines 1174-1181 static int _restore_part_state(List old_part_list, char *old_def_part_name, Link Here
1174
1159
1175
	/* For each part in list, find and update recs */
1160
	/* For each part in list, find and update recs */
1176
	part_iterator = list_iterator_create(old_part_list);
1161
	part_iterator = list_iterator_create(old_part_list);
1177
	if (!part_iterator)
1178
		fatal("list_iterator_create malloc");
1179
	while ((old_part_ptr = (struct part_record *)
1162
	while ((old_part_ptr = (struct part_record *)
1180
			       list_next(part_iterator))) {
1163
			       list_next(part_iterator))) {
1181
		xassert(old_part_ptr->magic == PART_MAGIC);
1164
		xassert(old_part_ptr->magic == PART_MAGIC);
Lines 1189-1195 static int _restore_part_state(List old_part_list, char *old_def_part_name, Link Here
1189
					part_ptr->state_up = old_part_ptr->state_up;
1172
					part_ptr->state_up = old_part_ptr->state_up;
1190
				}
1173
				}
1191
				continue;
1174
				continue;
1192
			}	
1175
			}
1193
			/* Current partition found in slurm.conf,
1176
			/* Current partition found in slurm.conf,
1194
			 * report differences from slurm.conf configuration */
1177
			 * report differences from slurm.conf configuration */
1195
			if (_strcmp(part_ptr->allow_groups,
1178
			if (_strcmp(part_ptr->allow_groups,
(-)a/src/slurmctld/reservation.c (-80 / +7 lines)
Lines 183-193 static List _list_dup(List license_list) Link Here
183
		return lic_list;
183
		return lic_list;
184
184
185
	lic_list = list_create(license_free_rec);
185
	lic_list = list_create(license_free_rec);
186
	if (lic_list == NULL)
187
		fatal("list_create malloc failure");
188
	iter = list_iterator_create(license_list);
186
	iter = list_iterator_create(license_list);
189
	if (!iter)
190
		fatal("list_interator_create malloc failure");
191
	while ((license_src = (licenses_t *) list_next(iter))) {
187
	while ((license_src = (licenses_t *) list_next(iter))) {
192
		license_dest = xmalloc(sizeof(licenses_t));
188
		license_dest = xmalloc(sizeof(licenses_t));
193
		license_dest->name = xstrdup(license_src->name);
189
		license_dest->name = xstrdup(license_src->name);
Lines 548-555 static int _set_assoc_list(slurmctld_resv_t *resv_ptr) Link Here
548
	xfree(resv_ptr->assoc_list);	/* clear for modify */
544
	xfree(resv_ptr->assoc_list);	/* clear for modify */
549
	if (list_count(assoc_list_allow)) {
545
	if (list_count(assoc_list_allow)) {
550
		ListIterator itr = list_iterator_create(assoc_list_allow);
546
		ListIterator itr = list_iterator_create(assoc_list_allow);
551
		if (!itr)
552
			fatal("malloc: list_iterator_create");
553
		while ((assoc_ptr = list_next(itr))) {
547
		while ((assoc_ptr = list_next(itr))) {
554
			if (resv_ptr->assoc_list) {
548
			if (resv_ptr->assoc_list) {
555
				xstrfmtcat(resv_ptr->assoc_list, "%u,",
549
				xstrfmtcat(resv_ptr->assoc_list, "%u,",
Lines 563-570 static int _set_assoc_list(slurmctld_resv_t *resv_ptr) Link Here
563
	}
557
	}
564
	if (list_count(assoc_list_deny)) {
558
	if (list_count(assoc_list_deny)) {
565
		ListIterator itr = list_iterator_create(assoc_list_deny);
559
		ListIterator itr = list_iterator_create(assoc_list_deny);
566
		if (!itr)
567
			fatal("malloc: list_iterator_create");
568
		while ((assoc_ptr = list_next(itr))) {
560
		while ((assoc_ptr = list_next(itr))) {
569
			if (resv_ptr->assoc_list) {
561
			if (resv_ptr->assoc_list) {
570
				xstrfmtcat(resv_ptr->assoc_list, "-%u,",
562
				xstrfmtcat(resv_ptr->assoc_list, "-%u,",
Lines 686-694 static int _post_resv_update(slurmctld_resv_t *resv_ptr, Link Here
686
		 * new start time of now. */
678
		 * new start time of now. */
687
		if ((resv_ptr->start_time < now)
679
		if ((resv_ptr->start_time < now)
688
		     && (resv.assocs
680
		     && (resv.assocs
689
		         || resv.nodes
681
			 || resv.nodes
690
		         || (resv.flags != (uint16_t)NO_VAL)
682
			 || (resv.flags != (uint16_t)NO_VAL)
691
		         || (resv.cpus != (uint32_t)NO_VAL))) {
683
			 || (resv.cpus != (uint32_t)NO_VAL))) {
692
			resv_ptr->start_time_prev = resv_ptr->start_time;
684
			resv_ptr->start_time_prev = resv_ptr->start_time;
693
			resv_ptr->start_time = now;
685
			resv_ptr->start_time = now;
694
		}
686
		}
Lines 1207-1213 static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer, Link Here
1207
		cnode_cnt = resv_ptr->node_cnt;
1199
		cnode_cnt = resv_ptr->node_cnt;
1208
		if (cnodes_per_bp && !internal)
1200
		if (cnodes_per_bp && !internal)
1209
			cnode_cnt *= cnodes_per_bp;
1201
			cnode_cnt *= cnodes_per_bp;
1210
		pack32(cnode_cnt,	        buffer);
1202
		pack32(cnode_cnt,		buffer);
1211
#else
1203
#else
1212
		pack32(resv_ptr->node_cnt,	buffer);
1204
		pack32(resv_ptr->node_cnt,	buffer);
1213
#endif
1205
#endif
Lines 1247-1253 static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer, Link Here
1247
		cnode_cnt = resv_ptr->node_cnt;
1239
		cnode_cnt = resv_ptr->node_cnt;
1248
		if (cnodes_per_bp && !internal)
1240
		if (cnodes_per_bp && !internal)
1249
			cnode_cnt *= cnodes_per_bp;
1241
			cnode_cnt *= cnodes_per_bp;
1250
		pack32(cnode_cnt,	        buffer);
1242
		pack32(cnode_cnt,		buffer);
1251
#else
1243
#else
1252
		pack32(resv_ptr->node_cnt,	buffer);
1244
		pack32(resv_ptr->node_cnt,	buffer);
1253
#endif
1245
#endif
Lines 1371-1378 static bool _job_overlap(time_t start_time, uint16_t flags, Link Here
1371
		return overlap;
1363
		return overlap;
1372
1364
1373
	job_iterator = list_iterator_create(job_list);
1365
	job_iterator = list_iterator_create(job_list);
1374
	if (!job_iterator)
1375
		fatal("malloc: list_iterator_create");
1376
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
1366
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
1377
		if (IS_JOB_RUNNING(job_ptr)		&&
1367
		if (IS_JOB_RUNNING(job_ptr)		&&
1378
		    (job_ptr->end_time > start_time)	&&
1368
		    (job_ptr->end_time > start_time)	&&
Lines 1407-1414 static bool _resv_overlap(time_t start_time, time_t end_time, Link Here
1407
		return rc;
1397
		return rc;
1408
1398
1409
	iter = list_iterator_create(resv_list);
1399
	iter = list_iterator_create(resv_list);
1410
	if (!iter)
1411
		fatal("malloc: list_iterator_create");
1412
1400
1413
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
1401
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
1414
		if (resv_ptr == this_resv_ptr)
1402
		if (resv_ptr == this_resv_ptr)
Lines 2121-2128 extern int update_resv(resv_desc_msg_t *resv_desc_ptr) Link Here
2121
update_failure:
2109
update_failure:
2122
	/* Restore backup reservation data */
2110
	/* Restore backup reservation data */
2123
	iter = list_iterator_create(resv_list);
2111
	iter = list_iterator_create(resv_list);
2124
	if (!iter)
2125
		fatal("list_iterator_create: malloc failure");
2126
	while ((resv_next = (slurmctld_resv_t *) list_next(iter))) {
2112
	while ((resv_next = (slurmctld_resv_t *) list_next(iter))) {
2127
		if (resv_next == resv_ptr) {
2113
		if (resv_next == resv_ptr) {
2128
			list_delete_item(iter);
2114
			list_delete_item(iter);
Lines 2144-2151 static bool _is_resv_used(slurmctld_resv_t *resv_ptr) Link Here
2144
	bool match = false;
2130
	bool match = false;
2145
2131
2146
	job_iterator = list_iterator_create(job_list);
2132
	job_iterator = list_iterator_create(job_list);
2147
	if (!job_iterator)
2148
		fatal("malloc: list_iterator_create");
2149
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2133
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2150
		if ((!IS_JOB_FINISHED(job_ptr)) &&
2134
		if ((!IS_JOB_FINISHED(job_ptr)) &&
2151
		    (job_ptr->resv_id == resv_ptr->resv_id)) {
2135
		    (job_ptr->resv_id == resv_ptr->resv_id)) {
Lines 2165-2172 static void _clear_job_resv(slurmctld_resv_t *resv_ptr) Link Here
2165
	struct job_record *job_ptr;
2149
	struct job_record *job_ptr;
2166
2150
2167
	job_iterator = list_iterator_create(job_list);
2151
	job_iterator = list_iterator_create(job_list);
2168
	if (!job_iterator)
2169
		fatal("malloc: list_iterator_create");
2170
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2152
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
2171
		if (job_ptr->resv_ptr != resv_ptr)
2153
		if (job_ptr->resv_ptr != resv_ptr)
2172
			continue;
2154
			continue;
Lines 2194-2201 extern int delete_resv(reservation_name_msg_t *resv_desc_ptr) Link Here
2194
		info("delete_resv: Name=%s", resv_desc_ptr->name);
2176
		info("delete_resv: Name=%s", resv_desc_ptr->name);
2195
2177
2196
	iter = list_iterator_create(resv_list);
2178
	iter = list_iterator_create(resv_list);
2197
	if (!iter)
2198
		fatal("malloc: list_iterator_create");
2199
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2179
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2200
		if (strcmp(resv_ptr->name, resv_desc_ptr->name))
2180
		if (strcmp(resv_ptr->name, resv_desc_ptr->name))
2201
			continue;
2181
			continue;
Lines 2256-2263 extern void show_resv(char **buffer_ptr, int *buffer_size, uid_t uid, Link Here
2256
2236
2257
	/* write individual reservation records */
2237
	/* write individual reservation records */
2258
	iter = list_iterator_create(resv_list);
2238
	iter = list_iterator_create(resv_list);
2259
	if (!iter)
2260
		fatal("malloc: list_iterator_create");
2261
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2239
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2262
		if ((slurmctld_conf.private_data & PRIVATE_DATA_RESERVATIONS)
2240
		if ((slurmctld_conf.private_data & PRIVATE_DATA_RESERVATIONS)
2263
		    && !validate_operator(uid)) {
2241
		    && !validate_operator(uid)) {
Lines 2312-2319 extern int dump_all_resv_state(void) Link Here
2312
	/* write reservation records to buffer */
2290
	/* write reservation records to buffer */
2313
	lock_slurmctld(resv_read_lock);
2291
	lock_slurmctld(resv_read_lock);
2314
	iter = list_iterator_create(resv_list);
2292
	iter = list_iterator_create(resv_list);
2315
	if (!iter)
2316
		fatal("malloc: list_iterator_create");
2317
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter)))
2293
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter)))
2318
		_pack_resv(resv_ptr, buffer, true, SLURM_PROTOCOL_VERSION);
2294
		_pack_resv(resv_ptr, buffer, true, SLURM_PROTOCOL_VERSION);
2319
	list_iterator_destroy(iter);
2295
	list_iterator_destroy(iter);
Lines 2478-2485 static void _validate_all_reservations(void) Link Here
2478
	uint32_t res_num;
2454
	uint32_t res_num;
2479
2455
2480
	iter = list_iterator_create(resv_list);
2456
	iter = list_iterator_create(resv_list);
2481
	if (!iter)
2482
		fatal("malloc: list_iterator_create");
2483
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2457
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2484
		if (!_validate_one_reservation(resv_ptr)) {
2458
		if (!_validate_one_reservation(resv_ptr)) {
2485
			error("Purging invalid reservation record %s",
2459
			error("Purging invalid reservation record %s",
Lines 2500-2507 static void _validate_all_reservations(void) Link Here
2500
2474
2501
	/* Validate all job reservation pointers */
2475
	/* Validate all job reservation pointers */
2502
	iter = list_iterator_create(job_list);
2476
	iter = list_iterator_create(job_list);
2503
	if (!iter)
2504
		fatal("malloc: list_iterator_create");
2505
	while ((job_ptr = (struct job_record *) list_next(iter))) {
2477
	while ((job_ptr = (struct job_record *) list_next(iter))) {
2506
		if (job_ptr->resv_name == NULL)
2478
		if (job_ptr->resv_name == NULL)
2507
			continue;
2479
			continue;
Lines 2840-2847 static int _resize_resv(slurmctld_resv_t *resv_ptr, uint32_t node_cnt) Link Here
2840
static void _create_cluster_core_bitmap(bitstr_t **core_bitmap)
2812
static void _create_cluster_core_bitmap(bitstr_t **core_bitmap)
2841
{
2813
{
2842
	*core_bitmap = bit_alloc(cr_get_coremap_offset(node_record_count));
2814
	*core_bitmap = bit_alloc(cr_get_coremap_offset(node_record_count));
2843
	if (*core_bitmap == NULL)
2844
		fatal("bit_alloc: malloc failure");
2845
}
2815
}
2846
2816
2847
/* Given a reservation create request, select appropriate nodes for use */
2817
/* Given a reservation create request, select appropriate nodes for use */
Lines 2870-2877 static int _select_nodes(resv_desc_msg_t *resv_desc_ptr, Link Here
2870
	/* Don't use node already reserved */
2840
	/* Don't use node already reserved */
2871
	if (!(resv_desc_ptr->flags & RESERVE_FLAG_OVERLAP)) {
2841
	if (!(resv_desc_ptr->flags & RESERVE_FLAG_OVERLAP)) {
2872
		iter = list_iterator_create(resv_list);
2842
		iter = list_iterator_create(resv_list);
2873
		if (!iter)
2874
			fatal("malloc: list_iterator_create");
2875
		while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2843
		while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
2876
			if (resv_ptr->end_time <= now)
2844
			if (resv_ptr->end_time <= now)
2877
				_advance_resv_time(resv_ptr);
2845
				_advance_resv_time(resv_ptr);
Lines 2907-2915 static int _select_nodes(resv_desc_msg_t *resv_desc_ptr, Link Here
2907
		ListIterator feature_iter;
2875
		ListIterator feature_iter;
2908
		bool match;
2876
		bool match;
2909
2877
2910
		if (feature_bitmap == NULL)
2911
			fatal("bit_copy malloc failure");
2912
2913
		while (1) {
2878
		while (1) {
2914
			for (i=0; ; i++) {
2879
			for (i=0; ; i++) {
2915
				if (token[i] == '\0') {
2880
				if (token[i] == '\0') {
Lines 2931-2938 static int _select_nodes(resv_desc_msg_t *resv_desc_ptr, Link Here
2931
2896
2932
			match = false;
2897
			match = false;
2933
			feature_iter = list_iterator_create(feature_list);
2898
			feature_iter = list_iterator_create(feature_list);
2934
			if (feature_iter == NULL)
2935
				fatal("list_iterator_create malloc failure");
2936
			while ((feature_ptr = (struct features_record *)
2899
			while ((feature_ptr = (struct features_record *)
2937
					list_next(feature_iter))) {
2900
					list_next(feature_iter))) {
2938
				if (strcmp(token, feature_ptr->name))
2901
				if (strcmp(token, feature_ptr->name))
Lines 3088-3095 static void _check_job_compatibility(struct job_record *job_ptr, Link Here
3088
	debug2("job coremap: %s", str);
3051
	debug2("job coremap: %s", str);
3089
3052
3090
	full_node_bitmap = bit_copy(job_res->node_bitmap);
3053
	full_node_bitmap = bit_copy(job_res->node_bitmap);
3091
	if (full_node_bitmap == NULL)
3092
		fatal("bit_alloc: malloc failure");
3093
3054
3094
	debug2("Let's see core distribution for jobid: %u",
3055
	debug2("Let's see core distribution for jobid: %u",
3095
	       job_ptr->job_id);
3056
	       job_ptr->job_id);
Lines 3163-3170 static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, Link Here
3163
	save_bitmap = bit_copy(avail_bitmap);
3124
	save_bitmap = bit_copy(avail_bitmap);
3164
	bit_or(avail_bitmap, save_bitmap);	/* restore avail_bitmap */
3125
	bit_or(avail_bitmap, save_bitmap);	/* restore avail_bitmap */
3165
	job_iterator = list_iterator_create(job_list);
3126
	job_iterator = list_iterator_create(job_list);
3166
	if (job_iterator == NULL)
3167
		fatal("list_iterator_create: malloc failure");
3168
3127
3169
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
3128
	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
3170
		if (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr))
3129
		if (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr))
Lines 3194-3201 static bitstr_t *_pick_idle_node_cnt(bitstr_t *avail_bitmap, Link Here
3194
	 * the unsorted job list. */
3153
	 * the unsorted job list. */
3195
	if (resv_desc_ptr->flags & RESERVE_FLAG_IGN_JOBS) {
3154
	if (resv_desc_ptr->flags & RESERVE_FLAG_IGN_JOBS) {
3196
		job_iterator = list_iterator_create(job_list);
3155
		job_iterator = list_iterator_create(job_list);
3197
		if (!job_iterator)
3198
			fatal("list_iterator_create: malloc failure");
3199
		while ((job_ptr = (struct job_record *)
3156
		while ((job_ptr = (struct job_record *)
3200
			list_next(job_iterator))) {
3157
			list_next(job_iterator))) {
3201
			if (!IS_JOB_RUNNING(job_ptr) &&
3158
			if (!IS_JOB_RUNNING(job_ptr) &&
Lines 3395-3402 extern void job_time_adj_resv(struct job_record *job_ptr) Link Here
3395
	int32_t resv_begin_time;
3352
	int32_t resv_begin_time;
3396
3353
3397
	iter = list_iterator_create(resv_list);
3354
	iter = list_iterator_create(resv_list);
3398
	if (!iter)
3399
		fatal("malloc: list_iterator_create");
3400
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3355
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3401
		if (resv_ptr->end_time <= now)
3356
		if (resv_ptr->end_time <= now)
3402
			_advance_resv_time(resv_ptr);
3357
			_advance_resv_time(resv_ptr);
Lines 3432-3439 static int _license_cnt(List license_list, char *lic_name) Link Here
3432
		return lic_cnt;
3387
		return lic_cnt;
3433
3388
3434
	iter = list_iterator_create(license_list);
3389
	iter = list_iterator_create(license_list);
3435
	if (!iter)
3436
		fatal("list_interator_create malloc failure");
3437
	while ((license_ptr = list_next(iter))) {
3390
	while ((license_ptr = list_next(iter))) {
3438
		if (strcmp(license_ptr->name, lic_name) == 0)
3391
		if (strcmp(license_ptr->name, lic_name) == 0)
3439
			lic_cnt += license_ptr->total;
3392
			lic_cnt += license_ptr->total;
Lines 3490-3497 extern int job_test_lic_resv(struct job_record *job_ptr, char *lic_name, Link Here
3490
	job_start_time = when;
3443
	job_start_time = when;
3491
	job_end_time   = when + _get_job_duration(job_ptr);
3444
	job_end_time   = when + _get_job_duration(job_ptr);
3492
	iter = list_iterator_create(resv_list);
3445
	iter = list_iterator_create(resv_list);
3493
	if (!iter)
3494
		fatal("malloc: list_iterator_create");
3495
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3446
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3496
		if (resv_ptr->end_time <= now)
3447
		if (resv_ptr->end_time <= now)
3497
			_advance_resv_time(resv_ptr);
3448
			_advance_resv_time(resv_ptr);
Lines 3578-3585 extern int job_test_resv(struct job_record *job_ptr, time_t *when, Link Here
3578
		}
3529
		}
3579
		if (resv_ptr->flags & RESERVE_FLAG_LIC_ONLY) {
3530
		if (resv_ptr->flags & RESERVE_FLAG_LIC_ONLY) {
3580
			*node_bitmap = bit_alloc(node_record_count);
3531
			*node_bitmap = bit_alloc(node_record_count);
3581
			if (*node_bitmap == NULL)
3582
				fatal("bit_alloc: malloc failure");
3583
			bit_nset(*node_bitmap, 0, (node_record_count - 1));
3532
			bit_nset(*node_bitmap, 0, (node_record_count - 1));
3584
		} else
3533
		} else
3585
			*node_bitmap = bit_copy(resv_ptr->node_bitmap);
3534
			*node_bitmap = bit_copy(resv_ptr->node_bitmap);
Lines 3587-3594 extern int job_test_resv(struct job_record *job_ptr, time_t *when, Link Here
3587
		/* if there are any overlapping reservations, we need to
3536
		/* if there are any overlapping reservations, we need to
3588
		 * prevent the job from using those nodes (e.g. MAINT nodes) */
3537
		 * prevent the job from using those nodes (e.g. MAINT nodes) */
3589
		iter = list_iterator_create(resv_list);
3538
		iter = list_iterator_create(resv_list);
3590
		if (!iter)
3591
			fatal("malloc: list_iterator_create");
3592
		while ((res2_ptr = (slurmctld_resv_t *) list_next(iter))) {
3539
		while ((res2_ptr = (slurmctld_resv_t *) list_next(iter))) {
3593
			if ((resv_ptr->flags & RESERVE_FLAG_MAINT) ||
3540
			if ((resv_ptr->flags & RESERVE_FLAG_MAINT) ||
3594
			    (resv_ptr->flags & RESERVE_FLAG_OVERLAP) ||
3541
			    (resv_ptr->flags & RESERVE_FLAG_OVERLAP) ||
Lines 3623-3630 extern int job_test_resv(struct job_record *job_ptr, time_t *when, Link Here
3623
3570
3624
	job_ptr->resv_ptr = NULL;	/* should be redundant */
3571
	job_ptr->resv_ptr = NULL;	/* should be redundant */
3625
	*node_bitmap = bit_alloc(node_record_count);
3572
	*node_bitmap = bit_alloc(node_record_count);
3626
	if (*node_bitmap == NULL)
3627
		fatal("bit_alloc: malloc failure");
3628
	bit_nset(*node_bitmap, 0, (node_record_count - 1));
3573
	bit_nset(*node_bitmap, 0, (node_record_count - 1));
3629
	if (list_count(resv_list) == 0)
3574
	if (list_count(resv_list) == 0)
3630
		return SLURM_SUCCESS;
3575
		return SLURM_SUCCESS;
Lines 3635-3642 extern int job_test_resv(struct job_record *job_ptr, time_t *when, Link Here
3635
		lic_resv_time = (time_t) 0;
3580
		lic_resv_time = (time_t) 0;
3636
3581
3637
		iter = list_iterator_create(resv_list);
3582
		iter = list_iterator_create(resv_list);
3638
		if (!iter)
3639
			fatal("malloc: list_iterator_create");
3640
		while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3583
		while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3641
			if (resv_ptr->end_time <= now)
3584
			if (resv_ptr->end_time <= now)
3642
				_advance_resv_time(resv_ptr);
3585
				_advance_resv_time(resv_ptr);
Lines 3674-3680 extern int job_test_resv(struct job_record *job_ptr, time_t *when, Link Here
3674
				info("job_test_resv: %s reservation uses "
3617
				info("job_test_resv: %s reservation uses "
3675
					"partial nodes", resv_ptr->name);
3618
					"partial nodes", resv_ptr->name);
3676
				if (*exc_core_bitmap == NULL) {
3619
				if (*exc_core_bitmap == NULL) {
3677
					*exc_core_bitmap = 
3620
					*exc_core_bitmap =
3678
						bit_copy(resv_ptr->core_bitmap);
3621
						bit_copy(resv_ptr->core_bitmap);
3679
				} else {
3622
				} else {
3680
					bit_or(*exc_core_bitmap,
3623
					bit_or(*exc_core_bitmap,
Lines 3725-3732 extern time_t find_resv_end(time_t start_time) Link Here
3725
		return end_time;
3668
		return end_time;
3726
3669
3727
	iter = list_iterator_create(resv_list);
3670
	iter = list_iterator_create(resv_list);
3728
	if (!iter)
3729
		fatal("malloc: list_iterator_create");
3730
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3671
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3731
		if ((start_time < resv_ptr->start_time) ||
3672
		if ((start_time < resv_ptr->start_time) ||
3732
		    (start_time > resv_ptr->end_time))
3673
		    (start_time > resv_ptr->end_time))
Lines 3757-3764 extern void begin_job_resv_check(void) Link Here
3757
		resv_over_run *= 60;
3698
		resv_over_run *= 60;
3758
3699
3759
	iter = list_iterator_create(resv_list);
3700
	iter = list_iterator_create(resv_list);
3760
	if (!iter)
3761
		fatal("malloc: list_iterator_create");
3762
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3701
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3763
		resv_ptr->job_pend_cnt = 0;
3702
		resv_ptr->job_pend_cnt = 0;
3764
		resv_ptr->job_run_cnt  = 0;
3703
		resv_ptr->job_run_cnt  = 0;
Lines 3796-3802 extern int job_resv_check(struct job_record *job_ptr) Link Here
3796
	return SLURM_SUCCESS;
3735
	return SLURM_SUCCESS;
3797
}
3736
}
3798
3737
3799
/* Advance a expired reservation's time stamps one day or one week 
3738
/* Advance a expired reservation's time stamps one day or one week
3800
 * as appropriate. */
3739
 * as appropriate. */
3801
static void _advance_resv_time(slurmctld_resv_t *resv_ptr)
3740
static void _advance_resv_time(slurmctld_resv_t *resv_ptr)
3802
{
3741
{
Lines 3926-3933 extern void fini_job_resv_check(void) Link Here
3926
		return;
3865
		return;
3927
3866
3928
	iter = list_iterator_create(resv_list);
3867
	iter = list_iterator_create(resv_list);
3929
	if (!iter)
3930
		fatal("malloc: list_iterator_create");
3931
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3868
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3932
		if (!resv_ptr->run_prolog || !resv_ptr->run_epilog)
3869
		if (!resv_ptr->run_prolog || !resv_ptr->run_epilog)
3933
			continue;
3870
			continue;
Lines 3965-3972 extern int send_resvs_to_accounting(void) Link Here
3965
		return SLURM_SUCCESS;
3902
		return SLURM_SUCCESS;
3966
3903
3967
	itr = list_iterator_create(resv_list);
3904
	itr = list_iterator_create(resv_list);
3968
	if (!itr)
3969
		fatal("malloc: list_iterator_create");
3970
	while ((resv_ptr = list_next(itr))) {
3905
	while ((resv_ptr = list_next(itr))) {
3971
		_post_resv_create(resv_ptr);
3906
		_post_resv_create(resv_ptr);
3972
	}
3907
	}
Lines 3996-4003 extern void set_node_maint_mode(bool reset_all) Link Here
3996
		}
3931
		}
3997
	}
3932
	}
3998
	iter = list_iterator_create(resv_list);
3933
	iter = list_iterator_create(resv_list);
3999
	if (!iter)
4000
		fatal("malloc: list_iterator_create");
4001
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3934
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
4002
		if ((resv_ptr->start_time <= now) && !resv_ptr->run_prolog) {
3935
		if ((resv_ptr->start_time <= now) && !resv_ptr->run_prolog) {
4003
			resv_ptr->run_prolog = true;
3936
			resv_ptr->run_prolog = true;
Lines 4038-4045 extern bool is_node_in_maint_reservation(int nodenum) Link Here
4038
		return false;
3971
		return false;
4039
3972
4040
	iter = list_iterator_create(resv_list);
3973
	iter = list_iterator_create(resv_list);
4041
	if (!iter)
4042
		fatal("malloc: list_iterator_create");
4043
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
3974
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
4044
		if ((resv_ptr->flags & RESERVE_FLAG_MAINT) == 0)
3975
		if ((resv_ptr->flags & RESERVE_FLAG_MAINT) == 0)
4045
			continue;
3976
			continue;
Lines 4062-4069 extern void update_assocs_in_resvs(void) Link Here
4062
		error("No reservation list given for updating associations");
3993
		error("No reservation list given for updating associations");
4063
3994
4064
	iter = list_iterator_create(resv_list);
3995
	iter = list_iterator_create(resv_list);
4065
	if (!iter)
4066
		fatal("malloc: list_iterator_create");
4067
	while ((resv_ptr = list_next(iter))) {
3996
	while ((resv_ptr = list_next(iter))) {
4068
		_set_assoc_list(resv_ptr);
3997
		_set_assoc_list(resv_ptr);
4069
	}
3998
	}
Lines 4078-4085 extern void update_part_nodes_in_resv(struct part_record *part_ptr) Link Here
4078
	xassert(part_ptr);
4007
	xassert(part_ptr);
4079
4008
4080
	iter = list_iterator_create(resv_list);
4009
	iter = list_iterator_create(resv_list);
4081
	if (!iter)
4082
		fatal("malloc: list_iterator_create");
4083
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
4010
	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
4084
		if ((resv_ptr->flags & RESERVE_FLAG_PART_NODES) &&
4011
		if ((resv_ptr->flags & RESERVE_FLAG_PART_NODES) &&
4085
		    (resv_ptr->partition != NULL) &&
4012
		    (resv_ptr->partition != NULL) &&
(-)a/src/slurmctld/srun_comm.c (-4 / +1 lines)
Lines 338-346 extern int srun_user_message(struct job_record *job_ptr, char *msg) Link Here
338
		agent_arg_ptr = (agent_arg_t *) xmalloc(sizeof(agent_arg_t));
338
		agent_arg_ptr = (agent_arg_t *) xmalloc(sizeof(agent_arg_t));
339
		agent_arg_ptr->hostlist = hostlist_create(node_ptr->name);
339
		agent_arg_ptr->hostlist = hostlist_create(node_ptr->name);
340
#endif
340
#endif
341
		if (agent_arg_ptr->hostlist == NULL)
341
		notify_msg_ptr = (job_notify_msg_t *)
342
			fatal("hostlist_create: malloc failure");
343
		notify_msg_ptr = (job_notify_msg_t *) 
344
				 xmalloc(sizeof(job_notify_msg_t));
342
				 xmalloc(sizeof(job_notify_msg_t));
345
		notify_msg_ptr->job_id = job_ptr->job_id;
343
		notify_msg_ptr->job_id = job_ptr->job_id;
346
		notify_msg_ptr->message = xstrdup(msg);
344
		notify_msg_ptr->message = xstrdup(msg);
Lines 532-535 extern void srun_response(uint32_t job_id, uint32_t step_id) Link Here
532
		return;
530
		return;
533
	job_ptr->time_last_active = now;
531
	job_ptr->time_last_active = now;
534
}
532
}
535
(-)a/src/slurmctld/step_mgr.c (-24 lines)
Lines 458-465 void signal_step_tasks(struct step_record *step_ptr, uint16_t signal, Link Here
458
	agent_args->msg_type = msg_type;
458
	agent_args->msg_type = msg_type;
459
	agent_args->retry    = 1;
459
	agent_args->retry    = 1;
460
	agent_args->hostlist = hostlist_create("");
460
	agent_args->hostlist = hostlist_create("");
461
	if (agent_args->hostlist == NULL)
462
		fatal("hostlist_create: malloc failure");
463
	kill_tasks_msg = xmalloc(sizeof(kill_tasks_msg_t));
461
	kill_tasks_msg = xmalloc(sizeof(kill_tasks_msg_t));
464
	kill_tasks_msg->job_id      = step_ptr->job_ptr->job_id;
462
	kill_tasks_msg->job_id      = step_ptr->job_ptr->job_id;
465
	kill_tasks_msg->job_step_id = step_ptr->step_id;
463
	kill_tasks_msg->job_step_id = step_ptr->step_id;
Lines 468-475 void signal_step_tasks(struct step_record *step_ptr, uint16_t signal, Link Here
468
#ifdef HAVE_FRONT_END
466
#ifdef HAVE_FRONT_END
469
	xassert(step_ptr->job_ptr->batch_host);
467
	xassert(step_ptr->job_ptr->batch_host);
470
	hostlist_push(agent_args->hostlist, step_ptr->job_ptr->batch_host);
468
	hostlist_push(agent_args->hostlist, step_ptr->job_ptr->batch_host);
471
	if (agent_args->hostlist == NULL)
472
		fatal("hostlist_create: malloc failure");
473
	agent_args->node_count = 1;
469
	agent_args->node_count = 1;
474
#else
470
#else
475
	for (i = 0; i < node_record_count; i++) {
471
	for (i = 0; i < node_record_count; i++) {
Lines 519-526 void signal_step_tasks_on_node(char* node_name, struct step_record *step_ptr, Link Here
519
	agent_args->node_count++;
515
	agent_args->node_count++;
520
	agent_args->hostlist = hostlist_create(node_name);
516
	agent_args->hostlist = hostlist_create(node_name);
521
#endif
517
#endif
522
	if (agent_args->hostlist == NULL)
523
		fatal("hostlist_create: malloc failure");
524
	kill_tasks_msg = xmalloc(sizeof(kill_tasks_msg_t));
518
	kill_tasks_msg = xmalloc(sizeof(kill_tasks_msg_t));
525
	kill_tasks_msg->job_id      = step_ptr->job_ptr->job_id;
519
	kill_tasks_msg->job_id      = step_ptr->job_ptr->job_id;
526
	kill_tasks_msg->job_step_id = step_ptr->step_id;
520
	kill_tasks_msg->job_step_id = step_ptr->step_id;
Lines 545-552 static void _wake_pending_steps(struct job_record *job_ptr, int cpu_count) Link Here
545
	 * Try to start a bit more based upon step sizes. Effectiveness
539
	 * Try to start a bit more based upon step sizes. Effectiveness
546
	 * varies with step sizes, constraints and order. */
540
	 * varies with step sizes, constraints and order. */
547
	step_iterator = list_iterator_create(job_ptr->step_list);
541
	step_iterator = list_iterator_create(job_ptr->step_list);
548
	if (!step_iterator)
549
		fatal("list_iterator_create: malloc failure");
550
	while ((step_ptr = (struct step_record *) list_next (step_iterator))) {
542
	while ((step_ptr = (struct step_record *) list_next (step_iterator))) {
551
		if ((step_ptr->state == JOB_PENDING) &&
543
		if ((step_ptr->state == JOB_PENDING) &&
552
		    ((start_count < 8) ||
544
		    ((start_count < 8) ||
Lines 776-783 _pick_step_nodes (struct job_record *job_ptr, Link Here
776
	return NULL;
768
	return NULL;
777
#endif
769
#endif
778
	nodes_avail = bit_copy (job_ptr->node_bitmap);
770
	nodes_avail = bit_copy (job_ptr->node_bitmap);
779
	if (nodes_avail == NULL)
780
		fatal("bit_copy malloc failure");
781
	bit_and (nodes_avail, up_node_bitmap);
771
	bit_and (nodes_avail, up_node_bitmap);
782
	if (step_spec->features) {
772
	if (step_spec->features) {
783
		/* We only select for a single feature name here.
773
		/* We only select for a single feature name here.
Lines 1142-1149 _pick_step_nodes (struct job_record *job_ptr, Link Here
1142
			} else if (step_spec->min_nodes &&
1132
			} else if (step_spec->min_nodes &&
1143
				   (node_cnt > step_spec->min_nodes)) {
1133
				   (node_cnt > step_spec->min_nodes)) {
1144
				nodes_picked = bit_alloc(bit_size(nodes_avail));
1134
				nodes_picked = bit_alloc(bit_size(nodes_avail));
1145
				if (nodes_picked == NULL)
1146
					fatal("bit_alloc malloc failure");
1147
				FREE_NULL_BITMAP(nodes_avail);
1135
				FREE_NULL_BITMAP(nodes_avail);
1148
				nodes_avail = selected_nodes;
1136
				nodes_avail = selected_nodes;
1149
				selected_nodes = NULL;
1137
				selected_nodes = NULL;
Lines 1156-1163 _pick_step_nodes (struct job_record *job_ptr, Link Here
1156
		}
1144
		}
1157
	} else {
1145
	} else {
1158
		nodes_picked = bit_alloc(bit_size(nodes_avail));
1146
		nodes_picked = bit_alloc(bit_size(nodes_avail));
1159
		if (nodes_picked == NULL)
1160
			fatal("bit_alloc malloc failure");
1161
	}
1147
	}
1162
1148
1163
	/* In case we are in relative mode, do not look for idle nodes
1149
	/* In case we are in relative mode, do not look for idle nodes
Lines 1180-1187 _pick_step_nodes (struct job_record *job_ptr, Link Here
1180
		FREE_NULL_BITMAP (relative_nodes);
1166
		FREE_NULL_BITMAP (relative_nodes);
1181
	} else {
1167
	} else {
1182
		nodes_idle = bit_alloc (bit_size (nodes_avail) );
1168
		nodes_idle = bit_alloc (bit_size (nodes_avail) );
1183
		if (nodes_idle == NULL)
1184
			fatal("bit_alloc malloc failure");
1185
		step_iterator = list_iterator_create(job_ptr->step_list);
1169
		step_iterator = list_iterator_create(job_ptr->step_list);
1186
		while ((step_p = (struct step_record *)
1170
		while ((step_p = (struct step_record *)
1187
			list_next(step_iterator))) {
1171
			list_next(step_iterator))) {
Lines 3418-3425 extern void step_checkpoint(void) Link Here
3418
			continue; /* ignore periodic step ckpt */
3402
			continue; /* ignore periodic step ckpt */
3419
		}
3403
		}
3420
		step_iterator = list_iterator_create (job_ptr->step_list);
3404
		step_iterator = list_iterator_create (job_ptr->step_list);
3421
		if (!step_iterator)
3422
			fatal("list_iterator_create: malloc failure");
3423
		while ((step_ptr = (struct step_record *)
3405
		while ((step_ptr = (struct step_record *)
3424
				list_next (step_iterator))) {
3406
				list_next (step_iterator))) {
3425
			char *image_dir = NULL;
3407
			char *image_dir = NULL;
Lines 3492-3499 static void _signal_step_timelimit(struct job_record *job_ptr, Link Here
3492
	agent_args->msg_type = REQUEST_KILL_TIMELIMIT;
3474
	agent_args->msg_type = REQUEST_KILL_TIMELIMIT;
3493
	agent_args->retry = 1;
3475
	agent_args->retry = 1;
3494
	agent_args->hostlist = hostlist_create("");
3476
	agent_args->hostlist = hostlist_create("");
3495
	if (agent_args->hostlist == NULL)
3496
		fatal("hostlist_create: malloc failure");
3497
	kill_step = xmalloc(sizeof(kill_job_msg_t));
3477
	kill_step = xmalloc(sizeof(kill_job_msg_t));
3498
	kill_step->job_id    = job_ptr->job_id;
3478
	kill_step->job_id    = job_ptr->job_id;
3499
	kill_step->step_id   = step_ptr->step_id;
3479
	kill_step->step_id   = step_ptr->step_id;
Lines 3611-3618 extern int update_step(step_update_request_msg_t *req, uid_t uid) Link Here
3611
	 * any steps with any time limit */
3591
	 * any steps with any time limit */
3612
	if (req->step_id == NO_VAL) {
3592
	if (req->step_id == NO_VAL) {
3613
		step_iterator = list_iterator_create(job_ptr->step_list);
3593
		step_iterator = list_iterator_create(job_ptr->step_list);
3614
		if (step_iterator == NULL)
3615
			fatal("list_iterator_create: malloc failure");
3616
		while ((step_ptr = (struct step_record *)
3594
		while ((step_ptr = (struct step_record *)
3617
				   list_next (step_iterator))) {
3595
				   list_next (step_iterator))) {
3618
			if (step_ptr->state != JOB_RUNNING)
3596
			if (step_ptr->state != JOB_RUNNING)
Lines 3675-3682 extern void rebuild_step_bitmaps(struct job_record *job_ptr, Link Here
3675
		return;
3653
		return;
3676
3654
3677
	step_iterator = list_iterator_create(job_ptr->step_list);
3655
	step_iterator = list_iterator_create(job_ptr->step_list);
3678
	if (step_iterator == NULL)
3679
		fatal("list_iterator_create: malloc failure");
3680
	while ((step_ptr = (struct step_record *)
3656
	while ((step_ptr = (struct step_record *)
3681
			   list_next (step_iterator))) {
3657
			   list_next (step_iterator))) {
3682
		if (step_ptr->state != JOB_RUNNING)
3658
		if (step_ptr->state != JOB_RUNNING)
(-)a/src/slurmctld/trigger_mgr.c (-2 lines)
Lines 215-222 extern int trigger_pull(trigger_info_msg_t *msg) Link Here
215
215
216
	if (trigger_list == NULL) {
216
	if (trigger_list == NULL) {
217
		trigger_list = list_create(_trig_del);
217
		trigger_list = list_create(_trig_del);
218
		if (trigger_list == NULL)
219
			fatal("list_create: malloc failure");
220
	}
218
	}
221
219
222
	/* validate the request, designated trigger must be set */
220
	/* validate the request, designated trigger must be set */
(-)a/src/slurmdbd/read_config.c (-3 lines)
Lines 610-618 extern List dump_config(void) Link Here
610
	config_key_pair_t *key_pair;
610
	config_key_pair_t *key_pair;
611
	List my_list = list_create(destroy_config_key_pair);
611
	List my_list = list_create(destroy_config_key_pair);
612
612
613
	if (!my_list)
614
		fatal("malloc failure on list_create");
615
616
	key_pair = xmalloc(sizeof(config_key_pair_t));
613
	key_pair = xmalloc(sizeof(config_key_pair_t));
617
	key_pair->name = xstrdup("ArchiveDir");
614
	key_pair->name = xstrdup("ArchiveDir");
618
	key_pair->value = xstrdup(slurmdbd_conf->archive_dir);
615
	key_pair->value = xstrdup(slurmdbd_conf->archive_dir);
(-)a/src/squeue/squeue.c (-2 lines)
Lines 117-124 static int _multi_cluster(List clusters) Link Here
117
	int rc = 0, rc2;
117
	int rc = 0, rc2;
118
118
119
	itr = list_iterator_create(clusters);
119
	itr = list_iterator_create(clusters);
120
	if (!itr)
121
		fatal("list_iterator_create: malloc failure");
122
	while ((working_cluster_rec = list_next(itr))) {
120
	while ((working_cluster_rec = list_next(itr))) {
123
		if (first)
121
		if (first)
124
			first = false;
122
			first = false;
(-)a/src/sshare/process.c (-12 lines)
Lines 78-85 extern int process(shares_response_msg_t *resp) Link Here
78
		return SLURM_ERROR;
78
		return SLURM_ERROR;
79
79
80
	format_list = list_create(slurm_destroy_char);
80
	format_list = list_create(slurm_destroy_char);
81
	if (!format_list)
82
		fatal("list_create: malloc failure");
83
	if (long_flag) {
81
	if (long_flag) {
84
		slurm_addto_char_list(format_list,
82
		slurm_addto_char_list(format_list,
85
				      "A,User,RawShares,NormShares,"
83
				      "A,User,RawShares,NormShares,"
Lines 92-102 extern int process(shares_response_msg_t *resp) Link Here
92
	}
90
	}
93
91
94
	print_fields_list = list_create(destroy_print_field);
92
	print_fields_list = list_create(destroy_print_field);
95
	if (!print_fields_list)
96
		fatal("list_create: malloc failure");
97
	itr = list_iterator_create(format_list);
93
	itr = list_iterator_create(format_list);
98
	if (!itr)
99
		fatal("list_iterator_create: malloc failure");
100
	while ((object = list_next(itr))) {
94
	while ((object = list_next(itr))) {
101
		char *tmp_char = NULL;
95
		char *tmp_char = NULL;
102
		field = xmalloc(sizeof(print_field_t));
96
		field = xmalloc(sizeof(print_field_t));
Lines 183-190 extern int process(shares_response_msg_t *resp) Link Here
183
	}
177
	}
184
178
185
	itr2 = list_iterator_create(print_fields_list);
179
	itr2 = list_iterator_create(print_fields_list);
186
	if (!itr2)
187
		fatal("list_iterator_create: malloc failure");
188
	print_fields_header(print_fields_list);
180
	print_fields_header(print_fields_list);
189
181
190
	field_count = list_count(print_fields_list);
182
	field_count = list_count(print_fields_list);
Lines 193-203 extern int process(shares_response_msg_t *resp) Link Here
193
		return SLURM_SUCCESS;
185
		return SLURM_SUCCESS;
194
186
195
	tree_list = list_create(slurmdb_destroy_print_tree);
187
	tree_list = list_create(slurmdb_destroy_print_tree);
196
	if (!tree_list)
197
		fatal("list_create: malloc failure");
198
	itr = list_iterator_create(resp->assoc_shares_list);
188
	itr = list_iterator_create(resp->assoc_shares_list);
199
	if (!itr)
200
		fatal("list_iterator_create: malloc failure");
201
	while ((share = list_next(itr))) {
189
	while ((share = list_next(itr))) {
202
		int curr_inx = 1;
190
		int curr_inx = 1;
203
		char *tmp_char = NULL;
191
		char *tmp_char = NULL;

Return to ticket 198