From 0474252fb9ef10ec5f75311d8f3b3cf1241006e0 Mon Sep 17 00:00:00 2001 From: agushin101 Date: Tue, 6 May 2025 18:39:15 -0400 Subject: [PATCH 1/3] build new environment --- environment.yaml | 14 +++++++------- install.sh | 32 ++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/environment.yaml b/environment.yaml index 8fc0ec5..433c354 100644 --- a/environment.yaml +++ b/environment.yaml @@ -3,17 +3,15 @@ channels: - conda-forge - defaults dependencies: - - python=3.9 #3.10 causes CI to hang in parallel - - mpich - # - mpich=4.1.2=hd33e60e_101 - # - mpich=4.0.3 + # - python=3.7 - coveralls - dolfin-adjoint=2019.1.0 - - fenics + - fenics=2019.1.0=py39*_26 - hdf5 - jsonschema - matplotlib - memory_profiler + - mshr - openmdao - pandas - pyoptsparse @@ -21,7 +19,8 @@ dependencies: - pytest-cov - pytest-mpi - pyyaml - - scipy + - scipy=1.7.0 + - sympy=1.13.3 - slepc - sphinx<7.0.0 - pip @@ -37,5 +36,6 @@ dependencies: - pulp - fatpack - gmsh - - meshio + - meshio==5.3.4 + - h5py==3.13.0 - -e . diff --git a/install.sh b/install.sh index 1b2457f..a22cf66 100644 --- a/install.sh +++ b/install.sh @@ -1,15 +1,27 @@ #!/bin/bash -### Create some names -conda_base_path=$(conda info --base) -env_name=$1 - ### Run this to use conda in the script -source ${conda_base_path}/etc/profile.d/conda.sh +source $(conda info --base)/etc/profile.d/conda.sh + +# ### Create the Environment +# conda create -y --name $1 +# conda activate $1 + +# ### Install conda-forge dependencies +# conda install -y -c conda-forge fenics=2019.1.0=py38_9 dolfin-adjoint matplotlib scipy=1.4.1 slepc mshr hdf5 pyyaml memory_profiler pytest pytest-cov pytest-mpi coveralls pandas + +# ### Install the new tsfc compiler +# pip install git+https://github.com/blechta/tsfc.git@2018.1.0 +# pip install git+https://github.com/blechta/COFFEE.git@2018.1.0 +# pip install git+https://github.com/blechta/FInAT.git@2018.1.0 +# pip install git+https://github.com/mdolab/pyoptsparse@v1.0 +# pip install singledispatch networkx pulp openmdao fatpack + +# ### Install editible version of WindSE +# pip install -e . + +conda env create --name ${1} --file environment.yaml -### Create the Environment with mamba -conda create --yes --name ${env_name} --channel conda-forge python=3.9 mamba -conda activate ${env_name} +conda activate ${1} -### Install dependencies from environment -mamba env update --prefix ${conda_base_path}/envs/${env_name} --file environment.yaml --prune +pip install aeromesh --no-deps \ No newline at end of file From 91131732eb04b02471e3c1a2a318d4f010b90fa6 Mon Sep 17 00:00:00 2001 From: jefalon Date: Fri, 9 May 2025 12:52:44 -0600 Subject: [PATCH 2/3] added a check for the 'windse run' command in parallel --- windse_driver/driver.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/windse_driver/driver.py b/windse_driver/driver.py index c492bd6..8511736 100644 --- a/windse_driver/driver.py +++ b/windse_driver/driver.py @@ -1,5 +1,6 @@ import os import __main__ +from mpi4py import MPI ### Get the name of program importing this package ### if hasattr(__main__,"__file__"): @@ -54,6 +55,12 @@ def get_action(): ### Run the driver ### def run_action(params_loc=None): + + + # Check to see if call from exec and parallel + if __name__ == "windse_driver.driver" and MPI.COMM_WORLD.Get_size()>1: + raise NotImplementedError("Using the 'windse run' command in parallel is not currently supported. Instead run 'mpirun -n # python -u WindSE/windse_driver/driver.py run '") + tick = time.time() ### Clean up other module references ### From fd879387d8e32116c774805d8708b21c7bbae089 Mon Sep 17 00:00:00 2001 From: jefalon Date: Tue, 13 May 2025 13:36:25 -0600 Subject: [PATCH 3/3] removed mpi4py import --- windse_driver/driver.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/windse_driver/driver.py b/windse_driver/driver.py index 8511736..1b73a65 100644 --- a/windse_driver/driver.py +++ b/windse_driver/driver.py @@ -1,6 +1,5 @@ import os import __main__ -from mpi4py import MPI ### Get the name of program importing this package ### if hasattr(__main__,"__file__"): @@ -58,7 +57,7 @@ def run_action(params_loc=None): # Check to see if call from exec and parallel - if __name__ == "windse_driver.driver" and MPI.COMM_WORLD.Get_size()>1: + if __name__ == "windse_driver.driver" and dolfin.MPI.comm_world.Get_size()>1: raise NotImplementedError("Using the 'windse run' command in parallel is not currently supported. Instead run 'mpirun -n # python -u WindSE/windse_driver/driver.py run '") tick = time.time()