These are chat archives for nextflow-io/nextflow

17th
Feb 2019
evanbiederstedt
@evanbiederstedt
Feb 17 03:07

@pditommaso

I prefer much more self-configuring solution
it would be enough to add a init method in the LsfExecutor overriding the base init
and it could read that $LSF_ENVDIR/lsf.conf and fetch that setting

I'm interested in doing this pull request. However, this might require a bit more discussion.

I have a (hacky) method to parse the memory units from $LSF_ENVDIR/lsf.conf. Here's my idea (as a non-Groovy programmer):

def getLSF_memoryUnit() {
    // assuming $LSF_ENVDIR/lsf.conf exists
    def lsf_config = new File(System.getenv("$LSF_ENVDIR").toString() + "/lsf.conf")
    def lines = file1.readLines()
    def found = lines.find{ line-> line =~ /LSF_UNIT_FOR_LIMITS/ }
    def memory_units = found.split('LSF_UNIT_FOR_LIMITS=')[1]
    return memory_units
}

That gives the string GB for me.

Now that I have this (which needs improvement, e.g. a catch if $LSF_ENVDIR isn't found) and I include this as the init method for LsfExecutor, then I think we change the following:
https://github.com/nextflow-io/nextflow/blob/master/modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy#L64-L79

Simply feed in the memory unit to MemoryUnit and don't use toMega(). Sound reasonable?