Skip to content

馃憣 IMPROVE: Avoid using sed to add $HQ_CPUS#2

Description

@mbercx

To avoid the current bash escaping that adds single quotes around every command and argument, I added a bit of hacky sed logic:

submit_command = (
f"chmod 774 {submit_script}; options=$(grep '#HQ' {submit_script});"
f"sed -i s/\\'srun\\'/srun\ --cpu-bind=map_cpu:\$HQ_CPUS/ {submit_script};"
f'hq submit ${{options:3}} ./{submit_script}')

If/when it's possible to avoid the single quotes around all items in the srun line, we can e.g. simply add this to the srun command of the computer setup.

However, we should probably not add this option at all when running on multiple nodes. I haven't tested this so far.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

improvementImproving already existing features

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions