Giter Club home page Giter Club logo

Comments (11)

Chongran-Zhao avatar Chongran-Zhao commented on June 3, 2024

I have parallelize part of following functions in a new branch [openmp-dev-linux] of repo called M3C-Lab/PERIGEE-viv2022:

  • GmshFIleIO::write_vtp() in M3C-Lab/PERIGEE-viv2022/src/Mesh/
  • GmshFileIO::write_each_vtu() in M3C-Lab/PERIGEE-viv2022/src/Mesh/
  • Part_Tet::Generate_Partition() in M3C-Lab/PERIGEE-viv2022/src/Mesh/
  • NodalBC_3D_FSI::NodalBC_3D_FSI() in M3C-Lab/PERIGEE-viv2022/examples/tet4_fsi/src/
  • NodalBC_3D_vtu::NodalBC_3D_vtu() in M3C-Lab/PERIGEE-viv2022/src/Mesh/.

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024
  • openmp的计时功能
  • openmp的配置
  • openmp的报错信息处理

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

https://stackoverflow.com/questions/49816206/cmake-find-package-specify-path

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

https://stackoverflow.com/questions/56166109/detect-at-runtime-if-openmp-is-being-used-in-a-c-program

from perigee.

Chongran-Zhao avatar Chongran-Zhao commented on June 3, 2024

使用cmake自带的FindOpenMP.cmake进行配置,在system_lib_loading.cmake内修改

  • 添加:
set(OpenMP_ROOT /Users/chongran/lib/lib-omp)

find_package(OpenMP REQUIRED)

include_directories(${OpenMP_CXX_INCLUDE_DIR})

set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${OpenMP_CXX_LIBRARIES})

if(OPENMP_CXX_FOUND) 
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
  • 修改:
if( ${CMAKE_BUILD_TYPE} MATCHES "Release" )
  set(CMAKE_CXX_FLAGS " -O3 -Wall ")
else( ${CMAKE_BUILD_TYPE} MATCHES "Release" )
  set(CMAKE_CXX_FLAGS " -DENABLE_TEST -O0 -Wall ")
endif( ${CMAKE_BUILD_TYPE} MATCHES "Release" )

变为

if( ${CMAKE_BUILD_TYPE} MATCHES "Release" )
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wall ")
else( ${CMAKE_BUILD_TYPE} MATCHES "Release" )
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_TEST -O0 -Wall ")
endif( ${CMAKE_BUILD_TYPE} MATCHES "Release" )

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

Conditional use of OpenMP

https://stackoverflow.com/questions/56717411/control-conditional-openmp-in-define-macro

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

https://stackoverflow.com/questions/45477355/difference-between-pragma-and-pragma-in-c

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

https://www.dealii.org/current/doxygen/deal.II/config_8h_source.html

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

我们或许可以调控对每个exeutable文件的编译flag,参考这个
https://stackoverflow.com/questions/24238937/how-to-change-a-compiler-flag-for-just-one-executable-in-cmake

@ZhaoChongran

from perigee.

ju-liu avatar ju-liu commented on June 3, 2024

[] 我们还需要在程序里面设置omp_num_threads,避免环境变量里面没有设置这个参数。

[] 我们需要在Sys_Tools中加入一个 print函数 能够把当前的线程个数打印出来。

@ZhaoChongran

from perigee.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.