Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3cd2b73
change compilation flags for M4
campospinto Feb 13, 2026
acadab7
update gitignore for profiling and temp pyccel folders
campospinto Feb 13, 2026
0ceb382
use 2 patch for maxwell_2d_2_patch test
campospinto Feb 13, 2026
1430b70
use coarser and less grids in tests
campospinto Feb 13, 2026
9c17a52
Merge branch 'devel' into shorter_CI
campospinto Feb 13, 2026
79dc5b0
Merge branch 'devel' into shorter_CI
yguclu Feb 13, 2026
1fa1eb2
Merge branch 'devel' into shorter_CI
campospinto Feb 19, 2026
7282712
Update psydac/api/tests/test_2d_multipatch_mapping_maxwell.py
campospinto Feb 25, 2026
830e047
clean multipatch tests
campospinto Feb 26, 2026
2f598dd
update comment
campospinto Feb 26, 2026
88bfbde
revert changes to settings.py
campospinto Feb 26, 2026
121ea3a
add poisson test with bretzel domain
campospinto Feb 26, 2026
4b3ed90
Require Pyccel version >= 2.2.1
yguclu Mar 2, 2026
cafd8cd
Update build requirement on pyccel >= 2.2.1
yguclu Mar 3, 2026
2b06c44
Update psydac/api/tests/build_domain.py
campospinto Mar 3, 2026
238bab8
Update psydac/api/tests/build_domain.py
campospinto Mar 3, 2026
ff7ef79
Update psydac/api/tests/build_domain.py
campospinto Mar 3, 2026
55003eb
Update psydac/feec/multipatch_domain_utilities.py
campospinto Mar 3, 2026
b5b7ef9
Require Pyccel >= 2.2.2 at build and runtime
yguclu Mar 9, 2026
098ceba
clean build_domain.py
campospinto Mar 9, 2026
323f8ca
Merge branch 'devel' into shorter_CI
yguclu Mar 9, 2026
ca381ff
Import correct domain-building functions in API unit tests after name…
yguclu Mar 9, 2026
5e702c9
Fix parentheses in connectivities of test_2d_multipatch_poisson.py
yguclu Mar 10, 2026
7bc8654
Clean up test_2d_multipatch_poisson.py
yguclu Mar 10, 2026
e92ba5f
use expected conv order in projector tests
campospinto Mar 10, 2026
73eab39
Move prints from unit tests to manual run in test_global_projectors.py
yguclu Mar 10, 2026
9d4528f
use f2 and f3 in 3D projector tests
campospinto Mar 13, 2026
62807d9
accept small errors (tol = 1e-13) in convergence tests
campospinto Mar 13, 2026
4a25359
lower conv order in projector tests for low regularity functions
campospinto Mar 19, 2026
deb5a36
Merge branch 'devel' into shorter_CI
yguclu Mar 25, 2026
46a64c7
Don't run test_build_derham_mapping.py in parallel
yguclu Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*.so
*.lock
__psydac__/
__*pyccel__/
__*pyccel__*/
docs/source/modules/STUBDIR/*

build
Expand All @@ -13,6 +13,7 @@ build
*dist*
usr
*cache*
prof

*.swp
*.log
Expand Down
57 changes: 35 additions & 22 deletions psydac/api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@

PSYDAC_BACKEND_GPYCCEL = {'name': 'pyccel',
'compiler_family': 'GNU',
'flags' : '-O3 -ffast-math',
'flags' : '-O3 -ffast-math -march=native',
'folder' : '__gpyccel__',
'tag' : 'gpyccel',
'openmp' : False}

# [MCP 10.02.2026] this flag was used previously for intel mac, should we add it ?
# if not platform.system() == "Darwin":
# PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mtune=native'

# [MCP 10.02.2026] YG's suggestion:
if platform.machine() == 'x86_64':
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mavx'

PSYDAC_BACKEND_IPYCCEL = {'name': 'pyccel',
'compiler_family': 'intel',
'flags' : '-O3',
Expand Down Expand Up @@ -53,26 +61,31 @@
gfortran_version = Version(gfortran_version_string)

# Platform-dependent flags
if platform.system() == "Darwin" and platform.machine() == 'arm64' and gfortran_version >= Version("14"):

# Apple silicon requires architecture-specific flags (see https://github.com/pyccel/psydac/pull/411)
# which are only available on GCC version >= 14
cpu_brand = subprocess.check_output(['sysctl','-n','machdep.cpu.brand_string']).decode('utf-8').strip() # nosec B603, B607
if cpu_brand.startswith("Apple M"):
# Example: "Apple M3 Pro (virtual)" --> " -mcpu=apple-m3"
cpu_flag = '-'.join(cpu_brand.lower().split()[:2])
PSYDAC_BACKEND_GPYCCEL['flags'] += f' -mcpu={cpu_flag}'
else:
# TODO: Support later Apple CPU models. Perhaps the CPU naming scheme could be easily guessed
# based on the output of 'sysctl -n machdep.cpu.brand_string', but I wouldn't rely on this
# guess unless it has been manually verified. Loud errors are better than silent failures!
raise SystemError(f"Unsupported Apple CPU '{cpu_brand}'.")

else:
# Default architecture flags
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -march=native -mtune=native'
if platform.machine() == 'x86_64':
PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mavx'
# if platform.system() == "Darwin" and platform.machine() == 'arm64':
# PSYDAC_BACKEND_GPYCCEL['flags'] += ' -march=native'

# [MCP] version before PR #569, delete if OK:
# if platform.system() == "Darwin" and platform.machine() == 'arm64' and gfortran_version >= Version("14"):
#
# # Apple silicon requires architecture-specific flags (see https://github.com/pyccel/psydac/pull/411)
# # which are only available on GCC version >= 14
# cpu_brand = subprocess.check_output(['sysctl','-n','machdep.cpu.brand_string']).decode('utf-8').strip() # nosec B603, B607
# if cpu_brand.startswith("Apple M"):
# # Example: "Apple M3 Pro (virtual)" --> " -mcpu=apple-m3"
# cpu_flag = '-'.join(cpu_brand.lower().split()[:2])
# cpu_flag = cpu_flag.replace('4', '3')
# PSYDAC_BACKEND_GPYCCEL['flags'] += f' -mcpu={cpu_flag}'
# else:
# # TODO: Support later Apple CPU models. Perhaps the CPU naming scheme could be easily guessed
# # based on the output of 'sysctl -n machdep.cpu.brand_string', but I wouldn't rely on this
# # guess unless it has been manually verified. Loud errors are better than silent failures!
# raise SystemError(f"Unsupported Apple CPU '{cpu_brand}'.")

# else:
# # Default architecture flags
# PSYDAC_BACKEND_GPYCCEL['flags'] += ' -march=native -mtune=native'
# if platform.machine() == 'x86_64':
# PSYDAC_BACKEND_GPYCCEL['flags'] += ' -mavx'

#==============================================================================

Expand All @@ -83,4 +96,4 @@
'pyccel-intel' : PSYDAC_BACKEND_IPYCCEL,
'pyccel-pgi' : PSYDAC_BACKEND_PGPYCCEL,
'pyccel-nvidia': PSYDAC_BACKEND_NVPYCCEL,
}
}
Comment thread
yguclu marked this conversation as resolved.
Outdated
25 changes: 22 additions & 3 deletions psydac/api/tests/test_2d_multipatch_mapping_maxwell.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,25 @@ def test_maxwell_2d_2_patch_dirichlet_0():
#------------------------------------------------------------------------------
def test_maxwell_2d_2_patch_dirichlet_1():

domain = build_pretzel()
# domain = build_pretzel() # a lot of patches, takes a long time
Comment thread
yguclu marked this conversation as resolved.
Outdated

bounds1 = (0.5, 1.)
bounds2_A = (0, np.pi/2)
bounds2_B = (np.pi/2, np.pi)

A = Square('A',bounds1=bounds1, bounds2=bounds2_A)
B = Square('B',bounds1=bounds1, bounds2=bounds2_B)

mapping_1 = PolarMapping('M1',2, c1= 0., c2= 0., rmin = 0., rmax=1.)
mapping_2 = PolarMapping('M2',2, c1= 0., c2= 0., rmin = 0., rmax=1.)

D1 = mapping_1(A)
D2 = mapping_2(B)

connectivity = [((0,1,1),(1,1,-1))]
Comment thread
campospinto marked this conversation as resolved.
Outdated
patches = [D1,D2]
domain = Domain.join(patches, connectivity, 'domain')

x,y = domain.coordinates

omega = 1.5
Expand All @@ -158,8 +176,9 @@ def test_maxwell_2d_2_patch_dirichlet_1():

l2_error, Eh = run_maxwell_2d(Eex, f, alpha, domain, ncells=[2**2, 2**2], degree=[2,2])

expected_l2_error = 1.5941322657006822


expected_l2_error = 0.06335070876243 # 1.5941322657006822
print(l2_error, abs(l2_error - expected_l2_error))
assert abs(l2_error - expected_l2_error) < 1e-7

#------------------------------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 deletions psydac/feec/tests/test_commuting_projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@pytest.mark.parametrize('bc', [True, False])
@pytest.mark.parametrize('p', [2, 3])
@pytest.mark.parametrize('Nq', [5])
@pytest.mark.parametrize('Nel', [5, 6])
@pytest.mark.parametrize('Nel', [5]) #, 6])
def test_3d_commuting_pro_1(Nel, Nq, p, bc, m):

fun1 = lambda xi1, xi2, xi3 : np.sin(xi1)*np.sin(xi2)*np.sin(xi3)
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_3d_commuting_pro_1(Nel, Nq, p, bc, m):
@pytest.mark.parametrize('bc', [True, False])
@pytest.mark.parametrize('p', [2, 3])
@pytest.mark.parametrize('Nq', [7])
@pytest.mark.parametrize('Nel', [5, 6])
@pytest.mark.parametrize('Nel', [5]) #, 6])
def test_3d_commuting_pro_2(Nel, Nq, p, bc, m):

fun1 = lambda xi1, xi2, xi3 : np.sin(xi1)*np.sin(xi2)*np.sin(xi3)
Expand Down Expand Up @@ -195,7 +195,7 @@ def test_3d_commuting_pro_2(Nel, Nq, p, bc, m):
@pytest.mark.parametrize('bc', [True, False])
@pytest.mark.parametrize('p', [2, 3])
@pytest.mark.parametrize('Nq', [7])
@pytest.mark.parametrize('Nel', [5, 6])
@pytest.mark.parametrize('Nel', [5]) #, 6])
def test_3d_commuting_pro_3(Nel, Nq, p, bc, m):

fun1 = lambda xi1, xi2, xi3 : np.sin(xi1)*np.sin(xi2)*np.sin(xi3)
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_3d_commuting_pro_3(Nel, Nq, p, bc, m):
# 2D tests
#==============================================================================
@pytest.mark.mpi
@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [5])
@pytest.mark.parametrize('p', [2,3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down Expand Up @@ -351,7 +351,7 @@ def test_2d_commuting_pro_1(Nel, Nq, p, bc, m):
assert norm2_e1 < 1e-12

@pytest.mark.mpi
@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [5])
@pytest.mark.parametrize('p', [2,3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down Expand Up @@ -424,7 +424,7 @@ def test_2d_commuting_pro_2(Nel, Nq, p, bc, m):
assert norm2_e0 < 1e-12

@pytest.mark.mpi
@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [8])
@pytest.mark.parametrize('p', [2,3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down Expand Up @@ -504,7 +504,7 @@ def test_2d_commuting_pro_3(Nel, Nq, p, bc, m):
assert norm2_e3 < 1e-12

@pytest.mark.mpi
@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [8])
@pytest.mark.parametrize('p', [2,3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down
6 changes: 3 additions & 3 deletions psydac/feec/tests/test_commuting_projections_dual.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest


@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [5])
@pytest.mark.parametrize('p', [2, 3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_transpose_div_3d(Nel, Nq, p, bc, m):
assert error < 2e-10


@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [6])
@pytest.mark.parametrize('p', [2, 3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down Expand Up @@ -116,7 +116,7 @@ def test_transpose_curl_3d(Nel, Nq, p, bc, m):
assert error < 2e-9


@pytest.mark.parametrize('Nel', [8, 12])
@pytest.mark.parametrize('Nel', [8]) #, 12])
@pytest.mark.parametrize('Nq', [6])
@pytest.mark.parametrize('p', [2, 3])
@pytest.mark.parametrize('bc', [True, False])
Expand Down
2 changes: 1 addition & 1 deletion psydac/feec/tests/test_feec_conf_projectors_cart_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_polynomial_function(degree, hom_bc_axes, domain):
@pytest.mark.parametrize('nc', [5])
@pytest.mark.parametrize('reg', [0])
@pytest.mark.parametrize('hom_bc', [False, True])
@pytest.mark.parametrize('domain_name', ["1patch", "4patch_nc", "2patch_nc"])
@pytest.mark.parametrize('domain_name', ["1patch", "4patch_nc"]) #, "2patch_nc"])
@pytest.mark.parametrize("nonconforming, full_mom_pres",
[(True, True), (False, True)])

Expand Down
Loading