Skip to content

Commit

Permalink
update conda, hashdist, osx build, and chrono ANCF usage (#1261)
Browse files Browse the repository at this point in the history
* update conda package versions

* update hashdist stack

* update chrono ANCF gravity usage

* relax tolerances on several tests

* change travis image to minimal (language: minimal)

* remove nose dependency

* remove hard-coded compilers and options on travis conda builds

* use conda-installed openblas in default darwin config (no Accelerate)
  • Loading branch information
cekees authored Jun 23, 2022
1 parent 36654bf commit 713b86e
Show file tree
Hide file tree
Showing 27 changed files with 194 additions and 310 deletions.
16 changes: 6 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
os: linux
dist: focal
language: python
python: 3.9
language: minimal

notifications:
email:
Expand All @@ -14,8 +13,6 @@ jobs:
name: "conda linux"
os: linux
dist: focal
language: python
python: 3.9
env: TEST_PROFILE="proteus-conda"
install:
- git lfs pull
Expand All @@ -29,13 +26,13 @@ jobs:
- conda info -a
- conda env create -f environment-dev.yml
- conda activate proteus-dev
- PROTEUS_OPT="-g0 -O2 -DNDEBUG" FC=gfortran CC=mpicc CXX=mpicxx make develop-conda N=2
- make develop-conda N=2
script:
- export MPLBACKEND="AGG"
- py.test -n 1 --forked -v proteus/tests --ignore proteus/tests/POD --ignore proteus/tests/solver_tests/test_nse_RANS2P_step.py
- py.test -n 1 --forked -v air-water-vv/Tests/1st_set
- py.test -n 1 --forked -v air-water-vv/Tests/2nd_set
- mpiexec -np 2 pytest -v proteus/tests/FSI
- py.test -n 1 --forked -v proteus/tests/FSI
deploy:
provider: script
script: bash ./scripts/deploy.sh docs
Expand All @@ -45,9 +42,7 @@ jobs:
- stage: test
name: "conda osx"
os: osx
osx_image: xcode12.2
language: ruby
python: 2.6.6
osx_image: xcode13.4
env: TEST_PROFILE="proteus-conda-osx"
install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
Expand All @@ -60,11 +55,12 @@ jobs:
- conda env create -f environment-dev.yml
- conda activate proteus-dev
- pip install gmsh
- PROTEUS_OPT="-g0 -O2 -DNDEBUG" FC=gfortran CC=mpicc CXX=mpicxx make develop-conda N=2
- make develop-conda N=2
script:
- export MPLBACKEND="AGG"
- git lfs install
- git lfs pull
- py.test -n 1 --forked -v proteus/tests --ignore proteus/tests/solver_tests --ignore proteus/tests/POD --ignore=proteus/tests/MoveMeshMonitor --ignore proteus/tests/periodic
- py.test -n 1 --forked -v air-water-vv/Tests/1st_set
- py.test -n 1 --forked -v air-water-vv/Tests/2nd_set --ignore air-water-vv/Tests/2nd_set/test_randomWaves.py
- py.test -n 1 --forked -v proteus/tests/FSI
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ develop: ${PROTEUS_PREFIX}/bin/proteus_env.sh stack/default.yaml ${PROTEUS_PREFI
@echo "Installing development version"
@echo "************************"
$(call show_info)
${PROTEUS_ENV} pip install py2gmsh pytest pytest-xdist pytest-cov nose tables future
${PROTEUS_ENV} pip install py2gmsh pytest pytest-xdist pytest-cov tables future
${PROTEUS_ENV} ${PROTEUS_DEVELOP_BUILD_CMD}
${PROTEUS_ENV} ${PROTEUS_DEVELOP_CMD}
@echo "************************"
Expand Down
75 changes: 37 additions & 38 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,55 @@ channels:
- conda-forge
- defaults
dependencies:
- pip =21.1.3
- compilers =1.2.0
- pip =22.1.2
- compilers =1.4.1
- make
- setuptools =49.6.0
- cython =0.29.24
- setuptools =62.6.0
- cython =0.29.30
- daetk =1.0.1
- hdf5 =1.10.6=*mpich*
- h5py =3.3.0=*mpich*
- hdf5 =1.12.1=*mpich*
- h5py =3.6.0=*mpich*
- metis =5.1.0
- mpich =3.4.2
- mpich-mpicc =3.4.2
- mpich-mpicxx =3.4.2
- numpy =1.21.0
- openblas =0.3.17
- mpich =4.0.2
- mpich-mpicc =4.0.2
- mpich-mpicxx =4.0.2
- numpy =1.22.4
- openblas =0.3.20
- parmetis =4.0.3
- petsc4py =3.14.1
- petsc =3.14.6
- petsc4py =3.17.2
- petsc =3.17.2
- scorec =2.2.2
- superlu =5.2.2
- superlu_dist =6.2.0
- superlu_dist =7.2.0
- triangle =1.6
- pychrono =6.0.0
- gmsh =4.8.4
- matplotlib =3.4.2
- mpi4py =3.0.3
- nose
- pytables =3.6.1
- pychrono =7.0.0
- gmsh =4.10.4
- matplotlib =3.5.2
- mpi4py =3.1.3
- pytables =3.7.0
- pytest
- pytest-cov
- pytest-xdist
- scipy =1.7.0
- scipy =1.8.1
- tetgen =1.6.0
- ncurses =6.2
- python =3.9.6
- ncurses =6.3
- python =3.10.5
- future =0.18.2
- ipyparallel =6.3.0
- pillow =8.3.1
- xtensor-python = 0.25.3
- ipyparallel =8.4.0
- pillow =9.1.1
- xtensor-python = 0.26.1
- git-lfs
- eigen =3.3.9
- zoltan =3.83
- hypre =2.18.2
- eigen =3.4.0
- zoltan =3.901
- hypre =2.24.0
- mumps-mpi =5.2.1
- numexpr =2.7.3
- numexpr =2.8.0
- ptscotch =6.0.9
- scalapack =2.0.2
- tbb =2020.2
- zipp =3.5.0
- parso =0.8.2
- pycparser =2.20
- ipython =7.25.0
- decorator =5.0.9
- cffi =1.14.6
- scalapack =2.2.0
- tbb =2021.5.0
- zipp =3.8.0
- parso =0.8.3
- pycparser =2.21
- ipython =8.4.0
- decorator =5.1.1
- cffi =1.15.0
9 changes: 4 additions & 5 deletions proteus/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
platform_lapack_h = None
platform_lapack_integer = None
if sys.platform == 'darwin':
platform_extra_link_args = ['-framework', 'Accelerate']
platform_lapack_integer = '__CLPK_integer'
platform_blas_h = r'<Accelerate/Accelerate.h>'
platform_lapack_h = r'<Accelerate/Accelerate.h>'
platform_extra_compile_args = ['-flax-vector-conversions','-DPETSC_INCLUDE_AS_C','-DPETSC_SKIP_COMPLEX']
platform_extra_compile_args = ['-DPETSC_INCLUDE_AS_C', '-DPETSC_SKIP_COMPLEX']
platform_extra_link_args = ['-L'+PROTEUS_LIB_DIR,'-Wl,-rpath,' + PROTEUS_LIB_DIR]
platform_blas_h = r'"proteus_blas.h"'
platform_lapack_h = r'"proteus_lapack.h"'
major,minor = platform.mac_ver()[0].split('.')[0:2]
os.environ["MACOSX_DEPLOYMENT_TARGET"]= major+'.'+minor
elif sys.platform.startswith('linux'):
Expand Down
1 change: 0 additions & 1 deletion proteus/mbd/CouplingFSI.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2407,7 +2407,6 @@ cdef class ProtChMesh:

def __cinit__(self, ProtChSystem system):
self.ChMeshh = chrono_fea.ChMesh()
self.ChMeshh.SetAutomaticGravity(True)
cdef SwigPyObject *swig_obj = <SwigPyObject*> self.ChMeshh.this
cdef shared_ptr[ch.ChMesh]* pt_to_shp = <shared_ptr[ch.ChMesh]*> swig_obj.ptr;
self.mesh = pt_to_shp[0]
Expand Down
6 changes: 3 additions & 3 deletions proteus/mbd/ProtChMoorings.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "chrono/physics/ChLoadContainer.h"
#include "chrono/physics/ChLinkMate.h"
#include "chrono/physics/ChBodyEasy.h"
#include "chrono/fea/ChElementBeamANCF.h"
#include "chrono/fea/ChElementBeamANCF_3333.h"
#include "chrono/fea/ChElementCableANCF.h"
#include "chrono/fea/ChElementBeamEuler.h"
#include "chrono/fea/ChBeamSection.h"
Expand Down Expand Up @@ -735,7 +735,7 @@ void cppCable::buildElementsCableANCF(bool set_lastnodes) {
auto load = chrono_types::make_shared<ChLoadBeamWrench>(element);
std::shared_ptr<ChLoad<MyLoaderTriangular>> loadtri(new ChLoad<MyLoaderTriangular>(element));
auto load_volumetric = chrono_types::make_shared<ChLoad<ChLoaderGravity>>(element);
load_volumetric->loader.Set_G_acc(ChVector<>(0.,0.,0.));
load_volumetric->loader.Set_G_acc(system->Get_G_acc());
/* loadcontainer->Add(load_distributed); */
/* loadcontainer->Add(load); */
loadcontainer->Add(loadtri); // do not forget to add the load to the load container.
Expand Down Expand Up @@ -772,7 +772,7 @@ void cppCable::buildElementsBeamEuler(bool set_lastnodes) {
auto load = chrono_types::make_shared<ChLoadBeamWrench>(element);
std::shared_ptr<ChLoad<MyLoaderTriangular>> loadtri(new ChLoad<MyLoaderTriangular>(element));
auto load_volumetric = chrono_types::make_shared<ChLoad<ChLoaderGravity>>(element);
load_volumetric->loader.Set_G_acc(ChVector<>(0.,0.,0.));
load_volumetric->loader.Set_G_acc(system->Get_G_acc());
/* loadcontainer->Add(load_distributed); */
/* loadcontainer->Add(load); */
loadcontainer->Add(loadtri); // do not forget to add the load to the load container.
Expand Down
3 changes: 0 additions & 3 deletions proteus/tests/MeshAdaptPUMI/case_run/test_workflowPUMI.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@ def test_workflowPUMI(verbose=0):
currentPath = os.path.dirname(os.path.abspath(__file__))
runCommand = "cd "+currentPath+"; parun -l5 couette_so.py;"
subprocess.check_call(runCommand,shell=True )
if __name__ == '__main__':
import nose
nose.main(defaultTest='test_workflowPUMI:test_workflowPUMI')


Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import subprocess
import os
import pytest
Expand Down Expand Up @@ -37,7 +35,3 @@ def test_MeshAdaptRestart(verbose=0):
if(line1 != line2):
pytest.fail("pressure gauge values are not the same!\n")

if __name__ == '__main__':
import nose
nose.main(defaultTest='test_MeshAdaptRestart:test_MeshAdaptRestart_generateMesh,test_MeshAdaptRestart:test_MeshAdaptRestart_adaptiveTime_BackwardEuler_baseline, test_MeshAdaptRestart:test_MeshAdaptRestart_adaptiveTime_BackwardEuler, test_MeshAdaptRestart:test_MeshAdaptRestart')

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import subprocess
import os
import pytest
Expand Down Expand Up @@ -34,7 +32,3 @@ def test_MeshAdaptRestart_withRedistancing(verbose=0):
if(line1 != line2):
pytest.fail("pressure gauge values are not the same!\n")

if __name__ == '__main__':
import nose
nose.main(defaultTest='test_MeshAdaptRestart_withRedistancing:test_MeshAdaptRestart_generateMesh, test_MeshAdaptRestart_withRedistancing:test_MeshAdaptRestart_adaptiveTime_BackwardEuler_baseline_withRedistancing, test_MeshAdaptRestart_withRedistancing:test_MeshAdaptRestart_adaptiveTime_BackwardEuler_withRedistancing, test_MeshAdaptRestart_withRedistancing:test_MeshAdaptRestart_withRedistancing')

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import subprocess
import os
import pytest
Expand Down Expand Up @@ -34,8 +32,3 @@ def test_MeshAdaptRestart_withRDMC(verbose=0):
for line1, line2 in zip(file1, file2):
if(line1 != line2):
pytest.fail("pressure gauge values are not the same!\n")

if __name__ == '__main__':
import nose
nose.main(defaultTest='test_MeshAdaptRestart_withRDMC:test_MeshAdaptRestart_generateMesh,test_MeshAdaptRestart_withRDMC:test_MeshAdaptRestart_adaptiveTime_BackwardEuler_baseline_withRDMC, test_MeshAdaptRestart_withRDMC:test_MeshAdaptRestart_adaptiveTime_BackwardEuler_withRDMC, test_MeshAdaptRestart_withRDMC:test_MeshAdaptRestart_withRDMC')

22 changes: 8 additions & 14 deletions proteus/tests/MeshAdaptPUMI/test_gmshCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from proteus import Domain
from proteus import Comm
from petsc4py import PETSc
from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import os
import pytest

Expand Down Expand Up @@ -76,9 +74,9 @@ def test_gmshLoadAndAdapt(verbose=0):
domain.AdaptManager.PUMIAdapter.transferFieldToPUMI(b"vof", scalar)

errorTotal=domain.AdaptManager.PUMIAdapter.get_local_error()
ok(errorTotal<1e-14)
assert (errorTotal<1e-14)

#ok(domain.AdaptManager.willAdapt(),1)
#assert (domain.AdaptManager.willAdapt(),1)
domain.AdaptManager.PUMIAdapter.adaptPUMIMesh(b"")

mesh = MeshTools.TetrahedralMesh()
Expand All @@ -88,7 +86,7 @@ def test_gmshLoadAndAdapt(verbose=0):
parallel = comm.size() > 1,
dim = domain.nd)
nElements_final = mesh.nElements_global
ok(nElements_final>nElements_initial)
assert (nElements_final>nElements_initial)

def test_2DgmshLoadAndAdapt(verbose=0):
"""Test for loading gmsh mesh through PUMI, estimating error and adapting for
Expand Down Expand Up @@ -154,9 +152,9 @@ def test_2DgmshLoadAndAdapt(verbose=0):
domain.AdaptManager.PUMIAdapter.transferFieldToPUMI(b"vof", scalar)

errorTotal=domain.AdaptManager.PUMIAdapter.get_local_error()
ok(errorTotal<1e-14)
assert (errorTotal<1e-14)

#ok(domain.AdaptManager.willAdapt(),1)
#assert (domain.AdaptManager.willAdapt(),1)

domain.AdaptManager.PUMIAdapter.adaptPUMIMesh(b"")

Expand All @@ -167,7 +165,7 @@ def test_2DgmshLoadAndAdapt(verbose=0):
parallel = comm.size() > 1,
dim = domain.nd)
nElements_final = mesh.nElements_global
ok(nElements_final>nElements_initial)
assert (nElements_final>nElements_initial)

def test_2DmultiRegion(verbose=0):
"""Test for loading gmsh mesh through PUMI with multiple-regions"""
Expand All @@ -186,10 +184,6 @@ def test_2DmultiRegion(verbose=0):
mesh.cmesh = cmeshTools.CMesh()
comm = Comm.init()
mesh.convertFromPUMI(domain,domain.AdaptManager.PUMIAdapter, domain.faceList,domain.regList, parallel = comm.size() > 1, dim = domain.nd)
ok(mesh.elementMaterialTypes[0]==1)
ok(mesh.elementMaterialTypes[-1]==2)

if __name__ == '__main__':
import nose
nose.main(defaultTest='test_gmshCheck:test_gmshLoadAndAdapt,test_gmshCheck:test_2DgmshLoadAndAdapt,test_gmshCheck:test_2DmultiRegion')
assert mesh.elementMaterialTypes[0]==1
assert mesh.elementMaterialTypes[-1]==2

15 changes: 4 additions & 11 deletions proteus/tests/MeshAdaptPUMI/test_meshLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from proteus import cmeshTools
from proteus.MeshAdaptPUMI import MeshAdapt
from proteus import Domain
from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import os
import pytest

Expand All @@ -25,12 +23,7 @@ def test_meshLoadPUMI(verbose=0):
cmeshTools.allocateGeometricInfo_tetrahedron(mesh.cmesh)
cmeshTools.computeGeometricInfo_tetrahedron(mesh.cmesh)
mesh.buildFromC(mesh.cmesh)
eq(mesh.nElements_global,670)
eq(mesh.nNodes_global,190)
eq(mesh.nEdges_global,977)
eq(mesh.nElementBoundaries_global,1458)

if __name__ == '__main__':
import nose
nose.main(defaultTest='test_meshLoad:test_meshLoadPUMI')

assert mesh.nElements_global == 670
assert mesh.nNodes_global == 190
assert mesh.nEdges_global == 977
assert mesh.nElementBoundaries_global == 1458
15 changes: 4 additions & 11 deletions proteus/tests/MeshAdaptPUMI/test_parallelMeshLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from proteus import Domain
from proteus.MeshAdaptPUMI import MeshAdapt
from proteus import Comm
from nose.tools import eq_ as eq
from nose.tools import ok_ as ok
import os
from petsc4py import PETSc
import pytest
Expand Down Expand Up @@ -52,13 +50,8 @@ def test_2DparallelLoadPUMI(verbose=0):
mesh = MeshTools.TriangularMesh()
mesh.cmesh = cmeshTools.CMesh()
mesh.convertFromPUMI(domain,domain.PUMIMesh, domain.faceList, domain.regList,parallel = comm.size() > 1, dim = domain.nd)
eq(mesh.nElements_global,8)
eq(mesh.nNodes_global,10)
eq(mesh.nEdges_global,17)
eq(mesh.nElementBoundaries_global,17)

if __name__ == '__main__':
import nose
nose.main(defaultTest='test_parallelMeshLoad:test_3DparallelLoadPUMI,test_parallelMeshLoad:test_2DparallelLoadPUMI')

assert mesh.nElements_global == 8
assert mesh.nNodes_global == 10
assert mesh.nEdges_global == 17
assert mesh.nElementBoundaries_global == 17

Loading

0 comments on commit 713b86e

Please sign in to comment.