<div dir="ltr"><div dir="ltr">On Tue, Dec 7, 2021 at 9:43 AM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu">quentin.chevalier@polytechnique.edu</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">@Matthew, as stated before, error output is unchanged, i.e.the python<br>
command below produces the same traceback :<br>
<br>
# python3 -c "from petsc4py import PETSc; PETSc.Viewer().createHDF5('d.h5')"<br>
Traceback (most recent call last):<br>
File "<string>", line 1, in <module><br>
File "PETSc/Viewer.pyx", line 182, in petsc4py.PETSc.Viewer.createHDF5<br>
petsc4py.PETSc.Error: error code 86<br>
[0] PetscViewerSetType() at<br>
/usr/local/petsc/src/sys/classes/viewer/interface/viewreg.c:442<br>
[0] Unknown type. Check for miss-spelling or missing package:<br>
<a href="https://petsc.org/release/install/install/#external-packages" rel="noreferrer" target="_blank">https://petsc.org/release/install/install/#external-packages</a><br>
[0] Unknown PetscViewer type given: hdf5<br></blockquote><div><br></div><div>The reason I wanted the output was that the C output shows the configure options that the PETSc library</div><div>was built with, However, Python seems to be eating this, so I cannot check.</div><div><br></div><div>It seems like using this container is counter-productive. If it was built correctly, making these changes would be trivial.</div><div>Send mail to FEniCS (I am guessing Chris Richardson maintains this), and ask how they intend people to change these</div><div>options.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
@Wence that makes sense. I'd assumed that the original PETSc had been<br>
overwritten, and if the linking has gone wrong I'm surprised anything<br>
happens with petsc4py at all.<br>
<br>
Your tentative command gave :<br>
<br>
ERROR: Invalid requirement: '/usr/local/petsc/src/binding/petsc4py'<br>
Hint: It looks like a path. File<br>
'/usr/local/petsc/src/binding/petsc4py' does not exist.<br>
<br>
So I tested that global variables PETSC_ARCH & PETSC_DIR were correct<br>
then ran "pip install petsc4py" to restart petsc4py from scratch. This<br>
gives rise to a different error :<br>
# python3 -c "from petsc4py import PETSc"<br>
Traceback (most recent call last):<br>
File "<string>", line 1, in <module><br>
File "/usr/local/lib/python3.9/dist-packages/petsc4py/PETSc.py",<br>
line 3, in <module><br>
PETSc = ImportPETSc(ARCH)<br>
File "/usr/local/lib/python3.9/dist-packages/petsc4py/lib/__init__.py",<br>
line 29, in ImportPETSc<br>
return Import('petsc4py', 'PETSc', path, arch)<br>
File "/usr/local/lib/python3.9/dist-packages/petsc4py/lib/__init__.py",<br>
line 73, in Import<br>
module = import_module(pkg, name, path, arch)<br>
File "/usr/local/lib/python3.9/dist-packages/petsc4py/lib/__init__.py",<br>
line 58, in import_module<br>
with f: return imp.load_module(fullname, f, fn, info)<br>
File "/usr/lib/python3.9/imp.py", line 242, in load_module<br>
return load_dynamic(name, filename, file)<br>
File "/usr/lib/python3.9/imp.py", line 342, in load_dynamic<br>
return _load(spec)<br>
ImportError: /usr/local/lib/python3.9/dist-packages/petsc4py/lib/linux-gnu-real-32/<a href="http://PETSc.cpython-39-x86_64-linux-gnu.so" rel="noreferrer" target="_blank">PETSc.cpython-39-x86_64-linux-gnu.so</a>:<br>
undefined symbol: petscstack<br>
<br>
Not sure that it a step forward ; looks like petsc4py is broken now.<br>
<br>
Quentin<br>
<br>
On Tue, 7 Dec 2021 at 14:58, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
><br>
> On Tue, Dec 7, 2021 at 8:26 AM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>><br>
>> Ok my bad, that log corresponded to a tentative --download-hdf5. This<br>
>> log corresponds to the commands given above and has --with-hdf5 in its<br>
>> options.<br>
><br>
><br>
> Okay, this configure was successful and found HDF5<br>
><br>
>><br>
>> The whole process still results in the same error.<br>
><br>
><br>
> Now send me the complete error output with this PETSc.<br>
><br>
> Thanks,<br>
><br>
> Matt<br>
><br>
>><br>
>> Quentin<br>
>><br>
>><br>
>><br>
>> Quentin CHEVALIER – IA parcours recherche<br>
>><br>
>> LadHyX - Ecole polytechnique<br>
>><br>
>> __________<br>
>><br>
>><br>
>><br>
>> On Tue, 7 Dec 2021 at 13:59, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
>> ><br>
>> > On Tue, Dec 7, 2021 at 3:55 AM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>> >><br>
>> >> Hello Matthew,<br>
>> >><br>
>> >> That would indeed make sense.<br>
>> >><br>
>> >> Full log is attached, I grepped hdf5 in there and didn't find anything alarming.<br>
>> ><br>
>> ><br>
>> > At the top of this log:<br>
>> ><br>
>> > Configure Options: --configModules=PETSc.Configure --optionsModule=config.compilerOptions PETSC_ARCH=linux-gnu-complex-64 --COPTFLAGS=-O2 --CXXOPTFLAGS=-O2 --FOPTFLAGS=-O2 --with-make-np=2 --with-64-bit-indices=yes --with-debugging=no --with-fortran-bindings=no --with-shared-libraries --download-hypre --download-mumps --download-ptscotch --download-scalapack --download-suitesparse --download-superlu_dist --with-scalar-type=complex<br>
>> ><br>
>> ><br>
>> > So the HDF5 option is not being specified.<br>
>> ><br>
>> > Thanks,<br>
>> ><br>
>> > Matt<br>
>> ><br>
>> >> Cheers,<br>
>> >><br>
>> >> Quentin<br>
>> >><br>
>> >><br>
>> >><br>
>> >><br>
>> >> Quentin CHEVALIER – IA parcours recherche<br>
>> >><br>
>> >> LadHyX - Ecole polytechnique<br>
>> >><br>
>> >> __________<br>
>> >><br>
>> >><br>
>> >><br>
>> >> On Mon, 6 Dec 2021 at 21:39, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
>> >>><br>
>> >>> On Mon, Dec 6, 2021 at 3:27 PM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>> >>>><br>
>> >>>> Fine. MWE is unchanged :<br>
>> >>>> * Run this docker container<br>
>> >>>> * Do : python3 -c "from petsc4py import PETSc; PETSc.Viewer().createHDF5('dummy.h5')"<br>
>> >>>><br>
>> >>>> Updated attempt at a fix :<br>
>> >>>> * cd /usr/local/petsc/<br>
>> >>>> * ./configure PETSC_ARCH= linux-gnu-real-32 PETSC_DIR=/usr/local/petsc --with-hdf5 --force<br>
>> >>><br>
>> >>><br>
>> >>> Did it find HDF5? If not, it will shut it off. You need to send us<br>
>> >>><br>
>> >>> $PETSC_DIR/configure.log<br>
>> >>><br>
>> >>> so we can see what happened in the configure run.<br>
>> >>><br>
>> >>> Thanks,<br>
>> >>><br>
>> >>> Matt<br>
>> >>><br>
>> >>>><br>
>> >>>> * make PETSC_DIR=/usr/local/petsc PETSC-ARCH= linux-gnu-real-32 all<br>
>> >>>><br>
>> >>>> Still no joy. The same error remains.<br>
>> >>>><br>
>> >>>> Quentin<br>
>> >>>><br>
>> >>>><br>
>> >>>><br>
>> >>>> On Mon, 6 Dec 2021 at 20:04, Pierre Jolivet <<a href="mailto:pierre@joliv.et" target="_blank">pierre@joliv.et</a>> wrote:<br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> > On 6 Dec 2021, at 7:42 PM, Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>> >>>> ><br>
>> >>>> > The PETSC_DIR exactly corresponds to the previous one, so I guess that rules option b) out, except if a specific option is required to overwrite a previous installation of PETSc. As for a), well I thought reconfiguring pretty direct, you're welcome to give me a hint as to what could be wrong in the following process.<br>
>> >>>> ><br>
>> >>>> > Steps to reproduce this behaviour are as follows :<br>
>> >>>> > * Run this docker container<br>
>> >>>> > * Do : python3 -c "from petsc4py import PETSc; PETSc.Viewer().createHDF5('dummy.h5')"<br>
>> >>>> ><br>
>> >>>> > After you get the error Unknown PetscViewer type, feel free to try :<br>
>> >>>> ><br>
>> >>>> > * cd /usr/local/petsc/<br>
>> >>>> > * ./configure --with-hfd5<br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> > It’s hdf5, not hfd5.<br>
>> >>>> > It’s PETSC_ARCH, not PETSC-ARCH.<br>
>> >>>> > PETSC_ARCH is missing from your configure line.<br>
>> >>>> ><br>
>> >>>> > Thanks,<br>
>> >>>> > Pierre<br>
>> >>>> ><br>
>> >>>> > * make PETSC_DIR=/usr/local/petsc PETSC-ARCH=linux-gnu-real-32 all<br>
>> >>>> ><br>
>> >>>> > Then repeat the MWE and observe absolutely no behavioural change whatsoever. I'm afraid I don't know PETSc well enough to be surprised by that.<br>
>> >>>> ><br>
>> >>>> > Quentin<br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> > Quentin CHEVALIER – IA parcours recherche<br>
>> >>>> ><br>
>> >>>> > LadHyX - Ecole polytechnique<br>
>> >>>> ><br>
>> >>>> > __________<br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> ><br>
>> >>>> > On Mon, 6 Dec 2021 at 19:24, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
>> >>>> >><br>
>> >>>> >> On Mon, Dec 6, 2021 at 1:22 PM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>> >>>> >>><br>
>> >>>> >>> It failed all of the tests included in `make<br>
>> >>>> >>> PETSC_DIR=/usr/local/petsc PETSC-ARCH=linux-gnu-real-32 check`, with<br>
>> >>>> >>> the error `/usr/bin/bash: line 1: cd: src/snes/tutorials: No such file<br>
>> >>>> >>> or directory`<br>
>> >>>> >>><br>
>> >>>> >>> I am therefore fairly confident this a "file absence" problem, and not<br>
>> >>>> >>> a compilation problem.<br>
>> >>>> >>><br>
>> >>>> >>> I repeat that there was no error at compilation stage. The final stage<br>
>> >>>> >>> did present `gmake[3]: Nothing to be done for 'libs'.` but that's all.<br>
>> >>>> >>><br>
>> >>>> >>> Again, running `./configure --with-hdf5` followed by a `make<br>
>> >>>> >>> PETSC_DIR=/usr/local/petsc PETSC-ARCH=linux-gnu-real-32 all` does not<br>
>> >>>> >>> change the problem. I get the same error at the same position as<br>
>> >>>> >>> before.<br>
>> >>>> >><br>
>> >>>> >><br>
>> >>>> >> If you reconfigured and rebuilt, it is impossible to get the same error, so<br>
>> >>>> >><br>
>> >>>> >> a) You did not reconfigure<br>
>> >>>> >><br>
>> >>>> >> b) Your new build is somewhere else on the machine<br>
>> >>>> >><br>
>> >>>> >> Thanks,<br>
>> >>>> >><br>
>> >>>> >> Matt<br>
>> >>>> >><br>
>> >>>> >>><br>
>> >>>> >>> I will comment I am running on OpenSUSE.<br>
>> >>>> >>><br>
>> >>>> >>> Quentin<br>
>> >>>> >>><br>
>> >>>> >>> On Mon, 6 Dec 2021 at 19:09, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
>> >>>> >>> ><br>
>> >>>> >>> > On Mon, Dec 6, 2021 at 1:08 PM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>> >>>> >>> >><br>
>> >>>> >>> >> Hello Matthew and thanks for your quick response.<br>
>> >>>> >>> >><br>
>> >>>> >>> >> I'm afraid I did try to snoop around the container and rerun PETSc's<br>
>> >>>> >>> >> configure with the --with-hdf5 option, to absolutely no avail.<br>
>> >>>> >>> >><br>
>> >>>> >>> >> I didn't see any errors during config or make, but it failed the tests<br>
>> >>>> >>> >> (which aren't included in the minimal container I suppose)<br>
>> >>>> >>> ><br>
>> >>>> >>> ><br>
>> >>>> >>> > Failed which tests? What was the error?<br>
>> >>>> >>> ><br>
>> >>>> >>> > Thanks,<br>
>> >>>> >>> ><br>
>> >>>> >>> > Matt<br>
>> >>>> >>> ><br>
>> >>>> >>> >><br>
>> >>>> >>> >> Quentin<br>
>> >>>> >>> >><br>
>> >>>> >>> >><br>
>> >>>> >>> >><br>
>> >>>> >>> >> Quentin CHEVALIER – IA parcours recherche<br>
>> >>>> >>> >><br>
>> >>>> >>> >> LadHyX - Ecole polytechnique<br>
>> >>>> >>> >><br>
>> >>>> >>> >> __________<br>
>> >>>> >>> >><br>
>> >>>> >>> >><br>
>> >>>> >>> >><br>
>> >>>> >>> >> On Mon, 6 Dec 2021 at 19:02, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
>> >>>> >>> >> ><br>
>> >>>> >>> >> > On Mon, Dec 6, 2021 at 11:28 AM Quentin Chevalier <<a href="mailto:quentin.chevalier@polytechnique.edu" target="_blank">quentin.chevalier@polytechnique.edu</a>> wrote:<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> Hello PETSc users,<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> This email is a duplicata of this gitlab issue, sorry for any inconvenience caused.<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> I want to compute a PETSc vector in real mode, than perform calculations with it in complex mode. I want as much of this process to be parallel as possible. Right now, I compile PETSc in real mode, compute my vector and save it to a file, then switch to complex mode, read it, and move on.<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> This creates unexpected behaviour using MPIIO, so on Lisandro Dalcinl's advice I'm moving to HDF5 format. My code is as follows (taking inspiration from petsc4py doc, a bitbucket example and another one, all top Google results for 'petsc hdf5') :<br>
>> >>>> >>> >> >>><br>
>> >>>> >>> >> >>> viewer = PETSc.Viewer().createHDF5(file_name, 'r', COMM_WORLD)<br>
>> >>>> >>> >> >>> q.load(viewer)<br>
>> >>>> >>> >> >>> q.ghostUpdate(addv=PETSc.InsertMode.INSERT, mode=PETSc.ScatterMode.FORWARD)<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> This crashes my code. I obtain traceback :<br>
>> >>>> >>> >> >>><br>
>> >>>> >>> >> >>> File "/home/shared/code.py", line 121, in Load<br>
>> >>>> >>> >> >>> viewer = PETSc.Viewer().createHDF5(file_name, 'r', COMM_WORLD)<br>
>> >>>> >>> >> >>> File "PETSc/Viewer.pyx", line 182, in petsc4py.PETSc.Viewer.createHDF5<br>
>> >>>> >>> >> >>> petsc4py.PETSc.Error: error code 86<br>
>> >>>> >>> >> >>> [0] PetscViewerSetType() at /usr/local/petsc/src/sys/classes/viewer/interface/viewreg.c:442<br>
>> >>>> >>> >> >>> [0] Unknown type. Check for miss-spelling or missing package: <a href="https://petsc.org/release/install/install/#external-packages" rel="noreferrer" target="_blank">https://petsc.org/release/install/install/#external-packages</a><br>
>> >>>> >>> >> >>> [0] Unknown PetscViewer type given: hdf5<br>
>> >>>> >>> >> ><br>
>> >>>> >>> >> > This means that PETSc has not been configured with HDF5 (--with-hdf5 or --download-hdf5), so the container should be updated.<br>
>> >>>> >>> >> ><br>
>> >>>> >>> >> > THanks,<br>
>> >>>> >>> >> ><br>
>> >>>> >>> >> > Matt<br>
>> >>>> >>> >> ><br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> I have petsc4py 3.16 from this docker container (list of dependencies include PETSc and petsc4py).<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> I'm pretty sure this is not intended behaviour. Any insight as to how to fix this issue (I tried running ./configure --with-hdf5 to no avail) or more generally to perform this jiggling between real and complex would be much appreciated,<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> Kind regards.<br>
>> >>>> >>> >> >><br>
>> >>>> >>> >> >> Quentin<br>
>> >>>> >>> >> ><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/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
>> >>>> >>> ><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/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
>> >>>> >><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/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
>> >>>> ><br>
>> >>>> > <image003.jpg><br>
>> >>>> ><br>
>> >>>> ><br>
>> >>><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/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
>> ><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/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
><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/" rel="noreferrer" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>