26 September 2017

646. NWChem 6.6 on debian stretch (9)

I've got plenty of posts on how to compile nwchem on this blog. However, as I'm still running debian jessie on my work computers and cluster I have failed to appreciate quite how different things work in debian stretch.

This includes the compilation of ECCE (although owing to updates meant to rectify that at https://github.com/FriendsofECCE/ECCE this isn't necessarily something you'd notice) and NWChem.

Anyway, here's how to build nwchem with openmpi support under debian stretch:

1. Download source code and patches
sudo mkdir /opt/nwchem -p sudo chown $USER:$USER /opt/nwchem cd /opt/nwchem mkdir patches6.6 cd patches6.6 for i in Tddft_mxvec20.patch.gz Tools_lib64.patch.gz Config_libs66.patch.gz Cosmo_meminit.patch.gz Sym_abelian.patch.gz Xccvs98.patch.gz Dplot_tolrho.patch.gz Driver_smalleig.patch.gz Ga_argv.patch.gz Raman_displ.patch.gz Ga_defs.patch.gz Zgesvd.patch.gz Cosmo_dftprint.patch.gz Txs_gcc6.patch.gz Gcc6_optfix.patch.gz Util_gnumakefile.patch.gz Util_getppn.patch.gz Gcc6_macs_optfix.patch.gz Xatom_vdw.patch.gz Notdir_fc.patch.gz Hfmke.patch.gz Cdfti2nw66.patch.gz ; do wget http://www.nwchem-sw.org/download.php?f=$i ; done gunzip *.gz cat *.patch > consolidated.patch cd .. wget http://www.nwchem-sw.org/download.php?f=Nwchem-6.6.revision27746-src.2015-10-20.tar.gz -O Nwchem-6.6.revision27746-src.2015-10-20.tar.gz tar xvf Nwchem-6.6.revision27746-src.2015-10-20.tar.gz

Apply patches:
cd /opt/nwchem/nwchem-6.6/ cp /opt/nwchem/patches6.6/consolidated.patch . patch -p0 < consolidated.patch
In addition, you can do the following to print more information so that GabEdit properly shows MOs:
cd nwchem-6.6/ grep -rl "do klo = 0, min(n-1,9), 2"|xargs -I {} sed -i 's/do klo = 0, min(n-1,9), 2/do klo = 0, min(n-1,199), 2/g' {} grep -rl " 0.15d0,"|grep -v "atomdata"|xargs -I {} sed -i 's/0.15d0/0.01d0/g' {}

2. Install dependencies and compile.
 How exactly it is done depends on your compiler and math libs. I've used red for examples with INTEL mkl, blue for AMD acml and orange for the free openblas. ifort is shown in purple and gfortran like this.You should only use one compiler + one math lib.
Hint: also make sure your ld.conf.so.d files contain paths to your math libs.
cd /opt/nwchem/nwchem-6.6 sudo apt-get install build-essential gfortran python2.7-dev libopenmpi-dev openmpi-bin export NWCHEM_TOP=`pwd` export LARGE_FILES=TRUE export TCGRSH=/usr/bin/ssh export NWCHEM_TOP=`pwd` export NWCHEM_TARGET=LINUX64 export NWCHEM_MODULES="all" export PYTHONVERSION=2.7 export PYTHONHOME=/usr export BLASOPT="-L/opt/intel/composer_xe_2013.4.183/mkl/lib/intel64/ -lmkl_core -lmkl_sequential -lmkl_intel_ilp64" export LIBRARY_PATH="$LIBRARY_PATH:/opt/intel/composer_xe_2013.4.183/mkl/lib/intel64/" export BLASOPT="-L/opt/acml/acml5.3.1/gfortran64_int64/lib -lacml" export LIBRARY_PATH="$LIBRARY_PATH:/opt/acml/acml5.3.1/gfortran64_int64/lib" export BLASOPT="-L/opt/openblas/lib -lopenblas" export LIBRARY_PATH="$LIBRARY_PATH:/opt/openblas/lib" export USE_MPI=y export USE_MPIF=y export USE_MPIF4=y export ARMCI_NETWORK=SOCKETS cd $NWCHEM_TOP/src make clean make nwchem_config make FC=ifort 1> make.log 2>make.err make FC=gfortran 1> make.log 2>make.err cd $NWCHEM_TOP/contrib export FC=ifort export FC=gfortran ./getmem.nwchem

3. Run
mpirun -n 8 /opt/nwchem-6.6/bin/LINUX64/nwchem input.nw > output.nw

23 August 2017

645. Moodle on Debian

I want to play around with moodle on my own desktop so I can experiment before making any major commits to a course website.

I first had a look at https://docs.moodle.org/33/en/Installing_Moodle_on_Debian_based_distributions, but, realising that moodle is in sid, decided to build my own .deb package.

This was done on debian jessie (8.9), which has at this point been overtaken by stretch as stable. I'm thus three releases behind sid.

1. Add the sid /src/ repo to sources.list
deb-src http://ftp.au.debian.org/debian/ sid main non-free contrib

2. Get source and build
I don't know exactly what dependencies you'll need. Error messages will tell you.
sudo apt-get update sudo apt-get install build-essential dpkg-dev mysql-server mysql-client php5-xmlrpc php5-intl sudo service mysql start mkdir ~/tmp/moodle -p cd ~/tmp/moodle sudo apt-get source moodle
Edit debian/control (necessary if you're on Jessie/8.9 -- newer debian versions may not need this):
14 Depends: ${misc:Depends}, 15 php5, php5-mysql | php5-pgsql, php5-gd, php5-curl, php5-cli, 16 apache2 | httpd, ucf, postgresql-client | default-mysql-client | virtual-mysql-client, 17 dbconfig-common, libphp-phpmailer, libphp-adodb, php-htmlpurifier, php-tcpdf, 18 php-cas (>= 1.3.3-1), libjs-jquery-migrate-1 19 Pre-Depends: debconf (>= 0.5) | debconf-2.0
Then continue in the terminal:
cd ~/tmp/moodle-2.7.19+dfsg sudo dpkg-buildpackage -us -uc cd .. sudo dpkg -i moodle_2.7.19+dfsg-2_all.deb sudo apt-get -f install sudo cp /etc/moodle/apache.conf /etc/apache2/sites-available/moodle.conf sudo ln -s /etc/apache2/sites-available/moodle.conf /etc/apache2/sites-enabled/moodle.conf sudo chmod o+r /etc/apache2/sites-available/moodle.conf sudo chmod go+w /var/lib/moodle sudo service apache2 reload
Navigate to http://localhost/moodle and follow the prompts

09 August 2017

644. Redmine -- project management -- briefly.

I've reached the point in my career that I need to start thinking seriously about how I organise my work. It used to be enough to work with a white board, google calendar (w/ lightning + thunderbird) and lots of post-it notes.

Somehow it's not working anymore, in part because I'm getting older and find it difficult to remember things -- in particular short-term.

Running a group is much like running a company (I imagine):
1. you have to manage your funds
2. you have to manage projects over short, medium and long-term
3. you have employees that need taking care of -- PhD students and Postdocs

I manage my funds using GnuCash. It's not perfect, but once you've set it up it works well enough to keep track of your assets. Of course your university accountants/administrators will do the same, but there's always a lag between you spending your money and getting updated financial reports. It's also nice to be able to 'lean' money in case of future spending. I've found that the financial reports that I've been getting from the different institutions that I've been working at have not dealt well with salaries.  I mean, salaries get taken out monthly, but as they are predictable expenses I as a PI don't want to see the money -- I want it removed from view.

Also, every now and again the accountants make a mistake, and you're much more likely to discover it if you have a means of comparing your financial reports with what you would be expecting to see.

Taking care of and managing employees is a different kettle of fish altogether, and at this point I haven't found any magic bullet in terms of management style. I'm simply being me -- which sounds fine -- but that doesn't always work due to personality clashes etc. Sometimes it's probably better to have a professional persona that you can put on.

Anyway, this post is about project planning -- I need to plan my work and my private life. I've looked at a few solutions. Most of these are serious overkill for what I need. All are free, although their websites heavily advertise paid options.
* TaskCoach
* Project Libre
* RedMine
* Odoo (formerly OpenERP)

I really wanted something like the project tracker in github, but the programs that support that style seems to be cloud based, and I'd much rather have something that I can run locally.

TaskCoach is in the debian repo, as is redmine. Project libre and odoo have debs available from their respective websites.

I failed to get odoo working -- otherwise it looked nice in the screen shots on their website.

TaskCoach was easy to use, but not very pretty, and it just didn't feel 'right' for me in terms of look/layout and workflow. If I hadn't found redmine I probably would've stayed with TaskCoach.

I got lost and confused when looking at ProjectLibre, and gave up.

Redmine has the advantage of the redmine website running on redmine, so you can see exactly what it looks like and how it works. That's what I'm using now, and it seems to work with how I think about things. I like being able to attach files, make lots of short notes that show up and give a good overview what's going on.

I don't need time tracking, Gantt charts etc -- I just need to track the qualitative progress of what I'm doing.

I installed redmine on debian jessie according to https://wiki.debian.org/redmine
I did
sudo cp  /usr/share/doc/redmine/examples/apache2-passenger-alias.conf /etc/apache2/sites-enabled/redmine.conf

I then edited redmine.conf to include
ServerName localhost
but made no other changes.

I could then access redmine at localhost/redmine

21 July 2017

643. 'Hacking' a windows 10 computer w/o password

The scenario: a colleague's masters student had finished, and returned his university issued laptop. He didn't write down the password, and no he can't remember it. It's running Windows 10.

My colleague wants to use the laptop for a bit of testing. No IT support around, so can't reinstall windows.

It has Ubuntu installed as well.We have the password for it.

The local admin account in windows was not activated.

I looked at http://www.hackcave.net/2015/10/hack-windows-10-login-password-in-2.html, https://www.ghacks.net/2014/11/12/how-to-enable-the-hidden-windows-10-administrator-account/ and http://webcache.googleusercontent.com/search?q=cache:XXlk7evcUggJ:www.thewindowsclub.com/net-user-command-windows+&cd=4&hl=en&ct=clnk&gl=us

1. Boot into windows 10. Hold 'shift' while clicking on 'Shutdown', in order to force a proper shutdown rather than hibernation.

2. Boot into Linux (in this case it was a dual boot setup, but you could boot from a linux cd or usb stick). Mount the windows partition, open a terminal and navigate to Windows/System32. Rename cmd.exe to sethc.exe and sethc.exe to cmd.exe. Restart.

3. Boot into windows. When you get the log in screen, hit 'shift' 5-6 times. You'll now get a terminal with admin powers!

4. Activate the administrator account so that safe mode becomes useful:
net user administrator /active:yes
net user administrator *

Set the password.

5. Add a new user (users: john, password: b3ngalt0r1n.) and give it admin capabilities:
net user john b3ngalt0r1n. /add
net localgroup administrators john /add

Hold 'shift' while clicking on Shutdown

6. Boot into linux, and swap cmd.exe and sethc.exe back.

7. Boot into windows.