View | Details | Raw Unified | Return to ticket 4621 | Differences between
and this patch

Collapse All | Expand All

(-)a/src/plugins/launch/slurm/launch_slurm.c (-2 / +5 lines)
Lines 543-549 extern int launch_p_setup_srun_opt(char **rest, slurm_opt_t *opt_local) Link Here
543
}
543
}
544
544
545
extern int launch_p_handle_multi_prog_verify(int command_pos,
545
extern int launch_p_handle_multi_prog_verify(int command_pos,
546
					     slurm_opt_t *opt_local)
546
					     slurm_opt_t *opt_local,
547
					     bool test_exec)
547
{
548
{
548
	srun_opt_t *srun_opt = opt_local->srun_opt;
549
	srun_opt_t *srun_opt = opt_local->srun_opt;
549
	xassert(srun_opt);
550
	xassert(srun_opt);
Lines 557-563 extern int launch_p_handle_multi_prog_verify(int command_pos, Link Here
557
		if (verify_multi_name(srun_opt->argv[command_pos],
558
		if (verify_multi_name(srun_opt->argv[command_pos],
558
				      &opt_local->ntasks,
559
				      &opt_local->ntasks,
559
				      &opt_local->ntasks_set,
560
				      &opt_local->ntasks_set,
560
				      &srun_opt->multi_prog_cmds))
561
				      &srun_opt->multi_prog_cmds,
562
				      opt_local->cwd,
563
				      test_exec))
561
			exit(error_exit);
564
			exit(error_exit);
562
		return 1;
565
		return 1;
563
	} else
566
	} else
(-)a/src/srun/libsrun/launch.c (-3 / +5 lines)
Lines 49-55 Link Here
49
49
50
typedef struct {
50
typedef struct {
51
	int (*setup_srun_opt)      (char **rest, slurm_opt_t *opt_local);
51
	int (*setup_srun_opt)      (char **rest, slurm_opt_t *opt_local);
52
	int (*handle_multi_prog)   (int command_pos, slurm_opt_t *opt_local);
52
	int (*handle_multi_prog)   (int command_pos, slurm_opt_t *opt_local,
53
				    bool test_exec);
53
	int (*create_job_step)     (srun_job_t *job, bool use_all_cpus,
54
	int (*create_job_step)     (srun_job_t *job, bool use_all_cpus,
54
				    void (*signal_function)(int),
55
				    void (*signal_function)(int),
55
				    sig_atomic_t *destroy_job,
56
				    sig_atomic_t *destroy_job,
Lines 504-515 extern int launch_g_setup_srun_opt(char **rest, slurm_opt_t *opt_local) Link Here
504
}
505
}
505
506
506
extern int launch_g_handle_multi_prog_verify(int command_pos,
507
extern int launch_g_handle_multi_prog_verify(int command_pos,
507
					     slurm_opt_t *opt_local)
508
					     slurm_opt_t *opt_local,
509
					     bool test_exec)
508
{
510
{
509
	if (launch_init() < 0)
511
	if (launch_init() < 0)
510
		return 0;
512
		return 0;
511
513
512
	return (*(ops.handle_multi_prog))(command_pos, opt_local);
514
	return (*(ops.handle_multi_prog))(command_pos, opt_local, test_exec);
513
}
515
}
514
516
515
extern int launch_g_create_job_step(srun_job_t *job, bool use_all_cpus,
517
extern int launch_g_create_job_step(srun_job_t *job, bool use_all_cpus,
(-)a/src/srun/libsrun/launch.h (-1 / +4 lines)
Lines 111-119 extern int launch_g_setup_srun_opt(char **rest, slurm_opt_t *opt_local); Link Here
111
 *                  spot the command is in opt.argv.
111
 *                  spot the command is in opt.argv.
112
 * IN opt_local - options used for step creation
112
 * IN opt_local - options used for step creation
113
 *
113
 *
114
 * IN test_exec - Whether to check for execution permissions
114
 * RET 0 if not handled, 1 if handled
115
 * RET 0 if not handled, 1 if handled
115
 */
116
 */
116
extern int launch_g_handle_multi_prog_verify(int command_pos, slurm_opt_t *opt_local);
117
extern int launch_g_handle_multi_prog_verify(int command_pos,
118
					     slurm_opt_t *opt_local,
119
					     bool test_exec);
117
120
118
/*
121
/*
119
 * launch_g_create_job_step() creates the job step.
122
 * launch_g_create_job_step() creates the job step.
(-)a/src/srun/libsrun/multi_prog.c (-1 / +10 lines)
Lines 58-63 Link Here
58
#include "src/common/xassert.h"
58
#include "src/common/xassert.h"
59
#include "src/common/xmalloc.h"
59
#include "src/common/xmalloc.h"
60
#include "src/common/xstring.h"
60
#include "src/common/xstring.h"
61
#include "src/common/proc_args.h"
61
62
62
#include "debugger.h"
63
#include "debugger.h"
63
#include "multi_prog.h"
64
#include "multi_prog.h"
Lines 436-442 _validate_ranks(char *ranks, int *ntasks, bool *ntasks_set, int32_t *ncmds, Link Here
436
 */
437
 */
437
extern int
438
extern int
438
verify_multi_name(char *config_fname, int *ntasks, bool *ntasks_set,
439
verify_multi_name(char *config_fname, int *ntasks, bool *ntasks_set,
439
		  int32_t *ncmds)
440
		  int32_t *ncmds, char * cwd, bool test_exec)
440
{
441
{
441
	FILE *config_fd;
442
	FILE *config_fd;
442
	char line[BUF_SIZE];
443
	char line[BUF_SIZE];
Lines 505-510 verify_multi_name(char *config_fname, int *ntasks, bool *ntasks_set, Link Here
505
			rc = -1;
506
			rc = -1;
506
			goto fini;
507
			goto fini;
507
		}
508
		}
509
		if (test_exec && !search_path(cwd,exec_name,true,X_OK,true))
510
		{
511
			error("Line %d of configuration file %s, "
512
			      "program %s not executable",
513
			      line_num, config_fname, exec_name);
514
			rc = -1;
515
			goto fini;
516
		}
508
	}
517
	}
509
518
510
	for (i = 0; i < *ntasks; i++) {
519
	for (i = 0; i < *ntasks; i++) {
(-)a/src/srun/libsrun/multi_prog.h (-1 / +3 lines)
Lines 60-70 extern int mpir_set_multi_name(int ntasks, const char *config_fname, Link Here
60
 * IN config_name - MPMD configuration file name
60
 * IN config_name - MPMD configuration file name
61
 * IN/OUT ntasks - number of tasks to launch
61
 * IN/OUT ntasks - number of tasks to launch
62
 * IN/OUT ntasks_set - true if task count explicitly set by user
62
 * IN/OUT ntasks_set - true if task count explicitly set by user
63
 * IN cwd - CWD, may be changed by --chdir
64
 * IN test_exec - Whether to check for exec permissions
63
 * OUT ncmds - number of commands
65
 * OUT ncmds - number of commands
64
 * RET 0 on success, -1 otherwise
66
 * RET 0 on success, -1 otherwise
65
 */
67
 */
66
extern int verify_multi_name(char *config_fname, int *ntasks, bool *ntasks_set,
68
extern int verify_multi_name(char *config_fname, int *ntasks, bool *ntasks_set,
67
			     int32_t *ncmds);
69
			     int32_t *ncmds, char * cwd, bool test_exec);
68
70
69
#endif
71
#endif
70
72
(-)a/src/srun/libsrun/opt.c (-3 / +2 lines)
Lines 2469-2475 static void _opt_args(int argc, char **argv, int pack_offset) Link Here
2469
	}
2469
	}
2470
#if defined HAVE_BG
2470
#if defined HAVE_BG
2471
	/* BGQ's runjob command required a fully qualified path */
2471
	/* BGQ's runjob command required a fully qualified path */
2472
	if (!launch_g_handle_multi_prog_verify(command_pos, &opt) &&
2472
	if (!launch_g_handle_multi_prog_verify(command_pos, &opt, test_exec) &&
2473
	    (sropt.argc > command_pos)) {
2473
	    (sropt.argc > command_pos)) {
2474
		if ((fullpath = search_path(opt.cwd,
2474
		if ((fullpath = search_path(opt.cwd,
2475
					    sropt.argv[command_pos],
2475
					    sropt.argv[command_pos],
Lines 2480-2486 static void _opt_args(int argc, char **argv, int pack_offset) Link Here
2480
	}
2480
	}
2481
#else
2481
#else
2482
	/* may exit() if an error with the multi_prog script */
2482
	/* may exit() if an error with the multi_prog script */
2483
	(void) launch_g_handle_multi_prog_verify(command_pos, &opt);
2483
	(void) launch_g_handle_multi_prog_verify(command_pos, &opt, test_exec);
2484
2484
2485
	if (!sropt.multi_prog && (test_exec || sropt.bcast_flag)) {
2485
	if (!sropt.multi_prog && (test_exec || sropt.bcast_flag)) {
2486
2486
2487
- 

Return to ticket 4621