Nonadiabatic Dynamics
How to Prepare a HefeiNAMD Training
A HefeiNAMD training with a hands-on session is not just a slide lecture. The practical bottleneck is the training environment: a shared conference server, many participants submitting jobs at the same time, and a workflow whose real production path can take far longer than the classroom window. This note summarizes how I would prepare a complete training package after a recent HefeiNAMD workshop trip.
Background
My first assumption was that the task would be mostly presentation work: collect previous slides, watch available training videos, and explain the method clearly. The actual workshop required live demonstration and hands-on execution. That changed the preparation target from "understand the PPT" to "make every participant directory, script, dependency, and fallback output behave on the conference server".
The environment itself is usually not the hardest part. Conference servers normally have administrators, and most missing modules, queue settings, or path issues can be resolved quickly if the trainer asks early. The harder part is making the workflow robust when many attendees submit jobs through Slurm at the same time.
Principle
The key distinction is between a production HefeiNAMD workflow and a training demonstration. In production, every stage should be run and checked in sequence. In a hands-on workshop, however, the live computation should be designed as a reproducible teaching path, not as a time-consuming scientific production run.
The most reliable strategy is to precompute all heavy results on the same server before the workshop, then use light pseudo-job scripts during class. These scripts mimic the commands and directory transitions that participants need to learn, but copy or expose known-good outputs instead of forcing dozens of long calculations to compete in the queue.
HefeiNAMD Chain
A complete real workflow should still define the scientific chain clearly:
- Relax the initial structure.
- Build a suitable supercell and relax the expanded cell.
- Run NVT thermalization, then NVE production dynamics.
- Use the production
XDATCARto generate numbered SCF snapshot directories. - Run SCF calculations and prepare the CA-NAC inputs.
- Generate consistent
EIGTXT,NATXT,inp, andINICONfiles. - Run HefeiNAMD or DISH dynamics.
- Analyze populations, lifetimes, NAC traces, and comparison plots.
The important consistency checks are the time window, band window, timestep, number of MD frames, and the relationship among NSW, NAMDTIME, and NSAMPLE. A training fallback may skip expensive runtime, but it should not hide these dependencies from the participants.
Prepared Outputs
For a real hands-on session, I would prepare the following outputs before teaching:
- A tested software environment: compiler, MPI, VASP or upstream electronic-structure binaries, HefeiNAMD, Python, and all plotting or data-processing dependencies.
- Precomputed MD data, especially a stable production
XDATCAR. - Precomputed SCF snapshot outputs, including files that would normally be expensive to regenerate during class, such as
WAVECARwhen the teaching workflow needs it. - CA-NAC outputs that are already known to match the selected band window and MD time interval.
- Ready-to-run
inp,INICON,EIGTXT, andNATXTexamples. - Finished HefeiNAMD or DISH outputs and compact analysis scripts for population fitting and comparison with experimental timescales.
The ideal state is simple: if the server queue fails, the workshop can still teach the entire workflow. If the queue behaves well, participants can run selected lightweight stages themselves.
Workshop Directory Design
The participant directory should be cleaner than the trainer's research workspace. It should contain only the files needed for the exercise, with no absolute private paths, no unnecessary large intermediates, and no ambiguous duplicate scripts. I would prepare three layers:
inputs/: minimal clean inputs for each stage.scripts/: Slurm scripts, pseudo-job scripts, and postprocessing scripts.reference-results/: precomputed outputs that pseudo jobs can copy into the active working directory.
The pseudo-job scripts should preserve the visible logic of the real workflow. For example, participants should still see where XDATCAR enters, where SCF snapshots are created, where EIGTXT and NATXT come from, and how the final dynamics output is analyzed.
Fallback Used in This Training
In the time available for this workshop, it was not realistic to complete the whole HefeiNAMD chain live from scratch. The practical fallback was:
- Use an existing
XDATCARfor the MD stage. - Represent the SCF and
WAVECARstage with a prepared link or precomputed output. - Use pseudo-job scripts for the later steps so participants could follow the workflow without waiting for the full queue.
- Run a long single-sample DISH trajectory, fit the population behavior, and compare it qualitatively with experiment as a teaching demonstration.
This is acceptable as a classroom scaffold, but it should be labeled clearly. A single-sample long trajectory and a prepared WAVECAR are not a production-quality statistical protocol. They are a way to teach the file dependencies, execution order, and analysis logic within a limited workshop slot.
Rehearsal Checklist
Before the training starts, I would test the following steps on the actual server account that will be used during the workshop:
- Load modules and activate the Python environment from a clean shell.
- Submit one real Slurm job and one pseudo job.
- Check that parallel settings, queue names, and wall-time limits match the conference server policy.
- Run the complete participant path once, starting from a fresh copied directory.
- Confirm that every script uses relative paths or documented environment variables.
- Confirm that analysis scripts generate the expected plots and tables without manual edits.
- Prepare a short recovery note for common failures: missing module, wrong queue, exhausted quota, failed symbolic link, and accidental resubmission by many participants.
This rehearsal is the part I would treat most seriously next time. A slide can be corrected during a talk, but a broken directory layout or missing environment variable can consume the whole hands-on session.
Materials
The public material repository for this training is:
At publication time, the repository also contains compressed example data and result artifacts such as CsPbI3.zip and res.tar.gz. I keep them in the source repository rather than duplicating them into this website, because the website article only needs to document the preparation logic and point to the maintained training package.
Lesson Learned
The main lesson is that a computational workshop should be prepared like a small reproducible software release. Slides explain the method, but the hands-on session lives or dies by tested environments, clean directories, precomputed outputs, and a fallback path that still teaches the real dependency graph. For HefeiNAMD, this is especially important because the scientific chain is long: MD, SCF snapshots, CA-NAC, input generation, dynamics, and analysis all have to describe the same physical time window and electronic band window.