Upload
michael-karpov
View
1.228
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
МОЛОДЕЖНАЯ ШКОЛА«Суперкомпьютерные технологии
в науке, промышленности и образовании»
ННГУ им. Н.И. Лобачевского, Нижний Новгород, 26-31 октября 2009 г.
КОНСОРЦИУМ УНИВЕРСИТЕТОВ РОССИИ
«Есть ли жизнь после MPI?»
Абрамов С.М.д.ф.-м.н., чл.-корр. РАН, ИПС имени А.К.Айламазяна РАН
Институт программных систем имени А.К.Айламазяна РАН
Абрамов С.М.†, Климов А.В. ‡,Лацис А.О. ‡, Московский А.А. †
†ИПС имени А.К.Айламазяна РАН‡ИПМ имени М.В.Келдыша РАН
Доклад 2009.10.31, Нижний Новгород
Есть ли жизнь после Есть ли жизнь после MPIMPI??
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 2
Институт программных систем имени А.К.Айламазяна РАН
Переславль-Залесский.Переславль-Залесский.Институт программных системИнститут программных систем
имени А.К.Айламазянаимени А.К.АйламазянаРоссийской академии наукРоссийской академии наук
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 3
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Переславль-Залесский
Красивый старинный (Красивый старинный (860860 лет) лет)город России на берегу город России на берегу Плещеева озераПлещеева озера
Центр Золотого кольцаЦентр Золотого кольца Родина Св.Александра Невского, Родина Св.Александра Невского,
родина многих великих князейродина многих великих князей Здесь Петр Великий создавал Здесь Петр Великий создавал
свою первую «потешную свою первую «потешную флотилию» — место рождения флотилию» — место рождения Российского флотаРоссийского флота
Древний центр Российской Древний центр Российской Православной ЦерквиПравославной Церкви
Москва
Переславль-Залесский
120
км
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 4
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»ИПС имени А.К.Айламазяна РАН,
Переславль-Залесский
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 5
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Основание Института
Основан в 1984 году по постановлению ВПК для развития информатики и вычислительной техники в стране
Первый директор (1984–2003) — проф. А.К.Айламазян В декабре 2008 Институту присвоено имя А.К.Айламазяна
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 6
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
2009: Организационная структура института
Исследовательский центр искусственного интеллекта
Исследовательский центр медицинской информатики
Исследовательский центр мультипроцессорных систем
Исследовательский центр системного анализа
Исследовательский центр процессов управления
Научно-образовательный центр — Международный детский компьютерный лагерь (МДКЦ) имени А.К.Айламазяна
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 7
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»Университет города Переславля
имени А.К.Айламазяна
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 8
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Программы «СКИФ» и «СКИФ-ГРИД»
Заказчики-координаторы НАН Беларуси Агентство «Роснаука»
Головные исполнители Объединенный институт проблем
информатики НАН Беларуси Институт программных систем РАН
Исполнители «СКИФ» 2000-2004 — 10+10 организаций Беларуси и России «СКИФ-ГРИД» 2007-2010 — 10+20 организаций Беларуси и
России 2003-2008: 5 суперЭВМ семейства «СКИФ» в рейтинге Top500
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 9
Семейство суперЭВМ «СКИФ»: Ряды 1, 2, 3 и 4
Top1Top10Top100Top200Top300Top400Top500TopSKIF
100,000,000
1,000,000
100,000
10,000
1,000
100
LipackGflops
10
10,000,000
Ряд 1Ряд 1
Ряд 2Ряд 2
Ряд 3Ряд 3
Ряд 4Ряд 4
2032 Gflops СКИФ К-1000472 Gflops СКИФ К-500
57 Gflops Первенец-М26 Gflops ВМ510011 Gflops Первенец
47.17 Tflops СКИФ МГУ12.2 Tflops СКИФ Урал9 Тflops СКИФ Cyberia
Top1Top10Top100Top200Top300Top400Top500TopSKIF
100,000,000
1,000,000
100,000
10,000
1,000
100
LipackGflops
10
10,000,000
1 кв.2012 СКИФ П~5.03 кв. 2010 СКИФ П-1.03 кв. 2009 СКИФ П-0.5
Сделано: Ряды 1–3Ближайшие планы: Ряд 4
Linpack
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 10
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
10,000,000
1,000,000
100,000
10,000
1,000
100
Top 1Top10Top100Top200Top300Top400Top500M ade in Russia
21
3
45
6
LipackGflops
2002 июньМВС 1000M0.734/1.024 TFlops
2003 ноябрьСКИФ К-5000.423/0.717 TFlops
2004 ноябрьСКИФ К-10002.032/2.534 TFlops
2007 февральСКИФ Cyberia9.013/12.002 TFlops
2008 майСКИФ Урал12.2/15.9 TFlops
2008 майСКИФ МГУ47.1/60 TFlops
За все время только шесть созданных в РоссиисуперЭВМ вошли в Top500. Пять из шести—СКИФы!
За все время только шесть созданных в РоссиисуперЭВМ вошли в Top500. Пять из шести—СКИФы!
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 11
Институт программных систем имени А.К.Айламазяна РАН
Что затрудняет эффективное Что затрудняет эффективное использование использование MPI MPI в в
суперЭВМ ближайшего суперЭВМ ближайшего будущего?будущего?
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 12
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Проблемы MPI
Рост числа процессоров (и ядер) в суперЭВМ будет продолжаться Сегодня 1 Pflops ≈ 20,000 CPU ≈ 80,000 ядер Установки с 1,000,000 ядрами появятся очень скоро
Трудности эффективной реализации MPI для гигантского числа вычислительных узлов да еще и многоядерных!
Трудности эффективного использования программистами MPI для случая гигантского числа вычислительных узлов
Есть разрыв между тем, что реализует аппаратура (SMP + односторонние обмены) и тем, что имеется в MPI (двусторонние обмены, рандеву на канале)
Проблемы серьезны, возможно «вымирание» MPI8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 13
Институт программных систем имени А.К.Айламазяна РАН
Т-система: автоматическое Т-система: автоматическое динамическое динамическое
распараллеливание программраспараллеливание программ
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 14
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Т-система (неформально)
Функциональная модель + императивное описание тела функции
Арность и коарность функций Готовые и неготовые значения Вызов Т-функции — порождение процесса Можно копировать неготовые значения, в том числе и
передавать их как результат Любые иные операции с неготовым значением приводит
к «засыпанию» процесса на данной Т-переменной Побудка будет, когда Т-переменная примет готовое
значение Состояние вычисления: сеть из процессов (ребра —
отношение «поставщик-потребитель»), процесс исполнения: автотрансформация данной сети
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 15
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 16
a6
b5
c3
d9
u v wF
…d = G(a, b)b = du = ad = cv = aw = b…
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 17
a6
b5
c3
d
u v wF
…d = G(a, b)b = du = ad = cv = aw = b…
6 5
G
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 18
a6
b c3
d
u v wF
…d = G(a, b)b = du = ad = cv = aw = b…
6 5
G
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 19
a6
b c3
d
u v wF
6
…d = G(a, b)b = du = ad = cv = aw = b…
6 5
G
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 20
a6
b c3
d3
u v wF
6
…d = G(a, b)b = du = ad = cv = aw = b…
6 5
G
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 21
a6
b c3
d3
u v wF
6
…d = G(a, b)b = du = ad = cv = aw = b…
6 5
G
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 22
a6
b c3
d3
u v wF
6
…d = G(a, b)b = du = ad = cv = aw = b…
6 5
G
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 23
6
6 5
G
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
2424
T-System HistoryT-System HistoryT-System HistoryT-System History Mid-Mid-80-80-iesies
Basic ideasBasic ideas of T-Systemof T-System 1990-1990-iesies
First implementationFirst implementation of T-Systemof T-System 2001-20022001-2002, “SKIF” , “SKIF”
GRACE — Graph Reduction Applied to GRACE — Graph Reduction Applied to Cluster Environment Cluster Environment
2003-current, “SKIF” 2003-current, “SKIF” Cooperation with MicrosoftCooperation with MicrosoftOpen TS — Open T-systemOpen TS — Open T-system
Program Systems Institute Russian Academy of Sciences
2525
Open TS OverviewOpen TS OverviewOpen TS OverviewOpen TS Overview
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
2626
Comparison: T-System and Comparison: T-System and MPIMPI
Comparison: T-System and Comparison: T-System and MPIMPI
C/Fortran T-System
Assembler MPI
High-levela few
keywords
Low-levelhundred(s)primitives
Sequential Parallel
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
2727
T-System in ComparisonT-System in ComparisonT-System in ComparisonT-System in ComparisonRelated workRelated work Open TS differentiatorOpen TS differentiator
Charm++Charm++ FP-based approachFP-based approach
UPC, mpC++UPC, mpC++ Implicit parallelismImplicit parallelism
Glasgow Glasgow Parallel HaskellParallel Haskell
Allows C/C++ based low-Allows C/C++ based low-level optimizationlevel optimization
OMPC++OMPC++ Provides both language Provides both language and C++ templates and C++ templates librarylibrary
CilkCilk Supports SMP, MPI, PVM, Supports SMP, MPI, PVM, and GRID platformsand GRID platforms
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
2828
Open TS: an OutlineOpen TS: an OutlineOpen TS: an OutlineOpen TS: an Outline High-performance computing High-performance computing ““Automatic dynamic parallelization”Automatic dynamic parallelization” Combining functional and Combining functional and
imperative approaches, high-level imperative approaches, high-level parallel programmingparallel programming
Т++ Т++ language: “Parallel dialect” of language: “Parallel dialect” of C++ — an approach popular in 90-C++ — an approach popular in 90-iesies
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
2929
Т-Т-ApproachApproachТ-Т-ApproachApproach ““Pure” functions (Pure” functions (tfunctionstfunctions) invocations ) invocations
produce grains of parallelismproduce grains of parallelism T-Program isT-Program is
Functional – on higher levelFunctional – on higher level Imperative – on low level (optimization)Imperative – on low level (optimization)
C-compatible execution modelC-compatible execution model Non-ready variables, Multiple assignmentNon-ready variables, Multiple assignment ““Seamless” C-extension Seamless” C-extension (or Fortran-(or Fortran-
extension)extension)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3030
Т++Т++ Keywords KeywordsТ++Т++ Keywords Keywords tfuntfun —— Т-Т-functionfunction tvaltval—— Т-Т-variablevariable tptrtptr—— Т-Т-pointerpointer touttout —— Output parameter (like &) Output parameter (like &) tdroptdrop —— Make ready Make ready twaittwait —— Wait for readiness Wait for readiness tcttct —— Т-Т-contextcontext
Program Systems Institute Russian Academy of Sciences
3131
Short IntroductionShort Introduction(Sample Programs)(Sample Programs)Short IntroductionShort Introduction(Sample Programs)(Sample Programs)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3232
#include <stdio.h>#include <stdio.h>
int int fibfib (int n) { (int n) {return n < 2 ? n : return n < 2 ? n : fibfib(n-1)+ (n-1)+ fibfib(n-2);(n-2);
}}
int int mainmain (int argc, char **argv) { (int argc, char **argv) {if (argc != 2) { printf("Usage: fib <n>\n"); return 1; }if (argc != 2) { printf("Usage: fib <n>\n"); return 1; }int n = atoi(argv[1]);int n = atoi(argv[1]);printf("fib(%d) = %d\n", n, printf("fib(%d) = %d\n", n, fibfib(n));(n));return 0;return 0;
}}
Sample Program (C++)Sample Program (C++)Sample Program (C++)Sample Program (C++)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3333
#include <stdio.h>#include <stdio.h>
tfuntfun int int fibfib (int n) { (int n) {return n < 2 ? n : return n < 2 ? n : fibfib(n-1)+ (n-1)+ fibfib(n-2);(n-2);
}}
tfun tfun int int mainmain (int argc, char **argv) { (int argc, char **argv) {if (argc != 2) { printf("Usage: fib <n>\n"); return 1; }if (argc != 2) { printf("Usage: fib <n>\n"); return 1; }int n = atoi(argv[1]);int n = atoi(argv[1]);printf("fib(%d) = %d\n", n, printf("fib(%d) = %d\n", n, (int)(int)fibfib(n));(n));return 0;return 0;
}}
Sample Program (T++)Sample Program (T++)Sample Program (T++)Sample Program (T++)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3434
Sample Program (T+Sample Program (T++)+)
Sample Program (T+Sample Program (T++)+)
0%
20%
40%
60%
80%
100%
120%
0 2 4 6 8 10
CPUs
Time(%) CoE
WinCCS cluster,WinCCS cluster,4 nodes4 nodes
CPU:CPU: AMD Athlon AMD Athlon 64 X2 Dual Core 64 X2 Dual Core Processor 4400+ Processor 4400+ 2.21 GHz2.21 GHz
Gigabit EthernetGigabit Ethernet
time% =time% = timetimetapptapp(N)/timet(N)/timetappapp((1)1)
CoE = CoE = 1/(n×time%)1/(n×time%)CPU Cores
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3535
Approximate calculation of Pi (C+Approximate calculation of Pi (C++)+)
Approximate calculation of Pi (C+Approximate calculation of Pi (C++)+)
#include <math.h>#include <math.h>#include <stdio.h>#include <stdio.h>#include <stdlib.h>#include <stdlib.h>doubledouble
iisumsum(double begin,(double begin, double finish,double finish, double d) double d) {{
double dl = finish - begin;double dl = finish - begin; double mid = double mid =
(begin + finish) / 2;(begin + finish) / 2; if (fabs(dl) > d)if (fabs(dl) > d) return return isumisum(begin, mid, (begin, mid,
d) +d) + isumisum(mid, finish, d);(mid, finish, d); return return ff(mid) * dl;(mid) * dl;}}
double double ff(double x) {(double x) {
return 4/(1+x*x);return 4/(1+x*x);
}}int int mainmain(int argc, char* argv[]){(int argc, char* argv[]){ unsigned long h;unsigned long h; double a, b, d, sum;double a, b, d, sum;
iif (argc < 2) {return 0;}f (argc < 2) {return 0;} a = 0; b = 1; h = atol(argv[1]);a = 0; b = 1; h = atol(argv[1]); d = fabs(b - a) / h;d = fabs(b - a) / h; sum = sum = isumisum(a, b, d);(a, b, d); printf("PI is approximately printf("PI is approximately
%15.15lf\n", sum);%15.15lf\n", sum); return 0;return 0;}}
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3636
Approximate calculation of Pi (T+Approximate calculation of Pi (T++)+)
Approximate calculation of Pi (T+Approximate calculation of Pi (T++)+)
#include <math.h>#include <math.h>#include <stdio.h>#include <stdio.h>#include <stdlib.h>#include <stdlib.h>tfun tfun doubledouble
iisumsum(double begin,(double begin, double finish,double finish, double d) double d) {{
double dl = finish - begin;double dl = finish - begin; double mid = double mid =
(begin + finish) / 2;(begin + finish) / 2; if (fabs(dl) > d)if (fabs(dl) > d) return return isumisum(begin, mid, (begin, mid,
d) +d) + isumisum(mid, finish, d);(mid, finish, d); return return (double)(double)ff(mid) * dl;(mid) * dl;}}
tfun tfun double double ff(double x) {(double x) {
return 4/(1+x*x);return 4/(1+x*x);
}}tfun tfun int int mainmain(int argc, char* (int argc, char*
argv[]){argv[]){ unsigned long h;unsigned long h; double a, b, d, sum;double a, b, d, sum;
iif (argc < 2) {return 0;}f (argc < 2) {return 0;} a = 0; b = 1; h = atol(argv[1]);a = 0; b = 1; h = atol(argv[1]); d = fabs(b - a) / h;d = fabs(b - a) / h; sum = sum = isumisum(a, b, d);(a, b, d); printf("PI is approximately printf("PI is approximately
%15.15lf\n", sum);%15.15lf\n", sum); return 0;return 0;}}
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3737
0%
20%
40%
60%
80%
100%
120%
0 2 4 6 8 10
Time(%) CoE
Calculation of Pi (T++)Calculation of Pi (T++)Calculation of Pi (T++)Calculation of Pi (T++)
WinCCS cluster,WinCCS cluster,4 nodes4 nodes
CPU:CPU: AMD Athlon AMD Athlon 64 X2 Dual Core 64 X2 Dual Core Processor 4400+ Processor 4400+ 2.21 GHz2.21 GHz
Gigabit EthernetGigabit Ethernet
time% =time% = timetimetapptapp(N)/timet(N)/timetappapp((1)1)
CoE = CoE = 1/(n×time%)1/(n×time%)CPU Cores
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3838
Map-ReduceMap-ReduceMap-ReduceMap-Reduce----- Original Message ---------- Original Message -----From:From: Alexy MaykovSent:Sent: Monday, October 02, 2006 11:58 PM Monday, October 02, 2006 11:58 PMSubject:Subject: MCCS projects MCCS projects……I work in Microsoft Live Labs … I have I work in Microsoft Live Labs … I have several questions below:several questions below:
1.1. How would you implement Map-How would you implement Map-ReduceReduce
in OpenTS?in OpenTS?……
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
3939
Map-Reduce (C+Map-Reduce (C++)+)Map-Reduce (C+Map-Reduce (C++)+)
#include <vector>#include <vector>#include <algorithm>#include <algorithm>#include <functional>#include <functional>#include <iostream>#include <iostream>#include <ctime>#include <ctime>using namespace std;using namespace std;
int int fibfib (int n) (int n){{ return (n < 2) ? n : return (n < 2) ? n : fibfib(n-1) +(n-1) + fib fib(n-(n-
2);2);}}int int plusplus (int val1, int val2) (int val1, int val2) {{ return val1 + val2;return val1 + val2;}}int int mainmain (int argc, char *argv[ (int argc, char *argv[ ] ])){{ const int factor = 23;const int factor = 23; const int vector_size = 40;const int vector_size = 40; vector<int> a, b, c; vector<int> a, b, c; vector<int> fa, fb;vector<int> fa, fb;
cout << " Filling vectors..." << endl;cout << " Filling vectors..." << endl;
for (int i = 1; i <= vector_size; i++)for (int i = 1; i <= vector_size; i++)
{{
a.push_back(i % factor);a.push_back(i % factor);
b.push_back((vector_size + 1 - i) % factor);b.push_back((vector_size + 1 - i) % factor);
c.push_back(0);c.push_back(0);
fa.push_back(0);fa.push_back(0);
fb.push_back(0);fb.push_back(0);
}}
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(a.begin(), a.end(), fa.begin(),transform(a.begin(), a.end(), fa.begin(), fib fib););
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(b.begin(), b.end(), fb.begin(), transform(b.begin(), b.end(), fb.begin(), fibfib););
cout << " Reducing..." << endl;cout << " Reducing..." << endl;
transform(fa.begin(), fa.end(), fb.begin(), transform(fa.begin(), fa.end(), fb.begin(), c.begin(), ::plus);c.begin(), ::plus);
cout << endl << " Result: (" ;cout << endl << " Result: (" ;
ostream_iterator<int> output(cout, " ");ostream_iterator<int> output(cout, " ");
copy(c.begin(), c.end(), output); copy(c.begin(), c.end(), output);
cout << "\b)" << endl;cout << "\b)" << endl;
return 0;return 0;
}}
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4040
Map-Reduce (C+Map-Reduce (C++)+)Map-Reduce (C+Map-Reduce (C++)+)
#include <vector>#include <vector>#include <algorithm>#include <algorithm>#include <functional>#include <functional>#include <iostream>#include <iostream>#include <ctime>#include <ctime>using namespace std;using namespace std;
int int fibfib (int n) (int n){{ return (n < 2) ? n : return (n < 2) ? n : fibfib(n-1) +(n-1) + fib fib(n-(n-
2);2);}}int int plusplus (int val1, int val2) (int val1, int val2) {{ return val1 + val2;return val1 + val2;}}int int mainmain (int argc, char *argv[ (int argc, char *argv[ ] ])){{ const int factor = 23;const int factor = 23; const int vector_size = 40;const int vector_size = 40; vector<int> a, b, c; vector<int> a, b, c; vector<int> fa, fb;vector<int> fa, fb;
cout << " Filling vectors..." << endl;cout << " Filling vectors..." << endl;
for (int i = 1; i <= vector_size; i++)for (int i = 1; i <= vector_size; i++)
{{
a.push_back(i % factor);a.push_back(i % factor);
b.push_back((vector_size + 1 - i) % factor);b.push_back((vector_size + 1 - i) % factor);
c.push_back(0);c.push_back(0);
fa.push_back(0);fa.push_back(0);
fb.push_back(0);fb.push_back(0);
}}
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(a.begin(), a.end(), fa.begin(),transform(a.begin(), a.end(), fa.begin(), fib fib););
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(b.begin(), b.end(), fb.begin(), transform(b.begin(), b.end(), fb.begin(), fibfib););
cout << " Reducing..." << endl;cout << " Reducing..." << endl;
transform(fa.begin(), fa.end(), fb.begin(), transform(fa.begin(), fa.end(), fb.begin(), c.begin(), ::plus);c.begin(), ::plus);
cout << endl << " Result: (" ;cout << endl << " Result: (" ;
ostream_iterator<int> output(cout, " ");ostream_iterator<int> output(cout, " ");
copy(c.begin(), c.end(), output); copy(c.begin(), c.end(), output);
cout << "\b)" << endl;cout << "\b)" << endl;
return 0;return 0;
}}
Fibonacci
Just “Plus”
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4141
Map-Reduce (C+Map-Reduce (C++)+)Map-Reduce (C+Map-Reduce (C++)+)
#include <vector>#include <vector>#include <algorithm>#include <algorithm>#include <functional>#include <functional>#include <iostream>#include <iostream>#include <ctime>#include <ctime>using namespace std;using namespace std;
int int fibfib (int n) (int n){{ return (n < 2) ? n : return (n < 2) ? n : fibfib(n-1) +(n-1) + fib fib(n-(n-
2);2);}}int int plusplus (int val1, int val2) (int val1, int val2) {{ return val1 + val2;return val1 + val2;}}int int mainmain (int argc, char *argv[ (int argc, char *argv[ ] ])){{ const int factor = 23;const int factor = 23; const int vector_size = 40;const int vector_size = 40; vector<int> a, b, c; vector<int> a, b, c; vector<int> fa, fb;vector<int> fa, fb;
cout << " Filling vectors..." << endl;cout << " Filling vectors..." << endl;
for (int i = 1; i <= vector_size; i++)for (int i = 1; i <= vector_size; i++)
{{
a.push_back(i % factor);a.push_back(i % factor);
b.push_back((vector_size + 1 - i) % factor);b.push_back((vector_size + 1 - i) % factor);
c.push_back(0);c.push_back(0);
fa.push_back(0);fa.push_back(0);
fb.push_back(0);fb.push_back(0);
}}
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(a.begin(), a.end(), fa.begin(),transform(a.begin(), a.end(), fa.begin(), fib fib););
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(b.begin(), b.end(), fb.begin(), transform(b.begin(), b.end(), fb.begin(), fibfib););
cout << " Reducing..." << endl;cout << " Reducing..." << endl;
transform(fa.begin(), fa.end(), fb.begin(), transform(fa.begin(), fa.end(), fb.begin(), c.begin(), ::plus);c.begin(), ::plus);
cout << endl << " Result: (" ;cout << endl << " Result: (" ;
ostream_iterator<int> output(cout, " ");ostream_iterator<int> output(cout, " ");
copy(c.begin(), c.end(), output); copy(c.begin(), c.end(), output);
cout << "\b)" << endl;cout << "\b)" << endl;
return 0;return 0;
}}
Filling vectors:a=[ k%23 | k[1..40]]b=[ (41-k)%23 | k[1..40]]
Five vectors: a, b, fa, fb, c
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4242
Map-Reduce (C+Map-Reduce (C++)+)Map-Reduce (C+Map-Reduce (C++)+)
#include <vector>#include <vector>#include <algorithm>#include <algorithm>#include <functional>#include <functional>#include <iostream>#include <iostream>#include <ctime>#include <ctime>using namespace std;using namespace std;
int int fibfib (int n) (int n){{ return (n < 2) ? n : return (n < 2) ? n : fibfib(n-1) +(n-1) + fib fib(n-(n-
2);2);}}int int plusplus (int val1, int val2) (int val1, int val2) {{ return val1 + val2;return val1 + val2;}}int int mainmain (int argc, char *argv[ (int argc, char *argv[ ] ])){{ const int factor = 23;const int factor = 23; const int vector_size = 40;const int vector_size = 40; vector<int> a, b, c; vector<int> a, b, c; vector<int> fa, fb;vector<int> fa, fb;
cout << " Filling vectors..." << endl;cout << " Filling vectors..." << endl;
for (int i = 1; i <= vector_size; i++)for (int i = 1; i <= vector_size; i++)
{{
a.push_back(i % factor);a.push_back(i % factor);
b.push_back((vector_size + 1 - i) % factor);b.push_back((vector_size + 1 - i) % factor);
c.push_back(0);c.push_back(0);
fa.push_back(0);fa.push_back(0);
fb.push_back(0);fb.push_back(0);
}}
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(a.begin(), a.end(), fa.begin(),transform(a.begin(), a.end(), fa.begin(), fib fib););
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(b.begin(), b.end(), fb.begin(), transform(b.begin(), b.end(), fb.begin(), fibfib););
cout << " Reducing..." << endl;cout << " Reducing..." << endl;
transform(fa.begin(), fa.end(), fb.begin(), transform(fa.begin(), fa.end(), fb.begin(), c.begin(), ::plus);c.begin(), ::plus);
cout << endl << " Result: (" ;cout << endl << " Result: (" ;
ostream_iterator<int> output(cout, " ");ostream_iterator<int> output(cout, " ");
copy(c.begin(), c.end(), output); copy(c.begin(), c.end(), output);
cout << "\b)" << endl;cout << "\b)" << endl;
return 0;return 0;
}}
Transform vectors:fa = map fib afb = map fib bc = zipWith plus fa fb
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4343
Map-Reduce (C+Map-Reduce (C++)+)Map-Reduce (C+Map-Reduce (C++)+)
#include <vector>#include <vector>#include <algorithm>#include <algorithm>#include <functional>#include <functional>#include <iostream>#include <iostream>#include <ctime>#include <ctime>using namespace std;using namespace std;
int int fibfib (int n) (int n){{ return (n < 2) ? n : return (n < 2) ? n : fibfib(n-1) +(n-1) + fib fib(n-(n-
2);2);}}int int plusplus (int val1, int val2) (int val1, int val2) {{ return val1 + val2;return val1 + val2;}}int int mainmain (int argc, char *argv[ (int argc, char *argv[ ] ])){{ const int factor = 23;const int factor = 23; const int vector_size = 40;const int vector_size = 40; vector<int> a, b, c; vector<int> a, b, c; vector<int> fa, fb;vector<int> fa, fb;
cout << " Filling vectors..." << endl;cout << " Filling vectors..." << endl;
for (int i = 1; i <= vector_size; i++)for (int i = 1; i <= vector_size; i++)
{{
a.push_back(i % factor);a.push_back(i % factor);
b.push_back((vector_size + 1 - i) % factor);b.push_back((vector_size + 1 - i) % factor);
c.push_back(0);c.push_back(0);
fa.push_back(0);fa.push_back(0);
fb.push_back(0);fb.push_back(0);
}}
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(a.begin(), a.end(), fa.begin(),transform(a.begin(), a.end(), fa.begin(), fib fib););
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(b.begin(), b.end(), fb.begin(), transform(b.begin(), b.end(), fb.begin(), fibfib););
cout << " Reducing..." << endl;cout << " Reducing..." << endl;
transform(fa.begin(), fa.end(), fb.begin(), transform(fa.begin(), fa.end(), fb.begin(), c.begin(), ::plus);c.begin(), ::plus);
cout << endl << " Result: (" ;cout << endl << " Result: (" ;
ostream_iterator<int> output(cout, " ");ostream_iterator<int> output(cout, " ");
copy(c.begin(), c.end(), output); copy(c.begin(), c.end(), output);
cout << "\b)" << endl;cout << "\b)" << endl;
return 0;return 0;
}}
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4444
Map-Reduce (T+Map-Reduce (T++)+)Map-Reduce (T+Map-Reduce (T++)+)
#include <vector>#include <vector>#include <algorithm>#include <algorithm>#include <functional>#include <functional>#include <iostream>#include <iostream>#include <ctime>#include <ctime>using namespace std;using namespace std;
tfun tfun int int fibfib (int n) (int n){{ return (n < 2) ? n : return (n < 2) ? n : fibfib(n-1) +(n-1) + fib fib(n-(n-
2);2);}}tfun tfun int int plusplus (int val1, int val2) (int val1, int val2) {{ return val1 + val2;return val1 + val2;}}tfun tfun int int mainmain (int argc, char *argv[ (int argc, char *argv[ ] ])){{ const int factor = 23;const int factor = 23; const int vector_size = 40;const int vector_size = 40; vector<int> a, b, c; vector<int> a, b, c; vector<vector<tval tval int> fa, fb;int> fa, fb;
cout << " Filling vectors..." << endl;cout << " Filling vectors..." << endl;
for (int i = 1; i <= vector_size; i++)for (int i = 1; i <= vector_size; i++)
{{
a.push_back(i % factor);a.push_back(i % factor);
b.push_back((vector_size + 1 - i) % factor);b.push_back((vector_size + 1 - i) % factor);
c.push_back(0);c.push_back(0);
fa.push_back(0);fa.push_back(0);
fb.push_back(0);fb.push_back(0);
}}
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(a.begin(), a.end(), fa.begin(),transform(a.begin(), a.end(), fa.begin(), fib fib););
cout << " Mapping..." << endl;cout << " Mapping..." << endl;
transform(b.begin(), b.end(), fb.begin(), transform(b.begin(), b.end(), fb.begin(), fibfib););
cout << " Reducing..." << endl;cout << " Reducing..." << endl;
transform(fa.begin(), fa.end(), fb.begin(), transform(fa.begin(), fa.end(), fb.begin(), c.begin(), ::plus);c.begin(), ::plus);
cout << endl << " Result: (" ;cout << endl << " Result: (" ;
ostream_iterator<int> output(cout, " ");ostream_iterator<int> output(cout, " ");
copy(c.begin(), c.end(), output); copy(c.begin(), c.end(), output);
cout << "\b)" << endl;cout << "\b)" << endl;
return 0;return 0;
}}
Vector of T-values
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4545
Map-Reduce (T++): “Laziness” Map-Reduce (T++): “Laziness” Map-Reduce (T++): “Laziness” Map-Reduce (T++): “Laziness” Filling, mapping — all T-functions are invoked, no T-Functions calculated: 0 seconds
Calculating of all T-functions, printing out: 8 seconds
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4646
0%
20%
40%
60%
80%
100%
120%
0 2 4 6 8 10
Time(%) CoE
Map-Reduce (T++)Map-Reduce (T++)Map-Reduce (T++)Map-Reduce (T++)
WinCCS cluster,WinCCS cluster,4 nodes4 nodes
CPU:CPU: AMD Athlon AMD Athlon 64 X2 Dual Core 64 X2 Dual Core Processor 4400+ Processor 4400+ 2.21 GHz2.21 GHz
Gigabit EthernetGigabit Ethernet
time% =time% = timetimetapptapp(N)/timet(N)/timetappapp((1)1)
CoE = CoE = 1/(n×time%)1/(n×time%)CPU Cores
Program Systems Institute Russian Academy of Sciences
4747
Inside OpenTSInside OpenTSInside OpenTSInside OpenTS
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4848
Open TSOpen TS: : EnvironmentEnvironmentOpen TSOpen TS: : EnvironmentEnvironment
Supports more then 1,000,000
threads per core
Supports more then 1,000,000
threads per core
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
4949
SupermemorySupermemorySupermemorySupermemory
Utilization: non-ready values, resource Utilization: non-ready values, resource and status information, etc.and status information, etc.
Object-Oriented Distributed shared Object-Oriented Distributed shared memory (OO DSM)memory (OO DSM)
Global address spaceGlobal address space DSM-cell versioningDSM-cell versioning On top - automatic garbage collectionOn top - automatic garbage collection
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5050
Multithreading & Multithreading & CommunicationsCommunications
Multithreading & Multithreading & CommunicationsCommunications
Lightweight threadsLightweight threads PIXELS (1 000 000 threadsPIXELS (1 000 000 threads))
AsynchronousAsynchronous communications communications A thread A thread “A”“A” asks non-ready value (or new asks non-ready value (or new
job)job) Asynchronous request sent: Active Asynchronous request sent: Active
messages & Signals delivery over network to messages & Signals delivery over network to stimulate data transfer to the thread stimulate data transfer to the thread “A”“A”
Context switches (including a quant for Context switches (including a quant for communications)communications)
Latency HidingLatency Hiding for node-node exchange for node-node exchange
Program Systems Institute Russian Academy of Sciences
5151
Open TS applicationsOpen TS applications(selected)(selected)
Open TS applicationsOpen TS applications(selected)(selected)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5252
MultiGenMultiGenChelyabinsk State UniversityChelyabinsk State University
MultiGenMultiGenChelyabinsk State UniversityChelyabinsk State University
Level 0
Level 1
Level 2
Multi-conformation model
К0
К11 К12
К21 К22
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5353
MultiGen: SpeedupMultiGen: SpeedupMultiGen: SpeedupMultiGen: Speedup
Substance Atom number
Rotations number
Conformers Execution time (min.:с)
1 node 4 nodes 16 nodes
NCI-609067 28 4 13 9:33 3:21 1:22
TOSLAB A2-0261 82 18 49 115:27 39:23 16:09
NCI-641295 126 25 74 266:19 95:57 34:48
National Cancer Institute USAReg.No. NCI-609067(AIDS drug lead)
TOSLAB company (Russia-Belgium)Reg.No. TOSLAB A2-0261(antiphlogistic drug lead)
National Cancer Institute USAReg.No. NCI-641295(AIDS drug lead)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5454
AeromechanicsAeromechanicsInstitute of Mechanics, MSUInstitute of Mechanics, MSU
AeromechanicsAeromechanicsInstitute of Mechanics, MSUInstitute of Mechanics, MSU
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5555
Belocerkovski’sBelocerkovski’s approachapproachBelocerkovski’sBelocerkovski’s approachapproach
flow presented asa collection of smallelementary whirlwind(colours: clockwiseand contra-clockwiserotation)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5656
Creating space-born radar image from Creating space-born radar image from hologramhologram
Creating space-born radar image from Creating space-born radar image from hologramhologram
Space Research Institute Development
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5757
Simulating broadband radar Simulating broadband radar signalsignal
Simulating broadband radar Simulating broadband radar signalsignal
Graphical User Interface
Non-PSI RAS development team (Space research institute of Khrunichev corp.)
0
50
100
150
200
250
300
1 4 8 12 16 20 24 28
0
50
100
150
200
250
300
1 4 8 12 16 20 24 28
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
5858
Landsat Image Landsat Image
ClassificationClassification Landsat Image Landsat Image
ClassificationClassification Computational Computational “web-service”“web-service”
Program Systems Institute Russian Academy of Sciences
5959
Open TS vs. MPI case Open TS vs. MPI case studystudy
Open TS vs. MPI case Open TS vs. MPI case studystudy
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6060
ApplicationsApplicationsApplicationsApplications Popular and widely used Popular and widely used Developed by independent teams (MPI Developed by independent teams (MPI
experts)experts)
PovRayPovRay – Persistence of Vision Ray- – Persistence of Vision Ray-tracer, enabled for parallel run by a tracer, enabled for parallel run by a patchpatch
ALCMD/MP_liteALCMD/MP_lite – molecular dynamics – molecular dynamics package (Ames Lab)package (Ames Lab)
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6161
T-PovRay vs. MPI PovRay: T-PovRay vs. MPI PovRay: code complexitycode complexity
T-PovRay vs. MPI PovRay: T-PovRay vs. MPI PovRay: code complexitycode complexity
ProgramProgram Source code Source code volumevolume
MPI modules for MPI modules for PovRay 3.10gPovRay 3.10g
1,500 lines1,500 lines
MPI patch for MPI patch for PovRay 3.50cPovRay 3.50c
3,000 lines3,000 lines
T++ modules (for T++ modules (for both versions 3.10g & both versions 3.10g & 3.50c)3.50c)
200 lines200 lines
~7—15 times
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6262
T-PovRay vs. MPI PovRay: T-PovRay vs. MPI PovRay: performanceperformance
T-PovRay vs. MPI PovRay: T-PovRay vs. MPI PovRay: performanceperformance
90%100%110%120%130%140%150%160%170%180%190%200%210%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
2CPUs AMD Opteron 248 2.2 GHz RAM 4GB, GigE, LAM 7.1.1
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6363
T-PovRay vs MPI PovRay: T-PovRay vs MPI PovRay: performanceperformance
T-PovRay vs MPI PovRay: T-PovRay vs MPI PovRay: performanceperformance
90%100%110%120%130%140%150%160%170%180%190%200%210%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
2CPUs AMD Opteron 248 2.2 GHz RAM 4GB, GigE, LAM 7.1.1
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6464
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS ALCMD/OpenTS ALCMD/MPI vs ALCMD/MPI vs
ALCMD/OpenTS ALCMD/OpenTS MP_Lite component of ALCMD MP_Lite component of ALCMD
rewritten in T++rewritten in T++ Fortran code is left intact Fortran code is left intact
M PI
M PIM P_Lite
ALCMD
OpenTS
OpenTSM P_Lite
ALCMD
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6565
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS : ALCMD/OpenTS : code complexitycode complexity
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS : ALCMD/OpenTS : code complexitycode complexity
ProgramProgram Source code Source code volumevolume
MP_Lite total/MPIMP_Lite total/MPI ~20,000 lines~20,000 lines
MP_Lite,ALCMD-MP_Lite,ALCMD-related/related/MPIMPI
~3,500 lines~3,500 lines
MP_Lite,ALCMD-MP_Lite,ALCMD-related/related/OpenTSOpenTS
500 lines500 lines
~7 times
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6666
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
80%
90%
100%
110%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
16 dual Athlon 1800, AMD Athlon MP 1800+ RAM 1GB, FastEthernet, LAM 7.0.6, Lennard-Jones MD, 512000 atoms
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6767
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
80%
90%
100%
110%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
2CPUs AMD Opteron 248 2.2 GHz RAM 4GB, GigE, LAM 7.1.1, Lennard-Jones MD, 512000 atoms
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6868
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
80%
90%
100%
110%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
2CPUs AMD Opteron 248 2.2 GHz RAM 4GB, InfiniBand,MVAMPICH 0.9.4, Lennard-Jones MD,512000 atoms
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
6969
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
80%
90%
100%
110%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
2CPUs AMD Opteron 248 2.2 GHz RAM 4GB, GigE, LAM 7.1.1, Lennard-Jones MD, 512000 atoms
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7070
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
ALCMD/MPI vs ALCMD/MPI vs ALCMD/OpenTS: ALCMD/OpenTS:
performanceperformance
80%
90%
100%
110%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16Number of processors
Time MPI/Time OpenTS
2CPUs AMD Opteron 248 2.2 GHz RAM 4GB, InfiniBand,MVAMPICH 0.9.4, Lennard-Jones MD,512000 atoms
Program Systems Institute Russian Academy of Sciences
7171
Porting OpenTSPorting OpenTSto MS Windows CCSto MS Windows CCS
Porting OpenTSPorting OpenTSto MS Windows CCSto MS Windows CCS
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7272
2006: contract with Microsoft 2006: contract with Microsoft “Porting OpenTS to Windows “Porting OpenTS to Windows
Compute Cluster Server”Compute Cluster Server”
2006: contract with Microsoft 2006: contract with Microsoft “Porting OpenTS to Windows “Porting OpenTS to Windows
Compute Cluster Server”Compute Cluster Server” OpenTS@WinCCSOpenTS@WinCCS
inherits all basic features of the inherits all basic features of the original Linux versionoriginal Linux version
is available under FreeBSD licenseis available under FreeBSD license does not require any commercial does not require any commercial
compiler for T-program development compiler for T-program development — — it’s only enough to install VisualC+it’s only enough to install VisualC++ 2005 Express Edition (available for + 2005 Express Edition (available for free on Microsoft website) and PSDKfree on Microsoft website) and PSDK
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7373
OpenTS@WinCCSOpenTS@WinCCSOpenTS@WinCCSOpenTS@WinCCS AMD64 and x86 platforms are AMD64 and x86 platforms are
currently supportedcurrently supported Integration into Microsoft Visual Studio Integration into Microsoft Visual Studio
20052005 Two ways for building T-applications: Two ways for building T-applications:
command line and Visual Studio IDE command line and Visual Studio IDE An installer of OpenTS for Windows An installer of OpenTS for Windows
XP/2003/WCCSXP/2003/WCCS Installation of WCCS SDK Installation of WCCS SDK
(including MS-MPI), if necessary(including MS-MPI), if necessary OpenTS self-testing procedureOpenTS self-testing procedure
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7474
Installer of OpenTSInstaller of OpenTSfor Windows XP/2003/WCCSfor Windows XP/2003/WCCS
Installer of OpenTSInstaller of OpenTSfor Windows XP/2003/WCCSfor Windows XP/2003/WCCS
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7575
OpenTS integration into OpenTS integration into Microsoft Visual Studio 2005Microsoft Visual Studio 2005
OpenTS integration into OpenTS integration into Microsoft Visual Studio 2005Microsoft Visual Studio 2005
Program Systems Institute Russian Academy of Sciences
7676
Open TS “Gadgets”Open TS “Gadgets”Open TS “Gadgets”Open TS “Gadgets”
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7777
Web-services, Live Web-services, Live documentsdocuments
Web-services, Live Web-services, Live documentsdocuments
tfuntfun int fib (int n) { int fib (int n) { return n < 2 ? n : return n < 2 ? n :
fib(n-1)+fib(n-2);fib(n-1)+fib(n-2);}}
<operation name="wstfib"><operation name="wstfib"> <SOAP:operation style="rpc" soapAction=""/><SOAP:operation style="rpc" soapAction=""/> <input><input> <<SOAP:body use="encoded" namespace="urn:myservice“SOAP:body use="encoded" namespace="urn:myservice“ encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>> </input></input> <output><output> <SOAP:body use="encoded" namespace="urn:myservice" <SOAP:body use="encoded" namespace="urn:myservice" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>> </output></output>
</operation></operation>
twsgen Perl script
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7878
Trace visualizerTrace visualizerTrace visualizerTrace visualizer Collect trace of Collect trace of
T-program T-program executionexecution
Visualize Visualize performance performance metrics of metrics of OpenTS OpenTS runtimeruntime
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
7979
Fault-toleranceFault-toleranceFault-toleranceFault-tolerance Recalculation based fRecalculation based fault-toleranceault-tolerance
(+)(+) Very simple (in comparison with full Very simple (in comparison with full transactional model)transactional model)
(+)(+) Efficient (only minimal set of damaged Efficient (only minimal set of damaged functions are recalculated)functions are recalculated)
(–)(–) Applicable only for functional programsApplicable only for functional programs Fault-tolerant communications neededFault-tolerant communications needed
(eg.: DMPI v1.0)(eg.: DMPI v1.0) Implemented (experimental version on Linux Implemented (experimental version on Linux
))
Open TS: an advanced tool for parallel and distributed Open TS: an advanced tool for parallel and distributed computing. computing.
8080
Some other GadgetsSome other GadgetsSome other GadgetsSome other Gadgets Other T-languages: T-Refal, T-FortanOther T-languages: T-Refal, T-Fortan MemoizationMemoization Automatically choosing between call-Automatically choosing between call-
style and fork-style of function invocationstyle and fork-style of function invocation CheckpointingCheckpointing Heartbeat mechanismHeartbeat mechanism FlavoursFlavours of data references: “normal”, of data references: “normal”,
“glue” and “magnetic” “glue” and “magnetic” — — lazy, eager and lazy, eager and ultra-eager (speculative) data transferultra-eager (speculative) data transfer
Институт программных систем имени А.К.Айламазяна РАН
Full / Empty Bit (FEB) Full / Empty Bit (FEB) ииТ-СистемаТ-Система
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 81
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
FEB
Модель вычисления: «общая память» легковесные нити FEB — бит синхронизации на каждое слово
Тонкости: фьючеры Аппаратная реализация: Cray XMT, MTA, T3D (2001 и
далее) Программная реализация: Sandia National Laboratories:
Qthreads — www.cs.sandia.gov/qthreads
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 82
Институт программных систем имени А.К.Айламазяна РАН
Монотонные объекты, как Монотонные объекты, как безопасное расширение безопасное расширение функциональной моделифункциональной модели
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 83
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Идеи расширения
Монотонные объекты — обладают свойством Черча-Россера
Типичная жизнь монотонного объекта: Создание и инициализация объекта Поток обращений по обновлению («запись») и
считыванию текущего состояния («чтение») Финализация и удаление объекта
Примеры монотонных объектов (класса сумматоры) Примеры приложения с монотонным объектом Способы масштабируемой реализации монотонных
объектов
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 84
Институт программных систем имени А.К.Айламазяна РАН
Библиотеки односторонних Библиотеки односторонних обменов — обменов — SHMEMSHMEM, Gasnet, , Gasnet,
ARMCIARMCI
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 85
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Основные черты технологии SHMEM
«Чужие» данные не обрабатываются на месте, а копируются предварительно туда, где они нужны — как в MPI
Преобладающий режим копирования – запись, возможно, мелкозернистая
Синхронизация – барьерная Важны
высокий message rate (например, для приложений со сложной организацией данных: неструктурных сеток и т.п.)
низкая подлинная латентность (для снижения размера зерна параллелизма, независимо от того, сложно или просто организованы данные)
Однородность доступа не важна Message rate можно обеспечить программно, грамотной
буферизацией Низкую подлинную латентность может дать только
аппаратура
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 86
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Технология SHMEM
Рассчитана на полностью однородные многопроцессорные вычислители (общность системы команд, машинного представления чисел, одинаковая операционная система, один и тот же исполняемый файл)
Программа на С, использующая SHMEM, должна включать файл заголовков shmem.h.
shmem_init() — инициализация my_pe() — собственный номер процесса; num_pes() — число процессов
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 87
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
SHMEM: Односторонние обмены
put --- односторонняя запись в чужую память get --- одностороннее чтение из чужой памяти Поддержаны передачи данных разных типов, одного
значения, сплошного массива или массива, расположенного в памяти с шагом (например, столбец двумерного массива в С)
shmem_double_p( addr, value, pe )shmem_float_put( addr, src, len, pe )
Можно обмениваться областями памяти статических (но не автоматических!) переменных. И даже поддержан специальный malloc
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 88
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
SHMEM: Операции синхронизации
Возможность выполнить барьерную синхронизацию всех или лишь указанных процессов.
При выполнении синхронизации гарантируется, что все выданные до барьера запросы типа put будут завершены.
shmem_barrier_all() shmem_barrier( start, stride, size, sync )
step = 2stride
синхронизуются процессы с номерамиstart, strat+step, … strat+step*(size-1)
sync — рабочий массив (расписать нулями!) типа long, длиной _SHMEM_BARRIER_SYNC_SIZE
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 89
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Ожидание переменной
shmem_wait( &var, value ) — на «==» ожидание &var == value
shmem_int_wait_until( &var, SHMEM_CMP_GT, value ) ожидание &var > value
shmem_fence() — гарантирует, что все выданные ранее из данного процесса запросы типа put будут завершены.
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 90
Институт программных систем имени А.К.Айламазяна РАН
МоделиМодели PGAS (Partitioned Global PGAS (Partitioned Global Address Space)Address Space),,
DSM (Distributed Shared Memory)DSM (Distributed Shared Memory),,языкиязыки Co-Array Fortran Co-Array Fortran, , UPCUPC……
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 91
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Модель памяти
Разделяемая (shared) память Любой процесс может использовать ее или указывать на
нее
Приватная память Только «локальный» процесс может использовать ее или
указывать на нее
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 92
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Что такое UPC
Unified Parallel C Расширение ANSI C примитивами задания явного
параллелизма Основан на «distributed shared memory» Основные идеи
Сохранить философию С: Программист умен и аккуратен Близость к железу (насколько возможно) для лучшей
эффективности (но можно получить и проблемы) Простой и привычный синтаксис
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 93
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Модель исполнения
Несколько процессов (нитей 0..THREADS-1) работают независимо
MYTHREAD определяет номер процесса THREADS — число процессов Когда необходимо для синхронизации используются
Барьеры Блокировки Управление поведением памяти
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 94
ИПС имени А.К.Айламазяна РАН — Программа «СКИФ-ГРИД»
Пример 1
//vect_add.c
#include <upc_relaxed.h>
#define N 100*THREADS
shared int a[N], b[N], c[N];
void main(){
int i;
for(i=0; i<N; i++)
if (MYTHREAD==i%THREADS)
c[i]=a[i]+b[i];
}
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 95
Институт программных систем имени А.К.Айламазяна РАН
Вместо заключенияВместо заключения
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 96
Институт программных систем имени А.К.Айламазяна РАН
Спасибо за внимание!
8 апреля, 2023 СКИФ-ГРИД © 2009 Все права защищены Слайд 97