Thicket data repository for the EEG
1{
2 "id": "https://www.tunbury.org/2020/08/22/dump-process-memory",
3 "title": "Dump Process Memory",
4 "link": "https://www.tunbury.org/2020/08/22/dump-process-memory/",
5 "updated": "2020-08-22T12:41:29",
6 "published": "2020-08-22T12:41:29",
7 "summary": "Yesterday in a stroke of good fortune, I remembered a job that I’d set running a little while back and I checked in to see how it was doing. It’s a MPI console app running on 22 distributed Ubuntu nodes. My application was set to output the time periodically and it currently reported a runtime of 15837421 seconds (just over six months). Unfortunately I couldn’t see the current ‘best’ result as it results aren’t displayed until the end. I was intrigued to see how it was doing.",
8 "content": "<p>Yesterday in a stroke of good fortune, I remembered a job that I’d set running a little while back and I checked in to see how it was doing. It’s a MPI console app running on 22 distributed Ubuntu nodes. My application was set to output the time periodically and it currently reported a runtime of 15837421 seconds (just over six months). Unfortunately I couldn’t see the current ‘best’ result as it results aren’t displayed until the end. I was intrigued to see how it was doing.</p>\n\n<p>From <code>ps</code> I could see that the <em>manager</em> of my MPI application was process id 28845. I knew that the application had a string representation of the current best result as all the child nodes reported back to this process.</p>\n\n<p>I found <a href=\"https://github.com/Nopius/pmap-dump\">pmap-dump</a> on GitHub which seemed to fit the bill. I cloned the repository, compiled and installed:</p>\n\n<div><div><pre><code>git clone https://github.com/Nopius/pmap-dump.git\ncd pmap-dump\nmake install\n</code></pre></div></div>\n\n<p>Then in Bash save the process id of my application in a variable:</p>\n\n<div><div><pre><code>pid=28845\n</code></pre></div></div>\n\n<p>Using <code>pmap</code>, I could dump the memory segments in use by the application which can be built into the appropriate command line for <code>pmap-dump</code>.</p>\n\n<div><div><pre><code>pmap -x $pid | awk -vPID=$pid 'BEGIN{ printf(\"pmap-dump -p \" PID)};($5~/^r/){printf(\" 0x\" $1 \" \" $2)};END{printf(\"\\n\")}'\n</code></pre></div></div>\n\n<p>This yielded a toxic command line like this….</p>\n\n<div><div><pre><code>pmap-dump -p 28845 0x0000560fc10e3000 124 0x0000560fc10e3000 0 0x0000560fc1302000 4 0x0000560fc1302000 0 0x0000560fc1303000 4 ...\n</code></pre></div></div>\n\n<p>… which when executed produced 65 binary .hex files.</p>\n\n<p>Since I knew my result was a lengthy string, I obtained it with</p>\n\n<div><div><pre><code>strings -w -n 30 *.hex\n</code></pre></div></div>\n\n<p>Today the router crashed and the connection was broken…</p>",
9 "content_type": "html",
10 "author": {
11 "name": "Mark Elvers",
12 "email": "mark.elvers@tunbury.org",
13 "uri": null
14 },
15 "categories": [
16 "bash"
17 ],
18 "source": "https://www.tunbury.org/atom.xml"
19}