Skip to content

Commit e0cfa3b

Browse files
authored
Merge pull request #1801 from danielpeter/devel
updates github action script; shortens routine/variable names to avoid compiler warnings
2 parents ebb78bd + fd59015 commit e0cfa3b

17 files changed

+351
-213
lines changed

.github/workflows/CI.yml

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
#sudo -E apt-cache pkgnames intel | grep intel-oneapi
192192
#echo ""
193193
echo "installing packages intel oneapi:"
194-
sudo apt-get install -y intel-oneapi-compiler-fortran-2023.2.2 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.2 intel-oneapi-mpi intel-oneapi-mpi-devel
194+
sudo apt-get install -y intel-oneapi-compiler-fortran-2023.2.2 intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.2.2 intel-oneapi-mpi-2021.14 intel-oneapi-mpi-devel-2021.14
195195
echo ""
196196
197197
- name: compiler infos
@@ -298,6 +298,137 @@ jobs:
298298
run: |
299299
make tests
300300
301+
linuxCheck-Intel-ifx:
302+
name: Test Intel ifx on ubuntu-latest
303+
runs-on: ubuntu-latest
304+
needs: changesCheck
305+
306+
steps:
307+
- uses: actions/checkout@v4
308+
309+
- name: Cache Intel oneapi packages
310+
id: cache-intel-oneapi-ifx
311+
uses: actions/cache@v4
312+
with:
313+
path: /opt/intel/oneapi
314+
key: install-${{ runner.os }}-ifx-all
315+
316+
- name: Install packages
317+
if: steps.cache-intel-oneapi-ifx.outputs.cache-hit != 'true'
318+
run: |
319+
# new way
320+
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
321+
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
322+
echo ""
323+
sudo apt-get update
324+
echo ""
325+
# info
326+
#sudo -E apt-cache pkgnames intel | grep intel-oneapi
327+
#echo ""
328+
echo "installing packages intel oneapi:"
329+
sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mpi intel-oneapi-mpi-devel
330+
echo ""
331+
332+
- name: compiler infos
333+
run: |
334+
echo ""
335+
source /opt/intel/oneapi/setvars.sh
336+
echo ""
337+
echo "compiler versions:"
338+
echo "icx --version"
339+
which icx
340+
icx --version
341+
echo ""
342+
echo "ifx --version"
343+
which ifx
344+
ifx --version
345+
echo ""
346+
echo "mpiifx --version"
347+
which mpiifx
348+
mpiifx --version
349+
echo ""
350+
echo "mpif90 --version"
351+
which mpif90
352+
mpif90 --version
353+
echo ""
354+
# infos
355+
which ifx
356+
which icx
357+
which mpiifx
358+
echo "mpirun:"
359+
which mpirun
360+
echo ""
361+
# intel setup for running tests
362+
echo ""
363+
echo "replacing mpif90 with mpiifx link:"
364+
sudo ln -sf $(which mpiifx) $(which mpif90)
365+
mpif90 --version
366+
echo ""
367+
# debug
368+
#export I_MPI_DEBUG=5,pid,host
369+
#export I_MPI_LIBRARY_KIND=debug
370+
# remove -ftrapuv which leads to issues for running tests
371+
sed -i "s/-ftrapuv//g" flags.guess
372+
# environment setting
373+
export TERM=xterm
374+
# export info
375+
echo "exports:"
376+
export
377+
echo ""
378+
echo ""
379+
printenv >> $GITHUB_ENV
380+
echo "CXX=icx" >> $GITHUB_ENV
381+
echo "CC=icx" >> $GITHUB_ENV
382+
echo "FC=ifx" >> $GITHUB_ENV
383+
echo ""
384+
385+
- name: configure serial debug
386+
run: |
387+
set +e # revert the default `set -e`
388+
./configure --enable-debug --without-mpi FC=ifx CC=icx
389+
if [[ $? -ne 0 ]]; then echo "configuration failed:"; cat config.log; echo ""; echo "exiting..."; exit 1; fi
390+
391+
- name: make serial debug
392+
run: |
393+
make -j2 all
394+
make -j2 all --always-make
395+
make clean
396+
397+
- name: configure serial
398+
run: |
399+
./configure --without-mpi FC=ifx CC=icx
400+
401+
- name: make serial
402+
run: |
403+
make -j2 all
404+
make clean
405+
406+
- name: configure parallel debug
407+
run: |
408+
set +e # revert the default `set -e`
409+
./configure --enable-debug --with-mpi FC=ifx CC=icx MPIFC=mpiifx MPI_INC="${I_MPI_ROOT}/include"
410+
if [[ $? -ne 0 ]]; then echo "configuration failed:"; cat config.log; echo ""; echo "exiting..."; exit 1; fi
411+
412+
- name: make parallel debug
413+
run: |
414+
make -j2 all
415+
make -j2 all --always-make
416+
make clean
417+
418+
- name: configure parallel
419+
run: |
420+
./configure --with-mpi FC=ifx CC=icx MPIFC=mpiifx MPI_INC="${I_MPI_ROOT}/include"
421+
422+
- name: make parallel
423+
run: |
424+
make -j2 all
425+
make clean
426+
427+
# note: fails with -ftrapuv flag due to MPI issue on virtual nodes
428+
- name: make tests
429+
run: |
430+
make tests
431+
301432
linuxTest_0:
302433
name: Test 0 - make tests
303434
runs-on: ubuntu-latest

flags.guess

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ case $my_FC in
9898
# option "-openmp" is soon deprecated and replaced by "-qopenmp" for versions > 17.x
9999
OMP_FFLAGS="-qopenmp"
100100
;;
101+
ifx|*/ifx)
102+
#
103+
# Intel ifx Fortran for Linux
104+
# check: https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-ifort-to-ifx.html
105+
#
106+
DEF_FFLAGS="-xHost -fpe0 -ftz -assume buffered_io -assume byterecl -align sequence -std08 -diag-disable 6477 -implicitnone -gen-interfaces -warn all,noexternal"
107+
OPT_FFLAGS="-O3 -check nobounds"
108+
DEBUG_FFLAGS="-check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv"
109+
OMP_FFLAGS="-qopenmp"
110+
;;
101111
gfortran|*/gfortran|f95|*/f95)
102112
#
103113
# GNU gfortran

src/generate_databases/model_gll.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ subroutine model_gll(myrank,nspec,LOCAL_PATH)
180180
rho_vs(:,:,:,:) = rhostore(:,:,:,:) * vs_read(:,:,:,:)
181181

182182
if (ANISOTROPY) then
183-
183+
184184
! c11
185185
if (myrank == 0) write(IMAIN,*) ' reading in: c11.bin'
186186

@@ -284,7 +284,7 @@ subroutine model_gll(myrank,nspec,LOCAL_PATH)
284284

285285
read(IIN) c23store
286286
close(IIN)
287-
287+
288288
! c24
289289
if (myrank == 0) write(IMAIN,*) ' reading in: c24.bin'
290290

@@ -349,7 +349,7 @@ subroutine model_gll(myrank,nspec,LOCAL_PATH)
349349

350350
read(IIN) c34store
351351
close(IIN)
352-
352+
353353
! c35
354354
if (myrank == 0) write(IMAIN,*) ' reading in: c35.bin'
355355

src/gpu/compute_stacey_acoustic_cuda.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ void FC_FUNC_(compute_stacey_acoustic_undoatt_cuda,
282282
GPU_ERROR_CHECKING("compute_stacey_acoustic_undoatt_cuda");
283283
}
284284

285-
extern EXTERN_LANG
285+
extern EXTERN_LANG
286286
void FC_FUNC_(compute_coupled_injection_contribution_ac_device,
287287
COMPUTE_COUPLED_INJECTION_CONTRIBUTION_AC_DEVICE) (long *Mesh_pointer,
288288
realw* b_boundary_injection_potential,
@@ -317,7 +317,7 @@ void FC_FUNC_(compute_coupled_injection_contribution_ac_device,
317317
SAVE_STACEY,mp->d_num_abs_boundary_faces,mp->d_b_boundary_injection_potential
318318
);
319319
}
320-
#endif
320+
#endif
321321
#ifdef USE_HIP
322322
if (run_hip){
323323
hipLaunchKernelGGL(compute_stacey_acoustic_injection_kernel,dim3(grid), dim3(threads), 0, mp->compute_stream,

src/gpu/kernels/compute_stacey_acoustic_kernel.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ __global__ void compute_stacey_acoustic_injection_kernel(const realw* veloc_inj,
321321
nx = abs_boundary_normal[INDEX3(NDIM,NGLL2,0,igll,iface)];
322322
ny = abs_boundary_normal[INDEX3(NDIM,NGLL2,1,igll,iface)];
323323
nz = abs_boundary_normal[INDEX3(NDIM,NGLL2,2,igll,iface)];
324-
325-
// n \cdot u
324+
325+
// n \cdot u
326326
un = ux * nx + uy * ny + uz * nz;
327327
un += chi_dot /(cpl * rhol);
328-
328+
329329
// gets associated, weighted jacobian
330330
jacobianw = abs_boundary_jacobian2Dw[INDEX2(NGLL2,igll,iface)];
331331

src/gpu/kernels/kernel_proto.cu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ __global__ void compute_stacey_elastic_undoatt_kernel(realw* veloc,
911911
int num_abs_boundary_faces) ;
912912

913913
// nqdu added
914-
__global__ void
914+
__global__ void
915915
compute_stacey_elastic_injection_kernel(const realw* veloc_inj,
916916
const realw* tract_inj,
917917
realw* accel,
@@ -944,7 +944,7 @@ __global__ void compute_stacey_acoustic_injection_kernel(const realw* veloc_inj,
944944
int SAVE_STACEY,
945945
int num_abs_boundary_faces,
946946
field* b_boundary_injection_potential
947-
);
947+
);
948948

949949
//
950950
// src/gpu/kernels/enforce_free_surface_cuda_kernel.cu

src/meshfem3D/earth_chunk.f90

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,8 @@ subroutine earth_chunk_HEX8_Mesher(NGNOD)
507507

508508

509509
call calc_gll_points(xelm,yelm,zelm,xstore,ystore,zstore,shape3D,NGNOD,NGLLX,NGLLY,NGLLZ)
510-
call write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,ystore,zstore, &
511-
deg2rad,ilayer,iboun,ispec,nspec,longitud, &
512-
latitud,radius,rotation_matrix,updown)
510+
call write_all_chunk_surface_GLL(xstore,ystore,zstore,deg2rad,ilayer,iboun,ispec,nspec,longitud, &
511+
latitud,radius,rotation_matrix,updown)
513512

514513
endif
515514

@@ -1317,9 +1316,8 @@ subroutine earth_chunk_HEX27_Mesher(NGNOD)
13171316

13181317

13191318
call calc_gll_points(xelm,yelm,zelm,xstore,ystore,zstore,shape3D,NGNOD,NGLLX,NGLLY,NGLLZ)
1320-
call write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,ystore,zstore, &
1321-
deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1322-
latitud,radius,rotation_matrix,updown)
1319+
call write_all_chunk_surface_GLL(xstore,ystore,zstore,deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1320+
latitud,radius,rotation_matrix,updown)
13231321

13241322
endif
13251323

@@ -1935,9 +1933,8 @@ end subroutine write_gllz_points
19351933
!
19361934
!! Used (among other) for VM coupling with AxiSEM
19371935

1938-
subroutine write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,ystore,zstore, &
1939-
deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1940-
latitud,radius,rotation_matrix,updown)
1936+
subroutine write_all_chunk_surface_GLL(xstore,ystore,zstore,deg2rad,ilayer,iboun,ispec,nspec,longitud, &
1937+
latitud,radius,rotation_matrix,updown)
19411938

19421939
use constants, only: NGLLX, NGLLY, NGLLZ, &
19431940
INJECTION_TECHNIQUE_IS_DSM, INJECTION_TECHNIQUE_IS_AXISEM
@@ -2133,7 +2130,7 @@ subroutine write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords(xstore,
21332130

21342131
endif
21352132

2136-
end subroutine write_all_chunk_surface_GLL_in_spherical_and_Cartesian_coords
2133+
end subroutine write_all_chunk_surface_GLL
21372134

21382135
!
21392136
!=======================================================================================================

src/specfem3D/compute_stacey_acoustic.f90

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ subroutine compute_coupled_injection_contribution_ac(NGLOB_AB,potential_dot_dot_
566566
! point index using table lookup
567567
ipt = ipt_table(igll,iface)
568568

569-
! interpolates velocity/stress
569+
! interpolates velocity/stress
570570
! nqdu NOT CORRECT!!!
571571
! vx_FK = cs1 * Veloc_FK(1,ipt,iim1) + cs2 * Veloc_FK(1,ipt,ii) + cs3 * Veloc_FK(1,ipt,iip1) + cs4 * Veloc_FK(1,ipt,iip2)
572572
! vy_FK = cs1 * Veloc_FK(2,ipt,iim1) + cs2 * Veloc_FK(2,ipt,ii) + cs3 * Veloc_FK(2,ipt,iip1) + cs4 * Veloc_FK(2,ipt,iip2)
@@ -575,7 +575,7 @@ subroutine compute_coupled_injection_contribution_ac(NGLOB_AB,potential_dot_dot_
575575
! tx_FK = cs1 * Tract_FK(1,ipt,iim1) + cs2 * Tract_FK(1,ipt,ii) + cs3 * Tract_FK(1,ipt,iip1) + cs4 * Tract_FK(1,ipt,iip2)
576576
! ty_FK = cs1 * Tract_FK(2,ipt,iim1) + cs2 * Tract_FK(2,ipt,ii) + cs3 * Tract_FK(2,ipt,iip1) + cs4 * Tract_FK(2,ipt,iip2)
577577
! tz_FK = cs1 * Tract_FK(3,ipt,iim1) + cs2 * Tract_FK(3,ipt,ii) + cs3 * Tract_FK(3,ipt,iip1) + cs4 * Tract_FK(3,ipt,iip2)
578-
578+
579579
! now displ/chi_dot are saved in veloc_fk/tract_fk
580580
ux_FK = cs1 * Veloc_FK(1,ipt,iim1) + cs2 * Veloc_FK(1,ipt,ii) + &
581581
cs3 * Veloc_FK(1,ipt,iip1) + cs4 * Veloc_FK(1,ipt,iip2)
@@ -585,7 +585,7 @@ subroutine compute_coupled_injection_contribution_ac(NGLOB_AB,potential_dot_dot_
585585
cs3 * Veloc_FK(3,ipt,iip1) + cs4 * Veloc_FK(3,ipt,iip2)
586586
chi_dot_FK = cs1 * Tract_FK(1,ipt,iim1) + cs2 * Tract_FK(1,ipt,ii) + &
587587
cs3 * Tract_FK(1,ipt,iip1) + cs4 * Tract_FK(1,ipt,iip2)
588-
588+
589589
! velocity
590590
! vx = - vx_FK
591591
! vy = - vy_FK
@@ -642,7 +642,7 @@ subroutine compute_coupled_injection_contribution_ac(NGLOB_AB,potential_dot_dot_
642642
! here, it is added to first undo the factor (rhol*cpl) used to add the velocity contribution to the traction together
643643
! with another (rhol*cpl) used in the expressions of the Sommerfeld condition, where
644644
! absorbl = potential_dot_acoustic(iglob) * jacobianw / cpl / rhol
645-
645+
646646
un = ux*nx + uy*ny + uz*nz
647647
un = un + chi_dot / (rhol * cpl)
648648

@@ -673,25 +673,25 @@ end subroutine compute_coupled_injection_contribution_ac
673673
subroutine compute_coupled_injection_contribution_ac_GPU(iphase,Mesh_pointer)
674674

675675
use constants
676-
676+
677677
use specfem_par, only: SAVE_STACEY,SIMULATION_TYPE
678-
679-
use specfem_par, only: num_abs_boundary_faces
680-
678+
679+
use specfem_par, only: num_abs_boundary_faces
680+
681681
! boundary coupling
682682
use shared_parameters, only: COUPLE_WITH_INJECTION_TECHNIQUE
683683
! boundary injection wavefield parts for saving together with b_absorb_field
684684
use specfem_par_coupling, only: b_boundary_injection_potential
685-
685+
686686
implicit none
687-
687+
688688
! communication overlap
689689
integer,intent(in) :: iphase
690-
690+
691691
! GPU_MODE variables
692692
integer(kind=8),intent(in) :: Mesh_pointer
693693

694-
694+
695695
! safety checks
696696
if (.not. COUPLE_WITH_INJECTION_TECHNIQUE) return
697697

@@ -703,13 +703,13 @@ subroutine compute_coupled_injection_contribution_ac_GPU(iphase,Mesh_pointer)
703703

704704
! only for forward wavefield
705705
if (SIMULATION_TYPE /= 1) return
706-
707-
706+
707+
708708
! compute contribution in device
709-
call compute_coupled_injection_contribution_ac_device(Mesh_pointer,&
710-
b_boundary_injection_potential,&
709+
call compute_coupled_injection_contribution_ac_device(Mesh_pointer, &
710+
b_boundary_injection_potential, &
711711
SAVE_STACEY)
712-
713-
712+
713+
714714
end subroutine compute_coupled_injection_contribution_ac_GPU
715-
715+

0 commit comments

Comments
 (0)