Skip to content

Instantly share code, notes, and snippets.

View dutta-alankar's full-sized avatar
:octocat:
Yohoooo

Alankar Dutta dutta-alankar

:octocat:
Yohoooo
View GitHub Profile
@dutta-alankar
dutta-alankar / projection-paraview_prog-filter.py
Created September 7, 2026 11:33
Projection plot with ParaView programmable filter on AthenaK turbulent box data
import numpy as np
import vtk
from vtk.util import numpy_support as ns
# Output Data Set Type = vtkPolyData
# ---------------- user settings ----------------
AXIS = 2 # 0=x, 1=y, 2=z : integrate along this axis
FIELDS = None # ["nMgII_PIE_Z1.0_z0.0"] # or None for every cell array
SUFFIX = "_proj"
KPC = 3.0856775814913673e21 # cm
@dutta-alankar
dutta-alankar / fetch-illustris-tng-halos.py
Last active August 5, 2026 09:45
Fetch Illustris TNG halos
#!/usr/bin/env python3
"""Fetch a halo from the IllustrisTNG API (https://www.tng-project.org/api).
Fetches the metadata of a halo (FoF group) as JSON and, by default, downloads
its full HDF5 cutout: all particle types (gas, dm, stars, bhs) with all fields.
The cutout can optionally be restricted to a subset of particle types/fields.
Usage:
python fetch_halo.py HALO_ID --api-key KEY [options]
@dutta-alankar
dutta-alankar / MPI+HDF5_build_on_freya.md
Created July 14, 2026 15:10
Building CUDA-aware OpenMPI 5.0 + parallel HDF5 2.0.0 on Freya (MPCDF) GPU nodes

Building CUDA-aware OpenMPI 5.0 + parallel HDF5 2.0.0 on Freya (MPCDF) GPU nodes

Reproducible recipe for a hand-built, CUDA-aware OpenMPI 5.0.10 and a parallel HDF5 2.0.0 linked against it, using the gcc/15 + cuda/13.0 toolchain. This mirrors the site module openmpi_gpu/cuda_11.6-11.6.2-gcc_11-11.2.0/4.1.6 and the older hdf5-2.0.0-openmpi_gpu-4.1 stack, modernised for OpenMPI 5.x.

Built / verified: 2026-07-14 on Freya (SLE 15, SLURM 24.11).

What lands where

@dutta-alankar
dutta-alankar / firefox-on-freya.md
Created June 9, 2026 19:26
Enable browsing on remote cluster

Internet Browsing on the MPCDF Cluster (Firefox Fix)

Problem

Firefox opens but all pages fail to load. The browser shows connection errors for every URL, even though the cluster node has full internet connectivity (e.g. curl https://www.google.com returns HTTP 200).

Root Cause

@dutta-alankar
dutta-alankar / delta_ncsa-multipgpu-python-slurm.sh
Created May 5, 2026 09:26
Slurm script for multinode `Python` GPU job on NCSA Delta cluster
#!/bin/bash
#SBATCH --job-name="ion_box"
#SBATCH --output="tjob.out.%j.%N.out"
#SBATCH --partition=ghx4
#SBATCH --mem=0
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=4 # could be 1 for py-torch
#SBATCH --cpus-per-task=8 #6 # spread out to use 1 core per numa, set to 64 if tasks is 1
#SBATCH --gpus-per-node=4
#SBATCH --account=bdiz-dtai-gh
@dutta-alankar
dutta-alankar / generate-asbsorption-spectra.py
Last active May 6, 2026 10:59
MPI multi-GPU absorption spectrum calculator
# -*- coding: utf-8 -*-
"""
Created on Mon May 04 11:06:28 2026
@author: alankar
MPI + multi-GPU absorption spectrum calculator.
This script reads per-cell ion density (nIon) and hydro fields, then computes
line-of-sight absorption spectra in parallel:
@dutta-alankar
dutta-alankar / slurm_wait_time.py
Last active April 29, 2026 07:52
Compute Slurm submit-to-start waiting time statistics for a partition
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 00:07:48 2026
@author: alankar
Compute Slurm submit-to-start waiting time statistics for a partition.
Default behavior (source=auto):
@dutta-alankar
dutta-alankar / absorption_line_profile_calculator.py
Last active April 28, 2026 14:03
Generate synthetic absorption line spectra along a sightline
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 17 12:22:19 2023
@author: alankar
Absorption-line utilities for synthetic spectra along a sightline.
This module provides helper functions to build an absorption profile from
cell-wise gas properties (temperature, LOS velocity, ion density, and path
@dutta-alankar
dutta-alankar / load_gadget_snapshot-prog_source.py
Created April 28, 2026 09:33
ParaView programmable source helper to load an entire snapshot with one particle type
#!/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 11:27:48 2026
@author: alankar.
ParaView programmable source helper to load an entire snapshot with one particle type.
This script:
@dutta-alankar
dutta-alankar / load_gadget_halo-prog_source.py
Last active April 28, 2026 09:33
ParaView programmable source to load one halo and one particle type from output hdf5 files
#!/bin/python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 10:49:48 2026
@author: alankar.
ParaView programmable source helper to load one halo and one particle type.
This script: