Skip to content

Commit dae6563

Browse files
authored
Merge pull request #142 from anshgupta1234/intel
2 parents cf11592 + 4a2f046 commit dae6563

File tree

3 files changed

+58
-27
lines changed

3 files changed

+58
-27
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,18 @@ jobs:
2323
include:
2424
- os: ubuntu-latest
2525
debug: --no-debug
26+
intel: false
2627
- os: ubuntu-latest
2728
debug: --debug
29+
intel: false
30+
- os: ubuntu-latest
31+
debug: --no-debug
32+
intel: true
33+
intel-command: source /opt/intel/oneapi/setvars.sh
34+
- os: ubuntu-latest
35+
debug: --debug
36+
intel: true
37+
intel-command: source /opt/intel/oneapi/setvars.sh
2838
- os: macos-latest
2939
debug: --no-debug
3040
gcc: 11
@@ -36,7 +46,7 @@ jobs:
3646
- name: Clone
3747
uses: actions/checkout@v3
3848

39-
- name: Setup
49+
- name: Setup MacOS
4050
if: matrix.os == 'macos-latest'
4151
run: |
4252
echo "OMPI_FC=gfortran-${{ matrix.gcc }}" >> $GITHUB_ENV
@@ -48,21 +58,46 @@ jobs:
4858
brew install wget make python make cmake coreutils gcc@${{ matrix.gcc }}
4959
HOMEBREW_MAKE_JOBS=$(nproc) brew install --cc=gcc-${{ matrix.gcc }} --verbose --build-from-source open-mpi
5060
51-
- name: Setup
52-
if: matrix.os == 'ubuntu-latest'
61+
- name: Setup Ubuntu
62+
if: matrix.os == 'ubuntu-latest' && matrix.intel == false
5363
run: sudo apt install tar wget make cmake gcc g++ python3 python3-dev "openmpi-*" libopenmpi-dev
54-
64+
65+
- name: Setup Ubuntu (Intel)
66+
if: matrix.os == 'ubuntu-latest' && matrix.intel == true
67+
run: |
68+
sudo apt install tar wget make cmake python3 python3-dev
69+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
70+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
71+
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
72+
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
73+
sudo apt-get update
74+
sudo apt-get install -y intel-oneapi-common-vars intel-oneapi-compiler-fortran-2022.1.0 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0 intel-oneapi-mkl-2021.4.0 intel-oneapi-mpi-2021.7.1 intel-oneapi-mpi-devel-2021.7.1
75+
source /opt/intel/oneapi/setvars.sh
76+
echo "CXX=$(which icpc)" >> $GITHUB_ENV
77+
echo "CC=$(which icc)" >> $GITHUB_ENV
78+
echo "FC=$(which ifort)" >> $GITHUB_ENV
79+
echo "OMPI_FC=$(which ifort)" >> $GITHUB_ENV
80+
echo "OMPI_CXX=$(which icpc)" >> $GITHUB_ENV
81+
echo "OMPI_MPICC=$(which icc)" >> $GITHUB_ENV
82+
echo "MPI_HOME=/opt/intel/oneapi/mpi/2021.7.1/" >> $GITHUB_ENV
83+
5584
- name: Build
56-
run: /bin/bash mfc.sh build -j $(nproc) ${{ matrix.debug }}
85+
run: |
86+
${{ matrix.intel-command }}
87+
/bin/bash mfc.sh build -j $(nproc) ${{ matrix.debug }}
5788
58-
- name: Test Suite
89+
- name: Test Suite (Debug)
5990
if: matrix.debug == '--debug'
60-
run: /bin/bash mfc.sh test -j $(nproc) --debug
61-
62-
- name: Test Suite
91+
run: |
92+
${{ matrix.intel-command }}
93+
/bin/bash mfc.sh test -j $(nproc) --debug
94+
95+
- name: Test Suite (No Debug)
6396
if: matrix.debug == '--no-debug'
64-
run: /bin/bash mfc.sh test -j $(nproc) -a
65-
97+
run: |
98+
${{ matrix.intel-command }}
99+
/bin/bash mfc.sh test -j $(nproc) -a
100+
66101
self-cpu:
67102
name: (Self) Test Suite - CPU
68103
strategy:
@@ -143,7 +178,7 @@ jobs:
143178
module use /opt/nvidia/hpc_sdk/modulefiles/
144179
module load nvhpc
145180
/bin/bash mfc.sh test -j 8 -b mpirun --gpu -a
146-
181+
147182
# self-gpu-debug:
148183
# name: (Self) Test Suite - GPU - debug
149184
# strategy:

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
104104
)
105105
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
106106
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-free>)
107+
108+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
109+
add_compile_options(-g -O0 -traceback -debug)
110+
endif()
107111
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
108112
add_compile_options(
109113
$<$<COMPILE_LANGUAGE:Fortran>:-Mfreeform>

src/simulation/m_rhs.fpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ contains
178178
!! other procedures that are necessary to setup the module.
179179
subroutine s_initialize_rhs_module() ! ---------------------------------
180180

181-
integer :: i, j, k, l !< Generic loop iterators
181+
integer :: i, j, k, l, d !< Generic loop iterators
182182

183183
! Configuring Coordinate Direction Indexes =========================
184184
ix%beg = -buff_size; iy%beg = 0; iz%beg = 0
@@ -308,7 +308,6 @@ contains
308308
iy%beg:iy%end, iz%beg:iz%end, 1:sys_size))
309309

310310
end if
311-
312311
! Allocation of dq_prim_ds_qp ======================================
313312

314313
if (any(Re_size > 0)) then
@@ -448,7 +447,6 @@ contains
448447
end if
449448
end if
450449
end if
451-
452450
! ==================================================================
453451

454452
! Allocation of gm_alphaK_n =====================================
@@ -547,7 +545,6 @@ contains
547545

548546
end if
549547
end do
550-
551548
! END: Allocation/Association of flux_n, flux_src_n, and flux_gsrc_n ===
552549

553550
if (alt_soundspeed) then
@@ -575,7 +572,6 @@ contains
575572
!$acc update device(Res, Re_idx, Re_size)
576573
end if
577574

578-
579575
! Associating procedural pointer to the subroutine that will be
580576
! utilized to calculate the solution of a given Riemann problem
581577
if (riemann_solver == 1) then
@@ -584,6 +580,7 @@ contains
584580
s_riemann_solver => s_hllc_riemann_solver
585581
end if
586582

583+
587584
! Associating the procedural pointer to the appropriate subroutine
588585
! that will be utilized in the conversion to the mixture variables
589586
if (model_eqns == 1) then ! Gamma/pi_inf model
@@ -597,20 +594,15 @@ contains
597594
s_convert_species_to_mixture_variables
598595
end if
599596

600-
!$acc parallel loop collapse(4) gang vector default(present)
597+
598+
!$acc parallel loop collapse(5) gang vector default(present)
601599
do i = 1, sys_size
602600
do l = startz, p - startz
603601
do k = starty, n - starty
604602
do j = startx, m - startx
605-
flux_gsrc_n(1)%vf(i)%sf(j, k, l) = 0d0
606-
607-
if (n > 0) then
608-
flux_gsrc_n(2)%vf(i)%sf(j, k, l) = 0d0
609-
end if
610-
611-
if (p > 0) then
612-
flux_gsrc_n(3)%vf(i)%sf(j, k, l) = 0d0
613-
end if
603+
do d = 1, num_dims
604+
flux_gsrc_n(d)%vf(i)%sf(j, k, l) = 0d0;
605+
end do
614606
end do
615607
end do
616608
end do

0 commit comments

Comments
 (0)