Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
e6ef17db
Commit
e6ef17db
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Set job's default name to that of the executable.
parent
ba2c3473
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/srun/opt.c
+28
-2
28 additions, 2 deletions
src/srun/opt.c
with
28 additions
and
2 deletions
src/srun/opt.c
+
28
−
2
View file @
e6ef17db
...
...
@@ -283,6 +283,9 @@ static void opt_args(int, char **);
*/
static
bool
opt_verify
(
poptContext
,
bool
,
bool
,
bool
);
/* return command name from its full path name */
static
char
*
base_name
(
char
*
command
);
/* list known options and their settings
*/
#if __DEBUG
...
...
@@ -365,6 +368,27 @@ static enum distribution_t verify_dist_type(const char *arg)
return
result
;
}
/* return command name from its full path name */
char
*
base_name
(
char
*
command
)
{
char
*
char_ptr
,
*
name
;
int
i
;
if
(
command
==
NULL
)
return
NULL
;
char_ptr
=
strrchr
(
command
,
(
int
)
'/'
);
if
(
char_ptr
==
NULL
)
char_ptr
=
command
;
else
char_ptr
++
;
i
=
strlen
(
char_ptr
);
name
=
xmalloc
(
i
+
1
);
strcpy
(
name
,
char_ptr
);
return
name
;
}
/*
* to_bytes(): verify that arg is numeric with optional "G" or "M" at end
* if "G" or "M" is there, multiply by proper power of 2 and return
...
...
@@ -493,7 +517,7 @@ static void opt_default()
opt
.
time_limit
=
-
1
;
opt
.
partition
=
NULL
;
opt
.
job_name
=
""
;
opt
.
job_name
=
NULL
;
opt
.
distribution
=
SRUN_DIST_BLOCK
;
...
...
@@ -823,6 +847,9 @@ opt_verify(poptContext optctx,
verified
=
false
;
}
if
((
opt
.
job_name
==
NULL
)
&&
(
remote_argc
>
0
))
opt
.
job_name
=
base_name
(
remote_argv
[
0
]);
if
(
mode
==
MODE_ATTACH
)
{
/* attach to a running job */
if
(
nodes_set
||
cpus_set
||
procs_set
)
{
error
(
"do not specific a node allocation "
...
...
@@ -1031,7 +1058,6 @@ print_commandline()
return
xstrdup
(
buf
);
}
#define tf_(b) (b == true) ? "true" : "false"
static
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment