Example #1
0
extern int select_p_job_init(List job_list)
{
	static bool run_already = false;

	/* Execute only on initial startup. We don't support bgblock
	 * creation on demand today, so there is no need to re-sync data. */
	if (run_already)
		return other_job_init(job_list);

	run_already = true;

	if (!(slurmctld_conf.select_type_param & CR_NHC_NO)
	    && job_list && list_count(job_list)) {
		ListIterator itr = list_iterator_create(job_list);
		struct job_record *job_ptr;

		if (debug_flags & DEBUG_FLAG_SELECT_TYPE)
			info("select_p_job_init: syncing jobs");

		while ((job_ptr = list_next(itr))) {
			select_jobinfo_t *jobinfo =
				job_ptr->select_jobinfo->data;

			if (!(slurmctld_conf.select_type_param & CR_NHC_STEP_NO)
			    && job_ptr->step_list
			    && list_count(job_ptr->step_list)) {
				ListIterator itr_step = list_iterator_create(
					job_ptr->step_list);
				struct step_record *step_ptr;
				while ((step_ptr = list_next(itr_step))) {
					jobinfo =
						step_ptr->select_jobinfo->data;

					if (jobinfo && jobinfo->cleaning)
						_spawn_cleanup_thread(
							step_ptr, _step_fini);
				}
				list_iterator_destroy(itr_step);
			}
			jobinfo = job_ptr->select_jobinfo->data;
			if (jobinfo && jobinfo->cleaning)
				_spawn_cleanup_thread(job_ptr, _job_fini);
		}
		list_iterator_destroy(itr);
	}

	return other_job_init(job_list);
}
Example #2
0
extern int select_p_job_init(List job_list)
{
	if (job_list && list_count(job_list)) {
		ListIterator itr = list_iterator_create(job_list);
		struct job_record *job_ptr;

		if (debug_flags & DEBUG_FLAG_SELECT_TYPE)
			info("select_p_job_init: syncing jobs");

		while ((job_ptr = list_next(itr))) {
			select_jobinfo_t *jobinfo =
				job_ptr->select_jobinfo->data;

			if (!jobinfo->cleaning && job_ptr->step_list
			    && list_count(job_ptr->step_list)) {
				ListIterator itr_step = list_iterator_create(
					job_ptr->step_list);
				struct step_record *step_ptr;
				while ((step_ptr = list_next(itr_step))) {
					jobinfo =
						step_ptr->select_jobinfo->data;

					if (!jobinfo->cleaning)
						continue;
					_spawn_cleanup_thread(step_ptr,
							      _step_fini);
				}
				list_iterator_destroy(itr_step);
				continue;
			}
			_spawn_cleanup_thread(job_ptr, _job_fini);
		}
		list_iterator_destroy(itr);
	}

	return other_job_init(job_list);
}
Example #3
0
extern int select_p_job_init(List job_list)
{
	return other_job_init(job_list);
}