New coding practices for LSDALTON

Similar documents
Revision Control. An Introduction Using Git 1/15

Git. Ľubomír Prda. IT4Innovations.

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

What is git? Distributed Version Control System (VCS); Created by Linus Torvalds, to help with Linux development;

CS 390 Software Engineering Lecture 5 More Git

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

GIT : BEST PRACTICES GUIDE BY ERIC PIDOUX DOWNLOAD EBOOK : GIT : BEST PRACTICES GUIDE BY ERIC PIDOUX PDF

New Contributor Tutorial and Best Practices

MOOSE-Based Application Development on GitLab

Introduction to Supercomputing

Welcome! Virtual tutorial will start at 15:00 GMT. Please leave feedback afterwards at:

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

Creating a Patch. Created by Carl Heymann on 2010 Sep 14 1

CSC 2700: Scientific Computing

Git. A fast distributed revision control system. Nils Moschüring PhD Student (LMU)

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

Git(Lab) Tutorial and Hands-On

Git. A Distributed Version Control System. Carlos García Campos

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

FPLLL. Contributing. Martin R. Albrecht 2017/07/06

GIT. A free and open source distributed version control system. User Guide. January, Department of Computer Science and Engineering

Topics covered. Introduction to Git Git workflows Git key concepts Hands on session Branching models. Git 2

Beyond git add/commit/push

Continuous integration a walk-through. Dr Alin Marin Elena

From Tiny Acorns Your first submission to OpenAFS. Simon Wilkinson

TPS Documentation. Release Thomas Roten

Version Control System - Git. zswu

Version Control: Gitting Started

contribution-guide.org Release

Git. Christoph Matthies Software Engineering II WS 2018/19. Enterprise Platform and Integration Concepts group

Roman Numeral Converter Documentation

Introduction to distributed version control with git

Git. all meaningful operations can be expressed in terms of the rebase command. -Linus Torvalds, 2015

Submitting your Work using GIT

Version Control with Git

Version Control Systems

Mike McQuaid INCLUDES 66 TECHNIQUES. Foreword by Scott Chacon MANNING

Code and data management with Git

Software configuration management

Distributed Version Control (with Git)

Git Magic: Versioning Files Like a Boss. Tommy MacWilliam

Tizen/Artik IoT Practice Part 4 Open Source Development

Continuous integration & continuous delivery. COSC345 Software Engineering

Visualizing Git Workflows. A visual guide to 539 workflows

chatterbot-weather Documentation

Revision Control and GIT

Git better. Collaborative project management using Git and GitHub. Matteo Sostero March 13, Sant Anna School of Advanced Studies

Lecture 6 Remotes. Sign in on the attendance sheet!

Lab 01 How to Survive & Introduction to Git. Web Programming DataLab, CS, NTHU

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

Version Control Systems (VCS)

Getting the Source Code

New Chaste Infrastructure

Git for Subversion users

Effective Software Development and Version Control

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:

Python wrapper for Viscosity.app Documentation

GETTING TO KNOW GIT: PART II JUSTIN ELLIOTT PENN STATE UNIVERSITY

Why? Clean Model Branches Local reflog Flows Doc Ex. Advanced use of Git. Matthieu Moy

Version Control. Collaborating with git. Tim Frasier

Software Revision Control for MASS. Git Basics, Best Practices

DNS Zone Test Documentation

Tips and Tricks. Arian Treffer Software Engineering II WS 2016/17

A brief introduction to the GitLab service at the department

Belle II - Git migration

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Gerrit

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Git Basi, workflow e concetti avanzati (pt2)

Best Practices. Joaquim Rocha IT-DSS-TD

School of Computing Science Gitlab Platform - User Notes

EECS 470 Lab 4. Version Control System. Friday, 31 st January, 2014

Aircrack-ng python bindings Documentation

git-flow Documentation

Software Development I

Introduction, Instructions and Conventions

Improving Your Life With Git

Online Remote Repositories

Gitting things done. Hands-on introduction to git niceties. Jan Urbański Ducksboard

Index. Alias syntax, 31 Author and commit attributes, 334

FEEG Applied Programming 3 - Version Control and Git II

2 Initialize a git repository on your machine, add a README file, commit and push

Simple libtorrent streaming module Documentation

Version Control with GIT

CSE 331 Software Design & Implementation

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

Technology Background Development environment, Skeleton and Libraries

Version Control with GIT: an introduction

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

FreeBSD and Git. Ed Maste - FreeBSD Vendor Summit 2018

Introduction to Git. Database Systems DataLab, CS, NTHU Spring, 2018

Git Introduction CS 400. February 11, 2018

Git tutorial. Katie Osterried C2SM. October 22, 2015

CS 390 Software Engineering Lecture 3 Configuration Management

Gitlab Setup/Usage by Yifeng Zhu modified by Vince Weaver 30 January 2019

A L A TEX-oriented intro to Git

How to become an Eclipse committer in 20 minutes and to fork the Eclipse IDE

Transcription:

New coding practices for LSDALTON Simen Reine Centre for Theoretical and Computational Chemistry (CTCC), Department of Chemistry, University of Oslo, Norway November 20th, 2015 Simen Reine (CTCC, University of Oslo) November 20th, 2015 1 / 14

Outline DFT - MP2 difference in electro DFT - MP2 difference in electrostatic potential CAMB3LYP - MP2 B3LYP - MP2 (includes long-range correction) (no long-range correction) CA B3LYP - MP2 (includ (no long-range correction) LSDALTON Code Environment Gitlab Getting started Rebase and Squash Blue/red regions correspond to increased/decreased electrostatic potential for DFT compared to MP2 Merge Request See Frank Jensen, J. Chem Theory Comput. 6, 2726 (2010) for related discussion on electron affinity Coding Practices Blue/red regions correspond to increa electrostatic potential for DFT comp See Frank Jensen, J. Chem Theory Comput. 6, 2726 (2010) for related 26 26 Open Source Simen Reine (CTCC, University of Oslo) November 20th, 2015 2 / 14

LSDALTON Electronic-structure software tool originated from DALTON (1999) 3 releases: 2011, 2013, 2015 2015-500 licenses upcoming release in January developed in Norway and Denmark roughly 35 developers core code 520k lines external modules 210k lines fortran 90 (72%) and c/c++ (28%) MPI/OMP parallelized GPU developments Functionality linear-scaling DFT (and HF) linear-scaling DEC MP2/CC linear and quadratic response properties geometry optimization dynamics Goals own research training tool for other researchers visibility and impact funding Simen Reine (CTCC, University of Oslo) Require long term strategies code environment testing coding practices maintenance documentation releases user support collaboration November 20th, 2015 3 / 14

Code environment Version control system revision: state of a project history code changes branches git Build automation software build compilation linking testing setup cmake Automated testing nightly builds different compilers MPI/OMP/GPU testboard.org Simen Reine (CTCC, University of Oslo) November 20th, 2015 4 / 14

Gitlab Gitlab Features code hosting system free community edition enterprise edition used by 100k+ organizations 700 open source contributors 27 employees web-based git repository wiki issue tracking activities continuous integration (CI) merge request/code review Simen Reine (CTCC, University of Oslo) November 20th, 2015 5 / 14

Getting started 1/2 New developer supervisor introduces you to the forum http://daltonprogram.org/forum register to gitlab https://gitlab.com/users/sign in dalton group owner adds you to the dalton group register to the forum https://gitlab.com/groups/dalton/group members Radovan Bast adds you to the forum add public ssh key to gitlab under Profile Settings SSH Keys cd /.ssh ssh-keygen -t dsa Build the code clone the repository (always use the --recursive option) git clone --recursive git@gitlab.com:dalton/lsdalton.git my_repository run the setup cd my_repository./setup my_build build the code cd my_build make run tests ctest consult http://dalton-devguide.readthedocs.org/en/latest/ for assistance Simen Reine (CTCC, University of Oslo) November 20th, 2015 6 / 14

Getting started 2/2 Start coding create a feature branch git checkout -b my_name/my_feature code and commit git status git diff git commit <files> always look at the status and the diff - is this what I want to commit? do several commits and merges with master until the code works When you are ready to push to master rebase squash push to origin (automatic CI) file a merge request review (and merge) delete branch (if not done by the reviewer): git push origin --delete my_branch Simen Reine (CTCC, University of Oslo) November 20th, 2015 7 / 14

Rebase and squash Rebase the branch on top of master: $ git checkout master $ git pull $ git checkout my_name/my_feature f3 $ git rebase master f2 Then squash it into one commit: $ git reset --soft master $ git status $ git commit f1 m4 m3 m2 m1 f3 f2 f1 m4 m3 m2 m1 Rebase s1 m4 m3 m2 m1 Squash rebase puts your local commits on top of the commits on master changes the commits (different hash) do not rebase commits that are outside your repository! ie. either when others have branched off your branch, or cherry-picked one of your commits reset --soft changes the pointer to a different commit, but keeps the code changes by all subsequent commits a new commit then combine all the code changes into one commit Simen Reine (CTCC, University of Oslo) November 20th, 2015 8 / 14

Merge request and review Push to origin: git push origin my name/my feature this will initiate the CI testing checks out, builds and tests the code File a merge request a gitlab feature under dalton/lsdalton and Merge requests press +NEW MERGE REQUEST select Source branch my name/my feature and Target branch master press COMPARE BRANCHES write a proper title and description add an assignee to review your changes press SUBMIT NEW MERGE REQUEST Code review - typically takes 1-2 minutes CI builds successful? one commit? clear commit message? does the code look reasonable? if new keyword also added/modified test? documentation? updated change log? if bugfix also close issue? Check that the merge has not broken any tests/builds on testboard.org the next day! Simen Reine (CTCC, University of Oslo) November 20th, 2015 9 / 14

Coding practices 1/3 General rule In general Do not publish anything with unreleased code without explicit permission of the authors of that code (i.e. typically through a collaboration) document your code - Doxygen update manual - doc/keywords.tex report problems and bugs - file a ticket on gitlab test your code properly! update CHANGELOG.rst avoid code duplication! keep it short, keep it simple! keep default printing to a minimum modularity, modularity, modularity!!! new developers encouraged to develop submodules Modular code independent code specific functionality modular code is long lived components can easily be replaced code can easily be ported minimizes inter dependencies today: external submodules Ideally self contained define a clear external interface may depend on other modules make sure these modules can easily be replaced provide code environment (version control, build automation, testing) Simen Reine (CTCC, University of Oslo) November 20th, 2015 10 / 14

Coding practices 2/3 Branching and commit policy master main development line release/1 current release branch avoid long-lived branches! create one branch for each specific feature or bug fix ideal life time a few days or weeks keep new features as modular as possible delete branch after merge back to master Long-lived branches cannot fully be avoided, e.g. for new PhD students supervisor responsibility: ensure modularity and merge to master make interface early on and in master branch Release branch semantic version control: release X.x one release branch for each major release X major release number x minor release number - bugfixes and minor feature updates never merge master into release branch fix on release then merge back to master or cherry-pick commit to the release branch policy - support current release branch until new release Simen Reine (CTCC, University of Oslo) November 20th, 2015 11 / 14

Coding practices 3/3 Fortran 90 always use implicit none always make your module private separate declaration of input and local variables intent(in/out/inout) for all arguments - use intent(inout) for derived types always use the inquire function present for optional arguments never initialize a variable upon declaration remember to update documentation when changing already documented code! keep all variables as local as possible (exceptions in some time critical parts) avoid global dependencies - breaks modularity avoid redundant input arguments data structures should represent a natural unity - avoid adding data to a structure that does not belong there! code object oriented as much as possible - through use of private/public code hierarchically: level 0 routines are self contained, level 1 depend on level 0 and 1, etc. Simen Reine (CTCC, University of Oslo) November 20th, 2015 12 / 14

Open source Open source license... to study, change, and distribute software to anyone and for any purpose (wikipedia) Intent to go open source dalton meeting 2015 provided all developers agree! Why open source? hosting infrastructure for free minimize release effort immediate availability of patches scientific reproducibility more developers more users higher impact code review more funding opportunities enhance collaboration Missing need to choose a license policy to treat external developments consent from contributors Simen Reine (CTCC, University of Oslo) November 20th, 2015 13 / 14

The End Simen Reine (CTCC, University of Oslo) November 20th, 2015 14 / 14