Skip to content

Instantly share code, notes, and snippets.

View n01r's full-sized avatar

Marco Garten n01r

View GitHub Profile
@n01r
n01r / read_warpx_particle_hist.py
Last active July 9, 2022 01:01
Format ParticleHistogram Header for WarpX ReducedDiag
#!/usr/bin/env python
import numpy as np
import pandas as pd
import re
df = pd.read_csv("histHAll.txt",delimiter='\s+')
# the columns look like this:
# #[0]step() [1]time(s) [2]bin1=0.000220() [3]bin2=0.000660() [4]bin3=0.001100()
@n01r
n01r / Find_non-ASCII_in_Bibliography.md
Created June 16, 2020 15:19
Find non-ASCII characters in *.bib file that make LaTeX crash
@n01r
n01r / locally_check_out_github_pr.sh
Last active February 11, 2020 08:38
Better way to check out a pull request from GitHub
#!/bin/bash
cd <local/github/repository>
# here mainline is the alias for the main repository
git fetch mainline pull/<PR no.>/head:<new-branch-name>
@n01r
n01r / bpmeta_on_matching.sh
Last active April 17, 2019 12:11
Run bpmeta on files matching pattern
#!/bin/bash
# 1. Go to a directory where you have PIConGPU ADIOS output
# 2. Create a list of filenames matching your pattern, e.g. "fields"
f=$(\ls | grep fields)
# 3. Run bpmeta on all of them
for fdir in $f
do
# The naming pattern is for me "simData_fields_all_<step>.bp.dir"
@n01r
n01r / 01_serial_adios_on_taurus.sh
Last active August 21, 2018 09:54
Serial Adios on Taurus
#!/bin/bash
#
# `module spider <library name>` is awesome!
#
module purge
# change the module environment from 'scs5' to 'both' in order to be able to load the following modules
module load modenv/both
module load gcc/6.2.0
module load cmake/3.10.1
@n01r
n01r / interactive_SLURM_job.md
Created May 29, 2018 07:53
How to get an interactive SLURM job on Daint
  1. Allocate resources for the job
    salloc -C gpu -N <numberOfNodes> --ntasks-per-node 12 -J <JobName> -t <hh:mm:ss>
    
  2. Run a shell in pseudo terminal mode to really get to the compute nodes
    srun --pty --jobid <JobID> --wait=0 bash
    
@n01r
n01r / killall.sh
Created March 13, 2018 13:09
Kill all my jobs on Daint
for i in `squeue -u mgarten | awk '{print $1}' | sed -e "s/_//g" | sort | uniq`; do scancel $i; done
@n01r
n01r / PIConGPU_040-dev_PizDaint.sh
Last active April 13, 2018 12:10 — forked from ax3l/PIConGPU_040-dev_PizDaint.sh
Piz Daint: PIConGPU 0.4.0-dev Quick-Start
#!/usr/bin/env bash
#
# Author: Axel Huebl, Marco Garten
#
# last updated: 2018-02-26
#
# execute:
# wget -O - https://gist.githubusercontent.com/n01r/20dacc20987b75d1858db5261d5d0205/raw/PIConGPU_040-dev_PizDaint.sh | bash
PIC_BRANCH="dev"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@n01r
n01r / convertWavefrontToPhotonNumber.md
Created July 31, 2017 17:24
convertToOPMD - How to use the simex_platform script
  1. Download / clone simex_platform
git clone [email protected]:eucall-software/simex_platform.git
  1. Go to Python sources
cd ~/simex_platform/Sources/python  
  1. Import SimEx modules