Skip to content

Commit d3b8316

Browse files
authored
Bump mpi4py & cython min version (#369)
* Bump mpi4py min version to 4.0.3 * Bump mpi4py min version to 4.0.3 in conda recipe * Removing Python 3.13 from conda build until we update to cython 3.0 * Updating python build to cython 3.0+ * Updating conda build to cython 3.0+
1 parent 4153b0d commit d3b8316

File tree

9 files changed

+193
-185
lines changed

9 files changed

+193
-185
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ default:
55
@cd src && ${MAKE} || exit 1
66
@cd lib && ${MAKE} || exit 1
77
@cd funtofem; \
8-
echo "ctypedef double F2FScalar" > FuntofemTypedefs.pxi; \
8+
echo "ctypedef double F2FScalar" > cpp_headers/FuntofemTypedefs.pxi; \
99
echo "F2F_NPY_SCALAR = np.NPY_DOUBLE" > FuntofemDefs.pxi; \
1010
echo "dtype = np.double" >> FuntofemDefs.pxi;
1111

1212
debug:
1313
@cd src && ${MAKE} $@ || exit 1
1414
@cd lib && ${MAKE} || exit 1
1515
@cd funtofem; \
16-
echo "ctypedef double F2FScalar" > FuntofemTypedefs.pxi; \
16+
echo "ctypedef double F2FScalar" > cpp_headers/FuntofemTypedefs.pxi; \
1717
echo "F2F_NPY_SCALAR = np.NPY_DOUBLE" > FuntofemDefs.pxi; \
1818
echo "dtype = np.double" >> FuntofemDefs.pxi;
1919

2020
complex:
2121
@cd src && ${MAKE} $@ || exit 1
2222
@cd lib && ${MAKE} || exit 1
2323
@cd funtofem; \
24-
echo "ctypedef complex F2FScalar" > FuntofemTypedefs.pxi; \
24+
echo "ctypedef complex F2FScalar" > cpp_headers/FuntofemTypedefs.pxi; \
2525
echo "F2F_NPY_SCALAR = np.NPY_CDOUBLE" > FuntofemDefs.pxi; \
2626
echo "dtype = complex" >> FuntofemDefs.pxi;
2727

2828
complex_debug:
2929
@cd src && ${MAKE} $@ || exit 1
3030
@cd lib && ${MAKE} || exit 1
3131
@cd funtofem; \
32-
echo "ctypedef complex F2FScalar" > FuntofemTypedefs.pxi; \
32+
echo "ctypedef complex F2FScalar" > cpp_headers/FuntofemTypedefs.pxi; \
3333
echo "F2F_NPY_SCALAR = np.NPY_CDOUBLE" > FuntofemDefs.pxi; \
3434
echo "dtype = complex" >> FuntofemDefs.pxi;
3535

conda/meta.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ requirements:
4343
- mpich # [mpi == "mpich" and build_platform != target_platform]
4444
- openmpi-mpicxx # [mpi == "openmpi" and build_platform != target_platform]
4545
- mpich-mpicxx # [mpi == "mpich" and build_platform != target_platform]
46-
- mpi4py >=3.1.5,<4.0.0 # [build_platform != target_platform]
47-
- cython >=0.29,<3.0 # [build_platform != target_platform]
46+
- mpi4py >=4.0.3,<5.0.0 # [build_platform != target_platform]
47+
- cython >=3.0,<4.0 # [build_platform != target_platform]
4848
- setuptools # [build_platform != target_platform]
4949
- tacs >=3.4.0 # [build_platform != target_platform]
5050

@@ -56,8 +56,8 @@ requirements:
5656
- mpich # [mpi == "mpich"]
5757
- libopenblas
5858
- lapack
59-
- mpi4py >=3.1.5,<4.0.0
60-
- cython >=0.29,<3.0
59+
- mpi4py >=4.0.3,<5.0.0
60+
- cython >=3.0,<4.0
6161
- tacs >=3.4.0
6262

6363
run:
@@ -68,7 +68,7 @@ requirements:
6868
- mpich # [mpi == "mpich"]
6969
- libopenblas
7070
- lapack
71-
- mpi4py >=3.1.5,<4.0.0
71+
- mpi4py >=4.0.3,<5.0.0
7272
- tacs >=3.4.0
7373

7474
test:

funtofem/TransferScheme.pxd

Lines changed: 2 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -2,173 +2,5 @@
22
from mpi4py.libmpi cimport *
33
cimport mpi4py.MPI as MPI
44

5-
# Typdefs required for either real or complex mode
6-
include "FuntofemTypedefs.pxi"
7-
8-
cdef extern from "TransferScheme.h":
9-
cppclass LDTransferScheme:
10-
# Mesh loading
11-
void setAeroNodes(const F2FScalar *aero_X, int aero_nnodes)
12-
void setStructNodes(const F2FScalar *struct_X, int struct_nnodes)
13-
14-
# Initialization
15-
void initialize()
16-
17-
# Load and displacement transfers
18-
void transferDisps(const F2FScalar *struct_disps,
19-
F2FScalar *aero_disps)
20-
void transferLoads(const F2FScalar *aero_loads,
21-
F2FScalar *struct_loads)
22-
23-
# Get the dimensions
24-
int getStructNodeDof()
25-
int getAeroNodeDof()
26-
int getNumLocalAeroNodes()
27-
int getNumLocalStructNodes()
28-
int getLocalAeroArrayLen()
29-
int getLocalStructArrayLen()
30-
31-
# Action of transpose Jacobians needed for solving adjoint system
32-
void applydDduS(const F2FScalar *vecs, F2FScalar *prods)
33-
void applydDduSTrans(const F2FScalar *vecs, F2FScalar *prods)
34-
void applydLduS(const F2FScalar *vecs, F2FScalar *prods)
35-
void applydLduSTrans(const F2FScalar *vecs, F2FScalar *prods)
36-
void applydLdfA(const F2FScalar *vecs, F2FScalar *prods)
37-
void applydLdfATrans(const F2FScalar *vecs, F2FScalar *prods)
38-
39-
# Action of Jacobians needed for assembling gradient from adjoint variables
40-
void applydDdxA0(const F2FScalar *vecs, F2FScalar *prods)
41-
void applydDdxS0(const F2FScalar *vecs, F2FScalar *prods)
42-
void applydLdxA0(const F2FScalar *vecs, F2FScalar *prods)
43-
void applydLdxS0(const F2FScalar *vecs, F2FScalar *prods)
44-
45-
# Convert aero displacements into equivalent rigid + elastic deformation
46-
void transformEquivRigidMotion(const F2FScalar *aero_disps,
47-
F2FScalar *R, F2FScalar *t, F2FScalar *u)
48-
void applydRduATrans(const F2FScalar *vecs, F2FScalar *prods)
49-
void applydRdxA0Trans(const F2FScalar *aero_disps, const F2FScalar *vecs,
50-
F2FScalar *prods)
51-
52-
# Routines to test necessary functionality of transfer scheme
53-
int testAllDerivatives(const F2FScalar *struct_disps,
54-
const F2FScalar *aero_loads,
55-
const F2FScalar h, const double rtol,
56-
const double atol)
57-
int testLoadTransfer(const F2FScalar *struct_disps,
58-
const F2FScalar *aero_loads,
59-
const F2FScalar *pert,
60-
const F2FScalar h, const double rtol,
61-
const double atol)
62-
int testDispJacVecProducts(const F2FScalar *struct_disps,
63-
const F2FScalar *test_vec_a,
64-
const F2FScalar *test_vec_s,
65-
const F2FScalar h, const double rtol,
66-
const double atol)
67-
int testLoadJacVecProducts(const F2FScalar *struct_disps,
68-
const F2FScalar *aero_loads,
69-
const F2FScalar *test_vec_s1,
70-
const F2FScalar *test_vec_s2,
71-
const F2FScalar h, const double rtol,
72-
const double atol)
73-
int testdDdxA0Products(const F2FScalar *struct_disps,
74-
const F2FScalar *test_vec_a1,
75-
const F2FScalar *test_vec_a2,
76-
const F2FScalar h, const double rtol,
77-
const double atol)
78-
int testdDdxS0Products(const F2FScalar *struct_disps,
79-
const F2FScalar *test_vec_a,
80-
const F2FScalar *test_vec_s,
81-
const F2FScalar h, const double rtol,
82-
const double atol)
83-
int testdLdxA0Products(const F2FScalar *struct_disps,
84-
const F2FScalar *aero_loads,
85-
const F2FScalar *test_vec_a,
86-
const F2FScalar *test_vec_s,
87-
const F2FScalar h, const double rtol,
88-
const double atol)
89-
int testdLdxS0Products(const F2FScalar *struct_disps,
90-
const F2FScalar *aero_loads,
91-
const F2FScalar *test_vec_s1,
92-
const F2FScalar *test_vec_s2,
93-
const F2FScalar h, const double rtol,
94-
const double atol)
95-
96-
cppclass ThermalTransfer:
97-
# Mesh loading
98-
void setAeroNodes(const F2FScalar *aero_X, int aero_nnodes)
99-
void setStructNodes(const F2FScalar *struct_X, int struct_nnodes)
100-
101-
# Initialization
102-
void initialize()
103-
104-
# Transfer temperatures and heat fluxes
105-
void transferTemp(const F2FScalar *struct_temp,
106-
F2FScalar *aero_temp)
107-
void transferFlux(const F2FScalar *aero_flux,
108-
F2FScalar *struct_flux)
109-
110-
# Get the dimensions
111-
int getStructNodeDof()
112-
int getAeroNodeDof()
113-
int getNumLocalAeroNodes()
114-
int getNumLocalStructNodes()
115-
int getLocalAeroArrayLen()
116-
int getLocalStructArrayLen()
117-
118-
# Action of transpose Jacobians needed for solving adjoint system
119-
void applydTdtS(const F2FScalar *vecs, F2FScalar *prods)
120-
void applydTdtSTrans(const F2FScalar *vecs, F2FScalar *prods)
121-
void applydQdqA(const F2FScalar *vecs, F2FScalar *prods)
122-
void applydQdqATrans(const F2FScalar *vecs, F2FScalar *prods)
123-
124-
# Routines to test necessary functionality of transfer scheme
125-
int testAllDerivatives(const F2FScalar *struct_temps,
126-
const F2FScalar *aero_flux, const F2FScalar h,
127-
const double rtol, const double atol)
128-
129-
cdef extern from "MELD.h":
130-
cppclass MELD(LDTransferScheme):
131-
# Constructor
132-
MELD(MPI_Comm all,
133-
MPI_Comm structure, int struct_root,
134-
MPI_Comm aero, int aero_root,
135-
int symmetry, int num_nearest, F2FScalar beta)
136-
137-
cdef extern from "MELDThermal.h":
138-
cppclass MELDThermal(ThermalTransfer):
139-
# Constructor
140-
MELDThermal(MPI_Comm all,
141-
MPI_Comm structure, int struct_root,
142-
MPI_Comm aero, int aero_root,
143-
int symmetry, int num_nearest, F2FScalar beta)
144-
145-
cdef extern from "LinearizedMELD.h":
146-
cppclass LinearizedMELD(MELD):
147-
# Constructor
148-
LinearizedMELD(MPI_Comm all,
149-
MPI_Comm structure, int struct_root,
150-
MPI_Comm aero, int aero_root,
151-
int symmetry, int num_nearest, F2FScalar beta)
152-
153-
cdef extern from "RBF.h":
154-
enum RbfType "RBF::RbfType":
155-
GAUSSIAN "RBF::GAUSSIAN"
156-
MULTIQUADRIC "RBF::MULTIQUADRIC"
157-
INVERSE_MULTIQUADRIC "RBF::INVERSE_MULTIQUADRIC"
158-
THIN_PLATE_SPLINE "RBF::THIN_PLATE_SPLINE"
159-
160-
cppclass RBF(LDTransferScheme):
161-
# Constructor
162-
RBF(MPI_Comm all,
163-
MPI_Comm structure, int struct_root,
164-
MPI_Comm aero, int aero_root,
165-
RbfType rbf_type, int sampling_ratio)
166-
167-
cdef extern from "BeamTransfer.h":
168-
cppclass BeamTransfer(LDTransferScheme):
169-
# Constructor
170-
BeamTransfer(MPI_Comm all,
171-
MPI_Comm structure, int struct_root,
172-
MPI_Comm aero, int aero_root,
173-
const int *_conn, int _nelems, int _order,
174-
int _dof_per_node)
5+
# Import TACS c++ headers
6+
from funtofem.cpp_headers.TransferScheme cimport *

funtofem/TransferScheme.pyx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ cimport mpi4py.MPI as MPI
1010
cdef extern from "mpi-compat.h":
1111
pass
1212

13-
# Import the declarations required from the pxd file
14-
from TransferScheme cimport *
15-
1613
# Import numpy
1714
import numpy as np
1815
cimport numpy as np

0 commit comments

Comments
 (0)