Skip to content

[BUG] uw.function.evaluate not working in parallel #28

@bknight1

Description

@bknight1

I'm getting the following error when the code is doing an uw.function.evaluate:

(uw) benknight@MacBook-Pro UW3_timing % mpiexec -np 4 python3 eval_error_test.py


[2]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[2]PETSC ERROR: Invalid argument
[2]PETSC ERROR: Global dof 2 for point 66 is not the unconstrained 1
[2]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed before usage or a spelling mistake, etc!
[2]PETSC ERROR:   Option left: name:-dm_plex_gmsh_mark_vertices value: true source: code
[2]PETSC ERROR:   Option left: name:-dm_plex_gmsh_multiple_tags value: true source: code
[2]PETSC ERROR:   Option left: name:-dm_plex_gmsh_use_regions (no value) source: code
[2]PETSC ERROR:   Option left: name:-dm_plex_hash_location (no value) source: code
[2]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[2]PETSC ERROR: Petsc Release Version 3.21.5, unknown 
[2]PETSC ERROR: eval_error_test.py on a arch-darwin-c-debug named MacBook-Pro.lan by benknight Wed Oct  8 17:44:02 2025
[2]PETSC ERROR: Configure options --COPTFLAGS="-g -O3" --CXXOPTFLAGS="-g -O3" --FOPTFLAGS="-g -O3" --with-petsc4py=1 --with-shared-libraries=1 --with-cxx-dialect=C++11 --with-make-np=4 --download-zlib=1 --download-cmake=1 --download-hdf5=1 --download-mumps=1 --download-parmetis=1 --download-metis=1 --download-superlu=1 --download-hypre=1 --download-scalapack=1 --download-superlu_dist=1 --download-pragmatic=1 --download-ctetgen --download-eigen --download-superlu=1 --download-triangle --useThreads=1
[2]PETSC ERROR: #1 PetscSectionCreateGlobalSection() at /Users/benknight/software/petsc-3.21.5/src/vec/is/section/interface/section.c:1517
[2]PETSC ERROR: #2 DMGetGlobalSection() at /Users/benknight/software/petsc-3.21.5/src/dm/interface/dm.c:4635
[2]PETSC ERROR: #3 DMGetSectionSF() at /Users/benknight/software/petsc-3.21.5/src/dm/interface/dm.c:4708
[2]PETSC ERROR: #4 DMLocalToGlobalBegin() at /Users/benknight/software/petsc-3.21.5/src/dm/interface/dm.c:3065
Traceback (most recent call last):
  File "/Users/benknight/Documents/Research/Modelling/UW-models/Setonix_stuff/UW3_timing/eval_error_test.py", line 10, in <module>
Traceback (most recent call last):
  File "/Users/benknight/Documents/Research/Modelling/UW-models/Setonix_stuff/UW3_timing/eval_error_test.py", line 10, in <module>
    data = uw.function.evaluate(v.sym, mesh.data, evalf=True)


Not sure when it was introduced as I haven't run any models in parallel for a while.

I'm on the current dev branch with petsc v3.21.5

To recreate:

import underworld3 as uw

mesh = uw.meshing.UnstructuredSimplexBox()


v = uw.discretisation.MeshVariable('u',    mesh,  mesh.dim, degree=2 )
p = uw.discretisation.MeshVariable('p',    mesh,  1, degree=1 )


data = uw.function.evaluate(v.sym, mesh.data, evalf=True)

print(data)

To add, the evaluate will work if the p mesh variable is not defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions