Skip to content

Instantly share code, notes, and snippets.

View mxxo's full-sized avatar

Max Orok mxxo

  • Northern Ontario
View GitHub Profile
@mxxo
mxxo / egsnrc_slurm_job_array.sh
Last active November 4, 2021 23:09
Slurm script for running EGSnrc user codes as a job array
#!/bin/bash
# SLURM_ARRAY_TASK_ID will range from 1 to 10
#SBATCH --array=1-10
# adjust time limits as needed
#SBATCH --time=02:00:00
# run the user code using the input.egsinp file on ten cores
# note: * each run will use a different set of initial random numbers
# * the -s flag forces EGSnrc to use a simple job control object (no locking)
user_code -i input.egsinp -p pegs_data.pegs4dat -b -P 10 -j $SLURM_ARRAY_TASK_ID -s
# this will result in 10 egsdat files, which must be combined manually afterwards
@mxxo
mxxo / mrcp-parser.cpp
Last active December 21, 2020 15:41
ICRP 145 EGS_Mesh parser
// ICRP 145 mesh-type computational reference phantom (MCRP) node and element parser
// -- Max Orok 2020
//
// g++ -std=c++11 -Wall -Wextra -O2 -o mrcp-parser mrcp-parser.cpp
#include "msh_parser.h"
#include <fstream>
#include <sstream>
#include <stdexcept>
@mxxo
mxxo / careful.rs
Last active September 22, 2020 17:01
#![allow(unknown_lints)]
#[track_caller]
pub fn f() {
// ... dreaming about IO in const fns
// * https://github.com/rust-lang/const-eval/issues/44
// * could maybe use include_bytes
let loc = std::panic::Location::caller();
let contents = std::fs::read_to_string(loc.file()).unwrap();
@mxxo
mxxo / report.md
Last active September 3, 2020 16:22
GSoC 2020 Project Report: Fast Merging of RNTuple Data Sets