task.attempt variable question

163 views
Skip to first unread message

biowang

unread,
Jun 22, 2016, 2:32:27 AM6/22/16
to Nextflow
hi,

=============================
my code
=============================
process abc{


    memory { 2.GB * task.attempt }
    time { 1.hour * task.attempt }

    errorStrategy { task.exitStatus == 140 ? 'retry' : 'terminate' }
    maxRetries 10
    maxErrors 40


    """
    echo ${task.attempt}
    echo ${task.memory}
    echo ${task.time}
    exit 140
    """
}


=============================
the message printed
=============================
N E X T F L O W  ~  version 0.20.0
Launching a.nf
[warm up] executor > local
[5b/ce026b] Submitted process > abc (1)
[6d/43c30b] Re-submitted process > abc (1)
[65/ad76ab] Re-submitted process > abc (1)
[1b/8545a8] Re-submitted process > abc (1)
[c3/712d8e] Re-submitted process > abc (1)
[9e/1a5511] Re-submitted process > abc (1)
[4a/891464] Re-submitted process > abc (1)
[09/48cc92] Re-submitted process > abc (1)
[5c/d86846] Re-submitted process > abc (1)
[2b/fcff44] Re-submitted process > abc (1)
[b9/1b2ae1] Re-submitted process > abc (1)
Error executing process > 'abc (1)'

Caused by:
  Process 'abc (1)' terminated with an error exit status

Command executed:

  echo 1
  echo 2 GB
  echo 1h
  exit 140

Command exit status:
  140

Command output:
  1
  2 GB
  1h

Work dir:
  /tmp/work/b9/1b2ae1167742445c47b82e41e9a364

Tip: you can replicate the issue by changing to the process work dir and entering the command: 'bash .command.run'


=============================
my question
=============================
why the variable task.attempt did`t increased to 10.
and at the same time the Command executed not be

  echo 10
  echo 20 GB
  echo 10h
  exit 140











thank you very much

Paolo Di Tommaso

unread,
Jun 22, 2016, 3:07:42 AM6/22/16
to nextflow

Hi,

Because the script is not re-evaluated, but submitted as it is. Thus the updated values are not visible in the script.

I need to add this in the doc.

Cheers, Paolo

--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted
Message has been deleted

Paolo Di Tommaso

unread,
Jun 24, 2016, 5:34:31 PM6/24/16
to nextflow
I mean, when a task is re-submitted due to a failure the variable in the script are not re-evaluated in order that you are re-executing the identical job. 

Thus you won't see the new value for `task.attempt`. That variable is meant to be used in the directive definition in order to increase dynamically the resource requirements. 

Hope it helps. 

Cheers,
Paolo


On Wed, Jun 22, 2016 at 9:40 AM, biowang <wanglia...@163.com> wrote:
what is a re-evaluated script?

在 2016年6月22日星期三 UTC+8下午3:07:42,Paolo Di Tommaso写道:
Reply all
Reply to author
Forward
0 new messages