Skip to content

Commit

Permalink
Merge pull request #207 from zacharyjbaker/main
Browse files Browse the repository at this point in the history
ENH: Added yaml workflow files for testing installation of Fierro via anaconda and some example input, for the purpose of CI
  • Loading branch information
nathanielmorgan authored Jul 24, 2024
2 parents be49704 + 0ad88d3 commit fe0ecde
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .conda/fierro/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ cmake .. \
-D MPI_CXX_COMPILER="$BUILD_PREFIX/bin/mpicxx" \
-D VECTOR_ARCH_FLAGS="$VECTOR_ARCH_FLAGS" \

make -j 10 install
make -j 10 install
1 change: 1 addition & 0 deletions .etc/conda_build_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ dependencies:
- boa # For building
- conda-build
- anaconda-client # For uploading
- python=3.8
2 changes: 1 addition & 1 deletion .github/workflows/build-conda-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('.etc/conda_build_environment.yaml') }}-${{ env.CACHE_NUMBER }}
# env:
# CACHE_NUMBER: 1
# id: cache
# id: cached

- name: Update environment
run:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/fierro-test-no-implicit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Fierro Test (No Implicit)

# Workflow runs on following successful conda distribution
on:
workflow_run:
workflows: [Publish Test, Publish All, Publish Elements, Publish EVPFFT-CPU, Publish EVPFFT-dev, Publish EVPFFT-GPU, Publish FIERRO GUI, Publish Fierro-CPU, Publish Fierro-dev, Publish Heffte, Publish Heffte CUDA, Publish Trilinos-CPU]
types:
- completed
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: print trigger event
run: |
echo "::workflow triggering event name is::" ${{ github.event_name }}
- name: update the package list
run:
sudo apt-get update
shell: bash
- name: Install build tools
run:
sudo apt-get install build-essential
shell: bash
- name: Install LaPack
run:
sudo apt-get install libblas-dev liblapack-dev
shell: bash
- name: Install MPI
run: |
sudo apt-get install libopenmpi-dev openmpi-bin
echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV
- name: Install cmake
run:
sudo apt-get -y install cmake
shell: bash
- name: Install python
run:
sudo apt-get install python3.6
shell: bash

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8

- name: Create conda environment
run: conda env create -f ./.etc/conda_build_environment.yaml

- name: Initialize conda
run: conda init bash

- name: Activate conda environment, install Fierro anaconda packages
run: |
source ~/.bashrc
conda activate build-env
conda install --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive
conda install -c conda-forge -c fierromechanics fierro-cpu
conda install -c conda-forge -c fierromechanics evpfft
conda install -c conda-forge -c fierromechanics fierro_gui
- name: Verify package dependencies
run: |
conda info --envs
conda list
- name: Test fierro-parallel-explicit
run: |
source ~/.bashrc
conda activate build-env
fierro-parallel-explicit ./src/Parallel-Solvers/Parallel-Explicit/Example_Yaml_Scripts/example_simple.yaml
shell: bash

- name: Test fierro-mesh-builder
run: |
source ~/.bashrc
conda activate build-env
fierro-mesh-builder ./src/Mesh-Builder/examples/mesh_Box_16_p3.yaml
shell: bash


106 changes: 106 additions & 0 deletions .github/workflows/fierro-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Fierro Test

# Workflow runs on following successful conda distribution
on:
workflow_run:
workflows: [Publish Test, Publish All, Publish Elements, Publish EVPFFT-CPU, Publish EVPFFT-dev, Publish EVPFFT-GPU, Publish FIERRO GUI, Publish Fierro-CPU, Publish Fierro-dev, Publish Heffte, Publish Heffte CUDA, Publish Trilinos-CPU]
types:
- completed
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: update the package list
run:
sudo apt-get update
shell: bash
- name: Install build tools
run:
sudo apt-get install build-essential
shell: bash
- name: Install LaPack
run:
sudo apt-get install libblas-dev liblapack-dev
shell: bash
- name: Install MPI
run: |
sudo apt-get install libopenmpi-dev openmpi-bin
echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV
- name: Install cmake
run:
sudo apt-get -y install cmake
shell: bash
- name: Install python
run:
sudo apt-get install python3.6
shell: bash
- name: Install dos2unix
run:
sudo apt-get install dos2unix
shell: bash

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8

- name: Create conda environment
run: conda env create -f ./.etc/conda_build_environment.yaml

- name: Initialize conda
run: conda init bash

- name: Activate conda environment, install Fierro anaconda packages
run: |
source ~/.bashrc
conda activate build-env
conda install --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive
conda install -c conda-forge -c fierromechanics fierro-cpu
conda install -c conda-forge -c fierromechanics evpfft
conda install -c conda-forge -c fierromechanics fierro_gui
- name: Verify package dependencies
run: |
conda info --envs
conda list
- name: Test fierro-parallel-explicit
run: |
source ~/.bashrc
conda activate build-env
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=1
export OMP_PLACES=threads
mpirun -np 1 --bind-to core fierro-parallel-explicit ./src/Parallel-Solvers/Parallel-Explicit/Example_Yaml_Scripts/example_simple.yaml
shell: bash

- name: Test fierro-mesh-builder
run: |
source ~/.bashrc
conda activate build-env
fierro-mesh-builder ./src/Mesh-Builder/examples/mesh_Box_16_p3.yaml
shell: bash

- name: Test fierro-parallel-implicit
run: |
source ~/.bashrc
conda activate build-env
dos2unix ./Example_Yaml_Scripts/example_implicit_basic.yaml
export OMP_PROC_BIND=spread
export OMP_NUM_THREADS=1
export OMP_PLACES=threads
mpirun -np 1 --bind-to core fierro-parallel-implicit ./Example_Yaml_Scripts/example_implicit_basic.yaml
working-directory: ./src/Parallel-Solvers/Implicit-Lagrange
shell: bash




37 changes: 37 additions & 0 deletions .github/workflows/publish-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish All

on: workflow_dispatch

jobs:
elements:
uses: ./.github/workflows/publish-elements.yml

evpfft-cpu:
uses: ./.github/workflows/publish-evpfft-cpu.yml

evpfft-dev:
uses: ./.github/workflows/publish-evpfft-dev.yml

evpfft-gui:
uses: ./.github/workflows/publish-evpfft-gui.yml

fierro-cpu:
uses: ./.github/workflows/publish-fierro-cpu.yml

fierro-dev:
uses: ./.github/workflows/publish-fierro-dev.yml

fierro-gui:
uses: ./.github/workflows/publish-fierro-gui.yml

heffte-cpu:
uses: ./.github/workflows/publish-heffte-cpu.yml

heffte-cuda:
uses: ./.github/workflows/publish-heffte-cuda.yml

trilinos:
uses: ./.github/workflows/publish-trillinos.yml

voxelizer:
uses: ./.github/workflows/publish-voxelizer.yml
3 changes: 3 additions & 0 deletions .github/workflows/publish-fierro-cpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ jobs:
with:
recipe_dir: .conda/fierro/cpu
secrets: inherit



19 changes: 19 additions & 0 deletions .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Publish Test
on:
workflow_dispatch

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: update the package list
run:
sudo apt-get update
shell: bash


Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# input file
num_dims: 3

mesh_generation_options:
type: Box
origin: [0, 0, 0]
length: [10, 10, 100]
num_elems: [5, 5, 50]

materials:
- id: 0
elastic_modulus: 200000000000
poisson_ratio: 0.3
density: 7850
thermal_conductivity: 10
specific_internal_energy_rate: 1.0
initial_temperature: 293

fea_module_parameters:
- type: Inertial
material_id: 0
inertia_center_x: 0
inertia_center_y: 0
inertia_center_z: 0

- type: Elasticity
material_id: 0
# Dirichlet conditions
boundary_conditions:
- surface:
type: z_plane
plane_position: 0.0
type: displacement
value: 0.0

# Loading/Neumann Conditions
loading_conditions:
- surface:
type: z_plane
plane_position: 100.0
type: surface_traction
component_x: 500
component_y: 0
component_z: 0

- type: Heat_Conduction
material_id: 0
# Dirichlet conditions
boundary_conditions:
- surface:
type: z_plane
plane_position: 0.0
type: temperature
value: 293.0

# Loading/Neumann Conditions
loading_conditions:
- surface:
type: z_plane
plane_position: 100.0
type: surface_heat_flux
#can be normal (q dot n) or coordinated (vector q) for curved surfaces
specification: normal
flux_value: -0.1

optimization_options:
optimization_process: topology_optimization
method_of_moving_asymptotes: false
density_epsilon: 0.001
simp_penalty_power: 3
rol_params:
subproblem_algorithm: trust_region
initial_constraint_penalty: 1.e1
step_tolerance: 1.e-5
gradient_tolerance: 1.e-5
constraint_tolerance: 1.e-5
iteration_limit: 5
optimization_objective: multi_objective
#Weight coefficients should add up to 1
multi_objective_structure: linear
multi_objective_modules:
- type: minimize_thermal_resistance
weight_coefficient: 0.25
- type: minimize_compliance
weight_coefficient: 0.75

constraints:
- type: mass
relation: equality
value: 0.25
- type: moment_of_inertia
relation: equality
component: yy
value: 0.35
- type: moment_of_inertia
relation: equality
component: xy
value: 0.0

0 comments on commit fe0ecde

Please sign in to comment.