<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>My code has some problems now after converting to 64bit indices.</p>
    <p>After debugging, I realised that I'm using:</p>
    <p>call
MPI_ALLGATHER(counter,1,MPI_INTEGER,counter_global,1,MPI_INTEGER,MPI_COMM_WORLD,ierr)</p>
    <p>but now counter and counter_global are both 64bit integers. So
      should I change all mpi routine from MPI_INTEGER to MPI_INTEGER8?</p>
    <p>But if I switch back to using the 32bit PETSc, do I have to
      switch back again? In that case, does it mean I need to have 2
      copies of my code - one to compile with PETSc 32, another to
      compile with PETSc 64?</p>
    <p>Is there an easier way?<br>
    </p>
    <pre class="moz-signature" cols="72">Thank you very much.

Yours sincerely,

================================================
TAY Wee-Beng (Zheng Weiming) 郑伟明
Personal research webpage: <a class="moz-txt-link-freetext" href="http://tayweebeng.wixsite.com/website">http://tayweebeng.wixsite.com/website</a>
Youtube research showcase: <a class="moz-txt-link-freetext" href="https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA">https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA</a>
linkedin: <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/tay-weebeng">www.linkedin.com/in/tay-weebeng</a>
================================================</pre>
    <div class="moz-cite-prefix">On 5/9/2018 6:25 PM, Matthew Knepley
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMYG4G=8n8V2TkqR+T7y+Pbsi0C83hERtbhSUB4j3C83sOwujA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <div dir="ltr">
        <div class="gmail_quote">
          <div dir="ltr">On Wed, Sep 5, 2018 at 3:27 AM TAY wee-beng
            <<a href="mailto:zonexo@gmail.com" moz-do-not-send="true">zonexo@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
            On 31/8/2018 10:43 AM, Smith, Barry F. wrote:<br>
            ><br>
            >> On Aug 30, 2018, at 9:40 PM, TAY wee-beng <<a
              href="mailto:zonexo@gmail.com" target="_blank"
              moz-do-not-send="true">zonexo@gmail.com</a>> wrote:<br>
            >><br>
            >><br>
            >> On 31/8/2018 10:38 AM, Smith, Barry F. wrote:<br>
            >>>    PetscReal is by default real(8) you can
            leave those alone<br>
            >>><br>
            >>>     Any integer you pass to a PETSc routine
            needs to be declared as PetscInt (not integer) otherwise the
            64 bit indices stuff won't work.<br>
            >>><br>
            >>>     Barry<br>
            >>><br>
            >> Hi,<br>
            >><br>
            >> ok, I got it. Btw, is it advisable to change all
            integer in my code to PetscInt?<br>
            >><br>
            >> Will it cause any conflict or waste a lot of
            memory?<br>
            >><br>
            >> Or should I only change those related to PETSc?<br>
            >      That is up to you. Since you probably pass the
            values between PETSc and non-PETSc part of the code it is
            probably easier just to make all the integer PetscInt
            instead. No performance difference that you can measure by
            keeping a few integer around.<br>
            ><br>
            >      Barry<br>
            Hi,<br>
            <br>
            For some small parts of the code, it is preferred to use
            integer <br>
            instead. Btw, to force variable as integer, I can use
            int(aa). However, <br>
            I tried to force variable as PetscInt using PetscInt(aa) but
            it can't work.<br>
            <br>
            Is there any way I can make it work?<br>
          </blockquote>
          <div><br>
          </div>
          <div>I think you just define a PetscInt variable and use
            assignment.</div>
          <div><br>
          </div>
          <div>   Matt</div>
          <div> </div>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            Thanks.<br>
            >> Thanks!<br>
            >>>> On Aug 30, 2018, at 9:35 PM, TAY wee-beng
            <<a href="mailto:zonexo@gmail.com" target="_blank"
              moz-do-not-send="true">zonexo@gmail.com</a>> wrote:<br>
            >>>><br>
            >>>><br>
            >>>> On 31/8/2018 10:21 AM, Matthew Knepley
            wrote:<br>
            >>>>> On Thu, Aug 30, 2018 at 10:17 PM TAY
            wee-beng <<a href="mailto:zonexo@gmail.com"
              target="_blank" moz-do-not-send="true">zonexo@gmail.com</a>>
            wrote:<br>
            >>>>> Hi,<br>
            >>>>><br>
            >>>>> Due to my increase grid size, I have to
            go 64bit. I compiled the 64bit<br>
            >>>>> PETSc w/o error. However, when I tried
            to compile my code using the<br>
            >>>>> 64bit PETSc, I got the error below. May
            I know why is this so?<br>
            >>>>><br>
            >>>>> What changes should I make?<br>
            >>>>><br>
            >>>>> Is it possible that you did not declare
            some inputs as PetscInt, so the interface check is failing?<br>
            >>>>><br>
            >>>>>     Matt<br>
            >>>> Hi,<br>
            >>>><br>
            >>>> I'm using the standard<br>
            >>>><br>
            >>>> integer ::<br>
            >>>><br>
            >>>> real(8) ::<br>
            >>>><br>
            >>>> for some variables. For some others
            relating to PETSc, I use PetscInt.<br>
            >>>><br>
            >>>> Should I change all to PetscInt and
            PetscReal?<br>
            >>>><br>
            >>>> Currently, I use real(8) for all real
            values. If I change all to PetscReal, will PetscReal be real
            or real(8) by default?<br>
            >>>><br>
            >>>> Thanks!<br>
            >>>>>   <br>
            >>>>> [tsltaywb@nus02 ibm3d_IIB_mpi]$ make -f
            makefile_2018<br>
            >>>>>
/app/intel/xe2018/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin/mpif90<br>
            >>>>> -g -ip -ipo -O3 -c -fPIC  -save
            kinefunc.F90<br>
            >>>>>
/app/intel/xe2018/compilers_and_libraries_2018.0.128/linux/mpi/intel64/bin/mpif90<br>
            >>>>> -g -ip -ipo -O3 -c -fPIC  -save  -w<br>
            >>>>>
-I/home/users/nus/tsltaywb/propeller/lib/petsc-3.9.3_intel_2018_64bit_rel/include<br>
            >>>>>
-I/app/intel/xe2018/compilers_and_libraries_2018.0.128/linux/mpi/intel64/include<br>
            >>>>> global.F90<br>
            >>>>> global.F90(979): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>> call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> -----^<br>
            >>>>> global.F90(989): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>>       call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> ---------^<br>
            >>>>> global.F90(997): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>>       call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> ---------^<br>
            >>>>> global.F90(1005): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>>       call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> ---------^<br>
            >>>>> global.F90(1013): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>>       call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> ---------^<br>
            >>>>> global.F90(1021): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>>       call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> ---------^<br>
            >>>>> global.F90(1029): error #6285: There is
            no matching specific subroutine<br>
            >>>>> for this generic subroutine call. 
             [DMDACREATE3D]<br>
            >>>>>       call<br>
            >>>>>
DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&<br>
            >>>>> ---------^<br>
            >>>>> compilation aborted for global.F90
            (code 1)<br>
            >>>>><br>
            >>>>> -- <br>
            >>>>> Thank you very much.<br>
            >>>>><br>
            >>>>> Yours sincerely,<br>
            >>>>><br>
            >>>>>
            ================================================<br>
            >>>>> TAY Wee-Beng (Zheng Weiming) 郑伟明<br>
            >>>>> Personal research webpage: <a
              href="http://tayweebeng.wixsite.com/website"
              rel="noreferrer" target="_blank" moz-do-not-send="true">http://tayweebeng.wixsite.com/website</a><br>
            >>>>> Youtube research showcase: <a
              href="https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA</a><br>
            >>>>> linkedin: <a
              href="http://www.linkedin.com/in/tay-weebeng"
              rel="noreferrer" target="_blank" moz-do-not-send="true">www.linkedin.com/in/tay-weebeng</a><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/%7Eknepley/"
              rel="noreferrer" target="_blank" moz-do-not-send="true">https://www.cse.buffalo.edu/~knepley/</a><br>
            <br>
          </blockquote>
        </div>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div dir="ltr" class="gmail_signature"
          data-smartmail="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/%7Eknepley/"
                        target="_blank" moz-do-not-send="true">https://www.cse.buffalo.edu/~knepley/</a><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>