Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Boyle moble

View GitHub Profile
View X2D.py
"""Convert RPXMB files to RPDMB
This file can be run either as a script, or by calling its functions. To run as a script, do
something like this:
python X2D.py Strain_N2.h5 Strain_N3.h5 Strain_N4.h5 ExtraWaveforms.h5
To call the functions, and assuming that this file is in the same directory as the script using it,
do something like this:
@moble
moble / ComparingIntegrationMethods.ipynb
Last active Feb 23, 2022
Notebooks related to 'The integration of angular velocity' https://arxiv.org/abs/1604.08139
View ComparingIntegrationMethods.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View rpxmb.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moble
moble / README.md
Last active Aug 17, 2021
Speed up execution of `@everywhere` in julia
View README.md

As described in detail here, julia can take really excessive amounts of time to execute the first @everywhere statement on many processes — around 1 hour for thousands of processes — even if the actual code being executed everywhere is trivial. Basically, the Distributed functions need to be precompiled to make this happen quickly.

This gist provides a simple way to do so — at least on Slurm clusters (though the same principles should apply elsewhere). Just submit precompile.jl as a batch job (adjusting the SBATCH directives as needed), and it should create a sysimage that you can use to run future batch jobs. Check end of the log of the Slurm job to see exactly how to use the sysimage.

Note that both the original julia process and all processes created with addprocs should use the --sysimage=/path/to/sys_everywhere.so argument. Doing so reduces the time taken to execute the first @everywhere sta

@moble
moble / README.md
Last active Aug 17, 2021
Speed up execution of `@everywhere` in julia
View README.md
NOTE: A somewhat streamlined version of this approach can be found in this other gist, which involves only one simple script. You could still use the timing files from this gist if you want to check the details.

As described in detail here, julia can take really excessive amounts of time to execute the first @everywhere statement on many processes — around 1 hour for thousands of processes — even if the actual code being executed everywhere is trivial. Basically, the Distributed functions need to be precompiled to make this happen quickly.

This gist provides a simple way to do so — at least on Slurm clusters (though the same principles should apply elsewhere). The key file is organizer.jl; just submit it as a batch job (adjusting the SBATCH directives as needed), and it should create a sysimage that you can use to run futur

@moble
moble / memory.ipynb
Last active Dec 18, 2020
Notebook demonstrating the use of sxs memory functions
View memory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@moble
moble / unique_gene_id.py
Last active Jul 8, 2021
Ensure GTF-format files have `gene_id` fields unique to each `gene_name` or `transcript_id`
View unique_gene_id.py
#!/usr/bin/env python
# Copyright (c) 2020, Michael Boyle
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@moble
moble / show_dimensions.tex
Last active Sep 4, 2020
Get latex to tell you its sizes, then use those sizes in matplotlib to create plots that will fit perfectly in your latex file
View show_dimensions.tex
% Anywhere you want to see the dimensions latex is using, just place
% this command in the tex file itself, run latex, and look for these
% items in the compilation output. For example, to see these numbers
% as latex uses them within the text, just put this command in the
% main text. To see them in a figure caption, just put this command
% where you write the caption text. Note that the standard
% points-per-inch ratio is 72.27.
\makeatletter
View ExampleProblems.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View PowerDistributionUnderDisplacement.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.