[petsc-users] Compiling problem after upgrading to PETSc 3.8.3

Smith, Barry F. bsmith at mcs.anl.gov
Tue Feb 20 20:47:23 CST 2018


  Try setting

  u_global = tVec(1)

  immediately before the call to DMCreateGlobalVector()



> On Feb 20, 2018, at 6:40 PM, TAY wee-beng <zonexo at gmail.com> wrote:
> 
> Hi,
> 
> Indeed, replacing tvec with t_vec solves the problem. Now I'm trying to debug step by step. I got into problem when calling:
> 
> call DMCreateGlobalVector(da_u,u_global,ierr)
> 
> The error is:
> 
> [0]PETSC ERROR: --------------------- Error Message ----------------------------
> ----------------------------------
> [0]PETSC ERROR: Null argument, when expecting valid pointer
> [0]PETSC ERROR: Null Object: Parameter # 2
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trou
> ble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.8.3, Dec, 09, 2017
> [0]PETSC ERROR: C:\Obj_tmp\ibm3d_IIB_mpi\Debug\ibm3d_IIB_mpi.exe on a petsc-3.8.
> 3_win64_msmpi_vs2008 named 1C3YYY1-PC by tsltaywb Wed Feb 21 10:20:20 2018
> [0]PETSC ERROR: Configure options --with-cc="win32fe icl" --with-fc="win32fe ifo
> rt" --with-cxx="win32fe icl" --download-fblaslapack --with-mpi-include="[/cygdri
> ve/c/Program Files (x86)/Microsoft SDKs/MPI/Include,/cygdrive/c/Program Files (x....
> 
> But all I changed is from:
> 
> module global_data
> #include "petsc/finclude/petsc.h"
> use petsc
> use kdtree2_module
> implicit none
> save
> !grid variables
> 
> integer :: size_x,s....
> 
> ...
> 
> to
> 
> module global_data
> use kdtree2_module
> implicit none
> save
> #include "petsc/finclude/petsc.h90"
> !grid variables
> integer :: size_x,s...
> 
> ...
> 
> da_u, u_global were declared thru:
> 
> DM  da_u,da_v,...
> DM  da_cu_types ...
> Vec u_local,u_global,v_local...
> 
> So what could be the problem?
> 
> 
> Thank you very much.
> 
> Yours sincerely,
> 
> ================================================
> TAY Wee-Beng (Zheng Weiming) 郑伟明
> Personal research webpage: http://tayweebeng.wixsite.com/website
> Youtube research showcase: https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA
> linkedin: www.linkedin.com/in/tay-weebeng
> ================================================
> 
> On 20/2/2018 10:46 PM, Jose E. Roman wrote:
>> Probably the first error is produced by using a variable (mpi_comm) with the same name as an MPI type.
>> 
>> The second error I guess is due to variable tvec, since a Fortran type tVec is now being defined in src/vec/f90-mod/petscvec.h
>> 
>> Jose
>> 
>> 
>>> El 20 feb 2018, a las 15:35, Smith, Barry F. <bsmith at mcs.anl.gov> escribió:
>>> 
>>> 
>>>   Please run a clean compile of everything and cut and paste all the output. This will make it much easier to debug than trying to understand your snippets of what is going wrong.
>>> 
>>>> On Feb 20, 2018, at 1:56 AM, TAY Wee Beng <tsltaywb at nus.edu.sg> wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I was previously using PETSc 3.7.6 on different clusters with both Intel
>>>> Fortran and GNU Fortran. After upgrading, I met some problems when
>>>> trying to compile:
>>>> 
>>>> On Intel Fortran:
>>>> 
>>>> Previously, I was using:
>>>> 
>>>> #include "petsc/finclude/petsc.h90"
>>>> 
>>>> in *.F90 when requires the use of PETSc
>>>> 
>>>> I read in the change log that h90 is no longer there and so I replaced
>>>> with #include "petsc/finclude/petsc.h"
>>>> 
>>>> It worked. But I also have some *.F90 which do not use PETSc. However,
>>>> they use some modules which uses PETSc.
>>>> 
>>>> Now I can't compile them. The error is :
>>>> 
>>>> math_routine.f90(3): error #7002: Error in opening the compiled module
>>>> file.  Check INCLUDE paths.   [PETSC]
>>>> use mpi_subroutines
>>>> 
>>>> mpi_subroutines is a module which uses PETSc, and it compiled w/o problem.
>>>> 
>>>> The solution is that I have to compile e.g.  math_routine.F90 as if they
>>>> use PETSc, by including PETSc include and lib files.
>>>> 
>>>> May I know why this is so? It was not necessary before.
>>>> 
>>>> Anyway, it managed to compile until it reached hypre.F90.
>>>> 
>>>> Previously, due to some bugs, I have to compile hypre with the -r8
>>>> option. Also, I have to use:
>>>> 
>>>> integer(8) mpi_comm
>>>> 
>>>> mpi_comm = MPI_COMM_WORLD
>>>> 
>>>> to make my codes work with HYPRE.
>>>> 
>>>> But now, compiling gives the error:
>>>> 
>>>> hypre.F90(11): error #6401: The attributes of this name conflict with
>>>> those made accessible by a USE statement.   [MPI_COMM]
>>>> integer(8) mpi_comm
>>>> --------------------------------------^
>>>> hypre.F90(84): error #6478: A type-name must not be used as a
>>>> variable.   [MPI_COMM]
>>>>   mpi_comm = MPI_COMM_WORLD
>>>> ----^
>>>> hypre.F90(84): error #6303: The assignment operation or the binary
>>>> expression operation is invalid for the data types of the two
>>>> operands.   [1140850688]
>>>>   mpi_comm = MPI_COMM_WORLD
>>>> ---------------^
>>>> hypre.F90(100): error #6478: A type-name must not be used as a
>>>> variable.   [MPI_COMM]
>>>>       call HYPRE_StructGridCreate(mpi_comm, 3, grid_hypre, ierr)
>>>> ...
>>>> 
>>>> What's actually happening? Why can't I compile now?
>>>> 
>>>> On GNU gfortran:
>>>> 
>>>> I tried to use similar tactics as above here. However, when compiling
>>>> math_routine.F90, I got the error:
>>>> 
>>>> math_routine.F90:1333:21:
>>>> 
>>>> call subb(orig,vert1,tvec)
>>>>                    1
>>>> Error: Invalid procedure argument at (1)
>>>> math_routine.F90:1339:18:
>>>> 
>>>> qvec = cross_pdt2(tvec,edge1)
>>>>                 1
>>>> Error: Invalid procedure argument at (1)
>>>> math_routine.F90:1345:21:
>>>> 
>>>>    uu = dot_product(tvec,pvec)
>>>>                    1
>>>> Error: ‘vector_a’ argument of ‘dot_product’ intrinsic at (1) must be
>>>> numeric or LOGICAL
>>>> math_routine.F90:1371:21:
>>>> 
>>>>    uu = dot_product(tvec,pvec)
>>>> 
>>>> These errors were not present before. My variables are mostly vectors:
>>>> 
>>>> real(8), intent(in) ::
>>>> orig(3),infinity(3),vert1(3),vert2(3),vert3(3),normal(3)
>>>> 
>>>> real(8) :: uu,vv,dir(3)
>>>> 
>>>> real(8) :: edge1(3),edge2(3),tvec(3),pvec(3),qvec(3),det,inv_det,epsilon,d,t
>>>> 
>>>> I wonder what happened?
>>>> 
>>>> Please advice.
>>>> 
>>>> 
>>>> --
>>>> Thank you very much.
>>>> 
>>>> Yours sincerely,
>>>> 
>>>> ================================================
>>>> TAY Wee-Beng 郑伟明
>>>> Research Scientist
>>>> Experimental AeroScience Group
>>>> Temasek Laboratories
>>>> National University of Singapore
>>>> T-Lab Building
>>>> 5A, Engineering Drive 1, #02-02
>>>> Singapore 117411
>>>> Phone: +65 65167330
>>>> E-mail: tsltaywb at nus.edu.sg
>>>> http://www.temasek-labs.nus.edu.sg/program/program_aeroexperimental_tsltaywb.php
>>>> Personal research webpage: http://tayweebeng.wixsite.com/website
>>>> Youtube research showcase: https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA
>>>> linkedin: www.linkedin.com/in/tay-weebeng
>>>> ================================================
>>>> 
>>>> 
>>>> ________________________________
>>>> 
>>>> Important: This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you.
> 



More information about the petsc-users mailing list