Skip to content
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

BDS LSF Support #33

Closed
jhooge opened this issue Sep 29, 2014 · 17 comments
Closed

BDS LSF Support #33

jhooge opened this issue Sep 29, 2014 · 17 comments

Comments

@jhooge
Copy link

jhooge commented Sep 29, 2014

Hello Pablo,

I'm working as a Bioinformatician and Bayer Healthcare and I'm responsible for the development of our NGS pipelines. Currently I'm using bpipe, however due to its code intransparency I'm a bit unhappy with it and I'm currently looking into alternatives. We're using an LSF job scheduler on our HPC and BDS seems a viable alternative to our current pipeline solution, that is, if it did support LSF. However, skimming through your documentation, this doesn't seem to be the case. Are you planning to provide LSF support in the future?

Kind regards,
Jens

@pcingola
Copy link
Owner

Hi! I think I can add support for LSF (it shouldn't be hard).
Would you be willing to beta test it?

@jhooge
Copy link
Author

jhooge commented Sep 29, 2014

Hello Pablo,

unfortunately I wouldn't be able to convince my department of BDS, when
I'll use the word "beta", and due to my time constraints wouldn't be of
much help in testing.
I will keep an eye on your project though.

Best,
Jens

2014-09-29 17:22 GMT+02:00 Pablo Cingolani notifications@github.com:

Hi! I think I can add support for LSF (it shouldn't be hard).
Would you be willing to beta test it?


Reply to this email directly or view it on GitHub
#33 (comment)
.

@pcingola
Copy link
Owner

Sorry, but I'm a bit confused.
You asked me if I was willing to add support for LSF, and when I tell you that "yes, I'm willing to add support", your answer is "then I don't want it"? Am I misunderstanding you answer?

@jhooge
Copy link
Author

jhooge commented Sep 29, 2014

Hello Pablo,

LSF support would of course be appreciated, but I won't be able to beta
test it myself.

Best,
Jens

2014-09-29 17:41 GMT+02:00 Pablo Cingolani notifications@github.com:

Sorry, but I'm a bit confused.
You asked me if I was willing to add support for LSF, and when I tell you
that "yes, I'm willing to add support", your answer is "then I don't want
it"? Am I misunderstanding you answer?


Reply to this email directly or view it on GitHub
#33 (comment)
.

@ryanabo
Copy link

ryanabo commented Dec 10, 2014

I would be interested in LSF support as well. I would be willing to beta test its functionality. Is this something that is in development?

@pcingola
Copy link
Owner

Awsome.
It is not in development right now, but I'll try to work on this (hopefully in the next couple of weeks).

@pcingola pcingola reopened this Dec 10, 2014
@johnlees
Copy link

I would also be interested in using this on LSF, and would be happy to help beta test

@mxqian
Copy link

mxqian commented Feb 17, 2017

I am interested in using this on LSF. What's going on about this now? Has LSF been supported yet? Thanks.

@pcingola
Copy link
Owner

I don't have access to an LSF cluster, but you should be able to easily adapt bds for any cluster type using the "Generic cluster" hooks.

@mxqian
Copy link

mxqian commented Feb 21, 2017

I'm trying to understand and do it.
So, there were 4 perl scripts/settings:
clusterGenericRun = ~/.bds/clusterGeneric/run.pl
clusterGenericKill = ~/.bds/clusterGeneric/kill.pl
clusterGenericStat = ~/.bds/clusterGeneric/stat.pl
clusterGenericPostMortemInfo = ~/.bds/clusterGeneric/postMortemInfo.pl

One way is to replace these files according to the cluster (e.g. LFS/bsub). And then call "bds -s generic". Right?

Is it possible to rename the variable and folder name? For example:
clusterLFSRun =~/.bds/clusterLFS/run.pl
And then how let the "-s" to recognize the option?

Many thanks in advance.

@pcingola
Copy link
Owner

Exactly.
You can other scripts, just change the bds.config file accordingly. Look for
the entries: clusterGenericRun, clusterGenericKill, clusterGenericStat and clusterGenericPostMortemInfo. In the example bds.config there is a brief
description for each. I'm assuming it should be straightforward to
implement, although I don't use LSF.

It is not possible to rename at the moment. But if you send me your
implementation, I'll add them using that name and add the "-s lsf" option
for it.

@rfarouni
Copy link

rfarouni commented Jun 27, 2017

Hi,
I have modified the files to run on LSF. Here is what I have:

For kill.pl

#!/usr/bin/perl
#---
# Parse command line arguments
#---
die "Error: Missing arguments.\nUsage: kill.pl jobId\n" if $#ARGV < 0 ;
#$jobId = shift @ARGV;
$jobId = join(' ', @ARGV);

# Execute cluster command to kill task
#---
$exitCode = system "bkill $jobId";

# OK
exit($exitCode);

for run.pl

#!/usr/bin/perl

use POSIX;

die "Error: Missing arguments.\nUsage: run.pl timeout cpus mem queue saveStdout saveStderr cmd arg1 ... argN\n" if $#ARGV < 6 ;

$timeout = shift @ARGV;
$cpus = shift @ARGV;
$mem = shift @ARGV;
$queue = shift @ARGV;
$saveStdout = shift @ARGV;
$saveStderr = shift @ARGV;
$cmd = join(' ', @ARGV);

$qsub = "bsub ";

if( $cpus > 0 ) {
	$qsub .= "-n $cpus";
}


if( $mem > 0 ) {
	$mem = ceil($mem/1000000); # MB
	$qsub .= "-M $mem ";
}
if( $timeout > 0 ) {
	$timeout = ceil($timeout/60); # minute
	$qsub .= "-W $timeout ";
}
if ( $queue ne "" ) {
        $qsub .= "-q $queue "
}

$pid = open QSUB, " | $qsub";
die "Cannot run command '$qsub'\n" if ! kill(0, $pid); # Check that process exists
print QSUB "$cmd\n";		# Send cluster's task via qsub's STDIN
close QSUB;

exit(0);

for stat.pl

#!/usr/bin/perl

$exitCode = system "bjobs";

# OK
exit($exitCode);

for postMortemInfo.pl

#!/usr/bin/perl

die "Error: Missing arguments.\nUsage: postMortemInfo.pl jobId\n" if $#ARGV < 0 ;
$jobId = shift @ARGV;

#---
# Execute cluster command to show task details
#---
$exitCode = system "bjobs $jobId";

# OK
exit($exitCode);

@pcingola
Copy link
Owner

pcingola commented Jul 8, 2017

Great! I'll add them to the repository.
Thank you!

@pcingola pcingola closed this as completed Jul 8, 2017
@ekernf01
Copy link

ekernf01 commented Mar 19, 2018

I ran into a couple errors while getting this working. Here they are, in case any of the info is useful to others.

In run.pl:

  1. A Perl error about how the ceil subroutine is not defined. Solved by adding use POSIX; to the top.
  2. An LSF error Bad argument for option -n. Job not submitted. Solved by filling in a missing space: $qsub .= "-n $cpus"; becomes $qsub .= "-n $cpus ";.
  3. A sporadic error with incorrect or insufficient memory requests. Solved by correcting LSF syntax: $qsub .= "-M $mem "; becomes $qsub .= "-R rusage[mem=$mem] ";.

@ekernf01
Copy link

Here's another one! I got an error about BDS being unable to find the .exitCode file. Solved by replacing the end of run.pl with this. The problem is that bsub does not conform to the criteria for a clusterGeneric run script: it prints too much junk aside from the job ID.

use IPC::Open2;
$pid = open2(QSUB_IN, QSUB_OUT, " $qsub $cmd ", );
@result_split = split('<|>', <QSUB_IN>); # creates an @answer array
print @result_split[1] . "\n" ;
close QSUB_OUT;
close QSUB_IN;

# OK
exit(0);

@pcingola
Copy link
Owner

Added changes to scripts. I don't have an LSF cluster to test, so I didn't try them.

@ekernf01
Copy link

ekernf01 commented Apr 27, 2018

Well, these are working fine for me so I think you can leave this issue closed until or unless it comes up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants