Example #1
0
/*
 * Execute the job_submit() function in each job submit plugin.
 * If any plugin function returns anything other than SLURM_SUCCESS
 * then stop and forward it's return value.
 * IN job_desc - Job request specification
 * IN submit_uid - User issuing job submit request
 * OUT err_msg - Custom error message to the user, caller to xfree results
 */
extern int job_submit_plugin_submit(struct job_descriptor *job_desc,
				    uint32_t submit_uid, char **err_msg)
{
	DEF_TIMERS;
	int i, rc;

	xassert(verify_lock(CONF_LOCK, READ_LOCK));
	xassert(verify_lock(JOB_LOCK, READ_LOCK));
	xassert(verify_lock(NODE_LOCK, READ_LOCK));
	xassert(verify_lock(PART_LOCK, READ_LOCK));

	START_TIMER;
	rc = job_submit_plugin_init();
	slurm_mutex_lock(&g_context_lock);
	/* NOTE: On function entry read locks are set on config, job, node and
	 * partition structures. Do not attempt to unlock them and then
	 * lock again (say with a write lock) since doing so will trigger
	 * a deadlock with the g_context_lock above. */
	for (i = 0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++)
		rc = (*(ops[i].submit))(job_desc, submit_uid, err_msg);
	slurm_mutex_unlock(&g_context_lock);
	END_TIMER2("job_submit_plugin_submit");

	return rc;
}
Example #2
0
/*
 * Perform reconfig, re-read any configuration files
 */
extern int job_submit_plugin_reconfig(void)
{
	int rc = SLURM_SUCCESS;
	char *plugin_names = slurm_get_job_submit_plugins();
	bool plugin_change;

	if (!plugin_names && !submit_plugin_list)
		return rc;

	slurm_mutex_lock(&g_context_lock);
	if (plugin_names && submit_plugin_list &&
	    strcmp(plugin_names, submit_plugin_list))
		plugin_change = true;
	else
		plugin_change = false;
	slurm_mutex_unlock(&g_context_lock);

	if (plugin_change) {
		info("JobSubmitPlugins changed to %s", plugin_names);
		rc = job_submit_plugin_fini();
		if (rc == SLURM_SUCCESS)
			rc = job_submit_plugin_init();
	}
	xfree(plugin_names);

	return rc;
}
Example #3
0
/*
 * Execute the job_submit() function in each job submit plugin.
 * If any plugin function returns anything other than SLURM_SUCCESS
 * then stop and forward it's return value.
 */
extern int job_submit_plugin_submit(struct job_descriptor *job_desc,
				    uint32_t submit_uid)
{
	int i, rc;

	rc = job_submit_plugin_init();
	slurm_mutex_lock(&g_context_lock);
	for (i=0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++)
		rc = (*(ops[i].submit))(job_desc, submit_uid);
	slurm_mutex_unlock(&g_context_lock);
	return rc;
}
Example #4
0
/*
 * Execute the job_modify() function in each job submit plugin.
 * If any plugin function returns anything other than SLURM_SUCCESS
 * then stop and forward it's return value.
 */
extern int job_submit_plugin_modify(struct job_descriptor *job_desc,
				    struct job_record *job_ptr,
				    uint32_t submit_uid)
{
	DEF_TIMERS;
	int i, rc;

	START_TIMER;
	rc = job_submit_plugin_init();
	slurm_mutex_lock(&g_context_lock);
	for (i = 0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++)
		rc = (*(ops[i].modify))(job_desc, job_ptr, submit_uid);
	slurm_mutex_unlock(&g_context_lock);
	END_TIMER2("job_submit_plugin_modify");

	return rc;
}