Skip to content

Commit

Permalink
GPU added for the bicgstab linear solver
Browse files Browse the repository at this point in the history
  • Loading branch information
imronuke committed Jun 21, 2022
1 parent d6865bc commit 986125d
Show file tree
Hide file tree
Showing 7 changed files with 265 additions and 66 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build/
*.mod
*.o
*.out
45 changes: 11 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,18 @@
cmake_minimum_required(VERSION 3.15)

# set(CMAKE_Fortran_COMPILER nvfortran )
set(CMAKE_Fortran_COMPILER gfortran )
project(komodo Fortran)

option(DEBUG "Debug Mode " off)

if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
set(f90flags "-cpp -fbacktrace -fPIC -ffree-line-length-none")

if(DEBUG)
set(CMAKE_Fortran_FLAGS "-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,overflow,underflow ${f90flags}")
else()
set(CMAKE_Fortran_FLAGS "-O3 ${f90flags}")
endif()

add_definitions(-D__GNU)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
set(f90flags "-fpp -std08 -assume byterecl -traceback -diag-disable 6009 -fPIC -list-line-length-none")

if(DEBUG)
set(CMAKE_Fortran_FLAGS "-g -warn -ftrapuv -fp-stack-check -check all -check:noarg_temp_created -fpe0 ${f90flags}")
else()
set(CMAKE_Fortran_FLAGS "-O3 ${f90flags}")
endif()
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" OR CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
set(f90flags "-Mfree -Mpreprocess -Mbackslash")

if(DEBUG)
set(CMAKE_Fortran_FLAGS "-traceback -Wall -Kieee -Ktrap=fp ${f90flags}")
else()
set(CMAKE_Fortran_FLAGS "-O3 -fast ${f90flags}")
endif()

add_definitions(-D__NVHPC)
option(GPU "Use OpenACC GPU " OFF)

# Set for debug only
if(GPU)
set(CMAKE_Fortran_FLAGS "-fast -ta=tesla:lineinfo -Minfo=accel,ccff -Mfree -Mpreprocess -Mbackslash")
set(CMAKE_Fortran_COMPILER nvfortran )
else()
set(CMAKE_Fortran_FLAGS "-cpp -O3")
set(CMAKE_Fortran_COMPILER gfortran )
endif()

project(komodo Fortran)

file(GLOB SRC_sc ${PROJECT_SOURCE_DIR}/src/*.f90 )
add_executable(komodo ${SRC_sc})

Expand Down
56 changes: 56 additions & 0 deletions smpl/static/FDM3D
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
! IAEA2D input data with FDM nodal kernel

! Mode card
%MODE
FORWARD

! Case card
%CASE
IAEA2D
IAEA2D Benchmark With 16x16 nodes/FA with FDM nodal kernel

%KERN
FDM

%ITER
1200 20 1.e-5 1.e-5 20 40 20 80 ! Set fission interpolation interval every 10 outer iteration

! Cross-sections card
%XSEC
2 4 ! Number of groups and number of materials
! sigtr siga nu*sigf sigf chi sigs_g1 sigs_g2
0.222222 0.010120 0.000000 0.000000 1.000000 0.000000 0.020000
0.833333 0.080032 0.135000 0.135000 0.000000 0.000000 0.000000 ! COMPOSITION 1
0.222222 0.010120 0.000000 0.000000 1.000000 0.000000 0.020000
0.833333 0.085032 0.135000 0.135000 0.000000 0.000000 0.000000 ! COMPOSITION 2
0.222222 0.010120 0.000000 0.000000 1.000000 0.000000 0.020000
0.833333 0.130032 0.135000 0.135000 0.000000 0.000000 0.000000 ! COMPOSITION 3
0.166667 0.000160 0.000000 0.000000 1.000000 0.000000 0.040000
1.111111 0.010024 0.000000 0.000000 0.000000 0.000000 0.000000 ! COMPOSITION 4
! Geometry card
%GEOM
9 9 40 !nx, ny, nz
10.0 8*20.0 !x-direction assembly size in cm
8 8*16 ! 16x16 per FA
8*20.0 10.0 !y-direction assembly size in cm
8*16 8 ! 16x16 per FA
40*1.25 !z-direction assembly in cm
40*1 !z-direction nodal is not divided
1 !np number of planar type
40*1 !planar assignment (from bottom to top)
! Planar
3 2 2 2 3 2 2 1 4
2 2 2 2 2 2 2 1 4
2 2 2 2 2 2 1 1 4
2 2 2 2 2 2 1 4 4
3 2 2 2 3 1 1 4 0
2 2 2 2 1 1 4 4 0
2 2 1 1 1 4 4 0 0
1 1 1 4 4 4 0 0 0
4 4 4 4 0 0 0 0 0
! Boundary conditions (east), (west), (north), (south), (bottom), (top)
1 2 2 1 1 1

! Print Card
%PRNT
1 1 0 ! print output
7 changes: 0 additions & 7 deletions src/komodo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,4 @@ PROGRAM main
WRITE(*,*)
WRITE(*,*) " KOMODO EXIT NORMALLY"

#ifndef __NVHPC
#ifndef __GNU
! KOMODO stop to prevent remaining memory not allocated for g95 compiler
stop
#endif
#endif

END PROGRAM
Loading

0 comments on commit 986125d

Please sign in to comment.