EMSES-tutorials

First Tutorial

Follow the steps below to get EMSES up and running for the first time.

1. Launch VS Code and install the “Remote – SSH” extension

alt text

2. Log in to Kyoto University’s supercomputer “camphor”

alt text

3. Open a TERMINAL

alt text

4. Set up your data area: LARGE0

mkdir /LARGE0/gr20001/$USER
ln -s /LARGE0/gr20001/$USER ~/large0

5. Add the following lines to your .bashrc, then log out and log back in

grep -qxF 'module load intel-python' ~/.bashrc || echo 'module load intel-python' >> ~/.bashrc
grep -qxF 'export PATH="$PATH:$HOME/.local/bin"' ~/.bashrc || echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc

6. After reconnecting, choose Open Folder~/large0 and re-enter your password

alt text

7. After reconnecting and opening a TERMINAL, install EMSES

mkdir -p ~/large0/Github
cd ~/large0/Github
git clone https://github.com/CS12-Laboratory/MPIEMSES3D.git
cd MPIEMSES3D
make

8. Clone this tutorial repository and install the required Python libraries

cd ~/large0/Github
git clone https://github.com/CS12-Laboratory/EMSES-tutorials.git
cd EMSES-tutorials
pip install -r requirements.txt

9. Copy the EMSES executable into each dshield* directory

cp ~/large0/Github/MPIEMSES3D/bin/mpiemses3d dshield0/
cp ~/large0/Github/MPIEMSES3D/bin/mpiemses3d dshield1/
cp ~/large0/Github/MPIEMSES3D/bin/mpiemses3d dshield2/

10. Try running dshield0

cd ~/large0/Github/EMSES-tutorials/dshield0
mysbatch job.sh
mysbatch: Custom command (camptools: https://github.com/Nkzono99/camptools)

Reads the “nodes(:)” entry in plasma.inp, sets the number of processes in job.sh, and then runs sbatch job.sh.

11. Check the job status

qs         # Check job status (custom camptools command)
squeue     # Check job status (Slurm)
qgroup     # Check resource availability
latestjob  # Custom command (camptools: https://github.com/Nkzono99/camptools)
           #   Shows the latest job’s log file (= tail -n 5 stdout.*****.log)

NOTE: To cancel a submitted job, run

scancel <job-id>

NOTE: To view the stdout & stderr of a running job:

12. Confirm the job has finished

12.1 Run the following; if your job ID no longer appears or its state is “FINISHED,” it has completed

squeue

12.2 Verify normal completion

13. Visualization

13.1 Inspect the plots generated by the provided script (.mypython/plot.py)

These should be saved as data/*.png and data/gif/*.gif. For example:

phisp_2d_xy.png

phisp_2d_xy.png

13.2 Try visualizing interactively: open dshield0/plot_example.ipynb

See the following references for how to visualize:

alt text

14. Run for a longer time & try other simulation settings

14.1 Increase the runtime

In dshield0/plasma.inp, nstep is set to 100. This only captures the very early interaction between plasma and the object.

TODO: Increase nstep to simulate over a longer time, then run again.

14.2 Run other simulation configurations

For dshield1 and dshield2, open their respective plasma.inp files and run each one. Compare what changes between the cases.

14.3 TODO: After each simulation finishes, visualize it just like in dshield0 and discuss the results.


Before You Look at the Results, Make Predictions

An isolated negative charge in various plasma environments:

  1. Q1. In ds0, what does the spatial charge‐potential distribution around the negative charge look like?
  2. Q2. In ds1, how does the potential around the negative charge differ compared to ds0?
  3. Q3. In ds1, how do the plasma electrons and ions behave around the negative charge?
  4. Q4. In ds2, how does the potential around the negative charge differ compared to ds1?
  5. Q5. If you change plasma temperature instead of density, how will the results differ?

Practice Exercises

NOTE: If you set wp = 0.0d0 in ds0, the visualization library emout will not work properly. Therefore, when visualizing ds0, set wp to something like 1.0d0 in plasma.inp before running the visualization.

NOTE: If you run into issues following the simulation steps, first explain your situation to an M1 student and get advice. If you still can’t resolve the problem and need to ask your advisor or instructors, include all of the following information:

  1. What you asked the senior student
  2. What answer you received
  3. What you actually did based on that answer
  4. What still remains unresolved

After running the simulations, at minimum check:

Discuss the physical meaning of these results with your B4 group members and be prepared to share your thoughts in the next tutorial.


References