Skip to content
Snippets Groups Projects
Commit 9dcb3ff4 authored by Pierre Lindenbaum's avatar Pierre Lindenbaum Committed by Morris Jette
Browse files

Add patch for integration with make v4.0

renamed the patch for make 3.81 and added a patch for gnu make 4.0
parent 5eff4f91
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ SUBDIRS = cray lua pam perlapi torque sgather sjobexit slurmdb-direct pmi2 ...@@ -2,6 +2,8 @@ SUBDIRS = cray lua pam perlapi torque sgather sjobexit slurmdb-direct pmi2
EXTRA_DIST = \ EXTRA_DIST = \
env_cache_builder.c \ env_cache_builder.c \
make-3.81.slurm.patch \
make-4.0.slurm.patch \
make.slurm.patch \ make.slurm.patch \
mpich1.slurm.patch \ mpich1.slurm.patch \
ptrace.patch \ ptrace.patch \
......
...@@ -447,7 +447,8 @@ top_srcdir = @top_srcdir@ ...@@ -447,7 +447,8 @@ top_srcdir = @top_srcdir@
SUBDIRS = cray lua pam perlapi torque sgather sjobexit slurmdb-direct pmi2 SUBDIRS = cray lua pam perlapi torque sgather sjobexit slurmdb-direct pmi2
EXTRA_DIST = \ EXTRA_DIST = \
env_cache_builder.c \ env_cache_builder.c \
make.slurm.patch \ make-3.81.slurm.patch \
make-4.0.slurm.patch \
mpich1.slurm.patch \ mpich1.slurm.patch \
ptrace.patch \ ptrace.patch \
sgather \ sgather \
......
...@@ -47,14 +47,15 @@ of the SLURM contribs distribution follows: ...@@ -47,14 +47,15 @@ of the SLURM contribs distribution follows:
proctrack.lua - proctrack (process tracking) plugin that implements a proctrack.lua - proctrack (process tracking) plugin that implements a
very simple job step container using CPUSETs very simple job step container using CPUSETs
make.slurm.patch [ Patch to "make" command for parallel build ] make-3.81.slurm.patch [ Patch to "make" command for parallel build ]
make-4.0.slurm.patch [ Patch to "make" command for parallel build ]
This patch will use SLURM to launch tasks across a job's current resource This patch will use SLURM to launch tasks across a job's current resource
allocation. Depending upon the size of modules to be compiled, this may allocation. Depending upon the size of modules to be compiled, this may
or may not improve performance. If most modules are thousands of lines or may not improve performance. If most modules are thousands of lines
long, the use of additional resources should more than compensate for the long, the use of additional resources should more than compensate for the
overhead of SLURM's task launch. Use with make's "-j" option within an overhead of SLURM's task launch. Use with make's "-j" option within an
existing SLURM allocation. Outside of a SLURM allocation, make's behavior existing SLURM allocation. Outside of a SLURM allocation, make's behavior
will be unchanged. Designed for GNU make-3.81. will be unchanged. Designed for GNU make-3.81 or make-4.0.
mic [Tools for use on Intel MIC processors] mic [Tools for use on Intel MIC processors]
......
File moved
diff --git a/README b/README
index 8b10c42..9e52eb8 100644
--- a/README
+++ b/README
@@ -136,6 +136,18 @@ system contains rules that depend on proper behavior of tools like "cp
force make to treat them properly. See the manual for details.
+SLURM
+-----
+
+This patch will use SLURM to launch tasks across a job's current resource
+allocation. Depending upon the size of modules to be compiled, this may
+or may not improve performance. If most modules are thousands of lines
+long, the use of additional resources should more than compensate for the
+overhead of SLURM's task launch. Use with make's "-j" option within an
+existing SLURM allocation. Outside of a SLURM allocation, make's behavior
+will be unchanged. Designed for GNU make-4.0.
+
+
Ports
-----
diff --git a/job.c b/job.c
index febfac0..eea50f1 100644
--- a/job.c
+++ b/job.c
@@ -2269,6 +2269,23 @@ void
child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
char **argv, char **envp)
{
+ char** argx=NULL;
+ /* PARALLEL JOB LAUNCH VIA SLURM */
+ if (getenv("SLURM_JOB_ID")) {
+ unsigned int i, argc=4;
+ for (i=0; argv[i] != NULL ; i++) argc++;
+ argx = (char**) xmalloc( sizeof(char*)*( argc ));
+ argx[0] = "srun";
+ argx[1] = "-N1";
+ argx[2] = "-n1";
+ for (i=0; argv[i] != NULL ; i++) {
+ argx[i+3] = argv[i];
+ }
+ argx[ argc -1 ] = NULL;
+ argv = argx;
+ }
+/* END OF SLURM PATCH */
+
/* For any redirected FD, dup2() it to the standard FD then close it. */
if (stdin_fd != FD_STDIN)
{
@@ -2288,6 +2305,8 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
/* Run the command. */
exec_command (argv, envp);
+
+ free(argx);
}
#endif /* !AMIGA && !__MSDOS__ && !VMS */
#endif /* !WINDOWS32 */
...@@ -122,6 +122,7 @@ Lead Slurm developers are: ...@@ -122,6 +122,7 @@ Lead Slurm developers are:
<li>Piotr Lesnicki (Bull)</li> <li>Piotr Lesnicki (Bull)</li>
<li>Bernard Li (Genome Sciences Centre, Canada)</li> <li>Bernard Li (Genome Sciences Centre, Canada)</li>
<li>Eric Lin (Bull)</li> <li>Eric Lin (Bull)</li>
<li>Pierre Lindenbaum (L'Insitut du Thorax, France)</li>
<li>Donald Lipari (Lawrence Livermore National Laboratory)</li> <li>Donald Lipari (Lawrence Livermore National Laboratory)</li>
<br> <br>
<li>Komoto Masahiro</li> <li>Komoto Masahiro</li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment