Skip to content

Commit 0fb8818

Browse files
authored
Merge pull request #13 from nwu63/updated-packages
Updated packages
2 parents 89f0967 + f5ab636 commit 0fb8818

File tree

9 files changed

+67
-100
lines changed

9 files changed

+67
-100
lines changed

config/defaults/config.LINUX_GFORTRAN_OPENMPI.mk

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ CC = mpicc
1717
# so it is included in ${PETSC_LIB}. Otherwise you will have to
1818
# specify the HDF5 library.
1919

20-
# ----------- CGNS 3.2.x ------------------
21-
CGNS_VERSION_FLAG=
20+
# ----------- CGNS ------------------
21+
# CGNS_VERSION_FLAG= # for CGNS 3.2.x
22+
CGNS_VERSION_FLAG=-DUSECGNSMODULE # for CGNS 3.3.x
2223
CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
2324
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns
2425

25-
# # ----------- CGNS 3.3.x ------------------
26-
# CGNS_VERSION_FLAG=-DUSECGNSMODULE
27-
# CGNS_INCLUDE_FLAGS=-I$(HOME)/packages/CGNS/src
28-
# CGNS_LINKER_FLAGS=-L$(HOME)/packages/CGNS/src/lib -lcgns
29-
3026
# ------- Define Compiler Flags ----------------------------------------
3127
FF90_GEN_FLAGS = -fPIC
3228
CC_GEN_FLAGS = -fPIC

config/defaults/config.LINUX_INTEL_OPENMPI.mk

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ CC = mpicc
1616
# so it is included in ${PETSC_LIB}. Otherwise you will have to
1717
# specify the HDF5 library.
1818

19-
# ----------- CGNS 3.2.x ------------------
20-
CGNS_VERSION_FLAG=
19+
# ----------- CGNS ------------------
20+
# CGNS_VERSION_FLAG= # for CGNS 3.2.x
21+
CGNS_VERSION_FLAG=-DUSECGNSMODULE # for CGNS 3.3.x
2122
CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
2223
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns
2324

24-
# # ----------- CGNS 3.3.x ------------------
25-
# CGNS_VERSION_FLAG=-DUSECGNSMODULE
26-
# CGNS_INCLUDE_FLAGS=-I$(HOME)/packages/CGNS/src
27-
# CGNS_LINKER_FLAGS=-L$(HOME)/packages/CGNS/src/lib -lcgns
28-
2925
# ------- Define Compiler Flags ----------------------------------------
3026
FF90_GEN_FLAGS = -fPIC
3127
CC_GEN_FLAGS = -fPIC

config/defaults/config.OSX_GFORTRAN_OPENMPI.mk

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@ CC = mpicc
1616
# so it is included in ${PETSC_LIB}. Otherwise you will have to
1717
# specify the HDF5 library.
1818

19-
# ----------- CGNS 3.2.x ------------------
20-
CGNS_VERSION_FLAG=
19+
# ----------- CGNS ------------------
20+
# CGNS_VERSION_FLAG= # for CGNS 3.2.x
21+
CGNS_VERSION_FLAG=-DUSECGNSMODULE # for CGNS 3.3.x
2122
CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
2223
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns
2324

24-
# # ----------- CGNS 3.3.x ------------------
25-
# CGNS_VERSION_FLAG=-DUSECGNSMODULE
26-
# CGNS_INCLUDE_FLAGS=-I$(HOME)/packages/CGNS/src
27-
# CGNS_LINKER_FLAGS=-L$(HOME)/packages/CGNS/src/lib -lcgns
28-
2925
# ------- Define Compiler Flags ----------------------------------------
3026
FF90_GEN_FLAGS = -fPIC
3127
CC_GEN_FLAGS = -fPIC

python/reg_tests/solve_script.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test1():
9595
if MPI.COMM_WORLD.rank == 0:
9696
print('Sum of dxs:')
9797
reg_write(val,1e-8,1e-8)
98-
98+
9999
if MPI.COMM_WORLD.rank == 0:
100100
print('Verifying Warp Deriv')
101101
mesh.verifyWarpDeriv(dXv_warp,solverVec=False,dofStart=0,dofEnd=10,h=1e-9)
@@ -136,7 +136,7 @@ def test2():
136136
# Reset the newly computed surface coordiantes
137137
mesh.setSurfaceCoordinates(new_coords)
138138
mesh.warpMesh()
139-
139+
140140
# Get the sum of the warped coordinates
141141
#vCoords = mesh.getSolverGrid()
142142
vCoords = mesh.getWarpGrid()
@@ -157,7 +157,7 @@ def test2():
157157
if MPI.COMM_WORLD.rank == 0:
158158
print('Sum of dxs:')
159159
reg_write(val,1e-8,1e-8)
160-
160+
161161
if MPI.COMM_WORLD.rank == 0:
162162
print('Verifying Warp Deriv')
163163
mesh.verifyWarpDeriv(dXv_warp,solverVec=False,dofStart=0,dofEnd=5)
@@ -194,7 +194,7 @@ def test3():
194194
# Reset the newly computed surface coordiantes
195195
mesh.setSurfaceCoordinates(new_coords)
196196
mesh.warpMesh()
197-
197+
198198
# Get the sum of the warped coordinates
199199
#vCoords = mesh.getSolverGrid()
200200
vCoords = mesh.getWarpGrid()
@@ -215,7 +215,7 @@ def test3():
215215
if MPI.COMM_WORLD.rank == 0:
216216
print('Sum of dxs:')
217217
reg_write(val,1e-8,1e-8)
218-
218+
219219
if MPI.COMM_WORLD.rank == 0:
220220
print('Verifying Warp Deriv')
221221
mesh.verifyWarpDeriv(dXv_warp,solverVec=False,dofStart=0,dofEnd=5)
@@ -253,7 +253,7 @@ def test4():
253253
# Reset the newly computed surface coordiantes
254254
mesh.setSurfaceCoordinates(new_coords)
255255
mesh.warpMesh()
256-
256+
257257
# Get the sum of the warped coordinates
258258
#vCoords = mesh.getSolverGrid()
259259
vCoords = mesh.getWarpGrid()
@@ -274,7 +274,7 @@ def test4():
274274
if MPI.COMM_WORLD.rank == 0:
275275
print('Sum of dxs:')
276276
reg_write(val,1e-8,1e-8)
277-
277+
278278
if MPI.COMM_WORLD.rank == 0:
279279
print('Verifying Warp Deriv')
280280
mesh.verifyWarpDeriv(dXv_warp,solverVec=False,dofStart=0,dofEnd=5)
@@ -313,7 +313,7 @@ def test5():
313313
# Reset the newly computed surface coordiantes
314314
mesh.setSurfaceCoordinates(new_coords)
315315
mesh.warpMesh()
316-
316+
317317
# Get the sum of the warped coordinates
318318
#vCoords = mesh.getSolverGrid()
319319
vCoords = mesh.getWarpGrid()
@@ -334,22 +334,28 @@ def test5():
334334
if MPI.COMM_WORLD.rank == 0:
335335
print('Sum of dxs:')
336336
reg_write(val,1e-8,1e-8)
337-
337+
338338
if MPI.COMM_WORLD.rank == 0:
339339
print('Verifying Warp Deriv')
340340
mesh.verifyWarpDeriv(dXv_warp,solverVec=False,dofStart=0,dofEnd=5, h=1e-10)
341341

342342
if __name__ == '__main__':
343343
if len(sys.argv) == 1:
344-
test1()
344+
try:
345+
test1()
346+
except ModuleNotFoundError:
347+
print('WARNING: Test 1 skipped due to ModuleNotFoundError. Is OpenFoam installed?')
345348
test2()
346349
test3()
347350
test4()
348351
test5()
349352
else:
350353
# Run individual ones
351354
if 'test1' in sys.argv:
352-
test1()
355+
try:
356+
test1()
357+
except ModuleNotFoundError:
358+
print('WARNING: Test 1 skipped due to ModuleNotFoundError. Is OpenFoam installed?')
353359
if 'test2' in sys.argv:
354360
test2()
355361
if 'test3' in sys.argv:

src/modules/gridData.F90

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,9 @@ module gridData
77

88
#ifndef USE_TAPENADE
99

10-
#include <petscversion.h>
11-
#if PETSC_VERSION_GE(3,8,0)
1210
#include <petsc/finclude/petsc.h>
1311
use petsc
1412
implicit none
15-
#else
16-
implicit none
17-
#include "petsc/finclude/petsc.h"
18-
#include "petsc/finclude/petscvec.h90"
19-
#endif
2013

2114
! Volume grid vecs
2215
Vec Xv, Xv0, dXv, XvLocal
@@ -38,7 +31,6 @@ module gridData
3831
Vec solverGridVec
3932
VecScatter common_to_solver
4033
VecScatter common_to_warp
41-
VecScatter common_to_dxs
4234
#endif
4335

4436
! Pointers into the grid vecs

src/modules/kd_tree.F90

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,16 +1376,9 @@ function myCreateTree(uniquePts, link, faceSizes, faceConn) Result(tp)
13761376
use communication
13771377
#ifndef USE_TAPENADE
13781378

1379-
#include <petscversion.h>
1380-
#if PETSC_VERSION_GE(3,8,0)
13811379
#include <petsc/finclude/petsc.h>
13821380
use petsc
13831381
implicit none
1384-
#else
1385-
implicit none
1386-
#include "petsc/finclude/petsc.h"
1387-
#include "petsc/finclude/petscvec.h90"
1388-
#endif
13891382

13901383
#endif
13911384

src/utils/EChk.F90

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,22 @@ subroutine EChk(ierr, file, line)
33
! Check if ierr that resulted from a petsc or MPI call is in fact an
44
! error.
55
use precision
6-
#include <petscversion.h>
7-
#if PETSC_VERSION_GE(3,8,0)
8-
#include <petsc/finclude/petsc.h>
9-
use petsc
10-
implicit none
11-
#else
12-
implicit none
13-
#include "petsc/finclude/petsc.h"
14-
#include "petsc/finclude/petscvec.h90"
15-
#endif
6+
use communication, only : warp_comm_world, myid
167

178
integer(kind=intType),intent(in) :: ierr
189
character*(*),intent(in) :: file
1910
integer(kind=intType),intent(in) :: line
20-
integer(kind=intType) :: myid, jerr
11+
integer(kind=intType) :: jerr
12+
2113
if (ierr == 0) then
2214
return ! No error, return immediately
2315
else
24-
call MPI_Comm_rank(petsc_comm_world, myid, jerr)
2516
print *,'================================================================='
2617
write(*,900) "PETSc or MPI Error. Error Code ",ierr,". Detected on Proc ",myid
2718
write(*,901) "Error at line: ",line," in file: ",file
2819
print *,'================================================================='
2920

30-
call MPI_Abort(petsc_comm_world,1, ierr)
21+
call MPI_Abort(warp_comm_world, ierr, jerr)
3122
stop ! Just in case
3223
end if
3324

0 commit comments

Comments
 (0)