mdolab / mdolab/pyhyp

Compilation error: Rank mismatch

Open
#96 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Fortran
Stars
61
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Description

When running "make" i get the following errors:

mpifort -I../../mod -I/usr/local/include -fPIC -std=f2008 -fdefault-real-8 -O2 -I/opt/petsc/petsc_git/include -I/opt/petsc/petsc_git/arch-linux-c-debug/include -I/opt/petsc/petsc_git -c 3D_elliptic.F90 -o ../../obj/3D_elliptic.o
3D_code.F90:1020:44:

 1020 |         call MatSetValuesBlocked(hypMat, 1, i - 1, 1, j - 1, blk, ADD_VALUES, ierr)
      |                                            1
Error: Rank mismatch in argument ‘c’ at (1) (rank-1 and scalar)
3D_code.F90:1020:54:

 1020 |         call MatSetValuesBlocked(hypMat, 1, i - 1, 1, j - 1, blk, ADD_VALUES, ierr)
      |                                                      1
Error: Rank mismatch in argument ‘e’ at (1) (rank-1 and scalar)
make[3]: *** [../../rulesSources.mk:19: 3D_code.o] Error 1
make[3]: *** Waiting for unfinished jobs....
3D_elliptic.F90:520:47:

  520 |                 call MatSetValues(ellipMat, 1, j + iStart - 1, 1, i - 1, phi, INSERT_VALUES, ierr)
      |                                               1
Error: Rank mismatch in argument ‘c’ at (1) (rank-1 and scalar)
3D_elliptic.F90:520:66:

  520 |                 call MatSetValues(ellipMat, 1, j + iStart - 1, 1, i - 1, phi, INSERT_VALUES, ierr)
      |                                                                  1
Error: Rank mismatch in argument ‘e’ at (1) (rank-1 and scalar)
3D_elliptic.F90:520:73:

  520 |                 call MatSetValues(ellipMat, 1, j + iStart - 1, 1, i - 1, phi, INSERT_VALUES, ierr)
      |                                                                         1
Error: Rank mismatch in argument ‘f’ at (1) (rank-1 and scalar)
3D_elliptic.F90:532:49:

  532 |                 call MatSetValues(ellipPCMat, 1, j + iStart - 1, 1, i - 1, phi, INSERT_VALUES, ierr)
      |                                                 1
Error: Rank mismatch in argument ‘c’ at (1) (rank-1 and scalar)
3D_elliptic.F90:532:68:

  532 |                 call MatSetValues(ellipPCMat, 1, j + iStart - 1, 1, i - 1, phi, INSERT_VALUES, ierr)
      |                                                                    1
Error: Rank mismatch in argument ‘e’ at (1) (rank-1 and scalar)
3D_elliptic.F90:532:75:

  532 |                 call MatSetValues(ellipPCMat, 1, j + iStart - 1, 1, i - 1, phi, INSERT_VALUES, ierr)
      |                                                                           1
Error: Rank mismatch in argument ‘f’ at (1) (rank-1 and scalar)
make[3]: *** [../../rulesSources.mk:19: 3D_elliptic.o] Error 1

I tried the -fallow-argument-mismatch flag but it still produces errors.

Code versions

Operating System: Linux 6.6.52-gentoo-gentoo-dist #10 SMP PREEMPT_DYNAMIC Mon Nov 11 10:26:45 CET 2024 x86_64 Intel(R) Core(TM) i7-14700 GenuineIntel GNU/Linux
cmake: 3.30.5
Gcc: (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024
Fortran Compiler: GNU Fortran (Gentoo 13.3.1_p20241025 p1) 13.3.1 20241024
Python: 3.12.7
OpenMPI: openmpi-4.2.3
MPICH: 4.2.3
CGNS: CGNS-4.5.0
PETSc: petsc-3.22.1

  • This repository:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the build with the reported GNU Fortran, OpenMPI, and PETSc versions, then inspect the calls in 3D_code.F90 and 3D_elliptic.F90 at the reported lines. Compare the MatSetValues and MatSetValuesBlocked interfaces used by the installed PETSc Fortran bindings. Done means make completes without the rank-mismatch errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.