<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic BLACS broadcast 64-bit integer in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BLACS-broadcast-64-bit-integer/m-p/1013340#M19328</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to broadcast a 64-bit integer with BLACS routines IGEBS2D() and IGEBR2D() --- Centos 6.5 Linux, ifort, composer_xe_2013_sp1.2.144, intel64, Intel MPI, ilp64 libs.&amp;nbsp; Despite declaring all integers as integer*8, compiling with -i8 and linking exclusively with ilp64 libs, only 32-bits of the 64-bit integer seem to be broadcast.&amp;nbsp; My compile line is:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; mpiifort -i8 -o demo1 demo1.f -warn all -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_blacs_intelmpi_ilp64 -lpthread -lm&lt;/P&gt;

&lt;P&gt;Sample program:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;      program demo1
      implicit none
      integer*8 ictxt, iam, nprocs, nprow, npcol, myprow, mypcol, bignum

!     Determine my process number and the number of processes
      call blacs_pinfo (iam, nprocs)
      if (nprocs .lt. 2) stop 'Please use mpirun with more than 1 proc'

!     Get the blacs default system context
      call blacs_get (-1, 0, ictxt)

!     Set up a (1 x nprocs) processor grid
      nprow = 1
      npcol = nprocs
      call blacs_gridinit (ictxt, 'Row-major', nprow, npcol)

!     find out where I am in the processor grid, in (myprow, mypcol)
      call blacs_gridinfo (ictxt, nprow, npcol, myprow, mypcol)

!     skip everything unless I'm in the processor grid
      if (myprow .lt. nprow .and. mypcol .lt. npcol) then

!        broadcast bignum from the master proc to all other procs
         if (myprow .eq. 0 .and. mypcol .eq. 0) then

            bignum = 3000000000
            write (6,'(''initially bignum ='',i19)'), bignum
            call igebs2d (ictxt, 'All', ' ', 1, 1, bignum, 1)

         else

            call igebr2d (ictxt, 'All', ' ', 1, 1, bignum, 1, 0, 0)

         end if

         write (6,'(''iam,nprocs,bignum='',2i4,i19)')iam, nprocs, bignum

      end if

!     tidy up and exit
      call blacs_gridexit (ictxt)
      call blacs_exit (0)

      stop
      end
&lt;/PRE&gt;

&lt;P&gt;Expected output from&amp;nbsp; mpirun -np 2 demo1&amp;nbsp; is:&lt;/P&gt;

&lt;P&gt;initially bignum =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;/P&gt;

&lt;P&gt;but instead I see:&lt;/P&gt;

&lt;P&gt;initially bignum =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1294967296&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1294967296&lt;/P&gt;

&lt;P&gt;suggesting that integer*8 bignum was truncated to 32-bits when it was broadcast.&lt;/P&gt;

&lt;P&gt;What am I doing wrong please?&lt;/P&gt;

&lt;P&gt;Thanks, Peter McGavin.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2015 10:15:21 GMT</pubDate>
    <dc:creator>Peter_M_3</dc:creator>
    <dc:date>2015-07-16T10:15:21Z</dc:date>
    <item>
      <title>BLACS broadcast 64-bit integer</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BLACS-broadcast-64-bit-integer/m-p/1013340#M19328</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to broadcast a 64-bit integer with BLACS routines IGEBS2D() and IGEBR2D() --- Centos 6.5 Linux, ifort, composer_xe_2013_sp1.2.144, intel64, Intel MPI, ilp64 libs.&amp;nbsp; Despite declaring all integers as integer*8, compiling with -i8 and linking exclusively with ilp64 libs, only 32-bits of the 64-bit integer seem to be broadcast.&amp;nbsp; My compile line is:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; mpiifort -i8 -o demo1 demo1.f -warn all -L${MKLROOT}/lib/intel64 -lmkl_intel_ilp64 -lmkl_core -lmkl_sequential -lmkl_blacs_intelmpi_ilp64 -lpthread -lm&lt;/P&gt;

&lt;P&gt;Sample program:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;      program demo1
      implicit none
      integer*8 ictxt, iam, nprocs, nprow, npcol, myprow, mypcol, bignum

!     Determine my process number and the number of processes
      call blacs_pinfo (iam, nprocs)
      if (nprocs .lt. 2) stop 'Please use mpirun with more than 1 proc'

!     Get the blacs default system context
      call blacs_get (-1, 0, ictxt)

!     Set up a (1 x nprocs) processor grid
      nprow = 1
      npcol = nprocs
      call blacs_gridinit (ictxt, 'Row-major', nprow, npcol)

!     find out where I am in the processor grid, in (myprow, mypcol)
      call blacs_gridinfo (ictxt, nprow, npcol, myprow, mypcol)

!     skip everything unless I'm in the processor grid
      if (myprow .lt. nprow .and. mypcol .lt. npcol) then

!        broadcast bignum from the master proc to all other procs
         if (myprow .eq. 0 .and. mypcol .eq. 0) then

            bignum = 3000000000
            write (6,'(''initially bignum ='',i19)'), bignum
            call igebs2d (ictxt, 'All', ' ', 1, 1, bignum, 1)

         else

            call igebr2d (ictxt, 'All', ' ', 1, 1, bignum, 1, 0, 0)

         end if

         write (6,'(''iam,nprocs,bignum='',2i4,i19)')iam, nprocs, bignum

      end if

!     tidy up and exit
      call blacs_gridexit (ictxt)
      call blacs_exit (0)

      stop
      end
&lt;/PRE&gt;

&lt;P&gt;Expected output from&amp;nbsp; mpirun -np 2 demo1&amp;nbsp; is:&lt;/P&gt;

&lt;P&gt;initially bignum =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;/P&gt;

&lt;P&gt;but instead I see:&lt;/P&gt;

&lt;P&gt;initially bignum =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000000000&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1294967296&lt;BR /&gt;
	iam,nprocs,bignum=&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -1294967296&lt;/P&gt;

&lt;P&gt;suggesting that integer*8 bignum was truncated to 32-bits when it was broadcast.&lt;/P&gt;

&lt;P&gt;What am I doing wrong please?&lt;/P&gt;

&lt;P&gt;Thanks, Peter McGavin.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2015 10:15:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BLACS-broadcast-64-bit-integer/m-p/1013340#M19328</guid>
      <dc:creator>Peter_M_3</dc:creator>
      <dc:date>2015-07-16T10:15:21Z</dc:date>
    </item>
    <item>
      <title>Three things I thought of</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BLACS-broadcast-64-bit-integer/m-p/1013341#M19329</link>
      <description>&lt;P&gt;Three things I thought of later, but they didn't work:&lt;/P&gt;

&lt;P&gt;1: Adding the -ilp64 option to the mpiifort command;&lt;/P&gt;

&lt;P&gt;2: Adding the -ilp64 option to the mpirun command;&lt;/P&gt;

&lt;P&gt;3: Moving the blacs_gridexit() call to where it's supposed to be --- inside the preceding 'if I'm in the processor grid' clause.&lt;/P&gt;

&lt;P&gt;Problem is still unsolved - any help appreciated.&lt;/P&gt;

&lt;P&gt;Thanks, Peter McGavin.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2015 09:46:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/BLACS-broadcast-64-bit-integer/m-p/1013341#M19329</guid>
      <dc:creator>Peter_M_3</dc:creator>
      <dc:date>2015-07-18T09:46:26Z</dc:date>
    </item>
  </channel>
</rss>

