Upload
oswin-cameron
View
214
Download
0
Embed Size (px)
Citation preview
NEEDS Berkeley Workshop 2014
NEEDS Compact ModelDevelopment Process
Michael McLennanDirector, HUBzero® Platform for Scientific Collaboration
Purdue UniversityWest Lafayette, IN
Compact Model Development
2
1. Create a project area2. Access the Model Development Environment (MDE)3. Work on your compact model code4. Questions, Wishes, Tickets5. Model publication process
1. Create a project area
5
Short Tool Name: needsqsmmcShort Tool Name: needsqsmmc
Title: Quantum Singularity DeviceTitle: Quantum Singularity Device
Version: 0.1aVersion: 0.1a
At a glance: Generates power froma localized distortion ofspace and time
At a glance: Generates power froma localized distortion ofspace and time
Start all nameswith “needs”
2. Access the Model Dev Env (MDE)
10
system(‘svn checkout https://nanohub.org/tools/needsqsmmc/svn
/trunk needsqsmmc’)
system(‘svn checkout https://nanohub.org/tools/needsqsmmc/svn
/trunk needsqsmmc’)
Your model name goes here
Client/Server model:
Subversionrepository
Server(nanoHUB.org)
Clients
Using Subversion to Manage Code
• svn = Subversion• Created by developers at CollabNet• In development since 2000• Open source (Apache/BSD-style license)• Unix/Linux, Win32, MacOS X
Upload:add/commit
Download:checkout
11
working
x1x1x2x2
Why bother with Subversion?
Does this sound familiar?
NCSAcarter
test
CPU: 420s CPU: 340s
v1 = 3.125v2 = 9.987v1 = 3.125v2 = 9.987
x2 output
v1 = 3.12498v2 = 9.9901
v1 = 3.12498v2 = 9.9901
x3.1a output
x2x2
x2.1x2.1x2.1x2.1
x2.2x2.2
x2x2 x3x3x3x3
x3.1x3.1x3.1x3.1 ?12
Top 5: Why you should use Subversion
• It’s easy to learnA little simpler than Git
• You’ll feel more secureSSL transport between client/server; repository is backed up
• Where did I put that…It’s in the repository
• Who broke the build?Look at the revision history
• Your hard drive just diedNo problem, your code is in the repository
Subversionrepository
SSL
carter NCSA
13
A few simple commands
14
svn checkout https://nanohub.org/tools/⤦ needsqsmmc/svn/trunk needsqsmmc
cd needsqsmmcsvn delete middlewaresvn delete rappture
cp mymodel.m srcsvn add src/mymodel.m
svn commit
• Whoever checks in first has no problem• Next “svn update” integrates compatible changes
Merging changes
CC=gccall: $(CC) -O hello.c
CC=gccall: $(CC) -O hello.csvn commit
edit: Makefile
all: gcc –O hello.cclean: rm –f *.o a.out
all: gcc –O hello.cclean: rm –f *.o a.out
15
Merging changes
• Whoever checks in first has no problem• Next “svn update” integrates compatible changes• Use “svn commit” to commit the merged changes
svn update
edit: Makefile
all: gcc –O hello.cclean: rm –f *.o a.out
all: gcc –O hello.cclean: rm –f *.o a.out
CC=gccall: $(CC) -O hello.cclean: rm –f *.o a.out
CC=gccall: $(CC) -O hello.cclean: rm –f *.o a.out
svn commit
16
Resolving merge conflicts
• Whoever checks in first has no problem• Next “svn update” integrates changes
CC=gccall: $(CC) -O hello.c
CC=gccall: $(CC) -O hello.csvn commit
edit: Makefile
all: gcc –O hello.c –o helloclean: rm –f *.o a.out
all: gcc –O hello.c –o helloclean: rm –f *.o a.out
gcc –O hello.c –o hello
$(CC) -O hello.c
Problem here:both changethe same line
17
Resolving merge conflicts
svn updateC MakefileUpdated to revision 6.
svn commitsvn: Commit failed (details follow):svn: Aborting commit: 'Makefile' remains in conflict
svn status? Makefile.r5? Makefile.r6? Makefile.mineC Makefile
svn updateC MakefileUpdated to revision 6.
svn commitsvn: Commit failed (details follow):svn: Aborting commit: 'Makefile' remains in conflict
svn status? Makefile.r5? Makefile.r6? Makefile.mineC Makefile
conflict!
best guess at integrated changes
18
Resolving merge conflicts
vi Makefilevi Makefile
CC=gccall:<<<<<<< .mine $(CC) -O hello.c======= gcc -O hello.c -o hello clean: rm -f *.o a.out>>>>>>> .r6
19
Resolving merge conflicts
vi Makefilevi Makefile
CC=gccall:<<<<<<< .mine $(CC) -O hello.c======= gcc -O hello.c -o hello clean: rm -f *.o a.out>>>>>>> .r6
20
Resolving merge conflicts
vi Makefile
svn resolved MakefileResolved conflicted state of 'Makefile'
svn commitSending src/MakefileTransmitting file data .Committed revision 7.
vi Makefile
svn resolved MakefileResolved conflicted state of 'Makefile'
svn commitSending src/MakefileTransmitting file data .Committed revision 7.
CC=gccall: $(CC) -O hello.c -o hello clean: rm -f *.o a.out
21
3. Work on your compact model code
22
help MDE
!importfile
!svn add newfile.m
…edit, test…
!xterm –e svn commit
help MDE
!importfile
!svn add newfile.m
…edit, test…
!xterm –e svn commit
Start with! for Unixcommands
Other ways to get help
25
How does this work?How does this work? Would be better if…Would be better if…
https://nanohub.org/tools/mde
Not automated yet
27
Your NEEDS model status page
Don’t follow theusual “tool” process
Instead, contact:[email protected]