Skip to content

CMake for funtofem#6

Open
acrovato wants to merge 14 commits into
smdogroup:masterfrom
acrovato:master
Open

CMake for funtofem#6
acrovato wants to merge 14 commits into
smdogroup:masterfrom
acrovato:master

Conversation

@acrovato

@acrovato acrovato commented Oct 26, 2021

Copy link
Copy Markdown

Context

This PR replaces the traditional Makefiles by the CMake build tools to enable cross-platform compilation.

Changes

  • all the Makefiles have been deleted and replaced by CMakeLists.txt
  • the setup.py has been updated for Windows (look/add MKL libs)
  • the funtofem/init.py has been updated for Windows (add DLL at runtime)
  • the headers have been updated for Windows (export/import instructions for DLL)

Notes

  • I added 3 options for CMake (first choice is the default):
    • -DCMAKE_BUILD_TYPE=Release|Debug, to compile in release or debug,
    • -DUSE_COMPLEX=OFF|ON, to use real or complex numbers,
    • -DUSE_MKL=ON|OFF, to use Intel MKL instead of openblas.
  • The build on windows might fail. I managed to track down the issue to python's distutils, which calls the old spawn command. Replacing it by the newer subprocess, as described in the README, fixes the issue. Hopefully, this will be patched in future releases of distutils or setuptools. Another way to go would be to compile the python interface directly using CMake, and then only resorting to setuptools to install the package.
  • I have not tested anything else than Intel MKL and MSMPI on Windows. openblas and openMPI will probably require some updating.

Tests

I successfully ran "tests_scheme" and imported the python interface on:

  • Ubuntu 22.04 (gcc 11.2, python 3.10, openMPI, Intel oneMKL 2020.4)
  • Ubuntu 20.04 (gcc 9.3, python 3.8, openMPI, Intel MKL 2019.2)
  • Ubuntu 18.04 (gcc 7.4, python 3.6, openMPI, Intel MKL 2019.2)
  • Windows 10 (vs2019, python 3.8, MSMPI 10, Intel MKL 2021.3)

@acrovato

Copy link
Copy Markdown
Author

I have also updated .github/workflows/unit_test.yml. I have not tested it, as I thought it would be triggered by the PR. Is there a way to run it manually?

@LHalim

LHalim commented Oct 26, 2021

Copy link
Copy Markdown
Contributor

Apparently, there are known issues with running actions when initiating a pull request from a forked repo. A workaround is to push to your forked repo to run the actions there, and then submit a pr after a successful run.

Another workaround is to add workflow_dispatch to the unit_test.yml to allow for the actions to be run manually. More details here: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#workflow_dispatch

Comment thread .github/workflows/unit_tests.yml Outdated
else
python3 setup.py build_ext --inplace
fi
# cp Makefile.in.info Makefile.in;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These commented lines are causing an error that prevents the workflow to run. Should delete lines 97-100.

@acrovato

Copy link
Copy Markdown
Author

Actions were not enabled by default on my fork, hence did not run. Everything is building and running
fine now.

Thanks for your advice!

bburke38 added a commit that referenced this pull request Aug 25, 2022
bburke38 added a commit that referenced this pull request Mar 28, 2024
* update ssw testing caseS

* update the turbulence settings

* change turbulent conv settings

* Mass no adjoint SSW case 4 merge into SSW Turbulent example (#6)

* stupid simple wing prototype (#268)

* Define aero problem and conditions.

* Wing structural model ESP/CAPS

* Update .gitignore

* SSW structural model

Rename wing.udc to wingStuct.udc for clarity.
Completed structural model of SSW in ESP/CAPS.

* SSW aerodynamic model

* Full SSW ESP/CAPS model

* Completed meshing scripts for SSW

* Update 1_panel_thickness.py

* Initial CFD run

* Working oneway sizing optimization

* Update 1_panel_thickness.py

* Update 1_panel_thickness.py

* Initial version of 2_aero_aoa

* Update 2_aero_aoa.py

* Update sizing.txt

* Update ssw-sizing_history.png

* Update _mesh_fun3d.py

* Update 3_geom_twist.py

* Update fun3d.nml

* Update design file naming conventions

* Update 3_geom_twist.py

* Update 4_oml_shape.py

* Formatting

* Update 2_aero_aoa.py

* Update 4_oml_shape.py

* Update SSW branch (#275)

* Update esp/caps download (#271)

* Update esp/caps download

* Update tar command in unit-test workflow

* Fix ESP124 folder name

* FUN3D clean up: fix logic in shape driver and remove build_morph method in fun3d_model (#272)

* Update funtofem_shape_driver.py

* Update fun3d_model.py

Delete redundant build_morph method and add documentation to build method.

* Print out a summary of the driver instance for inspection (#273)

* Clean up the model summary

Added methods to print out a summary of the driver set up, including details on the solvers, shape change, mesh change, transfer settings, and comm manager.

Cleaned up the model summary to print more neatly using standard spacings rather than arbitrary tabs.

Small bug fix in `funtofem_shape_driver.py` associated with trying to delete the structural model at the end of the adjoint. Originally implemented to free up memory, but the implementation was attempting to delete an attribute which leads to an Attribute Error.

* Create driver summary methods

* Move print_transfer to _funtofem_driver

Move _print_transfer method to _funtofem_driver so that all drivers can inherit the method. Also changed the generic driver summary in _funtofem_driver.

* Formatting

* Make transfer_settings an attribute of base driver

Add attribute to the base driver class for the transfer_settings, including a check for None. Remove attribution in the shape driver.

* Typo in base driver

* Formatting

* Read in inactive variables from design files (#274)

* Root proc check on _setDictOptions for AFLR AIM

* Add ability to read inactive variables from previous designs

---------

Co-authored-by: Sean Engelstad <sean.engelstad1@gmail.com>

* Redefine geometry

Set all twists to default to zero.
Use blend instead of rule.

* Create _2_cfd_only.py

* Update _oneway_sizing to use SNOPT

* Update oneway_aero_driver.py

* Delete naca_wing.csm

* Delete ssw-sizing_history.png

* Update cases to match hpc files

* Add Pointwise meshes

* Update _oneway_sizing.py

* Formatting

* commit ssw 14.0 example

* egads aero mesh example

* prototype ssw finite difference test

* remove reload design file

* update cfl in namelist

* fix steps in namelist

* update panel thickness script

* add FD test for the derivatives

* fix early stopping multi analysis bug

* update ssw 14 fun3d nml

* new aero loads for ssw case

* oneway sizing opt

* updated aerodynamic function fun3d check

* black reformat

* SSW 14.0 Modifications for SNOPT (#295)

* Fix opt manager nan exit (#284)

* fix bug in optimization manager

* Update optimization_manager.py

* Create a generalized mesh AIM. (#286)

* Generalized mesh AIM

* New notation in meshAIM

* Update egads_aim.py

* Update aflr_aim.py

* Formatting

* Update egads_aim.py

* FUNtoFEM read and write unsteady aero loads files (#289)

* working unsteady aero loads files

* black reformat

* FUN3D v14.0.2 interface stable release for thermal cases (#288)

* fun3d 14.0 fun3d interface changes

* add separate fun3d 14 and 13.0 interfaces

* Update fun3d_14_interface.py name to Fun3d14Interface

* update fun3d 14 interface unittests

* update fun3d model

* black reformat

* update fun3d 14.0 thermal changes

* update fun3d 14 interface with debug statements

* new thermal fun3d test

* add new fun3d thermal interface test

* fun3d 14 thermal interface test complete

* update the fun3d 14 thermal interface test

* update the import statements

* black reformat

* black reformat with psf/black-stable

* Apply suggestions from code review

* undo debug changes

* black reformat

* Rollback test_fun3d_tacs.py to FUN3D 13.6 test

* Update test_fun3d_tacs.py to add fun3d_project_name back in

* black reformat

---------

Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* FUN3D 14.0 Coupling Frequency for Coupled Adjoint speedup + Early Stopping Fix (#291)

* huge speedup in funtofem fully coupled adjoint solve

* turn hanim off in turbulent beta nml

* working adjoint derivatives and change adjoint_steps

* working early stopping criterion in FUN3D 14.0.2

* add error check for first aero function w early stopping

* input funtofem loose coupling frequency through the fun3d interface (no longer namelist input)

* update nml for turbulent beta

* black reformat + throw error if FUN3D 13.6 uses loose coupling frequency

* Update funtofem/interface/fun3d_interface.py

---------

Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* commit ssw 14.0 example

* egads aero mesh example

* prototype ssw finite difference test

* remove reload design file

* update cfl in namelist

* fix steps in namelist

* update panel thickness script

* add FD test for the derivatives

* fix early stopping multi analysis bug

* update ssw 14 fun3d nml

* new aero loads for ssw case

* oneway sizing opt

* updated aerodynamic function fun3d check

* black reformat

---------

Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* fix any aerodynamic again

* fix any aerodynamic again

* Fix any aerodynamic function check again (#296)

* Fix opt manager nan exit (#284)

* fix bug in optimization manager

* Update optimization_manager.py

* Create a generalized mesh AIM. (#286)

* Generalized mesh AIM

* New notation in meshAIM

* Update egads_aim.py

* Update aflr_aim.py

* Formatting

* Update egads_aim.py

* FUNtoFEM read and write unsteady aero loads files (#289)

* working unsteady aero loads files

* black reformat

* FUN3D v14.0.2 interface stable release for thermal cases (#288)

* fun3d 14.0 fun3d interface changes

* add separate fun3d 14 and 13.0 interfaces

* Update fun3d_14_interface.py name to Fun3d14Interface

* update fun3d 14 interface unittests

* update fun3d model

* black reformat

* update fun3d 14.0 thermal changes

* update fun3d 14 interface with debug statements

* new thermal fun3d test

* add new fun3d thermal interface test

* fun3d 14 thermal interface test complete

* update the fun3d 14 thermal interface test

* update the import statements

* black reformat

* black reformat with psf/black-stable

* Apply suggestions from code review

* undo debug changes

* black reformat

* Rollback test_fun3d_tacs.py to FUN3D 13.6 test

* Update test_fun3d_tacs.py to add fun3d_project_name back in

* black reformat

---------

Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* FUN3D 14.0 Coupling Frequency for Coupled Adjoint speedup + Early Stopping Fix (#291)

* huge speedup in funtofem fully coupled adjoint solve

* turn hanim off in turbulent beta nml

* working adjoint derivatives and change adjoint_steps

* working early stopping criterion in FUN3D 14.0.2

* add error check for first aero function w early stopping

* input funtofem loose coupling frequency through the fun3d interface (no longer namelist input)

* update nml for turbulent beta

* black reformat + throw error if FUN3D 13.6 uses loose coupling frequency

* Update funtofem/interface/fun3d_interface.py

---------

Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* commit ssw 14.0 example

* egads aero mesh example

* prototype ssw finite difference test

* remove reload design file

* update cfl in namelist

* fix steps in namelist

* update panel thickness script

* add FD test for the derivatives

* fix early stopping multi analysis bug

* update ssw 14 fun3d nml

* new aero loads for ssw case

* oneway sizing opt

* updated aerodynamic function fun3d check

* black reformat

* fix any aerodynamic again

* fix any aerodynamic again

---------

Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* Updated SSW meshes (#297)

* Formatting (#299)

* update tolerances

* merge ssw geometries

* update aero surf mesh

* update

* geomtry orig

* working mass, adjoint False

* working mass function with no adjoint

* remove ssw-14 folder

* update unittest

* fix unittests?

* fix shape driver

* fix tacs interface unsteady with non adjoint functions

* add fix for case 2 ssw testing

* update case 3 ssw testing

* update example 3

* udpate case 3 _ssw-testing

* change scenario fun3d_project_name back

* update optimal designs

* ssw case 4

* update get variables routine for case 4

* remove TODO statements

* fix snoptimizer syntax

* update the ssw case 4 inviscid

* add test struct shape example

---------

Co-authored-by: Burke, Brian <bburke38@gatech.edu>
Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>

* write out forward and adjoint tolerances to design history file (#7)

* new pointwise aim settings

* fix pointwise aim mesher bug

* update pointwise aim

* updated ssw meshdef case

* pointwise aim updates

* rename ssw testing folder to ssw inviscid

* rename 1_panel_thickness in inviscid case

* black reformat

---------

Co-authored-by: Burke, Brian <bburke38@gatech.edu>
Co-authored-by: Brian Burke <97243450+bburke38@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants