These are chat archives for nextflow-io/nextflow

8th
Dec 2017
Karin Lagesen
@karinlag
Dec 08 2017 10:17
Hi! I'm having trouble with some slurm options. Can I submit a .command.run script to the queue to see how it fails? It looks like a slurm script, so
Paolo Di Tommaso
@pditommaso
Dec 08 2017 10:35
yes of course
sbatch .command.run
that's it
Phil Ewels
@ewels
Dec 08 2017 10:56
Hi @pditommaso - how do I take a text string in a params object and convert that to a Memory / time / cpus (int?) unit?
Context: I have if(obj.compareTo(params.max_memory) == 1) which works fine when running with the default (which is defined as a memory object), but fails when specified on the command line (as a string)
obj is another memory object
I tried MemoryUnit.of(params.max_memory) but that doesn't seem to work
Paolo Di Tommaso
@pditommaso
Dec 08 2017 10:58
umm (params.max_memory as MemoryUnit) should do the trick
Phil Ewels
@ewels
Dec 08 2017 11:04
ace, thanks!
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:04
:v:
Phil Ewels
@ewels
Dec 08 2017 11:04
and as TimeUnit for time I guess?
what about cpus?
(maybe that one works already, haven't got that far yet)
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:04
cpus is just an int
as int
Phil Ewels
@ewels
Dec 08 2017 11:05
hmm
  /groovy/script/Script7EEDE984F89F1A8B4667644603761B07/_nf_config_9a993fa6: 91: unable to resolve class MemoryUnit
   @ line 91, column 22.
         if(obj.compareTo(params.max_memory as MemoryUnit) == 1)
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:05
oops
:)
Phil Ewels
@ewels
Dec 08 2017 11:06
This is with the string '7GB'
should it be '7.GB' or something?
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:07
try 7.GB without quotes
we are entering in an unexplored zone ..
Phil Ewels
@ewels
Dec 08 2017 11:07
same error :/
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:07
really, can you copy it?
Phil Ewels
@ewels
Dec 08 2017 11:08
log or command or code?
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:09
both
changed to: if(obj.compareTo(params.max_memory as MemoryUnit) == 1)
command:
nextflow run ../main.nf -resume -name "Test RNA Run: 1512731087" -profile docker --max_memory '7.GB' --max_cpus 2 --max_time '48h' --gtf ./test_data/ngi-rna_test_set/genes.gtf --bed12 ./test_data/ngi-rna_test_set/genes.bed --hisat2_index ./test_data/ngi-rna_test_set/r64/ --aligner hisat2 --singleEnd --reads "./test_data/ngi-rna_test_set/*.fastq.gz"
Paolo Di Tommaso
@pditommaso
Dec 08 2017 11:11
how are you using check_max ?
anyhow something like this should work
   def max = params.max_memory as nextflow.util.MemoryUnit 
   if( obj > max )
      return max
Phil Ewels
@ewels
Dec 08 2017 13:35
Sorry, abruptly went for lunch then had a meeting
Using check_max every time we specify memory for a process. eg here
makes it easy to set "sensible defaults" but easily use the same config files on systems with less memory (eg. locally for testing)
ok amazing! as nextflow.util.MemoryUnit works :+1:
What's the class name for Time?
Apparently not nextflow.util.TimeUnit
ah, looks like the time version of compareTo works with strings
Paolo Di Tommaso
@pditommaso
Dec 08 2017 13:46
Apparently not nextflow.util.TimeUnit
it's nextflow.util.Duration :sunglasses:
Phil Ewels
@ewels
Dec 08 2017 13:49
gotcha :+1: Not needed though - I don't get the same error thrown when I try to compare a string for that one
So I guess that it must have some automatic conversion step that the MemoryUnit is missing?
Paolo Di Tommaso
@pditommaso
Dec 08 2017 13:50
umm, actually it should be needed also for duration, weird
Phil Ewels
@ewels
Dec 08 2017 13:50
Hmm, maybe it was just doing something weird instead of failing for that one
I'll keep the type casting in :+1:
Paolo Di Tommaso
@pditommaso
Dec 08 2017 13:51
better :)
working hard on the built-in sendMail
keep ready to test it :)
Phil Ewels
@ewels
Dec 08 2017 13:56
Awesome! Looking forward to it :tada:
Requirement stuff seems to be working great now: SciLifeLab/NGI-RNAseq#173 - thanks for the help!
Paolo Di Tommaso
@pditommaso
Dec 08 2017 13:56
almost there, testng
cool