Created
November 24, 2022 09:01
-
-
Save jpata/c86622546dc13457c1bf6cd218d7a8f4 to your computer and use it in GitHub Desktop.
pkdgrav3 compilation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pynbody | |
import matplotlib.pyplot as plt | |
import numpy as np | |
s = pynbody.load("./pkdgrav3/examples/example.00140") | |
plt.figure(figsize=(6,5)) | |
b = np.linspace(-0.5, 0.5, 256) | |
plt.hist2d(s["pos"][:, 0], s["pos"][:, 1], bins=(b, b), cmap="Blues"); | |
plt.colorbar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#build the software | |
rm -Rf build | |
mkdir build | |
cd build | |
singularity exec base.simg cmake -DFFTW_INCLUDES=/usr/include/ .. &> log | |
singularity exec base.simg make -j16 | |
#Run the simulation on GPU | |
chmod +x run_sim.sh | |
singularity exec --nv base.simg ./run_sim.sh | |
#Check the output | |
singularity exec --nv python3 example.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#https://github.com/open-mpi/ompi/issues/7701#issuecomment-932587086 | |
export HWLOC_COMPONENTS=-gl | |
lstopo | |
cd examples | |
mpirun --display-topo ../build/pkdgrav3 cosmology.par |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment