PLUTO hydro code for Astrophysics by Andrea Mignone
552
This is a docker repository which can run PLUTO astrophysical hydrodynamics code. PLUTO is written by Prof. Andrea Mignone and others.
Setting up an HPC environment and along with all the dependent libraries can be a challenging task especially for the beginners. Keeping this in mind, I have created this Docker repository which any user can pull and start running PLUTO. I have already set up all the required as well as optional dependencies of PLUTO. The environment variables have also been set. One can run PLUTO within this Docker container in both serial and parallel.
To pull this repository, use docker pull alankardutta/pluto:latest
If you want an image that already has a run with sample data files (HD/Blast) use docker pull alankardutta/pluto:sample_run
To run the docker image, use docker run -it --rm alankardutta/pluto:latest bash
--rm removes the container after it is closed.
Note that the tag needs to be changed to whatever in use.
There is also one larger docker image with tag latest_with_vis which has visualization utilities like ParaView (5.11.1) and yt python (idefix) module setup. One can use this. However, this requires X-server setup and running in the host system.
To run docker and make it use the running X-server one needs to use the following command in
docker run -it --rm --env="DISPLAY=host.docker.internal:0" alankardutta/pluto:latestThe DISPLAY environment variable should be set to the IP address of the virtual X server running on the Windows host. Using host.docker.internal allows the container to connect to the X server running on the host machine. For example, one can use Xming or XDMCP session in MobaXterm as the X server.
docker run -it --rm --env="DISPLAY" --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" alankardutta/pluto:latestThe scripts to set the environment variables are located in /etc/profile.d and useful libraries are compiled and set up in /modules
Note to PLUTO Chombo AMR users:
To run PLUTO with Adaptive Mesh Refinement (AMR) support pull the docker image with latest_amr tag using docker pull alankardutta/pluto:latest_amr
Note: I have noticed that hdf5 libraries must be removed from LD_LIBRARY_PATH and LIBRARY_PATH for PLUTO to compile successfully with Chombo Adaptive Mesh Refinement (AMR) library. One may ignore this note altogether and use the pre-set environment in this Docker image with the standard PLUTO runs without AMR.
Set Output_dir in the pluto.ini file to have output from Chombo dumped in a separate directory.
Note to advanced users/developers :
One can use the Docker image pluto:prepare to create a new image when a new version of Pluto comes up (or if one wants any version with custom mods). Here is the Dockerfile script that can do this upon using the following command: docker build -t pluto:<desired_tag> .
I'm assuming that the necessary files are there in the files directory in the host machine with respect to the directory where Dockerfile is present and the previous command was executed.
# Base image with Linux OS and MPI installed
FROM alankardutta/pluto:prepare
COPY ./files/mpich.sh /etc/profile.d/
COPY ./files/hdf5.sh /etc/profile.d/
COPY ./files/fftw.sh /etc/profile.d/
COPY ./files/gsl.sh /etc/profile.d/
RUN echo 'root:pluto4.4p2' | chpasswd
RUN apt -y install sudo subversion git
# Create a new user (replace 'hpc_user' with your desired username)
RUN useradd -m -s /bin/bash hpc_user
# Set a password for the new user (optional but recommended)
RUN echo 'hpc_user:pluto4.4p2' | chpasswd
# Add the new user to the sudoers group to grant them sudo privileges
RUN usermod -aG sudo hpc_user
RUN mkdir -p /home/hpc_user/Downloads
COPY ./files/pluto-4.4-patch2.tar.gz /home/hpc_user/Downloads
RUN chown -R hpc_user:hpc_user /home/hpc_user/Downloads
# Set the default user to be the newly created user
USER hpc_user
# Set environment variables required for your code to run
ENV PLUTO_DIR=/home/hpc_user/PLUTO
ENV XDG_RUNTIME_DIR=/tmp/runtime-hpc_user
# Set the working directory to the user's home directory
WORKDIR /home/hpc_user
RUN tar -xzf Downloads/pluto-4.4-patch2.tar.gz
RUN echo "shopt -s direxpand" >> ~/.bashrc
RUN echo echo "==========================================" >> ~/.bashrc
RUN echo echo " Welcome to PLUTO docker container! " >> ~/.bashrc
RUN echo echo " This is PLUTO v 4.4 p 2 " >> ~/.bashrc
RUN echo echo " Default user password is pluto4.4p2 " >> ~/.bashrc
RUN echo echo "==========================================" >> ~/.bashrc
# Setup the library environments
RUN echo . /etc/profile.d/mpich.sh >> ~/.bashrc
RUN echo . /etc/profile.d/hdf5.sh >> ~/.bashrc
RUN echo . /etc/profile.d/fftw.sh >> ~/.bashrc
RUN echo . /etc/profile.d/gsl.sh >> ~/.bashrc
One can also use ParaView in client-server mode making the docker container the server and host the client using the following command:
docker run -it --rm -p 127.0.0.1:11111:11111/tcp alankardutta/pluto:latest_with_vis
This exposes the 11111 port used by pvserver on the container to localhost in the host machine.
Even directories in the host can directly be mounted and used for to and fro file accessibility between the docker container and host. One can use the following command for this:
docker run -it --rm -v <directory_on_host_to_be_mounted>:<directory_on_container_ where_the_mounted_host_directory_to_show_up> alankardutta/pluto:latest
Also, note that many of these arguments to docker run can also also be combined together.
Many of these instructions were made with the help of ChatGPT.
Content type
Image
Digest
sha256:7888938c1…
Size
656.5 MB
Last updated
about 3 years ago
docker pull alankardutta/pluto