Skip to content

Commit

Permalink
Final (hopefully) changes for release!
Browse files Browse the repository at this point in the history
* changed dockerfile volume to map to somewhere more useful (/workspace/user_data)
* for models, just use LU where single proc operation, otherwise use default
* update glucifer viewer to use port 9999 (to avoid it being the default port kitematic latches onto)
* updates for xdmf swarm variable output
  • Loading branch information
jmansour committed Jun 6, 2016
1 parent 68dc796 commit c360f15
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 26 deletions.
4 changes: 2 additions & 2 deletions docs/development/docker/underworld2_untested/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ RUN git clone --branch "master" --single-branch https://github.com/underworldcod
# expose notebook port
EXPOSE 8888
# expose glucifer port
EXPOSE 8080
EXPOSE 9999

# setup space for working in
VOLUME /workspace
VOLUME /workspace/user_data
WORKDIR /workspace

# launch notebook
Expand Down
6 changes: 2 additions & 4 deletions docs/examples/1_07_SlabSubduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,7 @@
"source": [
"# use \"lu\" direct solve if running in serial\n",
"if(uw.nProcs()==1):\n",
" solver.set_inner_method(\"lu\")\n",
"else: # use \"mumps\" parallel method\n",
" solver.set_inner_method(\"mumps\")\n"
" solver.set_inner_method(\"lu\")"
]
},
{
Expand Down Expand Up @@ -638,7 +636,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"version": "2.7.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 1 addition & 7 deletions docs/examples/2_08_ShearBandsSimpleShear.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -484,16 +484,10 @@
"\n",
"solver = uw.systems.Solver( stokesPIC )\n",
"\n",
"# \"mumps\" instead of \"lu\" in parallel\n",
"# but needs to be installed in your petsc \n",
"# beforehand. See petsc docs for details.\n",
"\n",
"# assuming that it is installed if you are running in parallel\n",
"# use \"lu\" direct solve if running in serial\n",
"if(uw.nProcs()==1):\n",
" solver.set_inner_method(\"lu\")\n",
"else: # use \"mumps\" parallel method\n",
" solver.set_inner_method(\"mumps\")\n",
"\n",
"solver.set_penalty(1.0e6)\n",
"solver.options.scr.ksp_rtol = 1.0e-3\n",
Expand Down Expand Up @@ -877,7 +871,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"version": "2.7.10"
}
},
"nbformat": 4,
Expand Down
7 changes: 1 addition & 6 deletions docs/examples/2_09_ShearBandsPureShear.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,9 @@
"solver = uw.systems.Solver( stokesPIC )\n",
"\n",
"## Initial solve (drop the non-linearity the very first solve only)\n",
"## Replace \"lu\" with \"mumps\" for parallel if you have it.\n",
"\n",
"# assuming that it is installed if you are running in parallel\n",
"# use \"lu\" direct solve if running in serial\n",
"if(uw.nProcs()==1):\n",
" solver.set_inner_method(\"lu\")\n",
"else: # use \"mumps\" parallel method\n",
" solver.set_inner_method(\"mumps\")\n",
"\n",
"solver.set_penalty(1.0e6)\n",
"solver.options.scr.ksp_rtol = 1.0e-3\n",
Expand Down Expand Up @@ -1133,7 +1128,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
"version": "2.7.10"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions glucifer/_glucifer.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def image(self):
from IPython.display import Image,HTML
if not self._viewerProc:
return
url = "http://localhost:8080/image=0"
url = "http://localhost:9999/image=0"
response = urllib2.urlopen(url).read()
image_data = "data:image/png;base64,%s" % b64encode(response)
return HTML("<img src='%s'>" % image_data)
Expand All @@ -659,11 +659,11 @@ def open_viewer(self, args=[], background=True):

if haveLavaVu and uw.rank() == 0:
#Open viewer with local web server for interactive/iterative use
args = [self.db._lvbin, "-" + str(self.db.step), "-L", "-p8080", "-q90", fname] + args
args = [self.db._lvbin, "-" + str(self.db.step), "-L", "-p9999", "-q90", fname] + args
if background:
self._viewerProc = subprocess.Popen(args, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
from IPython.display import HTML
return HTML('''<a href='#' onclick='window.open("http://" + location.hostname + ":8080");'>Open Viewer Interface</a>''')
return HTML('''<a href='#' onclick='window.open("http://" + location.hostname + ":9999");'>Open Viewer Interface</a>''')
else:
lavavu.execute(args)

Expand All @@ -680,7 +680,7 @@ def run_script(self):
""" Run the saved script on an open viewer instance
"""
self.open_viewer()
url = "http://localhost:8080/command=" + urllib2.quote(';'.join(self._script))
url = "http://localhost:9999/command=" + urllib2.quote(';'.join(self._script))
response = urllib2.urlopen(url).read()
#print response

Expand All @@ -695,7 +695,7 @@ def send_command(self, cmd, retry=True):
"""
if haveLavaVu and uw.rank() == 0:
self.open_viewer()
url = "http://localhost:8080/command=" + urllib2.quote(cmd)
url = "http://localhost:9999/command=" + urllib2.quote(cmd)
try:
#print url
response = urllib2.urlopen(url).read()
Expand Down
4 changes: 2 additions & 2 deletions underworld/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ class SavedFileData(object):
pyobj: object
python object saved data relates to.
filename: str
filename for saved data.
filename for saved data, full path
'''
def __init__(self, pyobj, filename):
self.pyobj = pyobj
self.filename = filename
self.filename = os.path.abspath(filename)


### Code for XDMF output ###
Expand Down

0 comments on commit c360f15

Please sign in to comment.