Thanks to visit codestin.com
Credit goes to github.com

Skip to content

No such variable error in typed output block when using array directive _ #7215

Description

@ekageyama

Bug report

When using slurm as an executor in combination with arraySize, typed process can't resolve input variables.

Expected behavior and actual behavior

Input variables should be resolvable in typed output expressions regardless of array batching and executor.

When arraySize set and slurm executor present, output block of typed processes fail to resolve input variables

Steps to reproduce the problem

main.nf

nextflow.enable.types = true

process getSce {

    input:
    localFile: Path

    output:
    sce: Path = file("${localFile.baseName}_sce.rds")

    script:
    """
    touch ${localFile.baseName}_sce.rds
    """


}

workflow {
  def sceInput = channel.of(
    file('DS000020783', checkIfExists: false),
    file('DS000020917', checkIfExists: false),
  )

  def readResult = getSce(sceInput)
}

and nextflow.config:

params {
  arraySize = 1
}
profiles {
  local {
    process {
      executor = 'local'
    }
  }
  slurm {
    executor {
      name = 'slurm'
    }
    process {
      executor = 'slurm'
      array = params.arraySize > 1 ? params.arraySize : null
    }
  }
}

Program output

This works:
nextflow main.nf -profile slurm --arraySize 1
This also works
nextflow main.nf -profile local
This fails:
nextflow main.nf -profile slurm --arraySize 2
with:

ERROR ~ No such variable: localFile

Environment

  • Nextflow version: [26.04.1]
  • Java version: [
    openjdk version "21.0.5" 2024-10-15 LTS
    OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11-LTS)
    OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11-LTS, mixed mode, sharing)
    ]
  • Operating system: [Linux]
  • Bash version: GNU bash, version 4.4.20(1)-release (x86_64-redhat-linux-gnu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions