New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
revised LsfExecutor.groovy in order to parse $LSF_ENVDIR/lsf.conf #1035
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy
Outdated
Show resolved
Hide resolved
modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy
Outdated
Show resolved
Hide resolved
modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy
Outdated
Show resolved
Hide resolved
I think NF uses the same units as LSF, this snippet can be useful nextflow/modules/nf-commons/src/main/nextflow/util/MemoryUnit.groovy Lines 84 to 93 in 73977a9
|
Thank you for the comments; I should be able to fix the above soon.
I'm a bit confused what your plans are for the above---that would mean the user-provided units would be the "correct" units? |
It could be possible to add a
So that
|
modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy
Outdated
Show resolved
Hide resolved
I've yet to add unit tests---this can be done once there's agreement this solution seems reasonable. I've now installed DCO---future commits should have the sign off |
modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy
Outdated
Show resolved
Hide resolved
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
…d toUnit() function to parse this in MemoryUnit.groovy. Signed-off-by: Evan Biederstedt: evan.biederstedt@gmail.com Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
… form *B bytes Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
…t, not KB Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pditommaso
So, I've started to add unit tests both in nextflow/modules/nf-commons/src/test/nextflow/util/MemoryUnitTest.groovy
and nextflow/modules/nf-commons/src/test/nextflow/util/LsfExecutorTest.groovy
My lack of familiarity with Groovy + Spock is causing this to be a bit (unnecessarily) clumsy:
The CI tests fail on Travis at https://github.com/nextflow-io/nextflow/blob/master/modules/nextflow/src/test/groovy/nextflow/executor/LsfExecutorTest.groovy#L71-L84
However, it's not clear to me:
(A) why it's failing there, as the default behavior in MB should still exist
(B) how Groovy developers use Spock to quickly see what the unit tests "expect" to quickly correct the source code and/or tests. If I simply try to compile the NF sourcecode via Sublime, I run into compilation errors which could be related to which version of Java I'm using, e.g. error: package javax.annotation does not exist
Do you have advice how to best do this?
@@ -63,7 +64,7 @@ class LsfExecutor extends AbstractGridExecutor { | |||
super.init() | |||
queueInterval = session.getQueueStatInterval(name) | |||
log.debug "Creating executor '$name' > queue-stat-interval: ${queueInterval}" | |||
def memoryUnitLSF = getLSFmemoryUnits() ? : 'MB' | |||
def memoryUnitLSF = LsfExecutor.getLSFmemoryUnits() ? : 'MB' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible this isn't what you meant by the init()
function, so I'm unsure about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LsfExecutor.getLSFmemoryUnits()
is not correct because that implies a static method definition and getLSFmemoryUnits
should not br static.
The operator is ?:
not ? :
as + =
is not the same same +=
.. and I guess that's why it's failing.
Last, I was wrong to suggest you to implement this logic in the init
method, it should be register
instead (always a template method in the superclass).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback. These comments make a good deal of sense.
Last, I was wrong to suggest you to implement this logic in the
init
method, it should beregister
instead (always a template method in the superclass).
This I don't understand. What do you mean by "it should be register
instead"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Executor
class define either init
and register
method. The latter is meant to be overridden.
modules/nextflow/src/main/groovy/nextflow/executor/LsfExecutor.groovy
Outdated
Show resolved
Hide resolved
Well, if you are pretending to implement this without even compiling and testing it locally I think you are very low chances to get it working. To compile and test the code is enough running
If you want to use a integrated UI use IntelliJ as explained the project README file.
The test reports the expected output and the actual output. You can find in the report generated by |
Signed-off-by: evanbiederstedt <evan.biederstedt@gmail.com>
This is exactly what I was looking for, thank you! Excellent, this works well---it's far easier than with a standard text editor Apologies, I had missed this in the README. I appreciate the help |
In theory, Nextflow can simply specify |
Interesting could. Are you aware if since this version is supported this syntax? |
Yes, this syntax is detailed in the documentation of LSF v9 cited in this PR. And also in the documentation for LSF v10 that we use on our cluster. I also just successfully tested that both Update: I just realized the documentation above is for cluster admins, not for job submitters. And though Work on our LSF v10 cluster:
Fails on our older LSF v9 cluster:
|
Therefore is not a valid solution because there are NF users using even older LSF versions |
@pditommaso unfortunately yes. On our LSF v9 cluster, I could not find any other way to override the |
Can any of you attach here an example |
@pditommaso here are I had to remove personal information, but what remains should be sufficient for NextFlow. |
Tx |
I think quite a few files have changed since this PR was made. It may be best to start again to isolate why the tests are failing. |
I've already an implementation. I'll include in the next month edge release. thanks. |
Thanks @pditommaso Sincere apologies---other projects came up |
No pb, all of us have priorities. |
The unit used by LSF batch scheduler for memory limits depends on the setting of the attribute LSF_UNIT_FOR_LIMITS defined in the lsf.config file. This commit adds to the LSF executor the ability to fetch such setting and properly apply when a job is submitted for execution. Moreover if fixes the default mem unit to KB (instead of MB) when the above setting is not defined. Solves #1124. See also PR #1035.
The unit used by LSF batch scheduler for memory limits depends on the setting of the attribute LSF_UNIT_FOR_LIMITS defined in the lsf.config file. This commit adds to the LSF executor the ability to fetch such setting and properly apply when a job is submitted for execution. Moreover if fixes the default mem unit to KB (instead of MB) when the above setting is not defined. Solves nextflow-io#1124. See also PR nextflow-io#1035.
The unit used by LSF batch scheduler for memory limits depends on the setting of the attribute LSF_UNIT_FOR_LIMITS defined in the lsf.config file. This commit adds to the LSF executor the ability to fetch such setting and properly apply when a job is submitted for execution. Moreover if fixes the default mem unit to KB (instead of MB) when the above setting is not defined. Solves nextflow-io#1124. See also PR nextflow-io#1035. Signed-off-by: Ivkovic <sinisa.ivkovic@gmail.com>
The unit used by LSF batch scheduler for memory limits depends on the setting of the attribute LSF_UNIT_FOR_LIMITS defined in the lsf.config file. This commit adds to the LSF executor the ability to fetch such setting and properly apply when a job is submitted for execution. Moreover if fixes the default mem unit to KB (instead of MB) when the above setting is not defined. Solves #1124. See also PR #1035.
This needs a bit of work....
As discussed on gitter 15 Feb 2019, Nextflow currently assumes that users have the environment variable
LSF_UNIT_FOR_LIMITS=MB
set in the$LSF_ENVDIR/lsf.conf
. In principle, LSF users should have this exposed on their head and worker nodes.At the moment, this more of a proposal than a PR.
init()
method to override than inAbstractGridExecutor.groovy
$LSF_ENVDIR/lsf.conf
The major problem with this solution is that it doesn't address the problem of a discrepancy between the units the user sets in Nextflow, and the variable
LSF_UNIT_FOR_LIMITS
. If the user setsprocess.memory="5.MB"
and the variable in$LSF_ENVDIR/lsf.conf
is set asLSF_UNIT_FOR_LIMITS=GB
, then the above will override what the user sets.