Skip to content

Commit

Permalink
Fix job array syntax for PBS/Torque executor (#5281) [ci fast]
Browse files Browse the repository at this point in the history

Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman authored Sep 3, 2024
1 parent 5a01f27 commit d59f5fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PbsExecutor extends AbstractGridExecutor implements TaskArrayExecutor {

if( task instanceof TaskArrayRun ) {
final arraySize = task.getArraySize()
result << '-J' << "0-${arraySize - 1}".toString()
result << '-t' << "0-${arraySize - 1}".toString()
}

result << '-N' << getJobNameFor(task)
Expand Down Expand Up @@ -188,7 +188,7 @@ class PbsExecutor extends AbstractGridExecutor implements TaskArrayExecutor {

@Override
String getArrayIndexName() {
return 'PBS_ARRAY_INDEX'
return 'PBS_ARRAYID'
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,9 @@ class PbsProExecutor extends PbsExecutor {
DECODE_STATUS.get(status)
}

@Override
String getArrayIndexName() {
return 'PBS_ARRAY_INDEX'
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class PbsExecutorTest extends Specification {
}
then:
executor.getHeaders(taskArray) == '''
#PBS -J 0-4
#PBS -t 0-4
#PBS -N nf-task_name
#PBS -o /dev/null
#PBS -j oe
Expand Down Expand Up @@ -321,7 +321,7 @@ class PbsExecutorTest extends Specification {
given:
def executor = Spy(PbsExecutor)
expect:
executor.getArrayIndexName() == 'PBS_ARRAY_INDEX'
executor.getArrayIndexName() == 'PBS_ARRAYID'
executor.getArrayIndexStart() == 0
}

Expand Down

0 comments on commit d59f5fa

Please sign in to comment.