Skip to content

Instantly share code, notes, and snippets.

@tskisner
tskisner / toast_cache_test.py
Created August 30, 2019 07:46
Test code for TOAST cache memory freeing.
#!/usr/bin/env python3
"""Test the ability to free memory from a toast.Cache.
This stores the following objects per detector in a Cache:
- Detector signal as float64
- Detector flags as uint8
- Detector pointing pixel numbers as int64
- Detector pointing weights as float32
@tskisner
tskisner / Fiberassign Sky Test.ipynb
Created January 26, 2019 05:37
Fiberassign Sky-Only
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tskisner
tskisner / pypool.py
Created April 24, 2018 15:57
Example script that has each python process allocate a large portion of memory in turn.
from mpi4py import MPI
import sys
import traceback
import time
import numpy as np
def main():
@tskisner
tskisner / example_mpi_object_read.py
Created March 17, 2017 19:32
Quick Python pseudocode example of MPI read and broadcast of objects.
# Demo of buffered MPI distribution of objects by brick
# we could move this to desiutil...
from desispec.parallel import dist_uniform
def load_objects(path, comm=None, buffersize=5000):
"""
Read objects from a file in a buffered way.
@tskisner
tskisner / bgs-sims.slurm
Created May 29, 2016 16:11
Example slurm script for bgs-sims.py
#!/bin/bash -l
#SBATCH --partition=debug
#SBATCH --account=desi
#SBATCH --nodes=1
#SBATCH --time=00:30:00
#SBATCH --job-name=bgs-sims
#SBATCH --output=bgs-sims_%j.log
#SBATCH --export=NONE