Skip to content

Commit

Permalink
probably not working parallel 'fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
jowezarek committed Nov 8, 2024
1 parent 06286c4 commit b903659
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion psydac/api/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,17 @@ def discretize(a, *args, **kwargs):
assert isinstance(domain_h, Geometry)
domain = domain_h.domain
dim = domain.dim
if ((isinstance(a, sym_BilinearForm)) and (dim == 3)):

backend = kwargs.get('backend')# or None
#print(f'backend: {backend}')
assembly_backend = kwargs.get('assembly_backend')# or None
#print(f'assembly_backend: {assembly_backend}')
assembly_backend = backend or assembly_backend
#print(f'assembly_backend: {assembly_backend}')
openmp = False if assembly_backend is None else assembly_backend.get('openmp')
#print(f'openmp: {openmp}')

if (((isinstance(a, sym_BilinearForm)) and (dim == 3))) and not openmp:
kwargs['new_assembly'] = True
mapping = domain_h.domain.mapping
kwargs['symbolic_mapping'] = mapping
Expand Down
4 changes: 4 additions & 0 deletions psydac/api/fem.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,9 @@ def make_file(self, temps, ordered_stmts, *args, mapping_option=None):
assembly_code += '\n return\n'

#------------------------- MAKE FILE -------------------------
import os
if not os.path.isdir('__psydac__'):
os.makedirs('__psydac__')
filename = '__psydac__/assemble.py'
f = open(filename, 'w')
f.writelines(assembly_code)
Expand Down Expand Up @@ -1323,6 +1326,7 @@ def construct_arguments_generate_assembly_file(self):
threads_args = tuple(np.int64(a) if isinstance(a, int) else a for a in threads_args)

self.make_file(temps, ordered_stmts, test_v_p, trial_u_p, keys_1, keys_2, keys_3, mapping_option=mapping_option)
#from __test__.__psydac__.assemble import assemble_matrix
from __psydac__.assemble import assemble_matrix
from pyccel.epyccel import epyccel
new_func = epyccel(assemble_matrix, language='fortran')
Expand Down

0 comments on commit b903659

Please sign in to comment.