<?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 Re: Scalapack and several tasks in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865706#M7950</link>
    <description>&lt;P&gt;Hello, Semyon,&lt;BR /&gt;&lt;BR /&gt;I'd like to suggest youan example located&lt;A href="http://www.cs.utk.edu/~rwhaley/BLACS/Examples.html#PROCMAP" target="_blank"&gt;here&lt;/A&gt;. Usinga functionlike in theexample you could form different contexts over different set of processes and then use these contexts to share different tasks. For example:&lt;BR /&gt;&lt;BR /&gt;PROCMAP( ICNTX1, 2, 0, 2, 1, IWRK ) - Creates a context which involves first two processes,&lt;BR /&gt;PROCMAP( ICNTX2, 2, 2, 2, 1, IWRK ) - Creates a context which involves 3rd and 4th processes.&lt;BR /&gt;&lt;BR /&gt;Then you could use for example ICNTX1with DESCINIT to create a matrix for the first group of processes.&lt;BR /&gt;Sowhen youcall computational routine with the matrix, only processesfrom the contextwill be involved for operations over it.&lt;BR /&gt;&lt;BR /&gt;The PROCMAP from the example doesn't support stride over process to make processes 1 and 3 work on one task while 2 and 4 on another, but you could simply addthis by yourself for example by replacing K = K + 1 with K = K + STRIDE and correcting the check in the beginning: IF (NPROCS-BEGPROC .LT. NPROW*NPCOL) to IF (NPROCS-BEGPROC*STRIDE .LT. NPROW*NPCOL) with obviously adding STRIDE as input parameter.&lt;BR /&gt;&lt;BR /&gt;W.B.R.&lt;BR /&gt;Alexander&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2009 07:32:23 GMT</pubDate>
    <dc:creator>Alexander_K_Intel3</dc:creator>
    <dc:date>2009-12-10T07:32:23Z</dc:date>
    <item>
      <title>Scalapack and several tasks</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865705#M7949</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;While reading MKL Scalapack manual I haven't understood how I can solve several&lt;BR /&gt;tasks simultaniously. If I have n processors, I'd like&lt;BR /&gt;(1..n/2) processors to solve one linear equation and (n/2+1..n) processors to solve another&lt;BR /&gt;equation. I should setup several icontxt? How can I do that?&lt;BR /&gt;&lt;BR /&gt;And more complex situation:&lt;BR /&gt;If I have 4 processors, I'd like on the first step solve 2 tasks&lt;BR /&gt;Processors No 1,2 - task 1&lt;BR /&gt;Processors No 3,4 - task 2&lt;BR /&gt;and on the second step next 2 tasks&lt;BR /&gt;Processors No 1,3 - task 3&lt;BR /&gt;Processors No 2,4 - task 4&lt;BR /&gt;&lt;BR /&gt;Thanks, Semyon.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Dec 2009 19:49:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865705#M7949</guid>
      <dc:creator>semyon</dc:creator>
      <dc:date>2009-12-09T19:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scalapack and several tasks</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865706#M7950</link>
      <description>&lt;P&gt;Hello, Semyon,&lt;BR /&gt;&lt;BR /&gt;I'd like to suggest youan example located&lt;A href="http://www.cs.utk.edu/~rwhaley/BLACS/Examples.html#PROCMAP" target="_blank"&gt;here&lt;/A&gt;. Usinga functionlike in theexample you could form different contexts over different set of processes and then use these contexts to share different tasks. For example:&lt;BR /&gt;&lt;BR /&gt;PROCMAP( ICNTX1, 2, 0, 2, 1, IWRK ) - Creates a context which involves first two processes,&lt;BR /&gt;PROCMAP( ICNTX2, 2, 2, 2, 1, IWRK ) - Creates a context which involves 3rd and 4th processes.&lt;BR /&gt;&lt;BR /&gt;Then you could use for example ICNTX1with DESCINIT to create a matrix for the first group of processes.&lt;BR /&gt;Sowhen youcall computational routine with the matrix, only processesfrom the contextwill be involved for operations over it.&lt;BR /&gt;&lt;BR /&gt;The PROCMAP from the example doesn't support stride over process to make processes 1 and 3 work on one task while 2 and 4 on another, but you could simply addthis by yourself for example by replacing K = K + 1 with K = K + STRIDE and correcting the check in the beginning: IF (NPROCS-BEGPROC .LT. NPROW*NPCOL) to IF (NPROCS-BEGPROC*STRIDE .LT. NPROW*NPCOL) with obviously adding STRIDE as input parameter.&lt;BR /&gt;&lt;BR /&gt;W.B.R.&lt;BR /&gt;Alexander&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2009 07:32:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865706#M7950</guid>
      <dc:creator>Alexander_K_Intel3</dc:creator>
      <dc:date>2009-12-10T07:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scalapack and several tasks</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865707#M7951</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/93635"&gt;Alexander Kobotov (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;P&gt;Hello, Semyon,&lt;BR /&gt;&lt;BR /&gt;I'd like to suggest youan example located&lt;A href="http://www.cs.utk.edu/~rwhaley/BLACS/Examples.html#PROCMAP" target="_blank"&gt;here&lt;/A&gt;. Usinga functionlike in theexample you could form different contexts over different set of processes and then use these contexts to share different tasks. For example:&lt;BR /&gt;&lt;BR /&gt;PROCMAP( ICNTX1, 2, 0, 2, 1, IWRK ) - Creates a context which involves first two processes,&lt;BR /&gt;PROCMAP( ICNTX2, 2, 2, 2, 1, IWRK ) - Creates a context which involves 3rd and 4th processes.&lt;BR /&gt;&lt;BR /&gt;Then you could use for example ICNTX1with DESCINIT to create a matrix for the first group of processes.&lt;BR /&gt;Sowhen youcall computational routine with the matrix, only processesfrom the contextwill be involved for operations over it.&lt;BR /&gt;&lt;BR /&gt;The PROCMAP from the example doesn't support stride over process to make processes 1 and 3 work on one task while 2 and 4 on another, but you could simply addthis by yourself for example by replacing K = K + 1 with K = K + STRIDE and correcting the check in the beginning: IF (NPROCS-BEGPROC .LT. NPROW*NPCOL) to IF (NPROCS-BEGPROC*STRIDE .LT. NPROW*NPCOL) with obviously adding STRIDE as input parameter.&lt;BR /&gt;&lt;BR /&gt;W.B.R.&lt;BR /&gt;Alexander&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I tried to use PROCMAP, but found out that blacs_pnum doesn't work, a simple program&lt;/P&gt;
&lt;P&gt;program main&lt;BR /&gt; integer :: ictxt, nprow, npcol, myrow, mycol&lt;BR /&gt; integer :: iam, nprocs&lt;BR /&gt; integer :: pnum&lt;BR /&gt;call blacs_pinfo(iam, nprocs)&lt;BR /&gt;nprow=1&lt;BR /&gt; npcol=nprocs&lt;BR /&gt; call blacs_get(-1,0,ictxt)&lt;BR /&gt; call blacs_gridinit(ictxt,'R',nprow,npcol)&lt;BR /&gt; call blacs_gridinfo(ictxt,nprow,npcol,myrow,mycol)&lt;BR /&gt; pnum=blacs_pnum(ictxt, myrow, mycol)&lt;BR /&gt; write (*,*) 'myrow=',myrow,'mycol=',mycol,'pnum=',pnum&lt;BR /&gt;call blacs_gridexit(ictxt)&lt;BR /&gt; call blacs_exit(0)&lt;BR /&gt; end program main&lt;/P&gt;
&lt;P&gt;Results to:&lt;/P&gt;
&lt;P&gt;semyon@kepler ~/scalapack $ mpirun -n 4 a.out&lt;BR /&gt; myrow=           0 mycol=           0 pnum=           0&lt;BR /&gt; myrow=           0 mycol=           1 pnum=           0&lt;BR /&gt; myrow=           0 mycol=           2 pnum=           0&lt;BR /&gt; myrow=           0 mycol=           3 pnum=           0&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I wrote a program without blacs_pnum() but it tells me:&lt;/P&gt;
&lt;P&gt;PDDTTRF parameter number  606 had an illegal value&lt;/P&gt;
&lt;P&gt;and info=-606&lt;/P&gt;
&lt;P&gt;PDDTTRS parameter number 1103 had an illegal value&lt;/P&gt;
&lt;P&gt;info=-1103&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;what does it mean? I expected info variable to be from 1 to 10.&lt;/P&gt;
&lt;P&gt;Semyon.&lt;/P&gt;
&lt;P&gt;program main&lt;BR /&gt; integer :: iam, nprocs&lt;BR /&gt; integer :: ictxt, ictxt_temp, ictxt1, ictxt2&lt;BR /&gt; integer :: usermap(1,10)&lt;BR /&gt; integer :: i, j&lt;BR /&gt; integer :: nprow, npcol, nprow0, npcol0&lt;BR /&gt; integer :: myrow, mycol&lt;BR /&gt; integer :: mr, mc&lt;BR /&gt; integer :: GNx, GNy, Nx, Ny&lt;BR /&gt; double precision :: phi(100,100)&lt;BR /&gt; double precision :: boundl(100), boundr(100), boundu(100), boundd(100)&lt;BR /&gt; double precision :: dl(100), du(100), d(100), f(100)&lt;BR /&gt; double precision :: dx, dy, tau&lt;BR /&gt; integer :: desca(7), descf(7)&lt;BR /&gt; double precision :: af(1000), work(1000)&lt;BR /&gt; integer :: laf, lwork, Nrhs&lt;BR /&gt;&lt;BR /&gt; call blacs_pinfo(iam, nprocs)&lt;BR /&gt;&lt;BR /&gt; nprow0=1&lt;BR /&gt; npcol0=nprocs&lt;BR /&gt;&lt;BR /&gt; nprow = int(sqrt(real(nprocs)))&lt;BR /&gt; npcol = nprocs/nprow&lt;BR /&gt;&lt;BR /&gt;mycol=mod(iam,npcol)&lt;BR /&gt; myrow=iam/npcol&lt;BR /&gt;&lt;BR /&gt; do i=1,nprow&lt;BR /&gt; call blacs_get(0,0,ictxt)&lt;BR /&gt; call blacs_gridinit(ictxt, 'R', nprow, npcol)&lt;BR /&gt; call blacs_gridinfo(ictxt, nprow, npcol, mr, mc)&lt;BR /&gt;!     write (*,*) ictxt&lt;BR /&gt; do j=1,npcol&lt;BR /&gt; usermap(1,j)=npcol*(i-1)+j-1&lt;BR /&gt; end do&lt;BR /&gt; call blacs_get(ictxt, 10, ictxt_temp)&lt;BR /&gt; call blacs_gridmap(ictxt_temp, usermap, 1, 1, npcol)&lt;BR /&gt; if ((i-1)==myrow) then&lt;BR /&gt; ictxt1=ictxt_temp&lt;BR /&gt; end if&lt;BR /&gt;end do&lt;BR /&gt;&lt;BR /&gt; do i=1,npcol&lt;BR /&gt; call blacs_get(0,0,ictxt)&lt;BR /&gt; call blacs_gridinit(ictxt, 'R', nprow, npcol)&lt;BR /&gt; call blacs_gridinfo(ictxt, nprow, npcol, mr, mc)&lt;BR /&gt; do j=1,nprow&lt;BR /&gt; usermap(1,j)=npcol*(j-1)+i-1&lt;BR /&gt; end do&lt;BR /&gt; call blacs_get(ictxt, 10, ictxt_temp)&lt;BR /&gt; call blacs_gridmap(ictxt_temp, usermap, 1, 1, nprow)&lt;BR /&gt; if ((i-1)==mycol) then&lt;BR /&gt; ictxt2=ictxt_temp&lt;BR /&gt; end if&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; write (*,*) 'iam=',iam,'ictxt1=',ictxt1,'ictxt2=',ictxt2&lt;BR /&gt;&lt;BR /&gt; GNx=10&lt;BR /&gt; GNy=10&lt;BR /&gt; Nx=GNx/npcol&lt;BR /&gt; Ny=GNx/nprow&lt;BR /&gt; if(mycol==(npcol-1)) then&lt;BR /&gt; Nx=GNx-(npcol-1)*Nx&lt;BR /&gt; end if&lt;BR /&gt; if(myrow==(nprow-1)) then&lt;BR /&gt; Ny=GNy-(nprow-1)*Ny&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; write (*,*) 'iam=',iam,'Nx=',Nx,'Ny=',Ny&lt;BR /&gt;&lt;BR /&gt; tau=1.0d0&lt;BR /&gt; dx=1.0d0&lt;BR /&gt; dy=1.0d0&lt;BR /&gt;&lt;BR /&gt; do i=1,Nx&lt;BR /&gt; do j=1,Ny&lt;BR /&gt; phi(i,j)=0.0&lt;BR /&gt; end do&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; if(mycol==0) then&lt;BR /&gt; do j=1,Ny&lt;BR /&gt; boundl(j)=1.0&lt;BR /&gt; end do&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; if(mycol==(npcol-1)) then&lt;BR /&gt; do j=1,Ny&lt;BR /&gt; boundr(j)=0.0&lt;BR /&gt; end do&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; if(myrow==0) then&lt;BR /&gt; do i=1,Nx&lt;BR /&gt; j=mycol*Nx+i&lt;BR /&gt; boundd(i)=1.0-(j-1)*dx*1.0/((NGx-1)*dx)&lt;BR /&gt; end do&lt;BR /&gt; end if&lt;BR /&gt; &lt;BR /&gt; if(myrow==(nprow-1)) then&lt;BR /&gt; do i=1,Nx&lt;BR /&gt; j=mycol*Nx+i&lt;BR /&gt; boundu(i)=1.0-(j-1)*dx*1.0/((NGx-1)*dx)&lt;BR /&gt; end do&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; desca(1)=501&lt;BR /&gt; desca(2)=ictxt1&lt;BR /&gt; desca(3)=NGx&lt;BR /&gt; desca(4)=Nx&lt;BR /&gt; desca(5)=0&lt;BR /&gt; desca(6)=0&lt;BR /&gt; desca(7)=0&lt;BR /&gt;&lt;BR /&gt; descf(1)=502&lt;BR /&gt; descf(2)=ictxt1&lt;BR /&gt; descf(3)=NGx&lt;BR /&gt; descf(4)=Nx&lt;BR /&gt; descf(5)=0&lt;BR /&gt; descf(6)=Nx&lt;BR /&gt; descf(7)=0&lt;BR /&gt;&lt;BR /&gt; do i=1,Nx&lt;BR /&gt; dl(i)=-1.0/(2.0*dx*dx)&lt;BR /&gt; d(i)=1/tau+1/(dx*dx)&lt;BR /&gt; du(i)=-1.0d0/(2.0d0*dx*dx)&lt;BR /&gt; f(i)=0.0&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; if(myrow==0) then&lt;BR /&gt; if(mycol==0) then&lt;BR /&gt; d(1)=1.0&lt;BR /&gt; du(1)=0.0&lt;BR /&gt; f(1)=1.0&lt;BR /&gt; end if&lt;BR /&gt; else&lt;BR /&gt; if(mycol==0) then&lt;BR /&gt; d(1)=1.0&lt;BR /&gt; du(1)=0.0&lt;BR /&gt; f(1)=2.0&lt;BR /&gt; end if&lt;BR /&gt; end if&lt;BR /&gt; if(mycol==(npcol-1)) then&lt;BR /&gt; d(Nx)=1.0&lt;BR /&gt; dl(Nx)=0.0&lt;BR /&gt; f(Nx)=0.0&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; laf=1000&lt;BR /&gt; lwork=1000&lt;BR /&gt; Nrhs=1&lt;BR /&gt;&lt;BR /&gt; call pddttrf(GNx, dl, d, du, 1, desca, af, laf, work, lwork, info)&lt;BR /&gt; if (info.ne.0) then&lt;BR /&gt; write (*,*) 'Error: info=',info&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt; call pddttrs('N', GNx, Nrhs, dl, d, du, 1, desca, f, 1, descf, af, laf, work, lwork, info)&lt;BR /&gt; if (info.ne.0) then&lt;BR /&gt; write (*,*) 'Error: info=',info&lt;BR /&gt; end if&lt;BR /&gt; &lt;BR /&gt; do i=1,Nx&lt;BR /&gt; phi(i,myrow)=f(i)&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; write(*,*) (phi(i,myrow),i=1,Nx)&lt;BR /&gt;&lt;BR /&gt; call blacs_exit(0)&lt;BR /&gt; &lt;BR /&gt;end program main&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2009 15:34:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Scalapack-and-several-tasks/m-p/865707#M7951</guid>
      <dc:creator>semyon</dc:creator>
      <dc:date>2009-12-12T15:34:18Z</dc:date>
    </item>
  </channel>
</rss>

