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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mbercx opened this issue Dec 15, 2021 · 2 comments
Open

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

mbercx opened this issue Dec 15, 2021 · 2 comments
Labels
improvement Improving already existing features

Comments

@mbercx
Copy link
Member

mbercx commented Dec 15, 2021

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.

@mbercx mbercx added the improvement Improving already existing features label Dec 15, 2021
@giovannipizzi
Copy link
Member

giovannipizzi commented Dec 15, 2021

Indeed - in addition, other computers might use mpirun instead of srun.
The --cpu-bind=... part should be part of the mpirun command when we setup the computer (once the issue of escaping is fixed).
Also, for now (see It4innovations/hyperqueue#243 (comment)) we should expect for now that we run only single-node jobs with HQ. When HQ will support it, we can change the plugin accordingly.

@giovannipizzi
Copy link
Member

If my suggestion in this issue is accepted, we can also drop the chmod part. Otherwise, we should probably have AiiDA do it by default?

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

No branches or pull requests

2 participants