<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Volodymyr Obrizan: personal website - 19</title><link href="https://obrizan.com/" rel="alternate"></link><link href="https://obrizan.com/feeds/19.atom.xml" rel="self"></link><id>https://obrizan.com/</id><updated>2026-10-19T12:52:53+03:00</updated><entry><title>A new large language model isn't always better than the old one</title><link href="https://obrizan.com/blog/new-model-is-not-always-better/" rel="alternate"></link><published>2026-10-19T12:52:53+03:00</published><updated>2026-10-19T12:52:53+03:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2026-10-19:/blog/new-model-is-not-always-better/</id><summary type="html">&lt;p&gt;Sometimes it seems (or marketers assure us) that everything new is better than the old stuff.&lt;/p&gt;
&lt;p&gt;I'm migrating a translation service that uses language models. The old version uses gpt-4.1, and the new one uses gpt-6-luna. Users complained that the new version was translating more slowly.&lt;/p&gt;
&lt;p&gt;I thought: how …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Sometimes it seems (or marketers assure us) that everything new is better than the old stuff.&lt;/p&gt;
&lt;p&gt;I'm migrating a translation service that uses language models. The old version uses gpt-4.1, and the new one uses gpt-6-luna. Users complained that the new version was translating more slowly.&lt;/p&gt;
&lt;p&gt;I thought: how can that be? The new model is supposed to be better than the old one! But remembering the joke about how "in one village they ran a survey, and in the other they took measurements," I put together a small benchmark to measure whether the new model really was slower.&lt;/p&gt;
&lt;p&gt;And sure enough: gpt-6-luna is, on average, 1.3 times slower than gpt-4.1 at translating texts of different lengths.&lt;/p&gt;
&lt;p&gt;Translation quality and cost are outside the scope of this benchmark, though they can matter too.&lt;/p&gt;
&lt;p&gt;Unfortunately, gpt-4.1 was officially deprecated on October 14, 2026, and will be shut down for good on January 14, 2027.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Фото до допису «Нова велика мовна модель — не завжди краща за стару»" src="https://obrizan.com/images/telegram/2026/10/19/new-model-is-not-always-better-1.jpg"&gt;&lt;/p&gt;</content><category term="19"></category></entry><entry><title>A Second Away From</title><link href="https://obrizan.com/blog/a-second-away-from/" rel="alternate"></link><published>2016-03-19T00:02:00+02:00</published><updated>2016-03-19T00:02:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2016-03-19:/blog/a-second-away-from/</id><summary type="html">&lt;p&gt;The first time it happened was in seventh grade, in shop class. What I liked most was working on the engine lathe (Isaak Naumovich, hi!). I remember it like it was yesterday: I clamped the workpiece in the spindle, secured the tool holder, adjusted the tailstock coupling, tightened the screw …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The first time it happened was in seventh grade, in shop class. What I liked most was working on the engine lathe (Isaak Naumovich, hi!). I remember it like it was yesterday: I clamped the workpiece in the spindle, secured the tool holder, adjusted the tailstock coupling, tightened the screw fixing the carriage to the bed, and then tightened... although never mind, you don’t know what an engine lathe is anyway. The point was that I made a mistake and set the cutter clearance not to 0.1 mm, but to 1.1 mm, i.e., ten times more than required. I turned on the lathe, and the workpiece began to rotate. I fed the cutter. Because of the unacceptable clearance, the cutter started hammering hard against the workpiece, then the workpiece snapped in two at the spindle and whistled past my temple. If it had happened a second earlier, the workpiece would have ended up in my head. I never worked on the engine lathe again. &lt;/p&gt;
&lt;p&gt;The next time it happened was a year later. My friend and I (Vitya, hi!) were riding on top of the freight elevator in our building, and like any teenager I decided to show off in front of my friend. When the elevator was on the second floor, I stepped from the elevator car onto the door rail of the third floor. The elevator passengers went down to the first floor, and I stayed on the third, inside the shaft. So the layout in the elevator shaft ended up like this: the freight elevator on the first floor, my friend on the elevator, and me on the third floor on the door rail. But then the elevator started going up. When it was already approaching the second floor, I jumped from the door rail onto the roof of the elevator. But I lost my balance; one leg slipped and got between the elevator car and the shaft wall. Luckily, my foot hit some elevator part, and it stopped abruptly. There was half a meter left to the third-floor door rail. One second later, my right leg could have been at the bottom of the elevator shaft, while I myself would still have been on the roof of the elevator. I’d have gone for another ride, but you can’t get those years back. &lt;/p&gt;
&lt;p&gt;The most recent time it happened was on December 3, 2015. I was walking down Rymarska Street when a big chunk of ice from a roof glanced off my back. A second earlier, it would have hit me square on the head. &lt;/p&gt;
&lt;p&gt;Have you often been in a situation one second away from death?&lt;/p&gt;</content><category term="19"></category></entry><entry><title>Exams</title><link href="https://obrizan.com/blog/exams/" rel="alternate"></link><published>2016-01-19T22:14:00+02:00</published><updated>2016-01-19T22:14:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2016-01-19:/blog/exams/</id><content type="html">&lt;p&gt;So, students, how’s exam season going? Successfully?&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="https://obrizan.com/images/livejournal/2016/01/19/sessiya/25242-1000-456c7a7e8b0bf69b.png"&gt;&lt;/p&gt;</content><category term="19"></category></entry><entry><title>Unusual Marketing on the Streets of Kharkiv</title><link href="https://obrizan.com/blog/unusual-marketing-on-the-streets-of-kharkiv/" rel="alternate"></link><published>2016-01-19T21:31:00+02:00</published><updated>2016-01-19T21:31:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2016-01-19:/blog/unusual-marketing-on-the-streets-of-kharkiv/</id><summary type="html">&lt;p&gt;Today on Lenin Avenue I fell victim to... what? you don’t know where that is? Then let’s put it this way: today on Nauky Avenue I fell victim to an interesting kind of marketing. Clearer now? Good. A young man was walking toward me and asked:&lt;/p&gt;
&lt;p&gt;— Do you …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Today on Lenin Avenue I fell victim to... what? you don’t know where that is? Then let’s put it this way: today on Nauky Avenue I fell victim to an interesting kind of marketing. Clearer now? Good. A young man was walking toward me and asked:&lt;/p&gt;
&lt;p&gt;— Do you know how to get to “Rost” on Klochkivska?&lt;/p&gt;
&lt;p&gt;Of course I know how to get there, so I immediately started pointing:&lt;/p&gt;
&lt;p&gt;— You need to cross the street, then go down...&lt;/p&gt;
&lt;p&gt;But the young man interrupted me:&lt;/p&gt;
&lt;p&gt;— Great, since you know where it is, come to our store, we’re having a perfume sale right now!&lt;/p&gt;
&lt;p&gt;That’s when I realized this was yet another pusher of shit. &lt;/p&gt;
&lt;p&gt;— Here, take some samples! Here, take two more for your male and female friends!&lt;br&gt;
— Yes, thanks...&lt;/p&gt;
&lt;p&gt;But that wasn’t all:&lt;/p&gt;
&lt;p&gt;— The samples are 10 hryvnias each...&lt;/p&gt;
&lt;p&gt;That is, this wasn’t even an ad campaign, but a straight-up sales pitch on the street, and the product was already in my hands. The only thing missing was the final step of this protocol: for me to hand the seller 30 hryvnias. Naturally, I’d seen his stink-in-bottles in my coffin, so I hurried to return the product. But then he used a third trick: he didn’t take the product back. The awkward situation dragged on for about ten seconds; only when I made it clear with a motion of my hand that I would drop the product on the ground did he take it back, turn around, and go look for a new victim. &lt;/p&gt;
&lt;p&gt;How did it happen that some pimply dick from the street got me all the way to the last step of the sale — handing over the money? The answer is that usually we don’t notice and ignore the pushers of shit who shove it at us right away. We simply have a filter for scenarios like that. And this young man acted smarter: he asked me a question to knock me out of autopilot mode and make me think, make me pay attention to him.&lt;/p&gt;
&lt;p&gt;Obviously, he himself is an idiot and a loser, since he’s pushing shit on the street, but whoever trained him knew what they were doing.&lt;/p&gt;</content><category term="19"></category></entry><entry><title>Where Are the Father and Mother?</title><link href="https://obrizan.com/blog/where-are-the-father-and-mother/" rel="alternate"></link><published>2015-12-19T07:40:00+02:00</published><updated>2015-12-19T07:40:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2015-12-19:/blog/where-are-the-father-and-mother/</id><summary type="html">&lt;p&gt;Over ten years of teaching at a university, I’ve noticed one detail. When a student is already in a total disaster with a subject, when finals are already on and it’s too late to study properly, people come to plead on the student’s behalf. Uncles, aunts, Dad …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Over ten years of teaching at a university, I’ve noticed one detail. When a student is already in a total disaster with a subject, when finals are already on and it’s too late to study properly, people come to plead on the student’s behalf. Uncles, aunts, Dad’s friend or Mom’s friend (hee-hee ;) show up, and once even a grandfather came. “I served with this blockhead’s father, his dad is a great guy, you’re not going to expel his son, are you?”&lt;/p&gt;
&lt;p&gt;And where is the father himself? Where is the mother? Why do the closest people frankly not give a damn about the fate of their son or daughter? If the father and mother don’t care, why should other people then run around fussing?&lt;/p&gt;
&lt;p&gt;Why not ask once a week how your son is doing, ask him to tell you what’s going on at the university, read through his notes together? &lt;/p&gt;
&lt;p&gt;— If the parents don’t care, then there’s nothing I can do to help. &lt;/p&gt;
&lt;p&gt;Oh, and also, for those who left this nightmare behind long ago: it applies in every direction. Call your mom and dad, stop by their place for dinner tonight.&lt;/p&gt;</content><category term="19"></category></entry><entry><title>Students Are Curious 4</title><link href="https://obrizan.com/blog/students-are-curious-4/" rel="alternate"></link><published>2015-03-19T09:39:00+02:00</published><updated>2015-03-19T09:39:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2015-03-19:/blog/students-are-curious-4/</id><summary type="html">&lt;p&gt;Students are curious:&lt;/p&gt;
&lt;p&gt;Which specialty/department should I write my application for in the second year?&lt;/p&gt;
&lt;p&gt;Only SCS. Only APVT. &lt;/p&gt;
&lt;p&gt;Speaking as a department lecturer, I’ll answer for myself: my courses "Programming Cloud Technology Services" (Amazon Web Services, Google Cloud Platform) and "Programming Mobile Platforms" (Apple iPhone) are taken …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Students are curious:&lt;/p&gt;
&lt;p&gt;Which specialty/department should I write my application for in the second year?&lt;/p&gt;
&lt;p&gt;Only SCS. Only APVT. &lt;/p&gt;
&lt;p&gt;Speaking as a department lecturer, I’ll answer for myself: my courses "Programming Cloud Technology Services" (Amazon Web Services, Google Cloud Platform) and "Programming Mobile Platforms" (Apple iPhone) are taken only by SCS students. &lt;/p&gt;
&lt;p&gt;Of course, if you’re interested in knowledge of modern technologies that are in demand on the job market. If that doesn’t interest you, then don’t come to us; you’ll be picked on here. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;In previous installments:&lt;/p&gt;
&lt;p&gt;— Students are curious &lt;a href="https://obrizan.com/blog/students-are-curious-3/"&gt;about taking a course after the deadline&lt;/a&gt;.&lt;br&gt;
— Students are curious &lt;a href="https://obrizan.com/blog/students-are-curious-2/"&gt;about choosing a programming language&lt;/a&gt;.&lt;br&gt;
— Students are curious &lt;a href="https://obrizan.com/blog/students-are-curious/"&gt;about submitting a diploma thesis&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Interested in my opinion on any question of university life? Send your questions to volodymyr.obrizan@gmail.com. Anonymity is guaranteed. Answers will be published as questions come in. Questions can also be asked through the anonymous-questions site http://ask.fm/obrizan&lt;/p&gt;</content><category term="19"></category></entry><entry><title>Theft at the University</title><link href="https://obrizan.com/blog/theft-at-the-university/" rel="alternate"></link><published>2014-12-19T23:00:00+02:00</published><updated>2014-12-19T23:00:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2014-12-19:/blog/theft-at-the-university/</id><summary type="html">&lt;p&gt;December 19, 2014, room 229, Kharkiv National University of Radio Electronics. Cell phone theft. The thief was caught red-handed and handed over to the response team. Our guys did well: they quickly assessed the situation and acted decisively. &lt;/p&gt;
&lt;p&gt;To students: keep your valuables with you; don’t take your eyes …&lt;/p&gt;</summary><content type="html">&lt;p&gt;December 19, 2014, room 229, Kharkiv National University of Radio Electronics. Cell phone theft. The thief was caught red-handed and handed over to the response team. Our guys did well: they quickly assessed the situation and acted decisively. &lt;/p&gt;
&lt;p&gt;To students: keep your valuables with you; don’t take your eyes off strangers in the classroom.&lt;/p&gt;
&lt;iframe src="https://www.youtube.com/embed/KPOE5WKnjy4" width="560" height="315" style="width: 100%; height: auto; aspect-ratio: 16 / 9;" title="YouTube video player" loading="lazy" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen&gt;&lt;/iframe&gt;</content><category term="19"></category></entry><entry><title>On Studying English</title><link href="https://obrizan.com/blog/on-studying-english/" rel="alternate"></link><published>2013-08-19T18:11:00+03:00</published><updated>2013-08-19T18:11:00+03:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2013-08-19:/blog/on-studying-english/</id><summary type="html">&lt;p&gt;I’ve been studying English for a very long time, but I keep running into more and more new unfamiliar words. When I used an IBM PC-compatible computer running Windows 7, I used ABBYY Lingvo X3 to peek at translations of unfamiliar words (three languages: Russian, Ukrainian, English). An excellent …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I’ve been studying English for a very long time, but I keep running into more and more new unfamiliar words. When I used an IBM PC-compatible computer running Windows 7, I used ABBYY Lingvo X3 to peek at translations of unfamiliar words (three languages: Russian, Ukrainian, English). An excellent dictionary; I recommend it to everyone. When I moved to an IBM PC-compatible computer running Mac OS 10, I couldn’t transfer Lingvo — the Mac has a different version, and it needs a new license. Nevertheless, the need to understand the meaning of new words remained.&lt;/p&gt;
&lt;p&gt;It turned out that the Mac has a built-in explanatory dictionary. It’s available from any applications that let you select text and bring up a context menu.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen Shot 2013-08-19 at 17.54.37" src="https://obrizan.com/images/livejournal/2013/08/19/ob-izuchenii-angliiskogo-yazyka/753-original-8d8bcaa02dc0286a.png"&gt;&lt;/p&gt;
&lt;p&gt;The word card gives several meanings of the word, transcription, and usage:&lt;/p&gt;
&lt;p&gt;&lt;img alt="define" src="https://obrizan.com/images/livejournal/2013/08/19/ob-izuchenii-angliiskogo-yazyka/359-original-63dfe79b9fe8884d.png"&gt;&lt;br&gt;
I noticed that, with very rare exceptions, I had stopped looking up translations of words. English-language definitions are enough to understand its meaning. Strictly speaking, the dictionary became unnecessary. It’s very convenient that the dictionary is also built into an ARM-compatible phone running iOS.&lt;/p&gt;
&lt;p&gt;This is a very interesting way to study English: don’t rush to look up a word’s translation, but first give yourself a chance to understand the meaning from its definition. But what should those users do who don’t have a built-in English-language explanatory dictionary? There is the excellent site “Wiktionary.” For example, you can &lt;a href="http://en.wiktionary.org/wiki/perennial"&gt;read the definition of the word perennial&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Screen Shot 2013-08-19 at 18.04.22" src="https://obrizan.com/images/livejournal/2013/08/19/ob-izuchenii-angliiskogo-yazyka/1011-original-8d03a027c72a3e21.png"&gt;&lt;br&gt;
“Wiktionary” is available on any platform on any Internet-compatible electronic computer.&lt;/p&gt;</content><category term="19"></category></entry><entry><title>A Conversation with a Taxi Driver</title><link href="https://obrizan.com/blog/a-conversation-with-a-taxi-driver/" rel="alternate"></link><published>2012-05-19T01:23:00+03:00</published><updated>2012-05-19T01:23:00+03:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2012-05-19:/blog/a-conversation-with-a-taxi-driver/</id><summary type="html">&lt;p&gt;I usually don’t talk to taxi drivers. But today he started it.&lt;/p&gt;
&lt;p&gt;“Look, they didn’t get the roads done for Euro 2012, even though he promised he’d do everything! What will foreigners think when they see this? This is our home, what will they think of us …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I usually don’t talk to taxi drivers. But today he started it.&lt;/p&gt;
&lt;p&gt;“Look, they didn’t get the roads done for Euro 2012, even though he promised he’d do everything! What will foreigners think when they see this? This is our home, what will they think of us? I’ll just be ashamed in front of foreigners!”&lt;/p&gt;
&lt;p&gt;Well, if they do start talking, then I play along in turn:&lt;/p&gt;
&lt;p&gt;“What do you have to be ashamed of? You’re not the one building these roads. You’re an upstanding citizen, working conscientiously as a taxi driver. By the way, how’s your English? Are you ready to work with foreign tourists?”&lt;/p&gt;
&lt;p&gt;The taxi driver looked at me in fright through the rearview mirror. The awkward silence dragged on.&lt;/p&gt;
&lt;p&gt;“Not very good, somehow. Why, is it hard to learn?”&lt;/p&gt;
&lt;p&gt;When we stopped, we spent another five minutes or so talking about English. I warned him that the difficulty wouldn’t be learning words like “street,” “avenue,” “stadium,” “railway station,” but how foreigners would pronounce our toponyms like &lt;nobr&gt;“50th Anniversary&lt;/nobr&gt; of the Komsomol,” “Donets-Zakharzhevsky,” “Uprising Square,” “Otakar Yarosh,” and others. Here, even seasoned Anglophiles won’t catch on the first try by ear which street a visiting tourist with a Dutch accent is trying to get to.&lt;/p&gt;
&lt;p&gt;As for the shame: I doubt he’ll even wash his car by the start of the Championship, let alone learn English.&lt;/p&gt;</content><category term="19"></category><category term="English"></category><category term="Euro 2012"></category><category term="Kharkiv"></category><category term="taxi"></category></entry><entry><title>Now reading: “Pedagogical Poem”</title><link href="https://obrizan.com/blog/now-reading-pedagogical-poem/" rel="alternate"></link><published>2011-09-19T20:07:00+03:00</published><updated>2011-09-19T20:07:00+03:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2011-09-19:/blog/now-reading-pedagogical-poem/</id><summary type="html">&lt;p&gt;On my way to work in the morning, my eye caught on a book stall. I was disappointed to find it had nothing but fiction. But today the seller got lucky: I noticed a book by &lt;a href="http://ru.wikipedia.org/wiki/Макаренко,_Антон_Семёнович"&gt;Anton Semyonovich Makarenko&lt;/a&gt; titled “&lt;a href="http://ru.wikipedia.org/wiki/Педагогическая_поэма"&gt;Pedagogical Poem&lt;/a&gt;.” Anton Makarenko is our countryman, an outstanding educator …&lt;/p&gt;</summary><content type="html">&lt;p&gt;On my way to work in the morning, my eye caught on a book stall. I was disappointed to find it had nothing but fiction. But today the seller got lucky: I noticed a book by &lt;a href="http://ru.wikipedia.org/wiki/Макаренко,_Антон_Семёнович"&gt;Anton Semyonovich Makarenko&lt;/a&gt; titled “&lt;a href="http://ru.wikipedia.org/wiki/Педагогическая_поэма"&gt;Pedagogical Poem&lt;/a&gt;.” Anton Makarenko is our countryman, an outstanding educator who, in the &lt;nobr&gt;1920s&lt;/nobr&gt;, founded a labor colony for troubled teenagers in the Poltava region. And the book is about exactly that.&lt;/p&gt;
&lt;p&gt;The book did not disappoint. Already on page sixteen, there’s a scene describing the colony’s director beating one of its wards. With genuine interest, I continue reading. I think I need to start taking notes.&lt;/p&gt;
&lt;p&gt;I love the pedagogy of the old Soviet school!&lt;/p&gt;</content><category term="19"></category><category term="school"></category><category term="Makarenko"></category><category term="history"></category><category term="Kharkiv"></category><category term="interesting"></category><category term="Poltava"></category><category term="book"></category></entry><entry><title>Sasha on the line</title><link href="https://obrizan.com/blog/sasha-on-the-line/" rel="alternate"></link><published>2011-02-19T14:02:00+02:00</published><updated>2011-02-19T14:02:00+02:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2011-02-19:/blog/sasha-on-the-line/</id><content type="html">&lt;p&gt;Turns out Sasha Adamov started himself a little blog while I was traveling around.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ad-lex.livejournal.com/"&gt;&lt;strong&gt;http://ad-lex.livejournal.com/&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;He’s got a solid camera. Takes good pictures.&lt;/p&gt;
&lt;p&gt;&lt;img alt="DSC_0024_01" src="https://obrizan.com/images/blogger/2011/02/19/sasha-na-linii/dsc-0024-01-2.jpg"&gt;&lt;/p&gt;</content><category term="19"></category><category term="friends"></category><category term="photos"></category></entry><entry><title>Death Toll II</title><link href="https://obrizan.com/blog/death-toll-ii/" rel="alternate"></link><published>2010-10-19T18:12:00+03:00</published><updated>2010-10-19T18:12:00+03:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2010-10-19:/blog/death-toll-ii/</id><summary type="html">&lt;p&gt;And now there are fewer than 46 million of us:&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;*Ukraine’s population decreased by 65,770 people in August 2010 and as of September 1 stood at 45,831,408 people. *&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.objectiv.tv/181010/48149.html"&gt;http://www.objectiv.tv/181010/48149.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I still remember the public service ads in the early &lt;nobr&gt;90s …&lt;/nobr&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;And now there are fewer than 46 million of us:&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;*Ukraine’s population decreased by 65,770 people in August 2010 and as of September 1 stood at 45,831,408 people. *&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.objectiv.tv/181010/48149.html"&gt;http://www.objectiv.tv/181010/48149.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I still remember the public service ads in the early &lt;nobr&gt;90s:&lt;/nobr&gt; “There are 52 million of us”! For those whose calculator is in the cupboard, so you don’t have to get up, I’ll say that over the last twenty years the population of our country has shrunk by more than 6 million.&lt;/p&gt;
&lt;p&gt;And here’s one for those who think something can still be fixed:&lt;/p&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;According to the Health Protection Department of the Department of Health Protection and Social Affairs, in the first month 13,627 pupils (13.5% of the total) were examined in general education institutions. Of them, healthy children account for 34.6%, while 37.2% require follow-up medical supervision.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Physical education classes in the main group have been permitted for 7,348 pupils (53.9%), in the preparatory group for 5,193 (38.1%), and in the special group for 785 (5.8%). 300 children (2.2%) have been excused from physical education classes.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.city.kharkov.ua/ru/news/view/id/5307"&gt;http://www.city.kharkov.ua/ru/news/view/id/5307&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Half of schoolchildren can’t do sports. I’d love to see the results of the medical exams for students who have made a habit of drinking crap and buying their way out of PE. But of course, abolishing the fees for making up lab work is more important. That’s how we’ll win!&lt;/p&gt;</content><category term="19"></category><category term="Kharkiv"></category><category term="news"></category></entry><entry><title>An Example of the parallel_reduce Function</title><link href="https://obrizan.com/blog/an-example-of-the-parallel-reduce-function/" rel="alternate"></link><published>2009-06-19T10:13:00+03:00</published><updated>2009-06-19T10:13:00+03:00</updated><author><name>Volodymyr Obrizan</name></author><id>tag:obrizan.com,2009-06-19:/blog/an-example-of-the-parallel-reduce-function/</id><summary type="html">&lt;p&gt;The previous &lt;a href="https://obrizan.com/blog/cinder-blocks-of-parallel-programming/"&gt;article about Intel Threading Building Blocks&lt;/a&gt; discussed the advantages of this library and also looked at an example of the parallel_for algorithm. Let’s look at an example of using the parallel_reduce algorithm, which differs from the parallel_for function in that it allows partial results obtained in parallel …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The previous &lt;a href="https://obrizan.com/blog/cinder-blocks-of-parallel-programming/"&gt;article about Intel Threading Building Blocks&lt;/a&gt; discussed the advantages of this library and also looked at an example of the parallel_for algorithm. Let’s look at an example of using the parallel_reduce algorithm, which differs from the parallel_for function in that it allows partial results obtained in parallel threads to be combined.&lt;/p&gt;
&lt;p&gt;First of all, you need to include the necessary header files:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;`&lt;font size="2" face="Courier New" color="black"&gt;#include &lt;stdio.h&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;include &lt;tbb/blocked_range.h&gt;&lt;/h1&gt;
&lt;h1&gt;include &lt;tbb/parallel_reduce.h&gt;&lt;/h1&gt;
&lt;h1&gt;include &lt;tbb/task_scheduler_init.h&gt;&lt;/h1&gt;
&lt;p&gt;&lt;/font&gt; &lt;font size="1" color="gray"&gt;* This source code was highlighted with &lt;a href="http://virtser.net/blog/post/source-code-highlighter.aspx"&gt;&lt;font size="1" color="gray"&gt;Source Code Highlighter&lt;/font&gt;&lt;/a&gt;.&lt;/font&gt;`&lt;/p&gt;
&lt;p&gt;Here stdio.h is used to include the printf function (output to the screen), blocked_range.h for using the blocked_range class (a blocked range), parallel_reduce.h for including the corresponding algorithm, and task_scheduler_inti.h for including the task scheduler.&lt;/p&gt;
&lt;p&gt;As mentioned earlier, the standard Intel TBB algorithms — parallel_for, parallel_reduce — use the concept of a task class. The example below shows such a class for solving the problem of finding the value of the constant Pi (the example was inspired by an Intel contest, as well as by my student’s independent work). The idea of finding the number is to compute the area of a curvilinear trapezoid, which is approximated by a large number of rectangles. The more rectangles there are, the more accurate the value, but the more time is required for the computation. An illustration of this problem can be seen on the “http://www86.wolframalpha.com/input/?i=integral+4.0/(1.0+%2B+x+*+x),+x+from+0.0+to+1.0” site.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;`&lt;font size="2" face="Courier New" color="black"&gt;&lt;font color="#008000"&gt;// Класс-задача, отвечает за подсчет значения пи на заданном диапазаоне&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt; PiCalculation {&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;:    &lt;/p&gt;
&lt;p&gt;&lt;font color="#008000"&gt;// Количество шагов в интервале, влияет на точность&lt;/font&gt;   &lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;long&lt;/font&gt; num_steps;    &lt;font color="#008000"&gt;// Ширина шага&lt;/font&gt;   &lt;font color="#0000ff"&gt;double&lt;/font&gt; step;  &lt;font color="#0000ff"&gt;public&lt;/font&gt;:    &lt;font color="#008000"&gt;// Частичное значение пи&lt;/font&gt;   &lt;font color="#0000ff"&gt;double&lt;/font&gt; pi;    &lt;font color="#008000"&gt;// Вычислить частичное значение пи на заданном диапазоне&lt;/font&gt;   &lt;font color="#0000ff"&gt;void&lt;/font&gt; &lt;font color="#0000ff"&gt;operator&lt;/font&gt; () (&lt;font color="#0000ff"&gt;const&lt;/font&gt; tbb::blocked_range&amp;lt;&lt;font color="#0000ff"&gt;long&lt;/font&gt;&amp;gt; &amp;amp;r)    {     &lt;font color="#0000ff"&gt;double&lt;/font&gt; sum = 0.0;      &lt;font color="#0000ff"&gt;long&lt;/font&gt; end = r.end();      &lt;font color="#0000ff"&gt;for&lt;/font&gt; (&lt;font color="#0000ff"&gt;int&lt;/font&gt; i = r.begin(); i != end; i++)     {       &lt;font color="#0000ff"&gt;double&lt;/font&gt; x = (i + 0.5) * step;       sum += 4.0/(1.0 + x * x);     }      pi += sum * step;   }    &lt;font color="#008000"&gt;// Объеденить частичные результаты&lt;/font&gt;   &lt;font color="#0000ff"&gt;void&lt;/font&gt; join(PiCalculation &amp;amp;p)   {     pi += p.pi;   }    &lt;font color="#008000"&gt;// Разделяющий конструктор&lt;/font&gt;   PiCalculation(PiCalculation &amp;amp;p, tbb::split)   {     pi = 0.0;     num_steps = p.num_steps;     step = p.step;   }      &lt;font color="#008000"&gt;// Конструктор &lt;/font&gt;   PiCalculation(&lt;font color="#0000ff"&gt;long&lt;/font&gt; steps)   {     pi = 0.0;     num_steps = steps;     step = 1./(&lt;font color="#0000ff"&gt;double&lt;/font&gt;)num_steps;   } }; &lt;/font&gt; &lt;font size="1" color="gray"&gt;* This source code was highlighted with &lt;a href="http://virtser.net/blog/post/source-code-highlighter.aspx"&gt;&lt;font size="1" color="gray"&gt;Source Code Highlighter&lt;/font&gt;&lt;/a&gt;.&lt;/font&gt;`&lt;/p&gt;
&lt;p&gt;The following two methods are important in this class: operator () and join.&lt;/p&gt;
&lt;p&gt;The method void operator () (const blocked_range &amp;amp;r) computes a partial result over the interval [r.begin, r.end). The Intel TBB library and the blocked_range class take care of recursively splitting the original iteration space and “feeding” it in small portions to the operator () method. The result is accumulated in the variable pi, which is private to the thread. It is guaranteed that operator () for a single class will be called only from one thread, so errors such as “data races” (data races, race conditions) are ruled out.&lt;/p&gt;
&lt;p&gt;The method void join (PiCalculation &amp;amp;p) sums the partial results of different threads. This is where an important difference between the Intel TBB library and the OpenMP and MPI libraries shows up: in those, the number of operations for combining partial results (reduction) is limited. Intel TBB makes it possible to implement arbitrary functions for combining results in the body of the join method.&lt;/p&gt;
&lt;p&gt;Let’s look at starting the parallel_reduce algorithm.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;font size="2" face="Courier New" color="black"&amp;gt;&amp;lt;font color="#0000ff"&amp;gt;int&amp;lt;/font&amp;gt; main() {   &amp;lt;font color="#008000"&amp;gt;// Инициализация библиотеки Intel TBB&amp;lt;/font&amp;gt;   tbb::task_scheduler_init init;    &amp;lt;font color="#008000"&amp;gt;// Количество итераций&amp;lt;/font&amp;gt;   &amp;lt;font color="#0000ff"&amp;gt;const&amp;lt;/font&amp;gt; &amp;lt;font color="#0000ff"&amp;gt;long&amp;lt;/font&amp;gt; steps = 100000000;    &amp;lt;font color="#008000"&amp;gt;// Создание объекта-задачи по вычислению пи&amp;lt;/font&amp;gt;   &amp;lt;font color="#008000"&amp;gt;// Передается параметр: количество итераций&amp;lt;/font&amp;gt;   PiCalculation pi(steps);    &amp;lt;font color="#008000"&amp;gt;// Запуск алгоритма parallel_reduce над диапазоном [0, steps)&amp;lt;/font&amp;gt;   tbb::parallel_reduce(tbb::blocked_range&amp;lt;&amp;lt;font color="#0000ff"&amp;gt;long&amp;lt;/font&amp;gt;&amp;gt;(0, steps, 1000000), pi);    printf (&amp;lt;font color="#A31515"&amp;gt;"Pi is %3.20f\n"&amp;lt;/font&amp;gt;, pi.pi);    &amp;lt;font color="#0000ff"&amp;gt;return&amp;lt;/font&amp;gt; 0; } &amp;lt;/font&amp;gt; &amp;lt;font size="1" color="gray"&amp;gt;* This source code was highlighted with [&amp;lt;font size="1" color="gray"&amp;gt;Source Code Highlighter&amp;lt;/font&amp;gt;](http://virtser.net/blog/post/source-code-highlighter.aspx).&amp;lt;/font&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To do this, you need to perform the following steps: create an Intel TBB task scheduler object, create a PiCalculation task object, and call the parallel_reduce function. Here the function takes two parameters. The first is the range class. In our case, we specify the number of iterations [0, steps), i.e., when computing the integral from 0 to 1, steps = 100 000 000 steps will be used. The second parameter is a reference to the task object, which, after returning from the parallel_reduce function, will contain the value of pi.&lt;/p&gt;</content><category term="19"></category><category term="TBB"></category><category term="basics"></category></entry></feed>