Hello, I'm using petsc-dev to develop a program which involves complex numbers.
With the help from petsc-maint, I have successfully built the PETSc complex version on my system, and am able to run the example /ksp/ksp/examples/tutorials/ex11.c Now the problem is I can compile my code successfully: [d3m956 at olympus v0]$ make mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o allocMainData.o allocMainData.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o dynSim.o dynSim.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o readInput.o readInput.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o bcastGlobals.o bcastGlobals.C mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o admitBuild.o admitBuild.C mpicxx -o dynSim allocMainData.o dynSim.o readInput.o bcastGlobals.o admitBuild.o -L/pic/projects/ds/petsc-dev/arch-complex/lib -lpetsc -llapack -lblas -lX11 -lpthread -Wl,-rpath,/share/apps/openmpi/1.5.4/gcc/4.1.2/lib -L/share/apps/openmpi/1.5.4/gcc/4.1.2/lib -Wl,-rpath,/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lmpi_f90 -lmpi_f77 -lgfortran -lm -lm -lm -lm -lmpi_cxx -lstdc++ -lmpi_cxx -lstdc++ -ldl -lmpi -lnsl -lutil -lgcc_s -lpthread -ldl However, when I ran the code, I got several Error Messages as well as some results during the runtime as shown below: [d3m956 at olympus v0]$ mpirun -n 1 dynSim -i d100.txt Number of buses: 290 Number of branches: 907 Number of swing buses: 1 Number of PQ buses: 190 Number of PV buses: 99 Number of generators: 100 Number of switches: 7 Initialization time: 0.00221014 Alloc main data time: 0.00632787 Read input data time: 0.0415301 [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c [0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c [0]PETSC ERROR: buildConnectMatrix() line 281 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Not for unassembled matrix! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatDuplicate() line 4039 in src/mat/interface/matrix.c [0]PETSC ERROR: buildDiagMatrices() line 331 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Invalid argument! [0]PETSC ERROR: Wrong type of object: Parameter # 1! [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500 [0]PETSC ERROR: See docs/changes/index.html for recent updates. [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting. [0]PETSC ERROR: See docs/index.html for manual pages. [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013 [0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib [0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013 [0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: MatMatMult() line 8516 in src/mat/interface/matrix.c [0]PETSC ERROR: buildMatrix() line 107 in "unknowndirectory/"admitBuild.C [0]PETSC ERROR: buildAdmittanceMatrix() line 66 in "unknowndirectory/"dynSim.h Build admittance matrix time: 0.00370693 Can anyone give me a shot what might be a reason for errors like this? [0]PETSC ERROR: Object is in wrong state! [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()! [0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c [0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C Thanks, Shuangshuang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130313/762af988/attachment.html>