<div dir="ltr">Hi all,<div><br></div><div>I solved the problem by using different routine.</div><div><br></div><div>Thanks anyway!</div><div><br></div><div>Eda</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Eda Oktay <<a href="mailto:eda.oktay@metu.edu.tr">eda.oktay@metu.edu.tr</a>>, 18 Ara 2019 Çar, 10:24 tarihinde şunu yazdı:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello everyone,<div><br></div><div>In a part of my code, I am trying to understand whether a matrix is equal to its transpose, that is why I am using MatEqual(). However, for most of the matrices I took from University of Florida State Sparse Matrix Library, I get the following error for more than 2 processes, where main() line 155 is MatEqual:</div><div><br></div><div>[2]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[2]PETSC ERROR: Nonconforming object sizes<br>[2]PETSC ERROR: Mat A,Mat B: global dim 6 6 8 5<br>[2]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[2]PETSC ERROR: Petsc Release Version 3.11.1, Apr, 12, 2019 <br>[2]PETSC ERROR: ./yeni_vertexweight_imbalance_without_spectral on a arch-linux2-c-debug named <a href="http://d1e.wls.metu.edu.tr" target="_blank">d1e.wls.metu.edu.tr</a> by edaoktay Wed Dec 18 10:18:30 2019<br>[2]PETSC ERROR: Configure options --download-mpich --download-openblas --download-slepc --download-metis --download-parmetis --download-chaco --with-X=1<br>[2]PETSC ERROR: #1 MatEqual() line 5130 in /home/edaoktay/petsc-3.11.1/src/mat/interface/matrix.c<br>[2]PETSC ERROR: #2 MatEqual_MPIAIJ() line 2112 in /home/edaoktay/petsc-3.11.1/src/mat/impls/aij/mpi/mpiaij.c<br>[2]PETSC ERROR: #3 MatEqual() line 5136 in /home/edaoktay/petsc-3.11.1/src/mat/interface/matrix.c<br>[2]PETSC ERROR: #4 main() line 115 in /home/edaoktay/petsc-3.11.1/arch-linux2-c-debug/share/slepc/examples/src/eda/yeni_vertexweight_imbalance_without_spectral.c<br>[2]PETSC ERROR: PETSc Option Table entries:<br>[2]PETSC ERROR: -f /home/edaoktay/petsc-3.11.1/share/petsc/datafiles/matrices/binary_files/Ragusa16_binary<br>[2]PETSC ERROR: -mat_partitioning_type parmetis<br>[2]PETSC ERROR: ----------------End of Error Message -------send entire error message to petsc-maint@mcs.anl.gov----------<br></div><div><br></div><div>And this is the part of my code:</div><div><br></div><div> ierr = PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr;<br> <br> /*<br> Determine files from which we read matrix<br> */<br> <br> ierr = PetscOptionsGetString(NULL,NULL,"-f",file,PETSC_MAX_PATH_LEN,&flg);CHKERRQ(ierr);<br> if (!flg) SETERRQ(PETSC_COMM_WORLD,1,"Must indicate binary file with the -f option");<br><br> /*<br> Open binary file. Note that we use FILE_MODE_READ to indicate<br> reading from this file.<br> */<br> <br> ierr = PetscViewerBinaryOpen(PETSC_COMM_WORLD,file,FILE_MODE_READ,&fd);CHKERRQ(ierr);<br><br> /*<br> Load the matrix; then destroy the viewer.<br> */<br> <br> ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr); <br> ierr = MatSetOptionsPrefix(A,"a_");CHKERRQ(ierr);<br> ierr = MatSetFromOptions(A);CHKERRQ(ierr);<br> ierr = MatLoad(A,fd);CHKERRQ(ierr);<br> ierr = PetscViewerDestroy(&fd);CHKERRQ(ierr);<br> <br> /* PetscLogDouble v1,v2,elapsed_time; <br> PetscTime(&v1); */<br> <br> /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br> Create Partitioning<br> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */<br> <br> ierr = MatConvert(A,MATMPIADJ,MAT_INITIAL_MATRIX,&AL);CHKERRQ(ierr); <br><br> ierr = MatPartitioningCreate(MPI_COMM_WORLD,&part);CHKERRQ(ierr);<br> ierr = MatPartitioningSetAdjacency(part,AL);CHKERRQ(ierr); <br> <br> /* Symmetry check */<br> <br> Mat Atr,SymmA,Atrabs,Aabs;<br> PetscBool isEqual;<br> Vec D;<br> PetscInt i;<br><br> ierr = MatTranspose(A,MAT_INITIAL_MATRIX,&Atr);CHKERRQ(ierr);<br> ierr = MatDuplicate(Atr,MAT_COPY_VALUES,&SymmA);CHKERRQ(ierr);<br> flg = PETSC_TRUE; <br> PetscOptionsGetBool(NULL,NULL, "-check_symmetry", &flg,NULL);<br> if (flg) {<br> ierr = MatEqual(A,Atr,&isEqual);CHKERRQ(ierr);<br></div><div><br></div><div>For this specific error, the matrix is of size 24*24. When I checked, I couldn't understand what is wrong when it comes to 3rd process. I will be glad if someone can tell me what is wrong with my code that I get this dimension error.</div><div><br></div><div>Thanks,</div><div><br></div><div>Eda</div></div>
</blockquote></div>