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

Mantis deskewing with multiprocessing and slurm #47

Merged
merged 74 commits into from
Jul 10, 2023
Merged

Conversation

edyoshikun
Copy link
Contributor

@edyoshikun edyoshikun commented Jun 13, 2023

This PR has an example using slurmkit to replace the bash scripts.

2022-06-21 @talonchandler's summary:

  • fixes parallelized deskew and phase deconvolution  #13 (deskew here, phase reconstruction handled by recOrder's CLI)
  • uses multiprocessing to parallelize over T and C via the mantis deskew CLI
  • uses a naive loop to deskew a list of positions with mantis deskew input.zarr/*/*/* (no slurm necessary)
  • includes an example of parallelizing over P using slurm and slurmkit
  • upgrades to python=3.10 to support slurmkit

@edyoshikun edyoshikun mentioned this pull request Jun 13, 2023
@edyoshikun edyoshikun changed the title Slurmkit for deskewing create-then-fill-slurmkit Jun 13, 2023
@edyoshikun edyoshikun marked this pull request as ready for review June 13, 2023 18:14
this function depends soley on deskew_cli(),
removed the click inputs,
cleaned the code.
@edyoshikun
Copy link
Contributor Author

edyoshikun commented Jun 14, 2023

@talonchandler thank you for the call! I think it was super useful because I really like this new implementation where the mantis.deskew.deskew() does not rely on slurm and can be kept separate (removed the --slurm flag), and the slurmkit option -> slurm_deskew() simplifies #46 (3 bash and 2 python scripts).

Notes we should discuss:

  • This file now depends only on the mantis.deskew.py. The imported functions are deskew_cli,get_deskew_params, create_empty_zarrand get_output_paths, but I am not sure if they should live in deskew.pyorutil.py`.
  • Have this file live under analysis/slurm (?)
  • I removed all the CLI from slurm_deskew() there was no need to do that as shown at the end of the file
  • Decide on what uses click.echo,print() or logging.
  • Since I removed the --slurm flag from the mantis.deskew.deskew(), I don't think the batch scripts from create-then-fill #46 will work.

@talonchandler talonchandler changed the title create-then-fill-slurmkit Mantis deskewing with multiprocessing and slurm Jun 22, 2023
@ieivanov
Copy link
Collaborator

Fantastic, thank you!

I understand that the upgrade to python 3.10 is required by the slurmkit dependency. Should we upgrade the python version and test separately, probably together with #39? I'll port over your changed from here and merge that branch first, after testing that the acquisition engine works without problems (I'm hoping to soon write automated tests for that too).

@edyoshikun
Copy link
Contributor Author

I tested this on /hpc/projects/comp.micro/mantis/2023_05_10_PCNA_RAC1/timelapse_2_3/7-slurmkit and worked fine. This LGTM and can get merged once we confirm that python 3.10 does not cause any other issues. Thank you both!

mantis/cli/deskew.py Outdated Show resolved Hide resolved
@ieivanov
Copy link
Collaborator

@edyoshikun could you take a look at 9240cc4?

Copy link
Contributor

@talonchandler talonchandler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the os -> pathlib changes!

@ieivanov
Copy link
Collaborator

I think keep_overhang should be part of the deskew settings yaml file. This will simplify the func args quite a bit. I'll make that change

@ieivanov
Copy link
Collaborator

ieivanov commented Jun 23, 2023

I think I'm happy with this PR now. Here is a summary of my last changes. Thanks a lot for your work on this!

Before we merge this I'll finish #39 and them will merge main into this branch

@edyoshikun
Copy link
Contributor Author

edyoshikun commented Jun 23, 2023

This LGTM thank you guys! @ieivanov and I ran the test using the same datset as above /hpc/projects/comp.micro/mantis/2023_05_10_PCNA_RAC1/timelapse_2_3/7-slurmkit and worked well. Happy to get this merged and start working on the next steps for analysis. Looking back at the code history, this last version is clean!

@ieivanov
Copy link
Collaborator

Not quite ready yet, let me first test and merge #39

@ieivanov
Copy link
Collaborator

Actually, it's ok, we can do this out of order too. I haven't seen any issues with python 3.10 in my tests on #39

@ieivanov ieivanov deleted the use_slurmkit branch August 19, 2023 00:39
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.

parallelized deskew and phase deconvolution
3 participants