Skip to content

Instantly share code, notes, and snippets.

View jojennin's full-sized avatar

Joseph Jennings jojennin

  • NVIDIA
  • Santa Clara, CA
View GitHub Profile
@StevenCHowell
StevenCHowell / pool_update_xml_queue.py
Last active July 18, 2022 16:09
Demo performing parallel tasks with a queue for logging progress.
"""Demo performing parallel tasks with a queue for logging progress."""
import datetime
import multiprocessing as mp
import time
from collections import namedtuple
from xml.dom import minidom
import psutil
from lxml import etree
@TysonRayJones
TysonRayJones / SLURM_commands.md
Last active January 18, 2024 21:42
A list of useful SLURM commands

In addition to Harvard's fantastic list, we list some other convenient SLURM commands.


Delay an enqueued job from running

Useful for letting other enqueued jobs run without having to kill/re-run already running jobs. To delay for 7 days:

@mbdriscoll
mbdriscoll / reduce.py
Created November 16, 2017 21:04
Example of mpi4py MPI_Reduce with custom operator
import numpy as np
from mpi4py import MPI
rank = MPI.COMM_WORLD.rank
# create numpy arrays to reduce
src = (np.arange(8) + rank*8).reshape(4,2)
dst = np.zeros_like(src)
def myadd(xmem, ymem, dt):
@rmcgibbo
rmcgibbo / MPI_ManualReduce.cpp
Last active August 16, 2022 23:15
Efficient MPI Parallel Reduction Without MPI_Reduce or MPI_Scan (only Send/Recv)
/*
* An efficient MPI parallel reduction without MPI_Scan or MPI_Reduce. (i.e.
* only send/recv).
*
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*/
#include <mpi.h>
#include <cstdio>
#include <vector>