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
| @media (prefers-color-scheme: light){:root { | |
| --sds-border-accent-default: 1px solid #1a6cef; | |
| --sds-border-accent-focused: 1px solid #1a6cef; | |
| --sds-border-accent-hover: 1px solid #0041b9; | |
| --sds-border-accent-open: 1px solid #1a6cef; | |
| --sds-border-accent-pressed: 1px solid #002d90; | |
| --sds-border-accent-selected: 1px solid #1a6cef; | |
| --sds-border-base-default: 1px solid #969696; | |
| --sds-border-base-disabled: 1px solid #c3c3c3; |
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
| #!/bin/bash | |
| set -e | |
| # find files matching a given expression, | |
| # execute grep on them for a given string, | |
| # print matches and filenames | |
| if [ $# -eq 2 ]; then | |
| FILEPATTERN="$1" | |
| SEARCH="$2" |
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
| def AllGatherv_unknown_shape(data, comm, rank, n_threads, mpi_dtype, axis=1): | |
| """ | |
| Use MPI to compute shape of result array by asking every thread for their chunk's shape, | |
| then perform the AllGatherv operation (concatenating along the given axis) and return the result. | |
| """ | |
| if axis != 1: | |
| data = np.swapaxes(data, axis, 1) | |
| # Require row-major order for concatenation along axis 0 |
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
| # Return a decorator that runs the function only if rank == 0, | |
| # otherwise waits for a broadcast from rank 0 | |
| def broadcast_from_zero(rank, comm, root=0): | |
| def decorator(func): | |
| @functools.wraps(func) | |
| def wrapped(*args, **kwargs): | |
| if comm is None: | |
| return func(*args, **kwargs) | |