Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration of mprans to xtensor #1068

Merged
merged 44 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6c4f10b
xtensor
davidbrochart Jan 13, 2020
7a82d45
Install xtensor for hashdist
davidbrochart Jan 17, 2020
912cb05
Add PROTEUS_OPT compilation options for xtensor-based extensions
davidbrochart Jan 17, 2020
10a5082
Added xtensor-python to environment.yaml
JohanMabille Jan 13, 2020
48931e6
AddedMass based on xtensor
JohanMabille Jan 13, 2020
f85c8eb
SedClosure based on xtensor
JohanMabille Jan 14, 2020
d87882b
VOF3P based on xtensor
JohanMabille Jan 14, 2020
2c38803
NCLS3P based on xtensor
JohanMabille Jan 16, 2020
ac22551
Moved mprans2/setup.py into proteus/setup.py
JohanMabille Jan 16, 2020
9ff52fd
MCorr3P based on xtensor
JohanMabille Jan 16, 2020
a18bd72
mprans.RANS3PSed
davidbrochart Jan 20, 2020
aaf2926
mprans.RANS3PSed2D
davidbrochart Jan 20, 2020
3ac0d47
Moved RANS3PSed to mprans
davidbrochart Jan 20, 2020
c1633f4
Add calculateVelocityAverage
davidbrochart Jan 21, 2020
6abc305
Dissipation2D
davidbrochart Jan 21, 2020
e0d9891
VOS3P
davidbrochart Jan 21, 2020
ebe9a2a
PresInc
davidbrochart Jan 21, 2020
8f84e88
Dissipation
davidbrochart Jan 22, 2020
32ed891
CLSVOF
davidbrochart Jan 23, 2020
50ec5b5
NCLS
davidbrochart Jan 23, 2020
4dd14dd
MCorr
davidbrochart Jan 24, 2020
c9c59cc
RANS2P
davidbrochart Jan 24, 2020
f3042d9
RANS2P2D
davidbrochart Jan 24, 2020
7c662a2
RANS2P_IB
davidbrochart Jan 24, 2020
34bc00d
Travis parallel compilation disabled
davidbrochart Jan 25, 2020
9dad38c
RDLS
davidbrochart Jan 27, 2020
592276f
VOF
davidbrochart Jan 27, 2020
1c76f10
MoveMesh
davidbrochart Jan 27, 2020
4409c66
MoveMesh2D
davidbrochart Jan 27, 2020
dc1fa16
SW2D
davidbrochart Jan 27, 2020
e217e84
SW2DCV
davidbrochart Jan 27, 2020
7eea25a
GN_SW2DCV
davidbrochart Jan 28, 2020
e6b8476
Kappa and Kappa2D
davidbrochart Jan 28, 2020
19831c3
Fixed AddedMass
JohanMabille Jan 24, 2020
558eecc
Fixed VOF3P
JohanMabille Jan 24, 2020
6fed51e
Fixed NCLS3P
JohanMabille Jan 24, 2020
636967b
Fixed MCorr3P
JohanMabille Jan 24, 2020
d2a9e14
RANS3PF
JohanMabille Jan 28, 2020
aa3fb7e
SedClosure.h
JohanMabille Jan 28, 2020
f12d848
Splitted RANS3PF.h and RANS3PF2D.h
JohanMabille Jan 29, 2020
91640cb
Disabled optimizations
JohanMabille Feb 5, 2020
2a45964
Fixed build after rebase
JohanMabille Feb 10, 2020
6762b5b
Reverted RANS3PF and enabled optimizations again
JohanMabille Feb 10, 2020
16329ff
Merge branch 'master' into xtensor
zhang-alvin Feb 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ linux2/
garnet.gnu/
Cygwin
proteus.egg-info/
proteus/ADR.cpp
proteus/subsurfaceTransportFunctions.c
cygwin_bootstrap.done
matlab_setup.done
dist/
tmp/

# Generated files

Expand All @@ -58,14 +58,12 @@ proteus/csparsity.cpp
proteus/csubgridError.c
proteus/ctimeIntegration.c
proteus/ctransportCoefficients.c
proteus/elastoplastic/cElastoPlastic.cpp
proteus/equivalent_polynomials.cpp
proteus/fenton/Fenton.cpp
proteus/flcbdfWrappers.cpp
proteus/mbd/CouplingFSI.cpp
proteus/mprans/BoundaryConditions.cpp
proteus/mprans/MeshSmoothing.cpp
proteus/mprans/SedClosure.cpp
proteus/mprans/cAddedMass.cpp
proteus/mprans/cCLSVOF.cpp
proteus/mprans/cGN_SW2DCV.cpp
Expand All @@ -79,5 +77,4 @@ proteus/mprans/cRANS3PF.cpp
proteus/mprans/cRANS3PSed.cpp
proteus/mprans/cVOF3P.cpp
proteus/mprans/cVOS3P.cpp
proteus/richards/cRichards.cpp
proteus/superluWrappers.c
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
env: TEST_PROFILE="proteus-hashdist"
install:
- git lfs pull
- ./get_xtensor.sh
- ./stack/hit/bin/hit init-home
- ./stack/hit/bin/hit remote add http://levant.hrwallingford.com/hashdist_src --objects="source"
- ./stack/hit/bin/hit remote add http://levant.hrwallingford.com/hashdist_ubuntu_16_04 --objects="build"
Expand All @@ -51,7 +52,7 @@ jobs:
- export PATHSAVE=$PATH
- export PATH=$PWD/linux/bin:$PATH
- export LD_LIBRARY_PATH=$PWD/linux/lib:$LD_LIBRARY_PATH
- PROTEUS_OPT="-w -O2 -UNDEBUG" FC=gfortran CC=mpicc CXX=mpicxx make develop N=2
- PROTEUS_OPT="-w -O2 -UNDEBUG" FC=gfortran CC=mpicc CXX=mpicxx make develop N=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What did changing the number of workers resolve?

Copy link
Member Author

@JohanMabille JohanMabille Feb 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids timeout on travis due to long compilation. My guess is that the worker is going out of memory because of many template instantiations and swaps a lot. The number of workers can be reset to 2 when we moved to the dict of pyarray objects and reduce the size of the API.

- export SSL_CERT_DIR=/etc/ssl/certs
- #./linux/bin/pip3 install matplotlib
script:
Expand All @@ -76,7 +77,7 @@ jobs:
- conda info -a
- conda env create -f environment-dev.yml
- conda activate proteus-dev
- pip install -v -e .
- make develop-conda N=1
script:
- export MPLBACKEND="AGG"
- py.test -n 1 --dist=loadfile --forked -v proteus/tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --cov=proteus
Expand Down Expand Up @@ -108,4 +109,4 @@ jobs:
- git lfs pull
- cd proteus/tests/ci
- parun poisson_3d_tetgen_p.py poisson_3d_tetgen_c0p1_n.py -l 5 -v
# - py.test -n 1 --dist=no --forked -v proteus/tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --cov=proteus
# - py.test -n 1 --dist=no --forked -v proteus/tests --ignore proteus/tests/POD --ignore proteus/tests/MeshAdaptPUMI --cov=proteus
1 change: 1 addition & 0 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ dependencies:
- ipyparallel
- pillow
- recordtype
- xtensor-python
- git-lfs
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ dependencies:
- cython
- pillow
- pip
- xtensor-python
- pip:
- recordtype
15 changes: 15 additions & 0 deletions get_xtensor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

rm -rf proteus/xtensor
mkdir -p proteus/xtensor
cd proteus/xtensor
mkdir xtl xtensor-python xtensor pybind11
wget https://github.com/QuantStack/xtl/archive/0.6.11.tar.gz -O xtl.tar.gz
wget https://github.com/QuantStack/xtensor-python/archive/0.24.1.tar.gz -O xtensor-python.tar.gz
wget https://github.com/xtensor-stack/xtensor/archive/0.21.2.tar.gz -O xtensor.tar.gz
wget https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz -O pybind11.tar.gz
tar zxf xtl.tar.gz --strip-components=1 -C xtl
tar zxf xtensor-python.tar.gz --strip-components=1 -C xtensor-python
tar zxf xtensor.tar.gz --strip-components=1 -C xtensor
tar zxf pybind11.tar.gz --strip-components=1 -C pybind11
rm *.gz
29 changes: 29 additions & 0 deletions proteus/ADR.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "pybind11/pybind11.h"
#include "pybind11/stl_bind.h"

#define FORCE_IMPORT_ARRAY
#include "ADR.h"

#if defined(__GNUC__) && !defined(__clang__)
namespace workaround
{
inline void define_allocators()
{
std::allocator<int> a0;
std::allocator<double> a1;
}
}
#endif

namespace py = pybind11;
using proteus::cppADR_base;

PYBIND11_MODULE(ADR, m)
{
xt::import_numpy();

py::class_<cppADR_base>(m, "ADR")
.def(py::init(&proteus::newADR))
.def("calculateResidual", &cppADR_base::calculateResidual)
.def("calculateJacobian", &cppADR_base::calculateJacobian);
}
Loading