diff --git a/.vs/distributed-computing/FileContentIndex/8398de25-9bac-48e0-a06c-18aaea97d92a.vsidx b/.vs/distributed-computing/FileContentIndex/8398de25-9bac-48e0-a06c-18aaea97d92a.vsidx new file mode 100644 index 0000000..a7d76f1 Binary files /dev/null and b/.vs/distributed-computing/FileContentIndex/8398de25-9bac-48e0-a06c-18aaea97d92a.vsidx differ diff --git a/.vs/distributed-computing/FileContentIndex/93d61de0-c45c-41c9-ab8f-9bf05ddae775.vsidx b/.vs/distributed-computing/FileContentIndex/93d61de0-c45c-41c9-ab8f-9bf05ddae775.vsidx new file mode 100644 index 0000000..d1c0a3e Binary files /dev/null and b/.vs/distributed-computing/FileContentIndex/93d61de0-c45c-41c9-ab8f-9bf05ddae775.vsidx differ diff --git a/.vs/distributed-computing/FileContentIndex/beafefcc-fd5c-46c4-9183-2824d47e2375.vsidx b/.vs/distributed-computing/FileContentIndex/beafefcc-fd5c-46c4-9183-2824d47e2375.vsidx new file mode 100644 index 0000000..a3f93ec Binary files /dev/null and b/.vs/distributed-computing/FileContentIndex/beafefcc-fd5c-46c4-9183-2824d47e2375.vsidx differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..150df6e Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs new file mode 100644 index 0000000..ed92695 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.AssemblyInfo.cs b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.AssemblyInfo.cs new file mode 100644 index 0000000..8078eed --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.AssemblyInfo.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("RVIP")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("RVIP")] +[assembly: System.Reflection.AssemblyTitleAttribute("RVIP")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] +[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")] +[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.AssemblyInfoInputs.cache b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.AssemblyInfoInputs.cache new file mode 100644 index 0000000..cdcfb33 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +66522a906b27a1ec8d9c8c161f3a003780b7a4a5 diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.GeneratedMSBuildEditorConfig.editorconfig b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..3f2dde7 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,17 @@ +is_global = true +build_property.ApplicationManifest = +build_property.StartupObject = +build_property.ApplicationDefaultFont = +build_property.ApplicationHighDpiMode = +build_property.ApplicationUseCompatibleTextRendering = +build_property.ApplicationVisualStyles = +build_property.TargetFramework = net6.0-windows +build_property.TargetPlatformMinVersion = 7.0 +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = RVIP +build_property.ProjectDir = C:\Users\Егор\Source\Repos\distributed-computing\tasks\andrianov-ep\lab_5\RVIP\ diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.GlobalUsings.g.cs b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.GlobalUsings.g.cs new file mode 100644 index 0000000..84bbb89 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Debug/net6.0-windows/RVIP.GlobalUsings.g.cs @@ -0,0 +1,10 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.Drawing; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; +global using global::System.Windows.Forms; diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs new file mode 100644 index 0000000..ed92695 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.AssemblyInfo.cs b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.AssemblyInfo.cs new file mode 100644 index 0000000..fe62f67 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.AssemblyInfo.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("RVIP")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("RVIP")] +[assembly: System.Reflection.AssemblyTitleAttribute("RVIP")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] +[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")] +[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.AssemblyInfoInputs.cache b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.AssemblyInfoInputs.cache new file mode 100644 index 0000000..b369d5a --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +907a3e31c43acbb6269a04b9bdb75ef402c40a7a diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.GeneratedMSBuildEditorConfig.editorconfig b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..3f2dde7 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,17 @@ +is_global = true +build_property.ApplicationManifest = +build_property.StartupObject = +build_property.ApplicationDefaultFont = +build_property.ApplicationHighDpiMode = +build_property.ApplicationUseCompatibleTextRendering = +build_property.ApplicationVisualStyles = +build_property.TargetFramework = net6.0-windows +build_property.TargetPlatformMinVersion = 7.0 +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = RVIP +build_property.ProjectDir = C:\Users\Егор\Source\Repos\distributed-computing\tasks\andrianov-ep\lab_5\RVIP\ diff --git a/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.GlobalUsings.g.cs b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.GlobalUsings.g.cs new file mode 100644 index 0000000..84bbb89 --- /dev/null +++ b/tasks/andrianov-ep/lab_5/RVIP/obj/Release/net6.0-windows/RVIP.GlobalUsings.g.cs @@ -0,0 +1,10 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.Drawing; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; +global using global::System.Windows.Forms; diff --git a/tasks/andrianov-ep/lab_6/1.png b/tasks/andrianov-ep/lab_6/1.png new file mode 100644 index 0000000..cded102 Binary files /dev/null and b/tasks/andrianov-ep/lab_6/1.png differ diff --git a/tasks/andrianov-ep/lab_6/2.png b/tasks/andrianov-ep/lab_6/2.png new file mode 100644 index 0000000..155b8d4 Binary files /dev/null and b/tasks/andrianov-ep/lab_6/2.png differ diff --git a/tasks/andrianov-ep/lab_6/3.png b/tasks/andrianov-ep/lab_6/3.png new file mode 100644 index 0000000..bc96e33 Binary files /dev/null and b/tasks/andrianov-ep/lab_6/3.png differ diff --git a/tasks/andrianov-ep/lab_6/4.png b/tasks/andrianov-ep/lab_6/4.png new file mode 100644 index 0000000..082479e Binary files /dev/null and b/tasks/andrianov-ep/lab_6/4.png differ diff --git a/tasks/andrianov-ep/lab_6/README.md b/tasks/andrianov-ep/lab_6/README.md new file mode 100644 index 0000000..582aa8e --- /dev/null +++ b/tasks/andrianov-ep/lab_6/README.md @@ -0,0 +1,30 @@ +# Отчет по лабораторной работе №6 + +Выполнил студент гр. ИСЭбд-41 Андрианов Е.П. + +## Создание приложения + +Выбрал язык Pythone. + +Приложение на вход получает кол-во поток, далее у нас происходит последовательный расчет детерминанта. После чего выводит всё в консоль + +![](1.png) + + +## Бенчмарки + +Протестируем обычный и параллельный алгоритм матрицах 100х100, 300х300 и 500х500. + +Матрицы 100х100 + +![](2.png) + +Матрицы 300х300 + +![](3.png) + +Матрицы 500х500 + +![](4.png) + +Вывод: Чем больше у нас кол-во данных, тем разница между параллельным и последовательных становится меньше Как видно из скриншотов для матрицы 500x500 параллельный алгоритм завершил быстрее чем, последовательный. \ No newline at end of file diff --git a/tasks/andrianov-ep/lab_6/algo.py b/tasks/andrianov-ep/lab_6/algo.py new file mode 100644 index 0000000..435dfd7 --- /dev/null +++ b/tasks/andrianov-ep/lab_6/algo.py @@ -0,0 +1,61 @@ +import numpy as np +import time +from multiprocessing import Pool + +def determinant(matrix): + return np.linalg.det(matrix) + +def parallel_determinant(matrix, num_threads): + size = matrix.shape[0] + step = size // num_threads + pool = Pool(processes=num_threads) + blocks = [] + for i in range(0, size, step): + blocks.append(matrix[i:i+step, i:i+step]) + dets = pool.map(determinant, blocks) + return np.prod(dets) + +def benchmark(num_threads): + matrix1 = np.random.rand(100, 100) + start_time = time.time() + det1 = determinant(matrix1) + end_time = time.time() + execution_time = end_time - start_time + print("Матрица 100x100:", matrix1) + print("Детерминант матрицы 100x100:", det1) + print("Последовательное время выполнения:", execution_time, "сек") + start_time = time.time() + detp1 = parallel_determinant(matrix1, num_threads) + end_time = time.time() + execution_time = end_time - start_time + print("Пареллельное время выполнения:", execution_time, "сек") + matrix2 = np.random.rand(300, 300) + start_time = time.time() + det2 = determinant(matrix2) + end_time = time.time() + execution_time = end_time - start_time + print("Матрица 300x300:", matrix2) + print("Детерминант матрицы 300x300:", det2) + print("Последовательное время выполнения:", execution_time, "сек") + start_time = time.time() + detp2 = parallel_determinant(matrix2, num_threads) + end_time = time.time() + execution_time = end_time - start_time + print("Пареллельное время выполнения:", execution_time, "сек") + matrix3 = np.random.rand(500, 500) + det3 = determinant(matrix3) + end_time = time.time() + execution_time = end_time - start_time + print("Матрица 500x500:", matrix3) + print("Детерминант матрицы 500x500:", det3) + print("Последовательное время выполнения:", execution_time, "сек") + start_time = time.time() + detp3 = parallel_determinant(matrix3, num_threads) + end_time = time.time() + execution_time = end_time - start_time + print("Пареллельное время выполнения:", execution_time, "сек") + +if __name__ == "__main__": + print("Введите кол-во поток") + n = int(input()) + benchmark(n) \ No newline at end of file