This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python's asynchronous input-output framework speeds up IO-bound operations | |
| # by allowing your python program to make progress on multiple IO-bound tasks | |
| # concurrently. In this example, we load many neuroimaging data files and | |
| # then perform a compute-intensive operation on each of them. Parallelizing the | |
| # compute-intensive operation is beyond the scope of this tutorial. However, | |
| # we can still get a big speed up by reading multiple files concurrently. While | |
| # the program waits for the operating system to make progress on reading one | |
| # file, it can work on computational transformation of another file. | |
| # | |
| # Loading a file asynchronously is straightforward. Here, we define a helper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Synchronize slurm jobs using advisory file locks (flock). | |
| This module provides functionality for synchronizing concurrent work across | |
| multiple jobs running on multiple nodes in a slurm cluster. Synchronization is | |
| achieved using advisory file locks, or flock. This module is particularly useful | |
| for easily-parallelizable jobs that divide a large problem into chunks that can | |
| be processed independently. | |
| To use an flock like a mutex: | |
| >>> from slurm_sync import LockFile |
OlderNewer