<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Hello, I’m using petsc-dev to develop a program which involves complex numbers.</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>With the help from petsc-maint, I have successfully built the PETSc complex version on my system, and am able to run the example <font face="Calibri, sans-serif" color="#1F497D">/ksp/ksp/examples/tutorials/ex11.c</font></div>
<div><font face="Times New Roman, serif" color="#1F497D"> </font></div>
<div>Now the problem is I can compile my code successfully: </div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[d3m956@olympus v0]$ make</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">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</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">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</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">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</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">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</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">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</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">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</font></div>
<div><font face="Calibri, sans-serif" color="#1F497D"> </font></div>
<div>However, when I ran the code, I got several Error Messages as well as some results during the runtime as shown below:</div>
<div> </div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[d3m956@olympus v0]$ mpirun -n 1 dynSim -i d100.txt
</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of buses: 290</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of branches: 907</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of swing buses: 1</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of PQ buses: 190</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of PV buses: 99</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of generators: 100</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Number of switches: 7</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Initialization time: 0.00221014</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Alloc main data time: 0.00632787</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Read input data time: 0.0415301</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: --------------------- Error Message ------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Object is in wrong state!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/changes/index.html for recent updates.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/index.html for manual pages.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: --------------------- Error Message ------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Object is in wrong state!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/changes/index.html for recent updates.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/index.html for manual pages.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: buildConnectMatrix() line 281 in "unknowndirectory/"admitBuild.C</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: --------------------- Error Message ------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Object is in wrong state!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Not for unassembled matrix!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/changes/index.html for recent updates.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/index.html for manual pages.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: MatDuplicate() line 4039 in src/mat/interface/matrix.c</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: buildDiagMatrices() line 331 in "unknowndirectory/"admitBuild.C</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: --------------------- Error Message ------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Invalid argument!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Wrong type of object: Parameter # 1!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Petsc Development HG revision: 6e0ddc6e9b6d8a9d8eb4c0ede0105827a6b58dfb HG Date: Mon Mar 11 22:54:30 2013 -0500</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/changes/index.html for recent updates.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: See docs/index.html for manual pages.</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: dynSim on a arch-complex named olympus.local by d3m956 Tue Mar 12 15:33:32 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Libraries linked from /pic/projects/ds/petsc-dev/arch-complex/lib</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure run at Tue Mar 12 14:32:37 2013</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Configure options --with-scalar-type=complex --with-clanguage=C++ PETSC_ARCH=arch-complex --with-fortran-kernels=generic</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: ------------------------------------------------------------------------</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: MatMatMult() line 8516 in src/mat/interface/matrix.c</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: buildMatrix() line 107 in "unknowndirectory/"admitBuild.C</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: buildAdmittanceMatrix() line 66 in "unknowndirectory/"dynSim.h</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">Build admittance matrix time: 0.00370693</font></div>
<div><font face="Times New Roman, serif"> </font></div>
<div>Can anyone give me a shot what might be a reason for errors like this? </div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Object is in wrong state!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatSetValues()!</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: MatSetValues() line 1061 in src/mat/interface/matrix.c</font></div>
<div><font face="Calibri, sans-serif" color="#E46C0A">[0]PETSC ERROR: buildYshMatrix() line 216 in "unknowndirectory/"admitBuild.C</font></div>
<div><font face="Times New Roman, serif"> </font></div>
<div>Thanks,</div>
<div>Shuangshuang</div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Times New Roman, serif"> </font></div>
</font>
</body>
</html>