Notes on yt - Astro250/Sping2017 GitHub Wiki
YT
Fun with python and jupyter at NERSC...
So here are some things we should all fire up for playing with the data sets we are going to be seeing over the next few weeks. First off, here's the link to the NERSC pages on python. In particular I like to use the anaconda-python. We are all going to get this installed and play with yt through it.
First thing, log into cori and then:
module load python/2.7-anaconda
Then you want to:
source activate /project/projectdirs/astro250/ytnersc
To shut this down you can do a:
source deactivate
Now we want to make this visible from the NERSC ipython/jupyter hub.
Do the following:
mkdir -p ~/.ipython/kernels/ytnersc
cp /project/projectdirs/astro250/python/kernel.json ~/.ipython/kernels/ytnersc/
Then when you go to the ipython service you can fire up the ytnersc kernel which you will see under the "new" button on the top right. I have placed a notebook file that you can fire up located here: /project/projectdirs/astro250/python/Nyx_test.ipynb
so when I was playing with things with yt and mpi4py I noticed that I could do either one or the other in parallel but not both. In addition, any parallel version I had which I installed via anaconda did not allow me to fire it up via the <ipython.nersc.gov> service.
I sat down with Rollin Thomas today and worked through everything. It was a very subtle issue with how Fernando has set up jupyter and the use of ipython kernels. I detail the solutio below for those who are interested. In any case, I have made an conda installation using cray mpi4py, yt and ipykernel which we should all be able to use. It is in our project class directory.
Just:
module load python/2.7-anaconda
source activate /project/projectdirs/astro250/ytnersc
and you are good to go.
Note that if you want to use this in a slurm script you want to run in non-interactive mode, then it is best to not do a source activate in the script, rather you just prepend the location of the bin directory to your PATH.
export PATH=/project/projectdirs/astro250/ytnersc/bin:${PATH}
Debug: if you previously started the iPython server, you might need to go to Control Panel > Stop My Server from the iPython hub on NERSC.