Creating the GEOSagcm bridge repo
This page will detail the process of making the GEOSagcm bridge repo.
Following http://www.gitguys.com/topics/creating-a-shared-repository-users-sharing-the-repository/
Commands used to make a bridge repo:
Initialize a bare bridge repo
$ cd /discover/swdev/adasilva/bridge/ $ git init --bare GEOSagcm $ chgrp -R gmaosi GEOSagcm/ $ chmod -R g+w GEOSagcm/ $ lt total 0 drwxrwxr-x 3 adasilva gmaosi 512 2014-07-07 14:59 AEROsa/ drwxrwxr-x 3 adasilva gmaosi 512 2014-07-07 15:00 GEOSadas/ drwxrwxr-x 7 mathomp4 gmaosi 512 2014-07-16 12:06 GEOSagcm/
We now have an empty bridge repo.
Clone the empty bridge repo
Now go to a model directory:
$ cd /discover/swdev/mathomp4/Models
Make a place to check out the model:
$ mkdir Ganymed-4_0-bridge-repo $ cd Ganymed-4_0-bridge-repo
Clone the bare repo:
$ git clone /discover/swdev/adasilva/bridge/GEOSagcm Cloning into 'GEOSagcm'... warning: You appear to have cloned an empty repository. done.
Fill the empty git repo with our model
Now checkout the model:
$ ecvs co -kk -r Ganymed-4_0 Ganymed
where ecvs:
$ alias ecvs cvs -d:ext:esma:/cvsroot/esma
This CVS setup is user-agnostic and allows for multiple users to run CVS commands on it.
Add files to the git repo
$ cd GEOSagcm/ total 0 drwxr-xr-x 2 mathomp4 g0620 512 2014-07-16 12:11 CVS/ drwxr-xr-x 7 mathomp4 g0620 512 2014-07-16 12:11 src/ Directory: /discover/swdev/mathomp4/Models/Ganymed-4_0-bridge-repo/GEOSagcm $ git branch $
Now add the files:
$ git add .
and then commit:
$ git commit <add message in vim because I forgot to do it on the command line> [master (root-commit) 8afb4e9] MAT: Initialize GEOSagcm git bridge repo with CVS checkout of Ganymed-4_0 retrieved with: 4324 files changed, 1532916 insertions(+) create mode 100644 CVS/Entries create mode 100644 CVS/Entries.Log create mode 100644 CVS/Entries.Static ... create mode 100755 src/GNUmakefile create mode 100755 src/g5_modules create mode 100644 src/g5_modules.sh create mode 100755 src/parallel_build.csh $ git log commit 8afb4e903eacf8de6d8b5d56f66252c44e88ad9e Author: Matthew Thompson <matthew.thompson@nasa.gov> Date: Wed Jul 16 12:42:51 2014 -0400 MAT: Initialize GEOSagcm git bridge repo with CVS checkout of Ganymed-4_0 retrieved with: ecvs co -kk -r Ganymed-4_0 Ganymed on 2014-Jul-06 12:30 pm.
Check the branch:
$ git branch * master
Now try to push:
$ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) No refs in common and none specified; doing nothing. Perhaps you should specify a branch such as 'master'. fatal: The remote end hung up unexpectedly error: failed to push some refs to '/discover/swdev/adasilva/bridge/GEOSagcm' $ git remote origin $ git push origin master Counting objects: 4124, done. Delta compression using up to 8 threads. Compressing objects: 100% (3898/3898), done. Writing objects: 100% (4124/4124), 37.11 MiB | 4.80 MiB/s, done. Total 4124 (delta 825), reused 0 (delta 0) To /discover/swdev/adasilva/bridge/GEOSagcm * [new branch] master -> master $ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Everything up-to-date
Clone the model from the repo and try to build it
Now let's clone the model in a new directory:
$ cd /discover/swdev/mathomp4/Models $ mkdir Ganymed-4_0-from-git $ cd Ganymed-4_0-from-git $ git clone /discover/swdev/adasilva/bridge/GEOSagcm Cloning into 'GEOSagcm'... done. Checking out files: 100% (4324/4324), done. $ ls -l total 0 drwxr-xr-x 5 mathomp4 g0620 512 2014-07-16 12:51 GEOSagcm/
Now let's try building it. Use geostag or setenv ESMADIR and sourcing g5_modules to initialize the model setup and let's run parallel_build.csh:
$ cd /discover/swdev/mathomp4/Models/Ganymed-4_0-from-git/GEOSagcm/src $ ./parallel_build.csh g5_modules: Setting BASEDIR and modules for discover18 ================ PARALLEL BUILD ================ The build will proceed with 10 parallel processes on 12 CPUs. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOG and info will be written to the src/BUILD_LOG_DIR directory. Do the following to check the status/success of the build: cd BUILD_LOG_DIR ./gmh.pl [-v] LOG[.n] Note: Check the latest version of LOG for the most recent build info. Sp Code| Org | Sponsor | Research -------+-------+--------------------+---------------------------------- g0620 | 610.1 | William Putman | GMAO - Systems and Data Synthesis select group: [g0620] qsub -W group_list=g0620 -N parallel_build -o parallel_build.o%j -l select=1:ncpus=12:mpiprocs=10:proc=west -l walltime=1:00:00 -V ./parallel_build.csh 1944599 unset echo 1944599 mathomp4 general parallel_build -- 1 1 -- 01:00 Q 00:00 $
It should build just fine. Now, for kicks, let's run git status:
$ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) ../Config ../Linux/ Applications/GEOSgcm_App/GEOSgcm.o Applications/GEOSgcm_App/GEOSgcm.x Applications/GEOSgcm_App/idfupd.x BUILD_LOG_DIR/ ... GMAO_Shared/MAPL_Base/sort.d GMAO_Shared/MAPL_Base/sort.o GMAO_Shared/MAPL_cfio/r4/ GMAO_Shared/MAPL_cfio/r8/ parallel_build.o1944599 nothing added to commit but untracked files present (use "git add" to track)
Ah. I seem to have forgotten a .gitignore file. Luckily, one just happens to be around:
$ cp ~/GEOSagcm_src.gitignore ./.gitignore $ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) ../Config ../Linux/ .gitignore BUILD_LOG_DIR/ GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatch_GridComp/mk_restarts/Scale_Catch GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatch_GridComp/mk_restarts/mk_CatchRestarts GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatch_GridComp/mk_restarts/mk_LakeLandiceSaltRestarts GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatch_GridComp/mk_restarts/newcatch GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/GEOSland_GridComp/GEOScatch_GridComp/mk_restarts/strip_vegdyn GMAO_Shared/GMAO_etc/argopt GMAO_Shared/GMAO_etc/rst_date GMAO_Shared/GMAO_gfio/r4/ GMAO_Shared/GMAO_gfio/r8/ nothing added to commit but untracked files present (use "git add" to track)
Oops. The problem is our .gitignore was in the wrong place. Let's move it down below src/:
$ mv .gitignore .. $ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) ../.gitignore nothing added to commit but untracked files present (use "git add" to track)
Well, let's add that and push it to our repo!
$ git add ../.gitignore $ git status On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: ../.gitignore $ git commit -m 'MAT: Add .gitignore file' [master 9692fd5] MAT: Add .gitignore file 1 file changed, 47 insertions(+) create mode 100644 .gitignore $ git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) Counting objects: 4, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 656 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To /discover/swdev/adasilva/bridge/GEOSagcm 8afb4e9..9692fd5 master -> master $ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean $ git log commit 9692fd59ca22172aa3e84d2d4c279b7eceda92d7 Author: Matthew Thompson <matthew.thompson@nasa.gov> Date: Wed Jul 16 13:14:06 2014 -0400 MAT: Add .gitignore file commit 8afb4e903eacf8de6d8b5d56f66252c44e88ad9e Author: Matthew Thompson <matthew.thompson@nasa.gov> Date: Wed Jul 16 12:42:51 2014 -0400 MAT: Initialize GEOSagcm git bridge repo with CVS checkout of Ganymed-4_0 retrieved with: ecvs co -kk -r Ganymed-4_0 Ganymed on 2014-Jul-06 12:30 pm.
Check out and build on JIBB
Now we need to see if we can checkout the model on JIBB: