These are chat archives for nextflow-io/nextflow

9th
May 2018
Lavanya Veeravalli
@veeravalli
May 09 2018 03:16
Hi, my first post here :) I am trying to use (with version 0.28.0) "pollInterval" with pbs executor. pollInterval = '300 sec' But I get to see the following warning WARN: Unknown directive `pollInterval` for process `GenomicsDB But I don't get to see the warning when I use 0.29.0. Am I missing something? Thanks.
Lavanya Veeravalli
@veeravalli
May 09 2018 06:03
I checked the .nextflow.logs.. ThoughI don't get warning about "Unknown directive" as above, still pollInterval: 5s; whcih is by deafult. config file is as below. process { executor = 'sge' clusterOptions = { "-l mem_free=" + task.memory.toString().replaceAll(/[\sB]/,'') } penv = 'OpenMP'// task.cpus automagically added maxRetries = 3 errorStrategy = { task.attempt < 2 ? 'retry' : 'finish' } time = '2h' memory = '1 GB' pollInterval = '30 sec' }
Paolo Di Tommaso
@pditommaso
May 09 2018 06:32
because it needs to be define in the executor scope eg
executor {
   pollInterval = '30 sec'
}
Sven F.
@sven1103
May 09 2018 06:55
This message was deleted
@pditommaso did some changes for #681. Looking forward to your remarks/suggestions, I will change it then asap. I am not sure about the tests atm, give me some special advice for that, very much appreciated :D I also changed the -with-messagesoption flag to -with-httppost, but we can brainstorm for another name, if you like!
Lavanya Veeravalli
@veeravalli
May 09 2018 07:10
@pditommaso Great. Thanks.
Sven F.
@sven1103
May 09 2018 14:36
@pditommaso Referring to #681, would this be an appropriate usage of Agent?
@Override
    void onFlowStart(Session session) {
        // This is either set by the user or via Nexflows name generator
        runName = session.getRunName()
        runId = session.getUniqueId()
        def webLogAgent = new Agent<WebLogObserver>(this)
        webLogAgent.send(this.sendHttpMessage("started"))
        //sendHttpMessage("started")
    }
Sven F.
@sven1103
May 09 2018 15:00
so I could do sth like this?

    private void hireAgent(Closure function){
         def webLogAgent = new Agent<WebLogObserver>(this)
         webLogAgent.send(function)
    }

    @Override
    void onProcessComplete(TaskHandler handler, TraceRecord trace) {
        hireAgent({sendHttpMessage("process_complete", trace)})
    }
Paolo Di Tommaso
@pditommaso
May 09 2018 15:00
sorry, here I am
it should be enough webLogAgent.send { sendHttpMessage("started") }
Sven F.
@sven1103
May 09 2018 15:01
ah, send with {}
as closure
Paolo Di Tommaso
@pditommaso
May 09 2018 15:02
yes, exactly
Sven F.
@sven1103
May 09 2018 15:02
I start to like this
Paolo Di Tommaso
@pditommaso
May 09 2018 15:02
you are passing a function that will be executed by the Agent
Sven F.
@sven1103
May 09 2018 15:02
nice
Paolo Di Tommaso
@pditommaso
May 09 2018 15:02
(on a separate thread)
Sven F.
@sven1103
May 09 2018 15:03
so this would work?
private void hireAgent(Closure function){
        def webLogAgent = new Agent<WebLogObserver>(this)
        webLogAgent.send({function})
    }
hireAgent({do sth})
Paolo Di Tommaso
@pditommaso
May 09 2018 15:03
the syntax yes
Sven F.
@sven1103
May 09 2018 15:04
ok
Paolo Di Tommaso
@pditommaso
May 09 2018 15:04
but in this way you are crating a new agent instance each time
that's bad ! :)
Sven F.
@sven1103
May 09 2018 15:04
aaaaah
I see
Paolo Di Tommaso
@pditommaso
May 09 2018 15:04
declare the agent as a class property
Sven F.
@sven1103
May 09 2018 15:04
jupp
makes sense
Paolo Di Tommaso
@pditommaso
May 09 2018 15:04
and than just use the reference
Sven F.
@sven1103
May 09 2018 15:04
nice
do that
Paolo Di Tommaso
@pditommaso
May 09 2018 15:04
great
Sven F.
@sven1103
May 09 2018 15:09
will logging work from within the separate thread?
ok, it thos
nice
it works
Sven F.
@sven1103
May 09 2018 15:20
@pditommaso ok, submitted all my changes, I am off now until Sunday. I will look into remaining stuff asap then!