-
Notifications
You must be signed in to change notification settings - Fork 153
hpcSPAdes rebase, cleanup & implementation #1380
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
Conversation
58fa47b
to
3132f28
Compare
if not options_storage.args.only_generate_config: | ||
executor = executor_local.Executor(log) | ||
executor.execute(commands) | ||
executor = get_executor(log) |
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.
I don't like assigning a new functionality to the same variable, but overall fine I guess
else: | ||
jobs = executor.execute(commands) | ||
|
||
if jobs is not None and len(jobs): |
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.
I job is a list or None this will do as well
if jobs:
|
||
def get_executor(log): | ||
import importlib | ||
module_name = "executor_" + options_storage.args.grid_engine |
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.
would making grid_engine
a function parameter make any sense?
def generate_job_uuid(self): | ||
return ('hpcSPAdes_' if self.mpi_support else 'SPAdes_') + \ | ||
self.STAGE.replace(' ', '_') + "_" + \ | ||
''.join([random.choice(string.ascii_uppercase + string.digits) for k in range(32)]) |
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.
can also use
("%x" % random.randint(0, 1 << 128)).upper()
but doesn't matter really
command = [commands_parser.Command( | ||
STAGE="K%d" % self.K, | ||
path=os.path.join(self.bin_home, "spades-core"), | ||
path=os.path.join(self.bin_home, "{spades_core}"), |
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.
f"{spades_core}"
?
|
||
|
||
class ExecutorCluster(ExecutorBase): | ||
grid_engine = None |
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.
isn't it supposed to be inside __init__()
?
this defines static members, is it on purpose?
|
||
|
||
def get_MPI_command(self, command, prev_job_name=""): | ||
cmd = self.grid_engine_submit_command + " " |
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.
does it makes sense to make a list of strings and then do command.join(' ')
?
|
||
@abstractmethod | ||
def touch_file(self, command): | ||
def join(self, job_name): |
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.
you can also put raise NotImplementedError()
For now PR to run tests