Pages

30 October 2018

655. Linux for Edu -- creating lecture videos on linux

We're 'encouraged' to save money on teaching. The easiest (laziest?) way of doing this is to reduce teacher-led time. The ultimate time-saver (in terms of creation of content) is to simply record your lectures using screen-casting.

It's not a very good solution though.

From the point of the lecturer it is not very inspiring, recording 40 minutes of voice-over without mistakes in one take is hard, and updating the slides in the future is hard or impossible. Some solve the voice-over and update issue by using synthetic voices, but they are even more monotonous and uninspiring than most lecturers.

From the point of the student it can be hard to focus for 40 minutes, especially if all you're seeing is a series of slides with a droning voice over. There are other aspects that are bad too: you don't get to interact with the lecturer or your peers, and the lecture content/pace etc. can't be adjusted based on the dynamics of the class.

Some of these aspects can be solved or at least amended by using video editing software. The key is to not simply take a lecture and make a video, but to try to make the most of the medium, without having to become an expert at editing.

Key to making videos is to:
* make them short
...so that students don't need set aside a lot of time to watch them, and can maintain their concentration. It also helps you as a lecturer stay enthusiastic about the video project until it's finished. A long video will make you sick of it before you're done.

* cut everything up into small chunks
...so that you can replace slides and sections, and so you can (re-)record the narration is small chunks. This way you can do as many takes as you need to make sure that the voice over is punchy. No droning!

* to make them engaging
...so that it's fun to watch. This latter bit I haven't cracked. I have decided on a gimmick  though, where I put a countdown timer in the videos. I think/hope that it makes the student feel that the video is moving along quickly and feels 'dynamic'.

Received wisdom dictates that you should include a video of yourself lecturing. There's nothing precluding you from doing that in snippets too and using short Dissolve transitions between the video snippets.


Software:
One should use different tools for different purposes, so I use
* EasyScreenCast or OBSStudio for capturing the desktop if necessary
Make sure to record as webm. Note: You need to transcode the VP8 webm files using the following command or they may show up as black when you render the video in kdenlive:
avconv -i in.webm -c:v libvpx -c:a vorbis -quality best -f webm out.webm

* Audacity for recording audio

* Cheese for recording videos of myself

* Synfig for making simple animation

* kdenlive for video editing

So, here's a quick overview of how to make a simple video using static slides (no screen casting):

1. I made slides in google slides, and then exported each one as a PNG file

2. I recorded the narration using audacity. One recording for each slide. Cut and export.

3. I put it together in kdenlive 
Just drag the length of the slide images to match the lengths of the narration. I also put in a countdown timer as video 2, and overlayed it with the 'composite and transform' transition. I could easily have done the same with a video/videos of myself recorded in cheese.

Either way, the point is that it's very easy to do this.


I also tried to make a simple animation in synfig, but it didn't really pan out. Might be a post in the future -- the students are struggling with visualising 3D objects like orbitals and molecules, and creating animations might help here.


26 October 2018

654. Screen-casting on linux (debian 9)

Minipost:
I'm interested in making course videos where I show my desktop (I might have a full-screen presentation going), but where I also want to show my face.

I'm using debian.

Solution:
To screen-cast the desktop I'm using EasyScreenCast, which is a Gnome Extension: https://extensions.gnome.org/extension/690/easyscreencast/

Not much to say about it really, other than that it works very well.

To get my face on the desktop I use guvcview, which is in the repos.

To make guvcview stay on top even during a full-screen presentation I followed this: https://www.linuxquestions.org/questions/linux-general-1/how-to-make-guvcview-stay-always-on-top-4175541777/

My son's orca lecturing on the importance of experiments in formulating new theories
kdenlive seems like an interesting editor for post-production, but I haven't got that far yet.

20 August 2018

653. Energy decomposition analysis the manual/multiwfn way -- nwchem

I have a very large system (390 atoms, 3918 functions, 6474 primitives) where I want to analyse the bonding. Whereas I can reduce the size of the system a little bit, there's a large conjugated ad charged system in the middle which I can't really reduce. Either way, when I use GAMESS US to do NEDA, the calc seems to hang for days without ever progressing, and LMOEDA/CMOEDA keep running out of memory.

I recently had a look at Multiwfn, and section 4.100.8 in the manual shows how to do simple EDA as a multistep computation. The example uses multiwfn to input initial fragment wavefunctions to compute the DE_orb with Gaussian. Incidentally, this is something which is very easy to do with nwchem without using multiwfn.

I'll use NH3..BH3 as the example at RHF/6-31G*.


Nwchem:

1. Optimise NH3..BH3
scratch_dir /home/me/scratch Title "NH3BH3-nw" Start NH3BH3-nw charge 0 geometry noautosym noautoz units angstrom N 0.0720500 -0.00961700 -0.336156 H 0.871540 0.292859 -0.862886 H -0.685935 0.618297 -0.534511 H -0.187686 -0.922713 -0.663436 B 0.415920 -0.0366410 1.31774 H 0.709693 1.10584 1.58004 H -0.612009 -0.411733 1.83072 H 1.33214 -0.818018 1.41958 end basis "ao basis" cartesian print B library "6-31G*" H library "6-31G*" N library "6-31G*" END scf RHF nopen 0 end task scf optimize
Energy=-82.61181818

2. Run SE calcs on the BH3 and NH3 fragments:
scratch_dir /home/me/scratch Title "BH3-nw" Start BH3-nw charge 0 geometry noautosym noautoz units angstrom B 0.192902 -0.0151808 0.928551 H 0.486935 1.12724 1.19093 H -0.834959 -0.390362 1.44154 H 1.10930 -0.796437 1.03042 end basis "ao basis" cartesian print B library "6-31G*" H library "6-31G*" END scf RHF nopen 0 vectors output bh3.movecs end task scf energy
Energy=-26.368337779376
and
scratch_dir /home/me/scratch Title "NH3-nw" Start NH3-nw charge 0 geometry noautosym noautoz units angstrom N -0.150737 0.0117141 -0.725185 H 0.648571 0.314333 -1.25225 H -0.908696 0.639770 -0.923690 H -0.410582 -0.901249 -1.05260 end basis "ao basis" cartesian print N library "6-31G*" H library "6-31G*" END scf RHF nopen 0 vectors output nh3.movecs end task scf energy
Energy=-56.184296916045

3. Finally, use the two movecs created in step 2:
scratch_dir /home/andy/scratch Title "NH3BH3-nw" Start NH3BH3-nw charge 0 geometry noautosym noautoz units angstrom N 0.0720500 -0.00961700 -0.336156 H 0.871540 0.292859 -0.862886 H -0.685935 0.618297 -0.534511 H -0.187686 -0.922713 -0.663436 B 0.415920 -0.0366410 1.31774 H 0.709693 1.10584 1.58004 H -0.612009 -0.411733 1.83072 H 1.33214 -0.818018 1.41958 end basis "ao basis" cartesian print B library "6-31G*" H library "6-31G*" N library "6-31G*" END scf RHF nopen 0 vectors fragment nh3.movecs bh3.movecs output nh3bh3.movecs end task scf
4. Parse the output from step 4:
iter energy gnorm gmax time ----- ------------------- --------- --------- -------- 1 -82.5357150919 7.36D-01 2.88D-01 0.1 2 -82.6078664771 2.30D-01 5.23D-02 0.1 3 -82.6117699706 2.03D-02 7.47D-03 0.1 4 -82.6118181287 2.23D-04 5.79D-05 0.1 5 -82.6118181326 2.51D-06 7.28D-07 0.1 Final RHF results ------------------ Total SCF energy = -82.611818132574 One-electron energy = -190.292457149391 Two-electron energy = 67.248334359392 Nuclear repulsion energy = 40.432304657425 Time for solution = 0.1s
So, according to the Multiwfn Manual at 4.100.8, using the values from above:
DEtot=-82.61181818-(-26.368337779376-56.184296916045)= -37 kcal/mol (-155 kJ/mol)
DEorb=-82.611818132574-(-82.5357150919)= -48 kcal/mol (-200 kJ/mol)
DEsteric=DEtot-DEorb= 11 kcal/mol (45 kJ/mol)

This is essentially the Kitaura-Morokuma method.

See e.g. Frenking et al.in Energy Decomposition Analysis on page 44. Eq 2 defines Eint in the same way DEtot is defined above, and Eq 7 is the same Eorb as here.

DEstruc here is then DEelstat + DEPauli.

How to resolve these two factors from one another, is a problem for another day.
You can also run the calcs using a single input file:
scratch_dir /home/me/scratch Title "NH3BH3-nw-eda" Start NH3BH3-nw-eda echo charge 0 geometry molecule noautosym noautoz units angstrom N -0.150737 0.0117141 -0.725185 H 0.648571 0.314333 -1.25225 H -0.908696 0.639770 -0.923690 H -0.410582 -0.901249 -1.05260 B 0.192902 -0.0151808 0.928551 H 0.486935 1.12724 1.19093 H -0.834959 -0.390362 1.44154 H 1.10930 -0.796437 1.03042 end geometry ammonia noautosym noautoz units angstrom N -0.150737 0.0117141 -0.725185 H 0.648571 0.314333 -1.25225 H -0.908696 0.639770 -0.923690 H -0.410582 -0.901249 -1.05260 end geometry borohydride noautosym noautoz units angstrom B 0.192902 -0.0151808 0.928551 H 0.486935 1.12724 1.19093 H -0.834959 -0.390362 1.44154 H 1.10930 -0.796437 1.03042 end basis "ao basis" cartesian print N library "6-31G*" B library "6-31G*" H library "6-31G*" END set geometry ammonia scf vectors output ammonia.movecs end task scf set geometry borohydride scf vectors output borohydride.movecs end task scf set geometry molecule scf vectors input fragment ammonia.movecs borohydride.movecs output molecule.movecs end task scf

15 June 2018

652. N/EDA in GAMESS. 4. Running NEDA

Posts 1, 2 and 3.

For this you will need to have linked gamess and nbo.

Here's an example input that works:
andy@carbon:~$ less fast/gamess/mgme_tzvp/Mg_tzvp_opt_neda_2.inp ! File created by the GAMESS Input Deck Generator Plugin for Avogadro $CONTRL SCFTYP=RHF RUNTYP=energy DFTTYP=PBE0 ICHARG=1 MULT=1 NOSYM=1 $END ! $PCM SOLVNT=NEPTANE $END ! $PCMCAV RADII=SUAHF $END ! $SCF DIRSCF=.TRUE. $END $BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END $system mwords=2000 memddi=500 $end $INTGRL NOPK=1 $END $NBO MOLUNIT <1> > <2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23> $END $DEL NEDA END $END $DATA Title C1 Mg 12.0 3.14572 1.02487 1.29474 N 7.0 4.95329 0.37304 1.62652 N 7.0 3.11530 2.89665 1.82263 C 6.0 5.44265 -0.98008 1.41792 C 6.0 5.80308 1.30078 2.07039 C 6.0 1.96130 3.78017 1.78886 C 6.0 4.28661 3.37927 2.23846 C 6.0 5.48149 2.64462 2.33178 H 1.0 6.31935 3.22840 2.68338 C 6.0 4.36331 4.81950 2.64988 H 1.0 5.37500 5.09552 2.93515 H 1.0 3.70056 5.01438 3.49762 H 1.0 4.03950 5.47541 1.83769 C 6.0 7.22682 0.90313 2.32491 H 1.0 7.68811 0.50750 1.41630 H 1.0 7.27827 0.11050 3.07627 H 1.0 7.81805 1.74612 2.67254 H 1.0 5.81529 -1.43220 2.34182 H 1.0 4.63475 -1.61377 1.04987 H 1.0 6.24793 -1.02060 0.67837 H 1.0 1.72108 4.18678 2.77556 H 1.0 2.10316 4.62224 1.10460 H 1.0 1.08587 3.22835 1.44552 $END


And here's the output:
Natural Energy Decomposition Analysis (Summary): Component Energy(wfn) Energy(wfn) (kcal/mol) ------------------------------------------------------------------------------ C7H13N2Mg(+) -583.0832392(scf) -582.9738665(loc) CT = -68.632 ES = -394.694 POL = -353.983 XC = -29.974 1. Mg(+2) -199.0566873(def) -199.0582918(cp) DEF(SE) = 1.007( 0.400) 2. C7H13N2(-) -382.6763191(def) -383.3176043(cp) DEF(SE) = 402.412(176.794) --------- E = -443.864 Electrical (ES+POL+SE) : -571.483 Charge Transfer (CT) : -68.632 Core (XC+DEF-SE) : 196.251 ------------ Total Interaction (E) : -443.864 ..... done with NBO analysis .....
A couple of things to note:
* It runs with PCM, but the results seem nonsensical, in addition to it finding a lot more fragments than without PCM (the latter thing can be amended with NAO)

* If I use DEF2TZVP with PBE0 and DIRSCF=.TRUE. It'll get stuck during the NBO run at
437. RY ( 5) H 23 0.00000 0.00000 0.00000 NEXT STEP: Perform one SCF cycle to evaluate the energy of the new density matrix constructed from the deleted NBO Fock matrix. ------------------------------------------------------------------------------ -------------------------- R-PBE0 SCF CALCULATION -------------------------- DENSITY MATRIX CONVERGENCE THRESHOLD= 2.00E-05 COARSE -> FINE DFT GRID SWITCH THRESHOLD= 3.00E-04 (SWITCH IN $DFT) HF -> DFT SWITCH THRESHOLD= 0.00E+00 (SWOFF IN $DFT) DIRECT SCF CALCULATION, SCHWRZ=T FDIFF=T, DIRTHR= 0.00E+00 NITDIR=10 NONZERO BLOCKS ITER EX DEM TOTAL ENERGY E CHANGE DENSITY CHANGE DIIS ERROR INTEGRALS SKIPPED
It's not consuming any CPU at this point (nor is nbo). I'm running w/o DIRSCF now, but it's very slow, and requires ca 30 Gb of scratch space even for a small molecule like this one.

MOLUNIT <1> >
<2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23>
is not necessary for this run. You can simply use NBO $END instead.

651. N/EDA in GAMESS. 3. Running L/CMOEDA

As it turns out, while MOEDA works fine with pure and hybrid functionals, it does not appear to like PCM, giving weird results.

Here's an example of a run that works, with a few key words highlighted:
! File created by the GAMESS Input Deck Generator Plugin for Avogadro $BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END ! $PCM SOLVNT=NEPTANE $END ! $PCMCAV RADII=SUAHF $END $CONTRL SCFTYP=RHF RUNTYP=EDA DFTTYP=PBE0 ICHARG=1 MULT=1 $END $CONTRL NOSYM=1 $END $SYSTEM MWORDS=2500 MEMDDI=500 $END $SCF DIRSCF=.TRUE. $END $lmoeda matom(1)=1,22 mcharg(1)=2,-1 mmult(1)=1,1 $end $DATA Test of MOEDA using a Mg coordination compound. C1 Mg 12.0 3.14572 1.02487 1.29474 N 7.0 4.95329 0.37304 1.62652 N 7.0 3.11530 2.89665 1.82263 C 6.0 5.44265 -0.98008 1.41792 C 6.0 5.80308 1.30078 2.07039 C 6.0 1.96130 3.78017 1.78886 C 6.0 4.28661 3.37927 2.23846 C 6.0 5.48149 2.64462 2.33178 H 1.0 6.31935 3.22840 2.68338 C 6.0 4.36331 4.81950 2.64988 H 1.0 5.37500 5.09552 2.93515 H 1.0 3.70056 5.01438 3.49762 H 1.0 4.03950 5.47541 1.83769 C 6.0 7.22682 0.90313 2.32491 H 1.0 7.68811 0.50750 1.41630 H 1.0 7.27827 0.11050 3.07627 H 1.0 7.81805 1.74612 2.67254 H 1.0 5.81529 -1.43220 2.34182 H 1.0 4.63475 -1.61377 1.04987 H 1.0 6.24793 -1.02060 0.67837 H 1.0 1.72108 4.18678 2.77556 H 1.0 2.10316 4.62224 1.10460 H 1.0 1.08587 3.22835 1.44552 $END
The ! comments out the PCM lines. I generated the input from an .xyz file through avogadro, and then edited the file manually to get the charges etc. right.

Here's the output:
DIRECT SCF CALCULATION, SCHWRZ=T FDIFF=F, DIRTHR= 0.00E+00 NITDIR=10 DFT IS SWITCHED OFF, PERFORMING PURE SCF UNTIL SWOFF THRESHOLD IS REACHED. NONZERO BLOCKS ITER EX DEM TOTAL ENERGY E CHANGE DENSITY CHANGE DIIS ERROR INTEGRALS SKIPPED *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 0 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 EXECUTION OF GAMESS TERMINATED -ABNORMALLY- AT Thu Jun 14 23:30:05 2018 6712269 WORDS OF DYNAMIC MEMORY USED CPU 0: STEP CPU TIME= 1.73 TOTAL CPU TIME= 2.0 ( 0.0 MIN) TOTAL WALL CLOCK TIME= 2.1 SECONDS, CPU UTILIZATION IS 96.70% DDI Process 0: error code 911 ddikick.x: application process 0 quit unexpectedly. ddikick.x: Fatal error detected. The error is most likely to be in the application, so check for input errors, disk space, memory needs, application bugs, etc. ddikick.x will now clean up all processes, and exit... DDI Process 1: terminated upon request. DDI Process 2: terminated upon request. *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 1 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 2 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 DDI Process 3: terminated upon request. DDI Process 4: terminated upon request. *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 3 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 DDI Process 5: terminated upon request. *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 4 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 5 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 ddikick.x: Sending kill signal to DDI processes. ddikick.x: Execution terminated due to error(s). unset echo

650. N/EDA in GAMESS. 2. Defining an external basis set

This is post number two in a series. Post 1 is here: http://verahill.blogspot.com/2018/06/649-neda-in-gamess-1-recompiling-gamess.html

Defining external basis sets isn't hard, but I find that the gamess documentation isn't great, and there isn't as much online as one would hope.


1. Either way, I'll create an external basis set file with def2svp and def2tzvp at /opt/gamess/gamess_nbo/EXTFILE.txt

2. Get the basis set definition from https://bse.pnl.gov/bse/portal -- select the atoms you want, and the basis set, set format to GAMESS US, and click Get Basis Set.


3. When you paste the data into the EXTFILE.txt,
a) skip the $DATA tag, and
b) change the atom definition to their corresponding symbols (e.g. H instead of Hydrogen) and append the name of the basis set,

so the beginning looks like this:
MG DEF2SVP S 5 1 4953.8339196 -0.57778967498E-02 2 745.18044154 -0.43124761082E-01 3 169.21604972 -0.19268216987 4 47.300672019 -0.48641439116 5 14.461336973 -0.42550894077 S 3 1 24.768174789 0.87956969984E-01 2 2.4940945349 -0.55165058128 3 0.87807584533 -0.53443294833 S 1 1 0.87212782497E-01 1.0000000 S 1 1 0.33599293780E-01 1.0000000 P 5 1 98.053010494 -0.14480564601E-01 2 22.586932277 -0.95495750787E-01 3 6.8391509842 -0.30787672651 4 2.2332843818 -0.49936292886 5 0.71606599387 -0.31503476213 P 1 1 0.18914796195 1.0000000 P 1 1 0.53768755187E-01 1.0000000 D 1 1 0.1010000 1.0000000 H DEF2SVP S 3 1 13.0107010 0.19682158E-01 2 1.9622572 0.13796524 3 0.44453796 0.47831935 S 1 1 0.12194962 1.0000000 P 1 1 0.8000000 1.0000000 C DEF2SVP
and the end like this:
D 1 1 0.64500000 1.0000000 F 1 1 1.42800000 1.0000000 MG DEF2TZVP S 7 1 31438.3495550 0.60912311326E-03 2 4715.5153354 0.47066196465E-02 3 1073.1629247 0.24135820657E-01 4 303.57238768 0.93628959834E-01 5 98.626251042 0.26646742093 6 34.943808417 0.47890929917 7 12.859785199 0.33698490286 S 3 1 64.876913004 0.19180889307E-01 2 19.725520777 0.90913704392E-01 3 2.8951804339 -0.39563756125 S 2 1 1.1960454710 1.6827603373 2 0.54329451156 0.52141091954 S 1 1 0.10099104092 1.0000000 S 1 1 0.36865728085E-01 1.0000000 P 5 1 179.87189612 0.53799549018E-02 2 42.120069376 0.39318014098E-01 3 13.120503032 0.15740129476 4 4.6257503609 0.35919094128 5 1.6695211016 0.45533379310 P 1 1 0.58551012105 1.0000000 P 1 1 0.18914796195 1.0000000 P 1 1 0.53768755187E-01 1.0000000 D 1 1 3.4440000 1.0000000 D 1 1 0.2900000 1.0000000 D 1 1 0.0700000 1.0000000


4. Edit the gms-files.csh in your gamess root (e.g. /opt/gamess/gamess_nbo)
setenv EXTBAS /opt/gamess/gamess_nbo/EXTFILE.txt


5. To use, put
$BASIS EXTFIL=.TRUE. GBASIS=DEF2TZVP $END
or
$BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END
in your gamess input file.

649. N/EDA in GAMESS. 1. Recompiling GAMESS US with NBO6

I need to do energy decomposition analysis (EDA), but only have licenses for Gaussian and NBO6 (i.e. not ADF, turbomole, QChem etc.). NEDA isn't supported by NBO6 with gaussian (afaik).

NWChem, my usual gaussian alternative, doesn't support NBO6 beyond writing a .47 file.

Enter GAMESS US. I've been trying out gamess every few years, but I've found that it's slow and unreliable (very difficult to get SCF convergence) for the systems I work with (polyanions). Some of this may obviously be down to my lack of familiarity with the code -- there are probably plenty of satisified users of GAMESS US.

Either way, NBO6 suppports NEDA with GAMESS US. Also, GAMESS US does two different types  of   EDA: the common Morokuma-Kitaura (MOROKM) one (although only with HF) and an alternative approach by Su and Li that's referred to by GAMESS as LMOEDA (or CMOEDA).

MOROKM and LMOEDA as supported out of the box by GAMESS, but to get it to do NEDA you need to re-link it against NBO. Luckily it's even easier than the instructions in the NBO gamess file (i.e. no need to edit code).

NOTE: I could only link with gfortran 4.9 (jessie). gfortran 6.3 (stretch) failed to link (messages re -fPIC; recompiling gamess with -fPIC didn't solve it).

To compile gamess, see e.g. http://verahill.blogspot.com/2013/06/4xx-gamess-us-2013-r1-on-debian-wheezy.html

Once you've done the ddi/comp and compall steps, edit lked and search for NBO. Change to

set NBO=true set NBOLIB="/opt/nbo6/bin/gmsnbo.i8.a"
assuming that this location is correct.

Then do lked as in the post above.

17 April 2018

648. Compiling Quantum Espresso 6.2.1 on debian 8

Time has come for me to expand my horizons and skills. As I drift farther and farther away from my origins as an organic chemist and more and more towards inorganic materials science and non-discrete, extended systems, localised orbital DFT (i.e. 'standard' DFT) is not always looking as an appropriate method.

NWChem
Time thus to start using periodic systems and planewave basis sets. I've started working with nwpw and pspw in nwchem, and since I've used nwchem since ca 2002, in terms of setting up jobs and getting results it's been fairly straightforward. Understanding what all the options do and what's appropriate is another issue, but that's something I can work out empirically by comparing with benchmark systems (beginning to discover the importance of simulation cell now...)

Either way, nwchem does not yet afford a way of computing raman spectra for pspw jobs, which is one of the properties I'm interested in. Quantum Espresso, on the other hand, does, and is geared towards materials science in a way that nwchem isn't. Although quantum-espresso is included in the debian repos, I prefer to compile my own version. So, here I am.

I did this on one of my AMD nodes, but will follow up later with a post using intel MKL on my intel nodes. I only used the debian math libs, and not the AMD ACML (now replaced with ACL?), which I probably should've. Maybe I'll do an updated post on that later.

Note: I specify libblas.a instead of -lblas in the configure step since I have a custom openblas package installed as well, but which didn't work during compilation of QE.

Quantum Espresso (on an 8 core AMD processor)

'make' for gwl failed, and I didn't want to figure out why, so I skipped it. You can try doing make all instead of doing make for individual parts as I do below (type make to see what your options are).


sudo mkdir /opt/QE
sudo chown $USER /opt/QE
mkdir ~/tmp/QE -p
mkdir $HOME/scratch/QE -p
cd ~/tmp/QE
wget https://gitlab.com/QEF/q-e/-/archive/qe-6.2.1/q-e-qe-6.2.1.tar.gz
tar xvf q-e-qe-6.2.1.tar.gz
cd q-e-qe-6.2.1/

edit environment_variables
20 PREFIX=`/opt/QE` 21 BIN_DIR=$PREFIX/bin 22 PSEUDO_DIR=$PREFIX/pseudo 23 # Beware: everything in $TMP_DIR will be destroyed ! 24 TMP_DIR=$HOME/scratch/QE

sudo apt-get install libblas-dev libfftw3-dev libopenmpi-dev
./configure --prefix=/opt/QE/bin --exec-prefix=/opt/QE/bin/ FC=mpif90 BLAS_LIBS="/usr/lib/libblas/libblas.a" LIBS="-lmpi -lopen-rte -lopen-pal -ldl -lmpi_f77 -lpthread" CPPFLAGS="-I/usr/lib/openmpi/include"
sudo apt-get install libblas-dev libfftw3-dev libopenmpi-dev
-------------------------------------------------------------------- ESPRESSO can take advantage of several optimized numerical libraries (essl, fftw, mkl...). This configure script attempts to find them, but may fail if they have been installed in non-standard locations. If a required library is not found, the local copy will be compiled. The following libraries have been found: BLAS_LIBS="/usr/lib/libblas/libblas.a" LAPACK_LIBS=-L/opt/ATLAS/lib -llapack -lblas FFT_LIBS= -lfftw3 Please check if this is what you expect. If any libraries are missing, you may specify a list of directories to search and retry, as follows: ./configure LIBDIRS="list of directories, separated by spaces" Parallel environment detected successfully.\ Configured for compilation of parallel executables. For more info, read the ESPRESSO User's Guide (Doc/users-guide.tex). --------------------------------------------------------------------

make -j8 pwall cp ld1 upf xspectra tddft
make couple epw gui gwl

echo 'export PATH=$PATH:/opt/QE/bin' >>~/.bashrc
echo 'export PSEUDO_DIR=/opt/QE/pseudo' >>~/.bashrc
cp * -R /opt/QE/

source ~/.bashrc

To benchmark:
 make test-suite


14 February 2018

647. Linda/G16 and ecce + slurm

I had the opportunity to test G16 with Linda on my cluster. Suprisingly, I observed a decent reduction in computational time for geometry optimisation, and a fair reduction for vibrational analysis.

Computational time -- geometry optimisation
1x6 cores: 100%
2x6 cores: 56% (2 nodes)
3x6 cores: 44% (3 nodes)

Computational time -- normal mode computation
1x6 cores: 100%
2x6 cores: 63% (2 nodes)
3x6 cores: 57% (3 nodes)

In no case was the speed up good enough that it actually makes long-term sense to use Linda (need less than 50% for 2 nodes and 33% or less for 3 nodes), but if you're itching for quick results, it might be worth it.

Either way, as part of this I wrote a CONFIG.Linda for ECCE and SLURM:
Gaussian-16: /opt/gaussian/g16a/g16/g16 perlPath: /usr/bin/ qmgrPath: /usr/bin/ xappsPath: /usr/bin/ Slurm { #!/bin/csh #SBATCH -p linda #SBATCH --time=$walltime #SBATCH --output=slurm.out #SBATCH --job-name=$submitFile #SBATCH --nodes=$nodes #SBATCH --cpus-per-task=$ppn } Gaussian-16FilesToRemove{ core } Gaussian-16Command{ set path = ( /opt/nbo6/bin $path ) set nnodes = `scontrol show job $SLURM_JOBID|grep NodeList|sed 's/=/\t/'|gawk '{print $2}'|tail -n 1` sed -i "2s/^/%LindaWorkers=$nnodes\n/" g16.g16in sed -i '3s/^/%UseSSH\n/' g16.g16in sed -i "s/nprocshared.*/nprocshared=$ppn./" g16.g16in setenv GAUSS_SCRDIR /home/me/scratch setenv GAUSS_EXEDIR /opt/gaussian/g16a/g16 setenv GAUSS_ARCHDIR /opt/gaussian/g16a/g16/arch setenv GAUSS_BSDDIR /opt/gaussian/g16a/g16/bsd setenv GAUSS_LEXEDIR /opt/gaussian/g16a/g16/linda-exe /opt/gaussian/g16a/g16/g16< $infile > $outfile }
The slurm partition linda has all the nodes that has g16.