oneAPI-samples icon indicating copy to clipboard operation
oneAPI-samples copied to clipboard

Default optimization

Open chuckyount opened this issue 4 years ago • 5 comments

The README states that the default build for the OpenMP iso3dfd code creates the baseline w/o any optimizations. It appears that the default build is actually level-3 optimization. To build without optimization, you have to use cmake -DUSE_OPT3=0 ...

chuckyount avatar Sep 10 '21 17:09 chuckyount

Referring to this README: https://github.com/oneapi-src/oneAPI-samples/blob/master/DirectProgramming/C%2B%2B/StructuredGrids/iso3dfd_omp_offload/README.md

chuckyount avatar Sep 10 '21 18:09 chuckyount

@slgogar - Hey Sunny, can you look into this, please. If possible a fix asap would be appreciated as we are in validation now

JoeOster avatar Sep 21 '21 08:09 JoeOster

@JoeOster @chuckyount i am not able to reproduce the problem mentioned above.

[slgogar@hostname iso3dfd_omp_offload]$ git diff src/CMakeLists.txt [slgogar@hostname iso3dfd_omp_offload]$ git diff CMakeLists.txt [slgogar@hostname iso3dfd_omp_offload]$ cd build_test/ [slgogar@hostname build_test]$ source /opt/intel/oneapi/setvars.sh

[slgogar@hostname build_test]$ cmake .. -- The C compiler identification is GNU 8.4.1 -- The CXX compiler identification is Clang 13.0.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /opt/intel/oneapi/compiler/2021.3.0/linux/bin/icpx -- Check for working CXX compiler: /opt/intel/oneapi/compiler/2021.3.0/linux/bin/icpx -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using Baseline target code -- Configuring done -- Generating done -- Build files have been written to: /oneAPI-samples/DirectProgramming/C++/StructuredGrids/iso3dfd_omp_offload/build_test

If you already compiled for some optimization path for example - "cmake -DUSE_OPT1=1 .." then in order to go back to the baseline version you will have to either clean the build directory (rm -rf build) or use "cmake -DUSE_OPT1=0 .." OR use "ccmake .." to configure the optimization level as desired. Chosen optimized version is printed in cmake output for users reference.

slgogar avatar Sep 22 '21 17:09 slgogar

Yes, the problem was as you mentioned: I had used OPT3, then tried to go back to baseline. Maybe this scenario should be better documented.

chuckyount avatar Oct 04 '21 23:10 chuckyount

@slgogar - Hey What are your thoughts on documentation improvements?

JoeOster avatar Oct 08 '21 18:10 JoeOster

OneSmpl_Team1 working on this

bopeng1234 avatar Apr 25 '23 01:04 bopeng1234