<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>hpc | Computo ergo sum</title>
    <link>https://hiliev.eu/tags/hpc/</link>
      <atom:link href="https://hiliev.eu/tags/hpc/index.xml" rel="self" type="application/rss+xml" />
    <description>hpc</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>(cc) 2008&amp;ndash;2020 Hristo Iliev</copyright><lastBuildDate>Thu, 22 May 2014 12:34:30 +0200</lastBuildDate>
    <image>
      <url>https://hiliev.eu/images/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png</url>
      <title>hpc</title>
      <link>https://hiliev.eu/tags/hpc/</link>
    </image>
    
    <item>
      <title>Recipe: Obtaining Peak VM Size in Pure Fortran</title>
      <link>https://hiliev.eu/post/recipe-obtaining-peak-vm-memory-size-in-pure-fortran/</link>
      <pubDate>Thu, 22 May 2014 12:34:30 +0200</pubDate>
      <guid>https://hiliev.eu/post/recipe-obtaining-peak-vm-memory-size-in-pure-fortran/</guid>
      <description>&lt;p&gt;Often in High Performance Computing one needs to know about the various memory metrics of a given program with the peak memory usage probably being the most important one.
While the &lt;code&gt;getrusage(2)&lt;/code&gt; syscall provides some of that information, it&amp;rsquo;s use in Fortran programs is far from optimal and there are lots of metrics that are not exposed by it.&lt;/p&gt;
&lt;p&gt;On Linux one could simply parse the &lt;code&gt;/proc/PID/status&lt;/code&gt; file.
Being a simple text file it could easily be processed entirely with the built-in Fortran machinery as shown in the following recipe:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-fortran&#34;&gt;program test
  integer :: vmpeak

  call get_vmpeak(vmpeak)
  print *, &#39;Peak VM size: &#39;, vmpeak, &#39; kB&#39;
end program test

!---------------------------------------------------------------!
! Returns current process&#39; peak virtual memory size             !
! Requires Linux procfs mounted at /proc                        !
!---------------------------------------------------------------!
! Output: peak - peak VM size in kB                             !
!---------------------------------------------------------------!
subroutine get_vmpeak(peak)
  implicit none
  integer, intent(out) :: peak
  character(len=80) :: stat_key, stat_value
  !
  peak = 0
  open(unit=1000, name=&#39;/proc/self/status&#39;, status=&#39;old&#39;, err=99)
  do while (.true.)
    read(unit=1000, fmt=*, err=88) stat_key, stat_value
    if (stat_key == &#39;VmPeak:&#39;) then
      read(unit=stat_value, fmt=&#39;(I)&#39;) peak
      exit
    end if
  end do
88 close(unit=1000)
  if (peak == 0) goto 99
  return
  !
99 print *, &#39;ERROR: procfs not mounted or not compatible&#39;
  peak = -1
end subroutine get_vmpeak
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The code accesses the status file of the calling process &lt;code&gt;/proc/self/status&lt;/code&gt;.
The unit number is hard-coded which could present problems in some cases.
Modern Fortran 2008 compilers support the &lt;code&gt;NEWUNIT&lt;/code&gt; specifier and the following code could be used instead:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-fortran&#34;&gt;integer :: unitno 

open(newunit=unitno, name=&#39;/proc/self/status&#39;, status=&#39;old&#39;, err=99)
! ...
close(unit=unitno)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With older compilers the same functionality could be simulated using the 
&lt;a href=&#34;http://fortranwiki.org/fortran/show/newunit&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;following code&lt;/a&gt;.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>MPI Programming Basics</title>
      <link>https://hiliev.eu/post/mpi-programming-basics/</link>
      <pubDate>Tue, 18 Mar 2014 17:38:34 +0100</pubDate>
      <guid>https://hiliev.eu/post/mpi-programming-basics/</guid>
      <description>&lt;p&gt;Embracing the current development in educational technologies, the IT Center of the RWTH Aachen University (former Center for Computing and Communication) makes available online the audio recordings of most tutorials delivered during this year&amp;rsquo;s 
&lt;a href=&#34;http://www.itc.rwth-aachen.de/ppces/&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PPCES seminar&lt;/a&gt;.
Participation in PPCES is for free and course materials are available online, but this is the first time when proper audio recordings were taken.&lt;/p&gt;
&lt;p&gt;All videos (presentation slides + audio) are available on the 
&lt;a href=&#34;http://www.youtube.com/channel/UCtdrEoe46tD2IvJJRs_JH1A&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PPCES YouTube channel&lt;/a&gt; under Creative Commons Attribution license.
Course materials are available in the 
&lt;a href=&#34;https://sharepoint.campus.rwth-aachen.de/units/rz/HPC/public/Shared%20Documents/Forms/PPCES%202014.aspx&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;PPCES 2014 archive&lt;/a&gt; under unclear (read: do not steal blatantly) license.&lt;/p&gt;
&lt;p&gt;My own contribution to PPCES - as usual - consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Message passing with MPI, part 1:
Basic concepts and point-to-point communication&lt;/p&gt;

&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
  &lt;iframe src=&#34;https://www.youtube.com/embed/LBgx_S5ougk&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; allowfullscreen title=&#34;YouTube Video&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Message passing with MPI, part 2:
Collective operations and often-used patterns&lt;/p&gt;

&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
  &lt;iframe src=&#34;https://www.youtube.com/embed/CliFXC3kG90&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; allowfullscreen title=&#34;YouTube Video&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tracing and profiling MPI applications with VampirTrace and Vampir&lt;/p&gt;

&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
  &lt;iframe src=&#34;https://www.youtube.com/embed/pZVSs__h76Q&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; allowfullscreen title=&#34;YouTube Video&#34;&gt;&lt;/iframe&gt;
&lt;/div&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Big thanks to all the people who made recording and publishing the sessions possible.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
