Skip to content

Conversation

asl
Copy link
Member

@asl asl commented Sep 18, 2024

For now PR to run tests

if not options_storage.args.only_generate_config:
executor = executor_local.Executor(log)
executor.execute(commands)
executor = get_executor(log)
Copy link
Collaborator

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):
Copy link
Collaborator

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
Copy link
Collaborator

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)])
Copy link
Collaborator

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}"),
Copy link
Collaborator

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
Copy link
Collaborator

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 + " "
Copy link
Collaborator

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):
Copy link
Collaborator

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()

@asl asl requested a review from andrewprzh April 29, 2025 13:11
@asl asl changed the title [DO NOT MERGE] hpcSPAdes rebase, cleanup & implementation hpcSPAdes rebase, cleanup & implementation Apr 29, 2025
@asl asl dismissed andrewprzh’s stale review April 29, 2025 13:13

Decided to postpone python changes

@asl asl merged commit 6cfefe4 into main Apr 29, 2025
17 checks passed
@asl asl deleted the mpi-ng branch April 29, 2025 13:19
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

Successfully merging this pull request may close these issues.

4 participants