<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi,</p>
<p>I´m running a batch array script and would like to execute a
command after the last task</p>
<p><br>
</p>
<p>#SBATCH --array 1-10%10:1</p>
<p>sh myscript.R inputdir/file.${SLURM_ARRAY_TASK_ID}</p>
<p># Would like to run a command after the last task</p>
<p>For exemple when i was using SGE there was something like this<br>
</p>
<code class="java plain" style="font-family: Consolas,
"Bitstream Vera Sans Mono", "Courier New",
Courier, monospace !important; border-radius: 0px !important;
background: none !important; border: 0px !important; bottom: auto
!important; float: none !important; height: auto !important; left:
auto !important; line-height: 20px !important; margin: 0px
!important; outline: 0px !important; overflow: visible !important;
padding: 0px !important; position: static !important; right: auto
!important; text-align: left !important; top: auto !important;
vertical-align: baseline !important; width: auto !important;
box-sizing: content-box !important; font-weight: normal
!important; font-style: normal !important; font-size: 14px
!important; min-height: auto !important; color: rgb(0, 0, 0)
!important;"> if($SGE_TASK_ID == $SGE_TASK_LAST ) then</code>
<div class="line number10 index9 alt1" style="margin: 0px
!important; padding: 0px 1em 0px 0px !important; border-radius:
0px !important; background: none rgb(255, 255, 255) !important;
border: 0px !important; bottom: auto !important; float: none
!important; height: auto !important; left: auto !important;
line-height: 20px !important; outline: 0px !important; overflow:
visible !important; position: static !important; right: auto
!important; text-align: left; top: auto !important;
vertical-align: baseline !important; width: auto !important;
box-sizing: content-box !important; font-family: Consolas,
"Bitstream Vera Sans Mono", "Courier New",
Courier, monospace; font-weight: 400; font-style: normal;
font-size: 14px; min-height: auto !important; white-space: nowrap
!important; color: rgb(51, 51, 51); font-variant-ligatures:
normal; font-variant-caps: normal; letter-spacing: normal;
orphans: 2; text-indent: 0px; text-transform: none; widows: 2;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-style: initial; text-decoration-color: initial;"><code
class="java spaces" style="font-family: Consolas,
"Bitstream Vera Sans Mono", "Courier New",
Courier, monospace !important; border-radius: 0px !important;
background: none !important; border: 0px !important; bottom:
auto !important; float: none !important; height: auto
!important; left: auto !important; line-height: 20px !important;
margin: 0px !important; outline: 0px !important; overflow:
visible !important; padding: 0px !important; position: static
!important; right: auto !important; text-align: left !important;
top: auto !important; vertical-align: baseline !important;
width: auto !important; box-sizing: content-box !important;
font-weight: normal !important; font-style: normal !important;
font-size: 14px !important; min-height: auto !important;"> </code><code
class="java plain" style="font-family: Consolas, "Bitstream
Vera Sans Mono", "Courier New", Courier,
monospace !important; border-radius: 0px !important; background:
none !important; border: 0px !important; bottom: auto
!important; float: none !important; height: auto !important;
left: auto !important; line-height: 20px !important; margin: 0px
!important; outline: 0px !important; overflow: visible
!important; padding: 0px !important; position: static
!important; right: auto !important; text-align: left !important;
top: auto !important; vertical-align: baseline !important;
width: auto !important; box-sizing: content-box !important;
font-weight: normal !important; font-style: normal !important;
font-size: 14px !important; min-height: auto !important; color:
rgb(0, 0, 0) !important;">#<span> </span></code><code
class="java keyword" style="font-family: Consolas,
"Bitstream Vera Sans Mono", "Courier New",
Courier, monospace !important; border-radius: 0px !important;
background: none !important; border: 0px !important; bottom:
auto !important; float: none !important; height: auto
!important; left: auto !important; line-height: 20px !important;
margin: 0px !important; outline: 0px !important; overflow:
visible !important; padding: 0px !important; position: static
!important; right: auto !important; text-align: left !important;
top: auto !important; vertical-align: baseline !important;
width: auto !important; box-sizing: content-box !important;
font-weight: bold !important; font-style: normal !important;
font-size: 14px !important; min-height: auto !important; color:
rgb(51, 102, 153) !important;">do</code><span> </span><code
class="java plain" style="font-family: Consolas, "Bitstream
Vera Sans Mono", "Courier New", Courier,
monospace !important; border-radius: 0px !important; background:
none !important; border: 0px !important; bottom: auto
!important; float: none !important; height: auto !important;
left: auto !important; line-height: 20px !important; margin: 0px
!important; outline: 0px !important; overflow: visible
!important; padding: 0px !important; position: static
!important; right: auto !important; text-align: left !important;
top: auto !important; vertical-align: baseline !important;
width: auto !important; box-sizing: content-box !important;
font-weight: normal !important; font-style: normal !important;
font-size: 14px !important; min-height: auto !important; color:
rgb(0, 0, 0) !important;">last-task stuff here</code></div>
<div class="line number11 index10 alt2" style="margin: 0px
!important; padding: 0px 1em 0px 0px !important; border-radius:
0px !important; background: none rgb(255, 255, 255) !important;
border: 0px !important; bottom: auto !important; float: none
!important; height: auto !important; left: auto !important;
line-height: 20px !important; outline: 0px !important; overflow:
visible !important; position: static !important; right: auto
!important; text-align: left; top: auto !important;
vertical-align: baseline !important; width: auto !important;
box-sizing: content-box !important; font-family: Consolas,
"Bitstream Vera Sans Mono", "Courier New",
Courier, monospace; font-weight: 400; font-style: normal;
font-size: 14px; min-height: auto !important; white-space: nowrap
!important; color: rgb(51, 51, 51); font-variant-ligatures:
normal; font-variant-caps: normal; letter-spacing: normal;
orphans: 2; text-indent: 0px; text-transform: none; widows: 2;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-style: initial; text-decoration-color: initial;"><code
class="java plain" style="font-family: Consolas, "Bitstream
Vera Sans Mono", "Courier New", Courier,
monospace !important; border-radius: 0px !important; background:
none !important; border: 0px !important; bottom: auto
!important; float: none !important; height: auto !important;
left: auto !important; line-height: 20px !important; margin: 0px
!important; outline: 0px !important; overflow: visible
!important; padding: 0px !important; position: static
!important; right: auto !important; text-align: left !important;
top: auto !important; vertical-align: baseline !important;
width: auto !important; box-sizing: content-box !important;
font-weight: normal !important; font-style: normal !important;
font-size: 14px !important; min-height: auto !important; color:
rgb(0, 0, 0) !important;">endif</code></div>
<p><br>
</p>
<p>Can i do that with slurm ?</p>
<p><br>
</p>
</body>
</html>