sumatra and git

26
EBI is an Outstation of the European Molecular Biology Laboratory. Sumatra: an electronic labook. Git it right Michele Mattioni Computational Neurobiology group [email protected]

Upload: michele-mattioni

Post on 27-Jun-2015

2.133 views

Category:

Education


0 download

DESCRIPTION

Sumatra is a System Management Tool to keep track of your simulation results. Now it has also git support.

TRANSCRIPT

Page 1: Sumatra and git

EBI is an Outstation of the European Molecular Biology Laboratory.

Sumatra: an electronic labook. Git it right

Michele MattioniComputational Neurobiology [email protected]

Page 3: Sumatra and git

Open questions which I had no answer:

• Where are my results?• Which parameters I used on that simulation?• Which one was that simulation?• Why it worked yesterday and not today?• At exactly which point it worked yesterday?• Where is my mind stuff?

Fro

m V

ale

r ie

Eve

r ett

's p

ho

tos t

rea

mht

tp:/

/ww

w. f

lick r

.co

m/p

ho

tos/

vale

rieb

b/3

00

63

48

55

0/

Page 4: Sumatra and git

How the experimental people solve that?

• Write down on a labbook everything they do :• reagents• times• protocols• why!• what worked, what didn't• ...

Ma

rcin

Wic

ha

ry's

ph

ot o

stre

am

htt

p:/

/ww

w. f

lickr

.co

m/p

ho

tos/

mw

i ch

ary

/32

49

20

29

59

/

Page 5: Sumatra and git

We need an electronic labbook

• Able to track (automatically) our 'experiments' details:• script launched• parameters used• reason• outcome

• But we can also:• search them• organize them• Rerun them!

Page 6: Sumatra and git

Say hello to Sumatra

Slide from Andrew Davison (main developer),http://neuralensemble.org/meetings/talks/CodeJam3_Davison_Sumatra.pdf

http://neuralensemble.org/trac/sumatra

Page 7: Sumatra and git

Sumatra: what I need to use it

• Code under version control• Accepted version control:

• Mercurial (hg)

• Subversion (svn)

• Git (git) (I patched it! Power of the opensource..)

• your choice (exstensible architeture)

• Scripts organized as Main class and parameter_file

Page 8: Sumatra and git

smt Usage

$ cd myproject$ smt init MyProject

Normal way you launched the script:

$ python main.py default.param

New way using Sumatra:

$ smt run ­­simulator=python ­­main=main.py default.param

Page 9: Sumatra and git

Shorter cmdline to launch the job

Configure it (it has to be done once.)$ smt configure ­­simulator=python ­­main=main.py

From$ smt run ­­simulator=python ­­main=main.py default.param

To$ smt run default.param

Page 10: Sumatra and git

What if I use java?

$ java main default.param

$ smt run ­­simulator=java ­­main=main default.param

Page 11: Sumatra and git

Parameter file? Excuse me?

dt = 0.05 # Dt for the integrationtstop = 10 # [ms]

Basically a name <-> parameter pair

Not obligatory, but it's very handy because:

• Sumatra can store your parameters in the record• If Sumatra understand them then You can change parameter on the fly

$ smt run default.param tstop=20 dt=0.01

Page 12: Sumatra and git

Where is my stuff?

smt monitor a directory (default Data).• Any new file/image saved there is automatically added to the simulation record

You save the resultsSumatra remembers where is it

My way: I create a dir for each day and then save all my stuff in dedicated folder• Data/19­04­2010/Sim_1/, Data/19­04­2010/Sim_2/• Data/20­04­2010/Sim_1/, Data20­04­2010/Sim_2/

Page 13: Sumatra and git

Access the results: smt$ smt list default_20100407­163228default_20100407­171249

$ smt list ­l Label        : default_20100420­170241Reason       : Testing the tagging from the cmdlineOutcome      : It works!Duration     : 4.38211798668Repository   : GitRepository at /home/mattions/Work/model/MSN/TimeScalesMain_File    : spineIntegration.pyVersion      : 8a61ecdd999e30d25c29620a87d9f4536aa67e9eExecutable   : Python (version: 2.6.4) at /usr/bin/pythonTimestamp    : 2010­04­20 17:02:41.445588Tags         : test, test2

Page 14: Sumatra and git

Access the results: smtweb

Page 15: Sumatra and git

Access the results: smtweb

Page 16: Sumatra and git

Accessing the plot from the link

Page 17: Sumatra and git

How to install

ATM: Git support only available from the latest code:

hg clone https://neuralensemble.org/hg/sumatra

git clone http://github.com/mattions/sumatra_on_github

Page 18: Sumatra and git

How sumatra saved the day (yesterday)

Scenario:• Made some massive restructuring/refactoring on neuronvisio• Get lost on the way• Nothing worked anymore.

But ...

Page 19: Sumatra and git

Searched the last simulation where it worked

Page 20: Sumatra and git

Selected the latest working, and neuronvisio ver.

Page 21: Sumatra and git

Find that commit on neuronvisio repo

Page 22: Sumatra and git

Branched it

Page 23: Sumatra and git

Merged restart back into master

kind of apply twice the same patch, but you know it was worth it.

Page 24: Sumatra and git

Summary

• Sumatra can help you to:• keep your stuff organized• not lose your work• speed up the recovery time when somethig get wrong• remember what you used ages ago, to make that figure• be more focus on your science.

• You can help sumatra• Using it• Asking for request (ok, send a patch. It's quicker and easier)

Page 25: Sumatra and git

Acknowledgement

• Andrew Davison (main sumatra developer)• people got the picture from (link on each picture)• Nicolas Le Novère (to let me work on this)• Computational Neurobiology group @ EBI.

Page 26: Sumatra and git

Got questions?

http://neuralensemble.org/trac/sumatra