<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Hong,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks for the advice. I could not install petsc4py with the --with-petsc4py=1 option, which gave me an "No rule to make target 'petsc4py-install'" error when I ran "make install". That was why I needed to install petsc4py separately after the PETSc was
installed.<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Best regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Peng Sun<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Zhang, Hong <hongzhang@anl.gov><br>
<b>Sent:</b> Thursday, October 13, 2022 4:30 PM<br>
<b>To:</b> Peng Sun <psun@outlook.com><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Issue with single precision complex numbers in petsc4py</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">It seems that you installed petsc4py separately. I would suggest to add the configure option --with-petsc4py=1 and follow the instructions to set PYTHONPATH before using petsc4py.<br>
<br>
Hong (Mr.)<br>
<br>
> On Oct 13, 2022, at 10:42 AM, Peng Sun <psun@outlook.com> wrote:<br>
> <br>
> Hi Matt,<br>
> <br>
> Sure, please see the attached configure.log file. Thanks!<br>
> <br>
> Best regards,<br>
> Peng Sun<br>
> <br>
> <br>
> From: Matthew Knepley <knepley@gmail.com><br>
> Sent: Thursday, October 13, 2022 6:34 AM<br>
> To: Peng Sun <psun@outlook.com><br>
> Cc: petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
> Subject: Re: [petsc-users] Issue with single precision complex numbers in petsc4py<br>
> <br>
> First send configure.log so we can see the setup.<br>
> <br>
> Thanks,<br>
> <br>
> Matt<br>
> <br>
> On Thu, Oct 13, 2022 at 12:53 AM Peng Sun <psun@outlook.com> wrote:<br>
> Dear PETSc community, <br>
> <br>
> I have a question regarding the single precision complex numbers of petsc4py. I configured PETSc with the “--with-scalar-type=complex --with-precision=single" option before compiling, but all the DA structures I created with petsc4py had double precision.
<br>
> <br>
> Here is a minimum test code on Python 3.8/PETSc 3.12/petsc4py 3.12: both print commands show data type of complex128. Could anybody please help me? Thanks!<br>
> <br>
> import<br>
> petsc4py<br>
> <br>
> import<br>
> sys<br>
> petsc4py.init(sys.argv)<br>
> <br>
> from petsc4py import<br>
> PETSc<br>
> <br>
> da=PETSc.DA().create(sizes=[<br>
> 2,2,2],dof=1,stencil_type=0,stencil_width=1,boundary_type=1<br>
> )<br>
> da_1 = da.createGlobalVec()<br>
> <br>
> print<br>
> (petsc4py.PETSc.ComplexType)<br>
> <br>
> print(da_1.getArray().dtype)<br>
> <br>
> <br>
> <br>
> Best regards,<br>
> Peng Sun<br>
> <br>
> <br>
> -- <br>
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
> -- Norbert Wiener<br>
> <br>
> <a href="https://www.cse.buffalo.edu/~knepley/">https://www.cse.buffalo.edu/~knepley/</a><br>
> <configure.log><br>
<br>
</div>
</span></font></div>
</body>
</html>