{"id":327987,"date":"2022-01-14T03:00:13","date_gmt":"2022-01-14T03:00:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=327987"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=327987","title":{"rendered":"<span>\u041d\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Planning C 2.0<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>\u0425\u043e\u0447\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 &#8212; \u044f\u0437\u044b\u043a\u0435 Planning C (v2.0). \u041e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c C++, \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u0440\u044f\u0434\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/vpekunov\/Planning_C_Translator\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> (\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440\u0430-\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c MPI->Planning C). \u041e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 Planning C \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0435\u0433\u043e \u043d\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0443\u0434\u043e\u0431\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0435\u043a, \u0434\u0435\u043a \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c (\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432). \u042f\u0437\u044b\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f, \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432 \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432 \u0441 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438, \u0438 \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442, \u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0431\u044b\u043b\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043d\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438, \u00ab\u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f\u00bb \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0430\u0436\u0435 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\/\u0438\u043b\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f. \u0421\u0430\u043c \u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430\u043f\u0438\u0448\u0443 \u043b\u0438\u0448\u044c \u043e \u0441\u0430\u043c\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u044f\u0437\u044b\u043a\u0430, \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0415\u0441\u043b\u0438 \u0442\u0435\u043c\u0430 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043d\u0430\u043f\u0438\u0448\u0443 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443-\u0434\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u00ab\u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445\u00bb\/\u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438<\/h2>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441 \u043f\u043b\u0430\u043d\u043e\u043c. \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 (\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e), \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043f\u043b\u0430\u043d\u0435. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043b\u0430\u043d\u0430, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e (\u0432 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0446\u0438\u043a\u043b\u0435). \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u0435 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043b\u0430\u043d\u0430. \u041f\u043b\u0430\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0435 [\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043b\u0430\u043d\u0430 (<strong>plan_first<\/strong>) \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043f\u043b\u0430\u043d\u0430 (<strong>plan_last<\/strong>)].<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u2013 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f\u0442 \u0441 \u044d\u0442\u0430\u043f\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043b\u0430\u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0431\u044b\u043b \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u0435\u043c (\u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u043a\u0430 \u00ab!\u00bb \u043f\u043e\u0441\u043b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430), \u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2013 \u043e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043b\u0430\u043d\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0446\u0435\u043f\u0438 (\u043d\u0430\u0431\u043e\u0440\u044b \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e (\u0440\u0435\u0436\u0438\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u0430) \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u044d\u0442\u043e\u0439 \u0446\u0435\u043f\u0438 (\u0440\u0435\u0436\u0438\u043c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043b\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>throw_first<\/strong>, \u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u2013 <strong>throw_last<\/strong>).<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e \u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e 5:<\/p>\n<pre><code class=\"cpp\">reenterable Loop(int x, int last) {  \u00a0cout &lt;&lt; x &lt;&lt; \u201c \u201c;  \u00a0if (++x &lt;= last) plan_first(x);  }  \/* \u0412\u044b\u0437\u043e\u0432: Loop(0,5); *\/<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u0437\u043b\u043e\u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043f\u043e \u0443\u0440\u043e\u0432\u043d\u044f\u043c \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437 \u0438 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e.<\/p>\n<pre><code class=\"cpp\">typedef struct TreeTag {  \u00a0 int Data;  \u00a0 struct TreeTag * Left;  \u00a0 struct TreeTag * Right;  } TreeNode;  int Number;  reenterable EnumerateByLevel(TreeNode * Cur) {  \u00a0Cur->Data = Number++;  \u00a0if (Cur->Left) plan_last(Cur->Left);  \u00a0if (Cur->Right) plan_last(Cur->Right);  }  \/* \u0412\u044b\u0437\u043e\u0432: Number = 1; EnumerateByLevel(Root); *\/<\/code><\/pre>\n<p>\u0422\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>EnumerateByLevel<\/strong> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0432\u0438\u0434\u0435 \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441 \u0442\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0438\u0435\u043c, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <strong>plan_first<\/strong>\/<strong>plan_last<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <strong>reent_first<\/strong>\/<strong>reent_last<\/strong>:<\/p>\n<pre><code class=\"cpp\">auto f = reenterable (TreeNode * Cur) {  \u00a0Cur->Data = Number++;  \u00a0if (Cur->Left) reent_last(Cur->Left);  \u00a0if (Cur->Right) reent_last(Cur->Right);  }  \/* \u0412\u044b\u0437\u043e\u0432: Number = 1; f(Root); *\/<\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u043d \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043c\u0430\u0440\u043a\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442 \u0435\u0433\u043e \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0431\u0435\u0437 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432) \u0433\u0440\u0443\u043f\u043f\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u043f\u043b\u0430\u043d. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043b\u044e\u0431\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <strong>plan_group_parallelize<\/strong>, \u0442\u043e \u0442\u0443\u0442 \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b. \u0410 \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <strong>plan_group_vectorize<\/strong>, \u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043b\u0430\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 (\u0441\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441).<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0435\u0440\u0435\u0432\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0440\u0435\u0434\u0443\u043a\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430-\u0441\u0443\u043c\u043c\u044b:<\/p>\n<pre><code class=\"cpp\">reenterable TreeSum(TreeNode * Cur, reduction(+) int &amp; SumResult)  {  \u00a0if (Cur==Root) plan_group_parallelize;  \u00a0if (Cur->Left) plan_last(Cur->Left,SumResult);  \u00a0if (Cur->Right) plan_last(Cur->Right,SumResult);  \u00a0SumResult = Cur->Data;  }<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 (\u0443\u043c\u043d\u043e\u0436\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0447\u0438\u0441\u0435\u043b A[N] \u043d\u0430 k, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 B[N]):<\/p>\n<pre><code class=\"cpp\">#pragma plan vectorized  #pragma plan common begin  #define N 5  #pragma plan common end  reenterable Mul(bool init, int k, _global(N) int * A, int i, _local(1) int * out) {  \u00a0 int ii;  \u00a0 if (init) { \/\/ \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043b\u0430\u043d \u0438 \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435  \u00a0\u00a0\u00a0\u00a0 for (ii = 0; ii &lt; N; ii++) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_last(false, k, A, ii, out);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 out++;  \u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 plan_group_vectorize(NULL);  \u00a0 } else { \/\/ \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *out = A[i]*k;  \u00a0 }  }  \/* \u0412\u044b\u0437\u043e\u0432: Mul(true, k, A, 0, B); *\/<\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 (\u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430)<\/h2>\n<p>\u041f\u0443\u0441\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0435\u0433\u043e \u0441\u0442\u0430\u0434\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 4 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c.<\/p>\n<pre><code class=\"cpp\">#ifndef __min  #define __min(a,b) ((a)&lt;(b) ? (a) : (b))  #endif  #ifndef __max  #define __max(a,b) ((a)>(b) ? (a) : (b))  #endif  chain TreeMax(TreeNode * Cur, reduction(__max) int &amp; MaxResult)  { \/\/ \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0static int DummyMin;  \u00a0throw_last(Cur, DummyMin);  \u00a0if (Cur==Root) plan_group_parallelize;  \u00a0if (Cur->Left) plan_last(Cur->Left, MaxResult);  \u00a0if (Cur->Right) plan_last(Cur->Right, MaxResult);  \u00a0MaxResult = Cur->Data;  }  chain TreeMin(TreeNode * Cur, reduction(__min) int &amp; MinResult)  { \/\/ \u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0if (Cur==Root) plan_group_parallelize;  \u00a0MinResult = Cur->Data;  }  void TreeMinMax(int &amp; Min, int &amp; Max)  {  \u00a0Max = 0.0;  \u00a0Min = 1000.0;  \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u0432\u0435\u0439\u0435\u0440\u0430 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435  plan_parallel_chain(0, TreeMax(Root,Max)\/4, TreeMin(Root,Min)\/4);  }<\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439) \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435, \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/h2>\n<p>\u041d\u0430 \u0443\u0437\u043b\u0435 \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c 1 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 29.<\/p>\n<pre><code class=\"cpp\">#pragma plan clustered  #include &lt;iostream>  using namespace std;  chain A1() throw(int DATA) { \/\/ \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0 for (int i = 0; i &lt; 30; i++)  \u00a0\u00a0\u00a0\u00a0\u00a0 throw_last(i);  }  chain B1(int DATA) { \/\/ \u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0 cout&lt;&lt;DATA&lt;&lt;endl;  }  int main() {  \u00a0 int IDs[2] = {0,1}; \/\/ MPI-\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0443\u0437\u043b\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440  \u00a0 clustered(IDs) plan_parallel_chain(0, A1(), B1(0));  \u00a0 return 0;  }<\/code><\/pre>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/h2>\n<p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u043c\u0435\u0435\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445: \u0430) \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c (\u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442) \u0438 \u0431) \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f (\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 Planning C, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u043a\u043e\u0434\u0430). \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b: \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u044d\u0442\u0430\u043f\u043e\u0432 \u043f\u043b\u0430\u043d\u0430, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0434\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u2013 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 (\u0440\u0430\u0441\u0447\u0435\u0442 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430). \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u0443\u043c\u043c\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u2013 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 10000).<\/p>\n<pre><code class=\"cpp\">#include &lt;stdlib.h>  #include &lt;iostream>  using namespace std;  const int N = 10000;  const int M = 600;  const int NF = 20;  reenterable calc_histo(bool init, int np, int * A, soft_transact_array(int) * F, double grain, int k) {  \u00a0\u00a0\u00a0\u00a0 if (init) { \/\/ \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043b\u0430\u043d \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; N; i += np) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for (int j = 0; j &lt; np; j++)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_last(false, np, A, F, grain, i + j);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_group_soft_atomize; \/\/ \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 } else { \/\/ \u0420\u0430\u0431\u043e\u0442\u0430, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (k &lt; N) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int _k = A[k] \/ grain;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (_k >= NF) _k = NF - 1;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ++(*F)[_k];  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 }  }  int main() {  \u00a0\u00a0\u00a0\u00a0 int * A = new int[N];  \u00a0\u00a0\u00a0\u00a0 soft_transact_array(int) F(NF);  \u00a0\u00a0\u00a0\u00a0 srand(184415);  \u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; N; i++)  \u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 A[i] = rand() % M;  \u00a0\u00a0\u00a0\u00a0 double grain = 1.0 * M \/ NF;  \u00a0\u00a0\u00a0\u00a0 F = 0;  \u00a0\u00a0\u00a0\u00a0 calc_histo(true, 4, A, &amp;F, grain, 0);  \/\/ \u0413\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043b\u0438, \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443  \u00a0\u00a0\u00a0\u00a0 int SF = 0;  \u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; NF; i++)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SF += F[i];  \u00a0\u00a0\u00a0\u00a0 cout &lt;&lt; SF;  \u00a0\u00a0\u00a0\u00a0 delete[] A;  \u00a0\u00a0\u00a0\u00a0 return 0;  }<\/code><\/pre>\n<h2>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445<\/h2>\n<p>\u0417\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u0435\u043d \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u2013 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b, \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u044b, \u0431\u0430\u0440\u044c\u0435\u0440\u044b, \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438\u2026 \u0414\u0430, \u0432\u0441\u0435 \u044d\u0442\u043e \u0435\u0441\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u043d\u0438\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435 \u043d\u0435\u0442.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044f\u0437\u044b\u043a\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 <u>\u043c\u0435\u043d\u0435\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445<\/u>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u0435\u043c\u0430\u0444\u043e\u0440, \u043a\u0430\u043d\u0430\u043b\u044b \u0438 \u0431\u0430\u0440\u044c\u0435\u0440. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 (\u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432) \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 DATA \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u0439 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0438 \u00ab\u043a\u043b\u0438\u043a\u0430\u00bb.<\/p>\n<pre><code class=\"cpp\">#pragma plan clustered  #include &lt;iostream>>  using namespace std;  cvar(int) * DATA = NULL;  int Counter;  chain A(input_proc Src, int N) {  \u00a0 int id = plan_linear_num()-1;  \u00a0 if (Src == empty_proc) {  \u00a0\u00a0\u00a0\u00a0 (*DATA)++;  \u00a0\u00a0\u00a0\u00a0 Counter = 1;  \u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; N; i++)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (i != id)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 throw_first(A[i+1], N);  \u00a0 } else {  \u00a0\u00a0\u00a0\u00a0 (*DATA)++;  \u00a0\u00a0\u00a0\u00a0 Counter++;  \u00a0\u00a0\u00a0\u00a0 if (Counter == N) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_registered_barrier(topology);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (id == N-1) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout&lt;&lt;**DATA&lt;&lt;endl;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_topology_quit();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 }  \u00a0 }  }  int main() {  \u00a0 const int N = 5;  \u00a0 DATA = new cvar(int)(1);  \u00a0 if (plan_cluster_id() == 0) *DATA = 0;  \u00a0 int IDS[N];  \u00a0 for (int i = 0; i &lt; N; i++)  \u00a0\u00a0\u00a0\u00a0\u00a0 IDS[i] = i;  \u00a0 clustered(IDS) clique(N)\/N;  \u00a0 delete DATA;  \u00a0 return 0;  }<\/code><\/pre>\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u0431\u044b\u043b \u0441\u0434\u0435\u043b\u0430\u043d \u0430\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e (\u0445\u043e\u0442\u044f \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0441\u0442\u0438\u043b\u0435\u043c) \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430 \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0432\u044b\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u0432 <a href=\"https:\/\/github.com\/vpekunov\/Planning_C_Translator\/tree\/main\/Documentation\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/645533\/\"> https:\/\/habr.com\/ru\/post\/645533\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>\u0425\u043e\u0447\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 &#8212; \u044f\u0437\u044b\u043a\u0435 Planning C (v2.0). \u041e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c C++, \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u0440\u044f\u0434\u043e\u043c \u043d\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 <a href=\"https:\/\/github.com\/vpekunov\/Planning_C_Translator\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a> (\u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u043d\u0441\u043b\u044f\u0442\u043e\u0440\u0430-\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c MPI->Planning C). \u041e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 Planning C \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0435\u0433\u043e \u043d\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0431\u0430\u0437\u0435 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0443\u0434\u043e\u0431\u043d\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0435\u043a, \u0434\u0435\u043a \u0438\u043b\u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u044c (\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432). \u042f\u0437\u044b\u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f, \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432 \u043d\u0430\u0448\u0435 \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432 \u0441 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438, \u0438 \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442, \u0438 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044f\u0437\u044b\u043a\u0430 \u0431\u044b\u043b\u0438 \u0432\u0432\u0435\u0434\u0435\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u043d\u043e\u0432\u044b\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438, \u00ab\u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f\u00bb \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0430\u0436\u0435 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\/\u0438\u043b\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f. \u0421\u0430\u043c \u044f \u0438\u043d\u043e\u0433\u0434\u0430 \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0441\u0447\u0435\u0442\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043d\u0430\u043f\u0438\u0448\u0443 \u043b\u0438\u0448\u044c \u043e \u0441\u0430\u043c\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u044f\u0437\u044b\u043a\u0430, \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445. \u0415\u0441\u043b\u0438 \u0442\u0435\u043c\u0430 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043d\u0430\u043f\u0438\u0448\u0443 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443-\u0434\u0432\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u00ab\u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0445\u00bb\/\u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438<\/h2>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441 \u043f\u043b\u0430\u043d\u043e\u043c. \u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 (\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e), \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u043f\u043b\u0430\u043d\u0435. \u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0442\u0441\u044f \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043b\u0430\u043d\u0430, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e (\u0432 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0446\u0438\u043a\u043b\u0435). \u041a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043d\u0435\u0435 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043b\u0430\u043d\u0430. \u041f\u043b\u0430\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0435 [\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043b\u0430\u043d\u0430 (<strong>plan_first<\/strong>) \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043f\u043b\u0430\u043d\u0430 (<strong>plan_last<\/strong>)].<\/p>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u2013 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044f\u0442 \u0441 \u044d\u0442\u0430\u043f\u0430 \u043d\u0430 \u044d\u0442\u0430\u043f. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043b\u0430\u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0431\u044b\u043b \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u043e\u0442\u0441\u0435\u0447\u0435\u043d\u0438\u0435\u043c (\u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u043a\u0430 \u00ab!\u00bb \u043f\u043e\u0441\u043b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430), \u0442\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0442\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2013 \u043e\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043b\u0430\u043d\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0446\u0435\u043f\u0438 (\u043d\u0430\u0431\u043e\u0440\u044b \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e (\u0440\u0435\u0436\u0438\u043c \u0432\u0435\u043a\u0442\u043e\u0440\u0430) \u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u044d\u0442\u043e\u0439 \u0446\u0435\u043f\u0438 (\u0440\u0435\u0436\u0438\u043c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u043b\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <strong>throw_first<\/strong>, \u0430 \u0432 \u043a\u043e\u043d\u0435\u0446 \u2013 <strong>throw_last<\/strong>).<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e \u0446\u0438\u043a\u043b \u043e\u0442 0 \u0434\u043e 5:<\/p>\n<pre><code class=\"cpp\">reenterable Loop(int x, int last) {  \u00a0cout &lt;&lt; x &lt;&lt; \u201c \u201c;  \u00a0if (++x &lt;= last) plan_first(x);  }  \/* \u0412\u044b\u0437\u043e\u0432: Loop(0,5); *\/<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u0437\u043b\u043e\u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043f\u043e \u0443\u0440\u043e\u0432\u043d\u044f\u043c \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437 \u0438 \u0441\u043b\u0435\u0432\u0430 \u043d\u0430\u043f\u0440\u0430\u0432\u043e.<\/p>\n<pre><code class=\"cpp\">typedef struct TreeTag {  \u00a0 int Data;  \u00a0 struct TreeTag * Left;  \u00a0 struct TreeTag * Right;  } TreeNode;  int Number;  reenterable EnumerateByLevel(TreeNode * Cur) {  \u00a0Cur->Data = Number++;  \u00a0if (Cur->Left) plan_last(Cur->Left);  \u00a0if (Cur->Right) plan_last(Cur->Right);  }  \/* \u0412\u044b\u0437\u043e\u0432: Number = 1; EnumerateByLevel(Root); *\/<\/code><\/pre>\n<p>\u0422\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>EnumerateByLevel<\/strong> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0432 \u0432\u0438\u0434\u0435 \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441 \u0442\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0438\u0435\u043c, \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <strong>plan_first<\/strong>\/<strong>plan_last<\/strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f <strong>reent_first<\/strong>\/<strong>reent_last<\/strong>:<\/p>\n<pre><code class=\"cpp\">auto f = reenterable (TreeNode * Cur) {  \u00a0Cur->Data = Number++;  \u00a0if (Cur->Left) reent_last(Cur->Left);  \u00a0if (Cur->Right) reent_last(Cur->Right);  }  \/* \u0412\u044b\u0437\u043e\u0432: Number = 1; f(Root); *\/<\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439<\/h2>\n<p>\u041f\u0440\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u043b\u0430\u043d \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043c\u0430\u0440\u043a\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u043b\u044f\u0442 \u0435\u0433\u043e \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u044b. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0431\u0435\u0437 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432) \u0433\u0440\u0443\u043f\u043f\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u043f\u043b\u0430\u043d. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043b\u044e\u0431\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <strong>plan_group_parallelize<\/strong>, \u0442\u043e \u0442\u0443\u0442 \u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b. \u0410 \u0435\u0441\u043b\u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <strong>plan_group_vectorize<\/strong>, \u0442\u043e \u0433\u0440\u0443\u043f\u043f\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043b\u0430\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 (\u0441\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441).<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0435\u0440\u0435\u0432\u0430, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0440\u0435\u0434\u0443\u043a\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430-\u0441\u0443\u043c\u043c\u044b:<\/p>\n<pre><code class=\"cpp\">reenterable TreeSum(TreeNode * Cur, reduction(+) int &amp; SumResult)  {  \u00a0if (Cur==Root) plan_group_parallelize;  \u00a0if (Cur->Left) plan_last(Cur->Left,SumResult);  \u00a0if (Cur->Right) plan_last(Cur->Right,SumResult);  \u00a0SumResult = Cur->Data;  }<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u0435 (\u0443\u043c\u043d\u043e\u0436\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0447\u0438\u0441\u0435\u043b A[N] \u043d\u0430 k, \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 B[N]):<\/p>\n<pre><code class=\"cpp\">#pragma plan vectorized  #pragma plan common begin  #define N 5  #pragma plan common end  reenterable Mul(bool init, int k, _global(N) int * A, int i, _local(1) int * out) {  \u00a0 int ii;  \u00a0 if (init) { \/\/ \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043b\u0430\u043d \u0438 \u0434\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u0435  \u00a0\u00a0\u00a0\u00a0 for (ii = 0; ii &lt; N; ii++) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_last(false, k, A, ii, out);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 out++;  \u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 plan_group_vectorize(NULL);  \u00a0 } else { \/\/ \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 *out = A[i]*k;  \u00a0 }  }  \/* \u0412\u044b\u0437\u043e\u0432: Mul(true, k, A, 0, B); *\/<\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435 (\u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430)<\/h2>\n<p>\u041f\u0443\u0441\u0442\u044c \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0435\u0440\u0435\u0432\u043e, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u0435\u0433\u043e \u0441\u0442\u0430\u0434\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0430 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442. \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 4 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c.<\/p>\n<pre><code class=\"cpp\">#ifndef __min  #define __min(a,b) ((a)&lt;(b) ? (a) : (b))  #endif  #ifndef __max  #define __max(a,b) ((a)>(b) ? (a) : (b))  #endif  chain TreeMax(TreeNode * Cur, reduction(__max) int &amp; MaxResult)  { \/\/ \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0static int DummyMin;  \u00a0throw_last(Cur, DummyMin);  \u00a0if (Cur==Root) plan_group_parallelize;  \u00a0if (Cur->Left) plan_last(Cur->Left, MaxResult);  \u00a0if (Cur->Right) plan_last(Cur->Right, MaxResult);  \u00a0MaxResult = Cur->Data;  }  chain TreeMin(TreeNode * Cur, reduction(__min) int &amp; MinResult)  { \/\/ \u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0if (Cur==Root) plan_group_parallelize;  \u00a0MinResult = Cur->Data;  }  void TreeMinMax(int &amp; Min, int &amp; Max)  {  \u00a0Max = 0.0;  \u00a0Min = 1000.0;  \/\/ \u0417\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u0432\u0435\u0439\u0435\u0440\u0430 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435  plan_parallel_chain(0, TreeMax(Root,Max)\/4, TreeMin(Root,Min)\/4);  }<\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 (\u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439) \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0435, \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435<\/h2>\n<p>\u041d\u0430 \u0443\u0437\u043b\u0435 \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c 1 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 0 \u0434\u043e 29.<\/p>\n<pre><code class=\"cpp\">#pragma plan clustered  #include &lt;iostream>  using namespace std;  chain A1() throw(int DATA) { \/\/ \u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0 for (int i = 0; i &lt; 30; i++)  \u00a0\u00a0\u00a0\u00a0\u00a0 throw_last(i);  }  chain B1(int DATA) { \/\/ \u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440\u0430  \u00a0 cout&lt;&lt;DATA&lt;&lt;endl;  }  int main() {  \u00a0 int IDs[2] = {0,1}; \/\/ MPI-\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0443\u0437\u043b\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440  \u00a0 clustered(IDs) plan_parallel_chain(0, A1(), B1(0));  \u00a0 return 0;  }<\/code><\/pre>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438<\/h2>\n<p>\u0422\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0438\u043c\u0435\u0435\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445: \u0430) \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c (\u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442) \u0438 \u0431) \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f (\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u0430\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 Planning C, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0449\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439, \u0442\u0430\u043a \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u043a\u043e\u0434\u0430). \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0432\u0438\u0434\u0435\u043e\u043a\u0430\u0440\u0442\u044b: \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u044d\u0442\u0430\u043f\u043e\u0432 \u043f\u043b\u0430\u043d\u0430, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0434\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u2013 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 (\u0440\u0430\u0441\u0447\u0435\u0442 \u0433\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430). \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u0443\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u0443\u043c\u043c\u0443 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u2013 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 10000).<\/p>\n<pre><code class=\"cpp\">#include &lt;stdlib.h>  #include &lt;iostream>  using namespace std;  const int N = 10000;  const int M = 600;  const int NF = 20;  reenterable calc_histo(bool init, int np, int * A, soft_transact_array(int) * F, double grain, int k) {  \u00a0\u00a0\u00a0\u00a0 if (init) { \/\/ \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043b\u0430\u043d \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; N; i += np) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 for (int j = 0; j &lt; np; j++)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_last(false, np, A, F, grain, i + j);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 plan_group_soft_atomize; \/\/ \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 } else { \/\/ \u0420\u0430\u0431\u043e\u0442\u0430, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (k &lt; N) {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int _k = A[k] \/ grain;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (_k >= NF) _k = NF - 1;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ++(*F)[_k];  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0\u00a0 }  }  int main() {  \u00a0\u00a0\u00a0\u00a0 int * A = new int[N];  \u00a0\u00a0\u00a0\u00a0 soft_transact_array(int) F(NF);  \u00a0\u00a0\u00a0\u00a0 srand(184415);  \u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; N; i++)  \u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 A[i] = rand() % M;  \u00a0\u00a0\u00a0\u00a0 double grain = 1.0 * M \/ NF;  \u00a0\u00a0\u00a0\u00a0 F = 0;  \u00a0\u00a0\u00a0\u00a0 calc_histo(true, 4, A, &amp;F, grain, 0);  \/\/ \u0413\u0438\u0441\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043b\u0438, \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443  \u00a0\u00a0\u00a0\u00a0 int SF = 0;  \u00a0\u00a0\u00a0\u00a0 for (int i = 0; i &lt; NF; i++)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 SF += F[i];  \u00a0\u00a0\u00a0\u00a0 cout &lt;&lt; SF;  \u00a0\u00a0\u00a0\u00a0 delete[] A;  \u00a0\u00a0\u00a0\u00a0 return 0;  }<\/code><\/pre>\n<h2>\u0415\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445<\/h2>\n<p>\u0417\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u0435\u043d \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u2013 \u0441\u0435\u043c\u0430\u0444\u043e\u0440\u044b, \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u044b, \u0431\u0430\u0440\u044c\u0435\u0440\u044b, \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438\u2026 \u0414\u0430, \u0432\u0441\u0435 \u044d\u0442\u043e \u0435\u0441\u0442\u044c, \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u043d\u0438\u043c\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u0432 \u044f\u0437\u044b\u043a\u0435 \u043d\u0435\u0442.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u044f\u0437\u044b\u043a\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 <u>\u043c\u0435\u043d\u0435\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445<\/u>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2013 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0441\u0435\u043c\u0430\u0444\u043e\u0440, \u043a\u0430\u043d\u0430\u043b\u044b \u0438 \u0431\u0430\u0440\u044c\u0435\u0440. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 (\u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432) \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0442\u043e\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u043e\u0439 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 DATA \u043d\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043d\u043e\u0439 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0438 \u00ab\u043a\u043b\u0438\u043a\u0430\u00bb.<\/p>\n<pre><code class=\"cpp\">#pragma plan clustered  #include &lt;iostream>>  using namespace std;  cvar(int) * DATA = NULL;  int Counter;  chain A(input_proc Src, int N) {  \u00a0 int id = plan_linear_num()-1;  \u00a0 if (Src ==<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-327987","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327987"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/327987\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}