Skip to content

Commit

Permalink
Getting UWGeo internals to use uw2 mpi4py interface (#612)
Browse files Browse the repository at this point in the history
* Getting UWGeo internals to use uw2 mpi4py interface
* Update CHANGES.md
  • Loading branch information
julesghub committed May 31, 2022
1 parent a1f2072 commit c7631df
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 35 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CHANGES: Underworld2
=======================
Release 2.13-dev []
Release 2.13 [2022-05-30]

New:
* UWGeodynamics (`from underworld import UWGeodynamics as GEO`)
* UWGeodynamics (`from underworld import UWGeodynamics as GEO`) functionlity and models added. See https://www.underworldcode.org/articles/uwgeodynamics-and-underworld-merge/
-------------------

Release 2.12.0 [2022-01-31]
Expand Down
5 changes: 2 additions & 3 deletions underworld/UWGeodynamics/LecodeIsostasy/LecodeIsostasy.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from __future__ import print_function, absolute_import
import underworld as uw
import numpy as np
from mpi4py import MPI
from scipy.interpolate import interp1d, interp2d

comm = MPI.COMM_WORLD
rank = comm.Get_rank()
comm = uw.mpi.comm
rank = uw.mpi.rank


class LecodeIsostasy(object):
Expand Down
7 changes: 3 additions & 4 deletions underworld/UWGeodynamics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import print_function, absolute_import
import warnings

import underworld as uw
from underworld import __version__
from underworld.scaling import get_coefficients
from underworld.scaling import units as UnitRegistry
Expand All @@ -20,7 +21,6 @@
import uuid as _uuid
from itertools import chain
import six
from mpi4py import MPI as _MPI
from . import shapes
from . import surfaceProcesses
from . import utilities
Expand All @@ -43,9 +43,8 @@
from ._utils import remesh
from . import postprocessing

comm = _MPI.COMM_WORLD
rank = comm.rank
size = comm.size
rank = uw.mpi.rank
size = uw.mpi.size
nProcs = size

__author__ = "Romain Beucher"
Expand Down
7 changes: 1 addition & 6 deletions underworld/UWGeodynamics/_freesurface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
from scipy.interpolate import interp1d
import underworld as uw
from underworld.scaling import non_dimensionalise as nd
from mpi4py import MPI as _MPI

comm = _MPI.COMM_WORLD
rank = comm.rank
size = comm.size

class FreeSurfaceProcessor(object):
"""FreeSurfaceProcessor"""
Expand Down Expand Up @@ -74,7 +69,7 @@ def _advect_surface(self, dt):
f = interp1d(x2, y2, kind='cubic', fill_value='extrapolate')

self.TField.data[self.top.data, 0] = f(x)
comm.Barrier()
uw.mpi.barrier()
self.TField.syncronise()

def _update_mesh(self):
Expand Down
7 changes: 3 additions & 4 deletions underworld/UWGeodynamics/_mesh_advector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import sys
from mpi4py import MPI as _MPI

comm = _MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()

comm = uw.mpi.comm
size = uw.mpi.size
rank = uw.mpi.rank

class Mesh_advector(object):
"""Mesh_advector class"""
Expand Down
7 changes: 3 additions & 4 deletions underworld/UWGeodynamics/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import underworld as uw
import underworld.function as fn
from underworld.function.exception import SafeMaths as Safe
from mpi4py import MPI as _MPI
import underworld.UWGeodynamics.shapes as shapes
import underworld.UWGeodynamics.surfaceProcesses as surfaceProcesses
from . import rcParams
Expand All @@ -33,9 +32,9 @@
from ._remeshing import ReMesher
from ._density import Density

comm = _MPI.COMM_WORLD
rank = comm.rank
size = comm.size
comm = uw.mpi.comm
rank = uw.mpi.rank
size = uw.mpi.size

_dim_gravity = {'[length]': 1.0, '[time]': -2.0}
_dim_time = {'[time]': 1.0}
Expand Down
7 changes: 3 additions & 4 deletions underworld/UWGeodynamics/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
from underworld.utils import _swarmvarschema
from underworld.swarm import Swarm, SwarmVariable
from scipy import spatial
from mpi4py import MPI as _MPI

comm = _MPI.COMM_WORLD
rank = comm.rank
size = comm.size
comm = uw.mpi.comm
rank = uw.mpi.rank
size = uw.mpi.size

class PhaseChange(object):

Expand Down
7 changes: 3 additions & 4 deletions underworld/UWGeodynamics/lithopress/lithopress.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import underworld as uw
import underworld.function as fn
import numpy as np
from mpi4py import MPI

comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
comm = uw.mpi.comm
size = uw.mpi.size
rank = uw.mpi.rank

supported_elem_mesh = ["Q1", "Q2"]
supported_elem_subMesh = ["DQ1", "DQ0", "DPC1"]
Expand Down
8 changes: 4 additions & 4 deletions underworld/UWGeodynamics/surfaceProcesses.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import print_function, absolute_import
import abc
import underworld as uw
import underworld.function as fn
import numpy as np
import sys
Expand All @@ -9,12 +10,11 @@
from underworld.scaling import non_dimensionalise as nd
from underworld.scaling import dimensionalise
from underworld.scaling import units as u
from mpi4py import MPI as _MPI
from tempfile import gettempdir

comm = _MPI.COMM_WORLD
rank = comm.rank
size = comm.size
comm = uw.mpi.comm
rank = uw.mpi.rank
size = uw.mpi.size

ABC = abc.ABCMeta('ABC', (object,), {})
_tempdir = gettempdir()
Expand Down

0 comments on commit c7631df

Please sign in to comment.