├── Makefile ├── Makefile_win ├── README.md ├── ReadMe_IMB.txt ├── SECURITY.md ├── WINDOWS ├── IMB-EXT_VS_2017 │ ├── IMB-EXT.rc │ ├── IMB-EXT.sln │ ├── IMB-EXT.vcxproj │ └── resource.h ├── IMB-IO_VS_2017 │ ├── IMB-IO.rc │ ├── IMB-IO.sln │ ├── IMB-IO.vcxproj │ └── resource.h ├── IMB-MPI1_VS_2017 │ ├── IMB-MPI1.rc │ ├── IMB-MPI1.sln │ ├── IMB-MPI1.vcxproj │ └── resource.h ├── IMB-MT_VS_2017 │ ├── IMB-MT.rc │ ├── IMB-MT.sln │ ├── IMB-MT.vcxproj │ └── resource.h ├── IMB-NBC_VS_2017 │ ├── IMB-NBC.rc │ ├── IMB-NBC.sln │ ├── IMB-NBC.vcxproj │ └── resource.h ├── IMB-P2P_VS_2017 │ ├── IMB-P2P.rc │ ├── IMB-P2P.sln │ ├── IMB-P2P.vcxproj │ └── resource.h ├── IMB-RMA_VS_2017 │ ├── IMB-RMA.rc │ ├── IMB-RMA.sln │ ├── IMB-RMA.vcxproj │ └── resource.h └── mkvsprojs.sh ├── license ├── license.txt ├── third-party-programs.txt └── use-of-trademark-license.txt ├── src_c ├── IMB_2018.c ├── IMB_allgather.c ├── IMB_allgatherv.c ├── IMB_allreduce.c ├── IMB_alltoall.c ├── IMB_alltoallv.c ├── IMB_appl_errors.h ├── IMB_bandwidth.c ├── IMB_barrier.c ├── IMB_bcast.c ├── IMB_benchlist.c ├── IMB_benchmark.h ├── IMB_bnames_ext.h ├── IMB_bnames_io.h ├── IMB_bnames_mpi1.h ├── IMB_bnames_mpi4.h ├── IMB_bnames_nbc.h ├── IMB_bnames_rma.h ├── IMB_cache.h ├── IMB_chk_diff.c ├── IMB_comm_info.h ├── IMB_comments.h ├── IMB_cpu_exploit.c ├── IMB_cuda.c ├── IMB_cuda.h ├── IMB_cuda_api.c ├── IMB_cuda_api.h ├── IMB_declare.c ├── IMB_declare.h ├── IMB_err_check.h ├── IMB_err_handler.c ├── IMB_exchange.c ├── IMB_g_info.c ├── IMB_gather.c ├── IMB_gatherv.c ├── IMB_gpu_common.c ├── IMB_gpu_common.h ├── IMB_init.c ├── IMB_init_file.c ├── IMB_init_transfer.c ├── IMB_input.txt ├── IMB_mem_info.h ├── IMB_mem_manager.c ├── IMB_ones_accu.c ├── IMB_ones_bidir.c ├── IMB_ones_unidir.c ├── IMB_open_close.c ├── IMB_output.c ├── IMB_parse_name_ext.c ├── IMB_parse_name_io.c ├── IMB_parse_name_mpi1.c ├── IMB_parse_name_mpi4.c ├── IMB_parse_name_nbc.c ├── IMB_parse_name_rma.c ├── IMB_pingping.c ├── IMB_pingpong.c ├── IMB_prototypes.h ├── IMB_read.c ├── IMB_reduce.c ├── IMB_reduce_local.c ├── IMB_reduce_scatter.c ├── IMB_reduce_scatter_block.c ├── IMB_rma_atomic.c ├── IMB_rma_get.c ├── IMB_rma_put.c ├── IMB_scatter.c ├── IMB_scatterv.c ├── IMB_sendrecv.c ├── IMB_settings.h ├── IMB_settings_io.h ├── IMB_strgs.c ├── IMB_user_set_info.c ├── IMB_utils.c ├── IMB_warm_up.c ├── IMB_window.c ├── IMB_write.c ├── IMB_ze.c ├── IMB_ze.h ├── IMB_ze_api.c ├── IMB_ze_api.h ├── Makefile ├── Makefile_win └── P2P │ ├── Makefile │ ├── imb_p2p.c │ ├── imb_p2p.h │ ├── imb_p2p_birandom.c │ ├── imb_p2p_corandom.c │ ├── imb_p2p_pingping.c │ ├── imb_p2p_pingpong.c │ ├── imb_p2p_sendrecv_replace.c │ ├── imb_p2p_stencil2d.c │ ├── imb_p2p_stencil3d.c │ └── imb_p2p_unirandom.c └── src_cpp ├── EXT ├── EXT_benchmark.cpp ├── EXT_suite.cpp ├── Makefile.EXT.mk └── Makefile_win.EXT.mk ├── HALO ├── Makefile.HALO.mk ├── halo_benchmark.cpp ├── halo_benchmark.h └── halo_suite.cpp ├── IO ├── IO_benchmark.cpp ├── IO_suite.cpp ├── Makefile.IO.mk └── Makefile_win.IO.mk ├── MPI1 ├── MPI1_benchmark.cpp ├── MPI1_suite.cpp ├── Makefile.MPI1.mk └── Makefile_win.MPI1.mk ├── MPI4 ├── MPI4_benchmark.cpp ├── MPI4_suite.cpp └── Makefile.MPI4.mk ├── MT ├── MT_benchmark.cpp ├── MT_benchmark.h ├── MT_suite.cpp ├── MT_types.h ├── Makefile.MT.mk └── Makefile_win.MT.mk ├── Makefile ├── Makefile_win ├── NBC ├── Makefile.NBC.mk ├── Makefile_win.NBC.mk ├── NBC_benchmark.cpp └── NBC_suite.cpp ├── RMA ├── Makefile.RMA.mk ├── Makefile_win.RMA.mk ├── RMA_benchmark.cpp └── RMA_suite.cpp ├── any.h ├── args_parser.cpp ├── args_parser.h ├── args_parser_utests.cpp ├── benchmark.h ├── benchmark_suite.h ├── benchmark_suite_base.h ├── benchmark_suites_collection.cpp ├── benchmark_suites_collection.h ├── example ├── Makefile.example.mk ├── example_benchmark1.cpp ├── example_benchmark2.cpp ├── example_benchmark3.cpp ├── example_benchmark4.cpp └── example_benchmark5.cpp ├── helpers ├── Makefile.helpers.mk ├── Makefile_win.helpers.mk ├── helper_IMB_functions.h └── original_benchmark.h ├── imb.cpp ├── scope.cpp ├── scope.h ├── smart_ptr.h └── utils.h /Makefile: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | all: IMB-MPI1 IMB-NBC IMB-RMA IMB-EXT IMB-IO IMB-MT IMB-P2P 34 | 35 | IMB-MPI1: 36 | make -C src_cpp -f Makefile TARGET=MPI1 37 | @cp src_cpp/IMB-MPI1 . 38 | 39 | IMB-NBC: 40 | make -C src_cpp -f Makefile TARGET=NBC 41 | @cp src_cpp/IMB-NBC . 42 | 43 | IMB-MPI4: 44 | make -C src_cpp -f Makefile TARGET=MPI4 45 | @cp src_cpp/IMB-MPI4 . 46 | 47 | IMB-EXT: 48 | make -C src_cpp -f Makefile TARGET=EXT 49 | @cp src_cpp/IMB-EXT . 50 | 51 | IMB-RMA: 52 | make -C src_cpp -f Makefile TARGET=RMA 53 | @cp src_cpp/IMB-RMA . 54 | 55 | IMB-IO: 56 | make -C src_cpp -f Makefile TARGET=IO 57 | @cp src_cpp/IMB-IO . 58 | 59 | IMB-MT: | IMB-MPI1 60 | make -C src_cpp -f Makefile TARGET=MT 61 | @cp src_cpp/IMB-MT . 62 | 63 | IMB-P2P: 64 | make -C src_c/P2P -f Makefile TARGET=P2P 65 | @cp src_c/P2P/IMB-P2P . 66 | 67 | IMB-MPI1-GPU: 68 | make -C src_cpp -f Makefile TARGET=MPI1 GPU_ENABLE=1 69 | @cp src_cpp/IMB-MPI1 ./IMB-MPI1-GPU 70 | 71 | IMB-RMA-GPU: 72 | make -C src_cpp -f Makefile TARGET=RMA GPU_ENABLE=1 73 | @cp src_cpp/IMB-RMA ./IMB-RMA-GPU 74 | 75 | 76 | clean: 77 | make -C src_cpp -f Makefile TARGET=MPI1 clean 78 | make -C src_cpp -f Makefile TARGET=MPI1 clean GPU_ENABLE=1 79 | make -C src_cpp -f Makefile TARGET=NBC clean 80 | make -C src_cpp -f Makefile TARGET=RMA clean 81 | make -C src_cpp -f Makefile TARGET=RMA clean GPU_ENABLE=1 82 | make -C src_cpp -f Makefile TARGET=EXT clean 83 | make -C src_cpp -f Makefile TARGET=IO clean 84 | make -C src_cpp -f Makefile TARGET=MT clean 85 | make -C src_c/P2P -f Makefile TARGET=P2P clean 86 | rm -f IMB-MPI1 IMB-NBC IMB-RMA IMB-EXT IMB-IO IMB-MT IMB-P2P 87 | if [ -e IMB-MPI1-GPU ]; then rm -f IMB-MPI1-GPU; fi 88 | if [ -e IMB-RMA-GPU ]; then rm -f IMB-RMA-GPU; fi 89 | if [ -e IMB-MPI4 ]; then make -C src_cpp -f Makefile TARGET=MPI4 clean; rm -f IMB-MPI4; fi 90 | -------------------------------------------------------------------------------- /Makefile_win: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | all: IMB-MPI1 IMB-MT IMB-RMA IMB-EXT IMB-IO IMB-NBC 34 | 35 | IMB-MPI1: 36 | cd .\src_cpp 37 | nmake -f Makefile_win TARGET=MPI1 38 | cd .. 39 | copy .\src_cpp\IMB-MPI1.exe 40 | 41 | IMB-NBC: 42 | cd .\src_cpp 43 | nmake -f Makefile_win IMB-NBC 44 | cd .. 45 | copy .\src_cpp\IMB-NBC.exe 46 | 47 | IMB-RMA: 48 | cd .\src_cpp 49 | nmake -f Makefile_win TARGET=RMA 50 | cd .. 51 | copy .\src_cpp\IMB-RMA.exe 52 | 53 | IMB-EXT: 54 | cd .\src_cpp 55 | nmake -f Makefile_win IMB-EXT 56 | cd .. 57 | copy .\src_cpp\IMB-EXT.exe 58 | 59 | IMB-IO: 60 | cd .\src_cpp 61 | nmake -f Makefile_win IMB-IO 62 | cd .. 63 | copy .\src_cpp\IMB-IO.exe 64 | 65 | 66 | IMB-MT: 67 | cd .\src_cpp 68 | nmake -f Makefile_win TARGET=MT 69 | cd .. 70 | copy .\src_cpp\IMB-MT.exe 71 | 72 | clean: 73 | cd ./src_cpp 74 | nmake -f Makefile_win clean TARGET=MT 75 | nmake -f Makefile_win clean TARGET=MPI1 76 | nmake -f Makefile_win clean TARGET=RMA 77 | nmake -f Makefile_win clean TARGET=NBC 78 | nmake -f Makefile_win clean TARGET=IO 79 | nmake -f Makefile_win clean TARGET=EXT 80 | cd .. 81 | del /f /q IMB-MPI1.exe IMB-NBC.exe IMB-RMA.exe IMB-EXT.exe IMB-IO.exe IMB-MT.exe -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. 3 | 4 | ## Reporting a Vulnerability 5 | Please report any security vulnerabilities in this project [utilizing the guidelines here](https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html). 6 | 7 | -------------------------------------------------------------------------------- /WINDOWS/IMB-EXT_VS_2017/IMB-EXT.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-EXT" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-EXT.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | -------------------------------------------------------------------------------- /WINDOWS/IMB-EXT_VS_2017/IMB-EXT.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-EXT", "IMB-EXT.vcxproj", "{4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|x64 = Debug|x64 8 | Release|x64 = Release|x64 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Debug|x64.ActiveCfg = Debug|x64 12 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Debug|x64.Build.0 = Debug|x64 13 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Release|x64.ActiveCfg = Release|x64 14 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Release|x64.Build.0 = Release|x64 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /WINDOWS/IMB-EXT_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-EXT.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/IMB-IO_VS_2017/IMB-IO.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-IO" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-IO.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | 103 | -------------------------------------------------------------------------------- /WINDOWS/IMB-IO_VS_2017/IMB-IO.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-IO", "IMB-IO.vcxproj", "{8FDAF9E9-C2F3-443A-B86C-FC0A04DB7713}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|x64 = Debug|x64 8 | Release|x64 = Release|x64 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {8FDAF9E9-C2F3-443A-B86C-FC0A04DB7713}.Debug|x64.ActiveCfg = Debug|x64 12 | {8FDAF9E9-C2F3-443A-B86C-FC0A04DB7713}.Debug|x64.Build.0 = Debug|x64 13 | {8FDAF9E9-C2F3-443A-B86C-FC0A04DB7713}.Release|x64.ActiveCfg = Release|x64 14 | {8FDAF9E9-C2F3-443A-B86C-FC0A04DB7713}.Release|x64.Build.0 = Release|x64 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /WINDOWS/IMB-IO_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-IO.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/IMB-MPI1_VS_2017/IMB-MPI1.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-MPI1" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-MPI1.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | 103 | -------------------------------------------------------------------------------- /WINDOWS/IMB-MPI1_VS_2017/IMB-MPI1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-MPI1", "IMB-MPI1.vcxproj", "{72B11209-BF5B-4AF0-B38D-744C2FD082C3}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|x64 = Debug|x64 8 | Release|x64 = Release|x64 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Debug|x64.ActiveCfg = Debug|x64 12 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Debug|x64.Build.0 = Debug|x64 13 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Release|x64.ActiveCfg = Release|x64 14 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Release|x64.Build.0 = Release|x64 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /WINDOWS/IMB-MPI1_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-MPI1.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/IMB-MT_VS_2017/IMB-MT.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-MT" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-MT.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | 103 | -------------------------------------------------------------------------------- /WINDOWS/IMB-MT_VS_2017/IMB-MT.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-MT", "IMB-MT.vcxproj", "{72B11209-BF5B-4AF0-B38D-744C2FD082C3}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|x64 = Debug|x64 8 | Release|x64 = Release|x64 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Debug|x64.ActiveCfg = Debug|x64 12 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Debug|x64.Build.0 = Debug|x64 13 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Release|x64.ActiveCfg = Release|x64 14 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Release|x64.Build.0 = Release|x64 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /WINDOWS/IMB-MT_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-MT.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/IMB-NBC_VS_2017/IMB-NBC.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-NBC" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-NBC.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | 103 | -------------------------------------------------------------------------------- /WINDOWS/IMB-NBC_VS_2017/IMB-NBC.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-NBC", "IMB-NBC.vcxproj", "{4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x64 = Debug|x64 9 | Release|x64 = Release|x64 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Debug|x64.ActiveCfg = Debug|x64 13 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Debug|x64.Build.0 = Debug|x64 14 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Release|x64.ActiveCfg = Release|x64 15 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Release|x64.Build.0 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /WINDOWS/IMB-NBC_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-NBC.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/IMB-P2P_VS_2017/IMB-P2P.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-P2P" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-P2P.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | 103 | -------------------------------------------------------------------------------- /WINDOWS/IMB-P2P_VS_2017/IMB-P2P.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-P2P", "IMB-P2P.vcxproj", "{72B11209-BF5B-4AF0-B38D-744C2FD082C3}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|x64 = Debug|x64 8 | Release|x64 = Release|x64 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Debug|x64.ActiveCfg = Debug|x64 12 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Debug|x64.Build.0 = Debug|x64 13 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Release|x64.ActiveCfg = Release|x64 14 | {72B11209-BF5B-4AF0-B38D-744C2FD082C3}.Release|x64.Build.0 = Release|x64 15 | EndGlobalSection 16 | GlobalSection(SolutionProperties) = preSolution 17 | HideSolutionNode = FALSE 18 | EndGlobalSection 19 | EndGlobal 20 | -------------------------------------------------------------------------------- /WINDOWS/IMB-P2P_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-P2P.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/IMB-RMA_VS_2017/IMB-RMA.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Version 53 | // 54 | 55 | VS_VERSION_INFO VERSIONINFO 56 | FILEVERSION 2021,7,0,0 57 | PRODUCTVERSION 2021,7,0,0 58 | FILEFLAGSMASK 0x17L 59 | #ifdef _DEBUG 60 | FILEFLAGS 0x1L 61 | #else 62 | FILEFLAGS 0x0L 63 | #endif 64 | FILEOS 0x4L 65 | FILETYPE 0x1L 66 | FILESUBTYPE 0x0L 67 | BEGIN 68 | BLOCK "StringFileInfo" 69 | BEGIN 70 | BLOCK "040904b0" 71 | BEGIN 72 | VALUE "CompanyName", "Intel Corporation" 73 | VALUE "FileDescription", "Intel(R) MPI Benchmarks" 74 | VALUE "FileVersion", "2021.10" 75 | VALUE "InternalName", "IMB-RMA" 76 | VALUE "LegalCopyright", "Copyright Intel Corporation." 77 | VALUE "OriginalFilename", "IMB-RMA.exe" 78 | VALUE "ProductName", "Intel(R) MPI Benchmarks" 79 | VALUE "ProductVersion", "2021.10" 80 | END 81 | END 82 | BLOCK "VarFileInfo" 83 | BEGIN 84 | VALUE "Translation", 0x409, 1200 85 | END 86 | END 87 | 88 | #endif // English (U.S.) resources 89 | ///////////////////////////////////////////////////////////////////////////// 90 | 91 | 92 | 93 | #ifndef APSTUDIO_INVOKED 94 | ///////////////////////////////////////////////////////////////////////////// 95 | // 96 | // Generated from the TEXTINCLUDE 3 resource. 97 | // 98 | 99 | 100 | ///////////////////////////////////////////////////////////////////////////// 101 | #endif // not APSTUDIO_INVOKED 102 | 103 | -------------------------------------------------------------------------------- /WINDOWS/IMB-RMA_VS_2017/IMB-RMA.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IMB-RMA", "IMB-RMA.vcxproj", "{4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x64 = Debug|x64 9 | Release|x64 = Release|x64 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Debug|x64.ActiveCfg = Debug|x64 13 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Debug|x64.Build.0 = Debug|x64 14 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Release|x64.ActiveCfg = Release|x64 15 | {4219D5A9-6972-4B1C-9F07-EB97EEF4EDDA}.Release|x64.Build.0 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /WINDOWS/IMB-RMA_VS_2017/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by IMB-EXT.rc 4 | 5 | // Next default values for new objects 6 | // 7 | #ifdef APSTUDIO_INVOKED 8 | #ifndef APSTUDIO_READONLY_SYMBOLS 9 | #define _APS_NEXT_RESOURCE_VALUE 101 10 | #define _APS_NEXT_COMMAND_VALUE 40001 11 | #define _APS_NEXT_CONTROL_VALUE 1001 12 | #define _APS_NEXT_SYMED_VALUE 101 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /WINDOWS/mkvsprojs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #IMB-EXT_VS 4 | PROJ=$1 5 | if [ -d ${PROJ}_2017 ]; then rm -rf ${PROJ}_2017; fi 6 | 7 | cp -r ${PROJ}_2013 ${PROJ}_2017 8 | 9 | VCXPROJ_2017=${PROJ}_2017/*.vcxproj 10 | 11 | sed -i 's!ToolsVersion="12.0"!ToolsVersion="15.0"!' $VCXPROJ_2017 12 | sed -i 's!Win32Proj!Win32Proj\n 10.0.15063.0!' $VCXPROJ_2017 13 | sed -i 's!Toolset>v120v141 49 | 50 | 51 | /* DEFAULT EMPTY COMMENT */ 52 | extern char* NIL_COMMENT[]; 53 | 54 | char** Gral_cmt = NIL_COMMENT; 55 | 56 | char** PingPong_cmt = NIL_COMMENT; 57 | char** PingPing_cmt = NIL_COMMENT; 58 | char** Sendrecv_cmt = NIL_COMMENT; 59 | char** Exchange_cmt = NIL_COMMENT; 60 | char** Allreduce_cmt = NIL_COMMENT; 61 | char** Reduce_cmt = NIL_COMMENT; 62 | char** Reduce_scatter_cmt = NIL_COMMENT; 63 | char** Bcast_cmt = NIL_COMMENT; 64 | char** Barrier_cmt = NIL_COMMENT; 65 | char** Allgather_cmt = NIL_COMMENT; 66 | char** Allgatherv_cmt = NIL_COMMENT; 67 | char** Gatherv_cmt = NIL_COMMENT; 68 | char** Gather_cmt = NIL_COMMENT; 69 | char** Scatterv_cmt = NIL_COMMENT; 70 | char** Scatter_cmt = NIL_COMMENT; 71 | char** Alltoall_cmt = NIL_COMMENT; 72 | char** Alltoallv_cmt = NIL_COMMENT; 73 | 74 | char** Unidir_Get_cmt = NIL_COMMENT; 75 | char** Unidir_Put_cmt = NIL_COMMENT; 76 | char** Bidir_Get_cmt = NIL_COMMENT; 77 | char** Bidir_Put_cmt = NIL_COMMENT; 78 | char** Accumulate_cmt = NIL_COMMENT; 79 | char** Window_cmt = NIL_COMMENT; 80 | 81 | 82 | char** Write_Indv_cmt = NIL_COMMENT; 83 | char** Write_Shared_cmt = NIL_COMMENT; 84 | char** Write_Priv_cmt = NIL_COMMENT; 85 | char** Write_Expl_cmt = NIL_COMMENT; 86 | char** Read_Indv_cmt = NIL_COMMENT; 87 | char** Read_Shared_cmt = NIL_COMMENT; 88 | char** Read_Priv_cmt = NIL_COMMENT; 89 | char** Read_Expl_cmt = NIL_COMMENT; 90 | char** Open_cmt = NIL_COMMENT; 91 | char** Bi_bandwidth_cmt = NIL_COMMENT; 92 | char** Uni_bandwidth_cmt = NIL_COMMENT; 93 | 94 | char *Compare_and_swap_cmt[] = {"Uses MPI_INT data type", NULL}; 95 | 96 | char *Truly_passive_put_cmt[] = 97 | {"The benchmark measures execution time of MPI_Put for 2 cases:", 98 | "1) The target is waiting in MPI_Barrier call (t_pure value)", 99 | "2) The target performs computation and then enters MPI_Barrier routine (t_ovrl value)", 100 | NULL}; 101 | 102 | 103 | 104 | #endif // IMB_COMMENTS_H 105 | -------------------------------------------------------------------------------- /src_c/IMB_cuda.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | #ifndef __cuda_h__ 44 | #define __cuda_h__ 45 | 46 | #include "stdbool.h" 47 | #include 48 | 49 | #include "IMB_declare.h" 50 | #include "IMB_benchmark.h" 51 | #include "IMB_cuda_api.h" 52 | #include "IMB_prototypes.h" 53 | 54 | #define CUDA_CHKERR_EXPL_FINALLY(f, fin, a) { cudaError_t _cuda_chkerr_err; \ 55 | if ((_cuda_chkerr_err = (f), (void)(fin), _cuda_chkerr_err) != cudaSuccess) { \ 56 | fprintf(stderr, "ERROR: 0x%x returned from %s\n", _cuda_chkerr_err, #f); \ 57 | a; \ 58 | } \ 59 | } 60 | #define CUDA_CHKERR_EXPL(f, a) CUDA_CHKERR_EXPL_FINALLY(f, 0, a) 61 | #define CUDA_CHKERR_FINALLY(f, fin) CUDA_CHKERR_EXPL_FINALLY(f, fin, goto f_err) 62 | #define CUDA_CHKERR(f) CUDA_CHKERR_EXPL(f, goto f_err) 63 | #define CUDA_CHKERR_DO_NOT_FAIL(f) CUDA_CHKERR_EXPL_FINALLY(f, 0, (void)0) 64 | 65 | #define NZ_CHKERR_EXPL(f, a) if ((f) == 0) { \ 66 | fprintf(stderr, "ERROR: %s failed\n", #f); \ 67 | a; \ 68 | } 69 | #define NZ_CHKERR(f) NZ_CHKERR_EXPL(f, goto f_err) 70 | 71 | #define C_CHKERR_EXPL(f, a) if ((f) != 0) { \ 72 | fprintf(stderr, "ERROR: %s failed\n", #f); \ 73 | a; \ 74 | } 75 | #define C_CHKERR(f) C_CHKERR_EXPL(f, goto f_err) 76 | 77 | extern cudaStream_t cuda_stream; 78 | 79 | int cuda_initialize(char *dll_name); 80 | void *cuda_alloc(size_t size, char *where, MEM_ALLOC_TYPE mem_alloc_type); 81 | void cuda_free(void **B, MEM_ALLOC_TYPE mem_alloc_type); 82 | void cuda_ass_buf(void *buf, int rank, size_t pos1, size_t pos2, int value); 83 | int cuda_memcpy(void *dst, const void *src, size_t sz); 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /src_c/IMB_cuda_api.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | #ifdef GPU_ENABLE 44 | #include "IMB_cuda_api.h" 45 | 46 | cuda_functable_t cuda_proxy = { 47 | NULL, 48 | }; 49 | 50 | static const char *fn_names[] = { 51 | "cudaMalloc", 52 | "cudaMallocHost", 53 | "cudaMallocManaged", 54 | "cudaFree", 55 | "cudaFreeHost", 56 | "cudaMemcpyAsync", 57 | "cudaGetDeviceCount", 58 | "cudaStreamCreate", 59 | "cudaStreamDestroy", 60 | "cudaStreamSynchronize", 61 | }; 62 | 63 | #define CUDA_FUNCTABLE_COUNT (sizeof(cuda_proxy) / sizeof(void *)) 64 | 65 | void cuda_init_functable_dll(const char *dll_name) 66 | { 67 | void **sym_ptr = (void **)&cuda_proxy; 68 | 69 | void *handle = dlopen(dll_name, RTLD_LAZY | RTLD_GLOBAL); 70 | 71 | char *dl_error = dlerror(); 72 | 73 | if (dl_error) 74 | { 75 | fprintf(stderr, "%s\n", dl_error); 76 | exit(1); 77 | } 78 | 79 | size_t i; 80 | 81 | for (i = 0; i < CUDA_FUNCTABLE_COUNT; i++) 82 | { 83 | sym_ptr[i] = dlsym(handle, fn_names[i]); 84 | 85 | dl_error = dlerror(); 86 | 87 | if (dl_error) 88 | { 89 | fprintf(stderr, "%s\n", dl_error); 90 | exit(1); 91 | } 92 | 93 | if (sym_ptr[i] == NULL) 94 | { 95 | fprintf(stderr, "Symbol %s is not available!\n", fn_names[i]); 96 | exit(1); 97 | } 98 | } 99 | } 100 | 101 | #endif // GPU_ENABLE 102 | -------------------------------------------------------------------------------- /src_c/IMB_cuda_api.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | #ifndef CUDA_API_H 44 | #define CUDA_API_H 45 | 46 | #include "cuda_runtime_api.h" 47 | #include "driver_types.h" 48 | #include 49 | #include 50 | #include 51 | 52 | /* *INDENT-OFF* */ 53 | /* The current function names are from CUDA 12.0 */ 54 | typedef struct cuda_functable_t { 55 | cudaError_t (*cudaMalloc)(void **, size_t); 56 | cudaError_t (*cudaMallocHost)(void **, size_t); 57 | cudaError_t (*cudaMallocManaged)(void **, size_t, unsigned int); 58 | typeof(cudaFree) *cudaFree; 59 | typeof(cudaFreeHost) *cudaFreeHost; 60 | typeof(cudaMemcpyAsync) *cudaMemcpyAsync; 61 | typeof(cudaGetDeviceCount) *cudaGetDeviceCount; 62 | typeof(cudaStreamCreate) *cudaStreamCreate; 63 | typeof(cudaStreamDestroy) *cudaStreamDestroy; 64 | typeof(cudaStreamSynchronize) *cudaStreamSynchronize; 65 | } cuda_functable_t; 66 | 67 | extern cuda_functable_t cuda_proxy; 68 | 69 | #define cudaMalloc cuda_proxy.cudaMalloc 70 | #define cudaMallocHost cuda_proxy.cudaMallocHost 71 | #define cudaMallocManaged cuda_proxy.cudaMallocManaged 72 | #define cudaFree cuda_proxy.cudaFree 73 | #define cudaFreeHost cuda_proxy.cudaFreeHost 74 | #define cudaMemcpyAsync cuda_proxy.cudaMemcpyAsync 75 | #define cudaGetDeviceCount cuda_proxy.cudaGetDeviceCount 76 | #define cudaStreamCreate cuda_proxy.cudaStreamCreate 77 | #define cudaStreamDestroy cuda_proxy.cudaStreamDestroy 78 | #define cudaStreamSynchronize cuda_proxy.cudaStreamSynchronize 79 | 80 | void cuda_init_functable_dll(const char *dll_name); 81 | 82 | #endif /* CUDA_API_H */ 83 | -------------------------------------------------------------------------------- /src_c/IMB_declare.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | File: IMB_declare.c 43 | 44 | Implemented functions: 45 | 46 | ***************************************************************************/ 47 | 48 | 49 | 50 | 51 | 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include "IMB_settings.h" 57 | #include "IMB_comm_info.h" 58 | #include "IMB_err_check.h" 59 | 60 | 61 | #ifdef CHECK 62 | 63 | #include "IMB_prototypes.h" 64 | 65 | long r_check,s_check; 66 | double defect; 67 | double *all_defect; 68 | 69 | #endif 70 | 71 | FILE* dbg_file; 72 | char* dbgf_name; 73 | 74 | double *all_times; 75 | 76 | /* STRINGS FOR OUTPUT */ 77 | char aux_string[out_fields*ow_format]; 78 | 79 | /* FORMAT FOR OUTPUT */ 80 | char format [out_fields*7]; 81 | 82 | /* ARRAY OF CASES, EITHER DEFAULT OR ARGUMENT LIST */ 83 | char **cases ; 84 | 85 | /* Error status */ 86 | 87 | int err_flag; 88 | 89 | /* I/O unit */ 90 | FILE* unit; 91 | 92 | /* MAXIMAL MESSAGE LENGTH */ 93 | int MAXMSG; 94 | 95 | void * AUX; 96 | size_t AUX_LEN=0; 97 | 98 | int do_nonblocking=0; 99 | double tCPU = 0.; /* CPU time for overlap benchmarks */ 100 | double MFlops = -1.; 101 | 102 | /* calls to IMB_v_alloc / IMB_v_free */ 103 | int num_alloc=0, num_free=0; 104 | 105 | #ifdef USE_MPI_INIT_THREAD 106 | int mpi_thread_environment = MPI_THREAD_SINGLE; 107 | int mpi_thread_desired = MPI_THREAD_MULTIPLE; 108 | #endif /*USE_MPI_INIT_THREAD*/ 109 | -------------------------------------------------------------------------------- /src_c/IMB_err_check.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | 44 | 45 | 46 | 47 | 48 | #ifndef _ERR_CHECK_H 49 | #define _ERR_CHECK_H 50 | 51 | #ifdef CHECK 52 | #define MPI_ERRHAND(ierr_func) IMB_err_hand(1,ierr_func) 53 | #else 54 | #define MPI_ERRHAND(ierr_func) ierr_func 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src_c/IMB_gpu_common.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | #ifdef GPU_ENABLE 44 | #include "IMB_gpu_common.h" 45 | 46 | gpu_backend IMB_gpu_backend; 47 | 48 | void gpu_initialize() 49 | { 50 | char dll_name_cuda[] = "libcudart.so"; 51 | 52 | char dll_name_ze[] = "libze_loader.so.1"; 53 | 54 | if (dlopen(dll_name_cuda, RTLD_LAZY | RTLD_GLOBAL)) { 55 | #ifdef CUDA_INCLUDE_DIR 56 | cuda_initialize(dll_name_cuda); 57 | IMB_gpu_backend.IMB_gpu_backend_type = GPU_BACKEND_CUDA; 58 | IMB_gpu_backend.IMB_gpu_alloc = cuda_alloc; 59 | IMB_gpu_backend.IMB_gpu_free = cuda_free; 60 | IMB_gpu_backend.IMB_gpu_ass_buf = cuda_ass_buf; 61 | IMB_gpu_backend.IMB_gpu_memcpy = cuda_memcpy; 62 | #endif 63 | } else { 64 | if (dlopen(dll_name_ze, RTLD_LAZY | RTLD_GLOBAL)) { 65 | #ifdef ZE_INCLUDE_DIR 66 | ze_initialize(dll_name_ze); 67 | IMB_gpu_backend.IMB_gpu_backend_type = GPU_BACKEND_ZE; 68 | IMB_gpu_backend.IMB_gpu_alloc = ze_alloc; 69 | IMB_gpu_backend.IMB_gpu_free = ze_free; 70 | IMB_gpu_backend.IMB_gpu_ass_buf = ze_ass_buf; 71 | IMB_gpu_backend.IMB_gpu_memcpy = ze_memcpy; 72 | #endif 73 | } else { 74 | fprintf(stderr,"Neither CUDA nor Level Zero is available! \nPlease put path to gpu library in LD_LIBRARY_PATH\n"); 75 | exit(1); 76 | } 77 | } 78 | } 79 | 80 | int gpu_memcpy(void *dst, const void *src, size_t sz) 81 | { 82 | return IMB_gpu_backend.IMB_gpu_memcpy(dst, src, sz); 83 | } 84 | #endif //GPU_ENABLE 85 | -------------------------------------------------------------------------------- /src_c/IMB_gpu_common.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | #ifndef IMB_GPU_COMMON_H 44 | #define IMB_GPU_COMMON_H 45 | 46 | #include 47 | #include 48 | #include 49 | #include "IMB_comm_info.h" 50 | #ifdef ZE_INCLUDE_DIR 51 | #include "IMB_ze.h" 52 | #endif 53 | #ifdef CUDA_INCLUDE_DIR 54 | #include "IMB_cuda.h" 55 | #endif 56 | 57 | typedef enum gpu_backend_type_t { 58 | GPU_BACKEND_ZE = 0, 59 | GPU_BACKEND_CUDA, 60 | } gpu_backend_type_t; 61 | 62 | typedef struct gpu_backend { 63 | gpu_backend_type_t IMB_gpu_backend_type; 64 | void* (*IMB_gpu_alloc) (size_t, char*, MEM_ALLOC_TYPE); 65 | void (*IMB_gpu_free) (void**,MEM_ALLOC_TYPE); 66 | void (*IMB_gpu_ass_buf) (void*, int, size_t, size_t, int); 67 | int (*IMB_gpu_memcpy) (void*, const void*, size_t); 68 | } gpu_backend; 69 | 70 | extern gpu_backend IMB_gpu_backend; 71 | 72 | void gpu_initialize(); 73 | 74 | int gpu_memcpy(void *dst, const void *src, size_t sz); 75 | 76 | #endif //IMB_GPU_COMMON_H 77 | -------------------------------------------------------------------------------- /src_c/IMB_input.txt: -------------------------------------------------------------------------------- 1 | pingping 2 | pingpong 3 | allgather 4 | -------------------------------------------------------------------------------- /src_c/IMB_mem_info.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | 44 | 45 | /* 46 | Header file newly introduced in IMB 3.1 47 | */ 48 | 49 | #ifndef __mem_info_h__ 50 | #define __mem_info_h__ 51 | 52 | 53 | #define CACHE_UNIT 1048576 /* Unit for cache sizes */ 54 | #define CACHE_SIZE 8 /* default last level cache size (in units CACHE_UNIT Bytes) when using "off_cache" */ 55 | #define CACHE_LINE_SIZE 64 /* default last level cache line size (Bytes) */ 56 | 57 | #define MEM_UNIT 1073741824 /* Units for memory usage sizes */ 58 | #define MAX_MEM_USAGE 2 /* default max. memory (in units MEM_UNIT Bytes) used for message buffers */ 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src_c/IMB_user_set_info.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | File: IMB_user_set_info.c 43 | 44 | Implemented functions: 45 | 46 | IMB_user_set_info; 47 | 48 | ***************************************************************************/ 49 | 50 | 51 | 52 | 53 | 54 | #include "mpi.h" 55 | 56 | #include "IMB_declare.h" 57 | 58 | #include "IMB_prototypes.h" 59 | 60 | 61 | 62 | 63 | void IMB_user_set_info(MPI_Info* opt_info) { 64 | /* 65 | 66 | 67 | 68 | In/out variables: 69 | 70 | -opt_info (type MPI_Info*) 71 | Is set. Default is MPI_INFO_NULL, everything beyond 72 | this is user decision and system dependent. 73 | 74 | 75 | 76 | */ 77 | #ifdef MPIIO 78 | /* 79 | Set info for all MPI I/O functions 80 | */ 81 | 82 | *opt_info = MPI_INFO_NULL; 83 | 84 | #endif 85 | 86 | #ifdef EXT 87 | /* 88 | Set info for all MPI_Win_create calls 89 | */ 90 | 91 | *opt_info = MPI_INFO_NULL; 92 | 93 | #endif 94 | 95 | #ifdef RMA 96 | 97 | *opt_info = MPI_INFO_NULL; 98 | 99 | #endif 100 | 101 | #ifdef MPI4 102 | /* 103 | Set info for all MPI_***_init functions, where ***=collective_operation 104 | */ 105 | 106 | *opt_info = MPI_INFO_NULL; 107 | 108 | #endif 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src_c/IMB_utils.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | File: IMB_utils.c 43 | 44 | Implemented functions: 45 | 46 | IMB_Barrier; 47 | 48 | ***************************************************************************/ 49 | 50 | #include "mpi.h" 51 | 52 | #define IMB_BARRIER_TAG 1000 53 | int IMB_internal_barrier = 0; 54 | /* 55 | 56 | MPI-independent implementation of barrier syncronization. 57 | Implements Dissemination barrier algorithm. 58 | 59 | Input variables: 60 | 61 | -comm (type MPI_Comm) 62 | Communicator for barrier syncronization 63 | 64 | */ 65 | 66 | void IMB_Barrier(MPI_Comm comm) { 67 | int size = 0; 68 | int rank = 0; 69 | 70 | int mask = 0x1; 71 | int dst, src; 72 | 73 | int tmp = 0; 74 | 75 | MPI_Comm_size(comm, &size); 76 | MPI_Comm_rank(comm, &rank); 77 | 78 | for (; mask < size; mask <<= 1) { 79 | dst = (rank + mask) % size; 80 | src = (rank - mask + size) % size; 81 | MPI_Sendrecv(&tmp, 0, MPI_BYTE, dst, IMB_BARRIER_TAG, 82 | &tmp, 0, MPI_BYTE, src, IMB_BARRIER_TAG, 83 | comm, MPI_STATUS_IGNORE); 84 | } 85 | } 86 | 87 | -------------------------------------------------------------------------------- /src_c/IMB_window.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | File: IMB_window.c 43 | 44 | Implemented functions: 45 | 46 | IMB_window; 47 | 48 | ***************************************************************************/ 49 | 50 | 51 | 52 | 53 | 54 | #include "IMB_declare.h" 55 | #include "IMB_benchmark.h" 56 | 57 | 58 | #include "IMB_prototypes.h" 59 | 60 | 61 | /*************************************************************************/ 62 | 63 | 64 | 65 | void IMB_window(struct comm_info* c_info, int size, struct iter_schedule* ITERATIONS, 66 | MODES RUN_MODE, double* time) { 67 | /* 68 | 69 | MPI-2 benchmark kernel 70 | MPI_Win_create + MPI_Win_fence + MPI_Win_free 71 | 72 | Input variables: 73 | 74 | -c_info (type struct comm_info*) 75 | Collection of all base data for MPI; 76 | see [1] for more information 77 | 78 | -size (type int) 79 | Basic message size in bytes 80 | 81 | -ITERATIONS (type struct iter_schedule) 82 | Repetition scheduling 83 | 84 | -RUN_MODE (type MODES) 85 | Mode (aggregate/non aggregate; blocking/nonblocking); 86 | see "IMB_benchmark.h" for definition 87 | 88 | Output variables: 89 | 90 | -time (type double*) 91 | Timing result per sample 92 | 93 | */ 94 | double t1, t2; 95 | int i; 96 | 97 | if (c_info->rank != -1) { 98 | for (i = 0; i < N_BARR; i++) 99 | MPI_Barrier(c_info->communicator); 100 | 101 | t1 = MPI_Wtime(); 102 | for (i = 0; i < ITERATIONS->n_sample; i++) { 103 | MPI_ERRHAND(MPI_Win_create(c_info->r_buffer, size, 1, MPI_INFO_NULL, 104 | c_info->communicator, &c_info->WIN)); 105 | MPI_ERRHAND(MPI_Win_fence(0, c_info->WIN)); 106 | /* July 2002 fix V2.2.1, empty window case */ 107 | if (size > 0) { 108 | MPI_ERRHAND(MPI_Put(c_info->s_buffer, 1, c_info->s_data_type, 109 | c_info->rank, 0, 1, c_info->r_data_type, c_info->WIN)); 110 | } 111 | 112 | MPI_ERRHAND(MPI_Win_fence(0, c_info->WIN)); 113 | 114 | MPI_ERRHAND(MPI_Win_free(&c_info->WIN)); 115 | } 116 | t2 = MPI_Wtime(); 117 | *time = (t2 - t1) / (ITERATIONS->n_sample); 118 | } 119 | else 120 | *time = 0.; 121 | } 122 | 123 | -------------------------------------------------------------------------------- /src_c/IMB_ze.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | 44 | #ifndef __ze_h__ 45 | #define __ze_h__ 46 | 47 | #include 48 | #include "stdbool.h" 49 | #include 50 | 51 | #include "IMB_declare.h" 52 | #include "IMB_benchmark.h" 53 | #include "IMB_ze_api.h" 54 | #include "IMB_prototypes.h" 55 | 56 | #define IMB_L0_MEM_ALIGNMENT 64 57 | #define ZE_NULL_HANDLE NULL /* just for verbosity */ 58 | 59 | #define ZE_CHKERR_EXPL_FINALLY(f, fin, a) { ze_result_t _ze_chkerr_err; \ 60 | if ((_ze_chkerr_err=(f), (fin), _ze_chkerr_err) != ZE_RESULT_SUCCESS) { \ 61 | fprintf(stderr, "ERROR: 0x%x returned from %s\n", _ze_chkerr_err, #f); \ 62 | a; \ 63 | } \ 64 | } 65 | #define ZE_CHKERR_EXPL(f, a) ZE_CHKERR_EXPL_FINALLY(f, 0, a) 66 | #define ZE_CHKERR_FINALLY(f, fin) ZE_CHKERR_EXPL_FINALLY(f, fin, goto f_err) 67 | #define ZE_CHKERR(f) ZE_CHKERR_EXPL(f, goto f_err) 68 | #define ZE_CHKERR_DO_NOT_FAIL(f) ZE_CHKERR_EXPL_FINALLY(f, 0, (void)0) 69 | 70 | #define NZ_CHKERR_EXPL(f, a) if ((f) == 0) { \ 71 | fprintf(stderr, "ERROR: %s failed\n", #f); \ 72 | a; \ 73 | } 74 | #define NZ_CHKERR(f) NZ_CHKERR_EXPL(f, goto f_err) 75 | 76 | #define C_CHKERR_EXPL(f, a) if ((f) != 0) { \ 77 | fprintf(stderr, "ERROR: %s failed\n", #f); \ 78 | a; \ 79 | } 80 | #define C_CHKERR(f) C_CHKERR_EXPL(f, goto f_err) 81 | 82 | int ze_initialize(char *dll_name); 83 | void *ze_alloc(size_t size, char *where, MEM_ALLOC_TYPE mem_alloc_type); 84 | void ze_free(void **B, MEM_ALLOC_TYPE mem_alloc_type); 85 | void ze_ass_buf(void *buf, int rank, size_t pos1, size_t pos2, int value); 86 | int ze_memcpy(void *dst, const void *src, size_t sz); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /src_c/IMB_ze_api.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | *************************************************************************** 32 | 33 | For more documentation than found here, see 34 | 35 | [1] doc/ReadMe_IMB.txt 36 | 37 | [2] Intel(R) MPI Benchmarks 38 | Users Guide and Methodology Description 39 | In 40 | doc/IMB_Users_Guide.pdf 41 | 42 | ***************************************************************************/ 43 | 44 | #ifdef GPU_ENABLE 45 | #include "IMB_ze_api.h" 46 | #include "IMB_gpu_common.h" 47 | 48 | level_zero_functable_t level_zero_proxy = { 49 | NULL, /* zeInit */ 50 | /* the rest is zeroed */ 51 | }; 52 | 53 | static const char *fn_names[] = { 54 | "zeInit", 55 | "zeDriverGet", 56 | "zeMemAllocDevice", 57 | "zeMemAllocHost", 58 | "zeMemAllocShared", 59 | "zeMemFree", 60 | "zeDeviceGet", 61 | "zeCommandQueueCreate", 62 | "zeCommandQueueExecuteCommandLists", 63 | "zeCommandQueueSynchronize", 64 | "zeCommandListCreate", 65 | "zeCommandListCreateImmediate", 66 | "zeCommandListAppendMemoryCopy", 67 | "zeCommandListReset", 68 | "zeCommandListClose", 69 | "zeContextCreate", 70 | }; 71 | 72 | #define LEVEL_ZERO_FUNCTABLE_COUNT (sizeof(level_zero_proxy) / sizeof(void *)) 73 | 74 | void level_zero_init_functable_dll(const char *dll_name) 75 | { 76 | void **sym_ptr = (void **)&level_zero_proxy; 77 | 78 | void *handle = dlopen(dll_name, RTLD_LAZY | RTLD_GLOBAL); 79 | 80 | char *dl_error = dlerror(); 81 | 82 | if (dl_error) 83 | { 84 | printf("%s\n", dl_error); 85 | exit(1); 86 | } 87 | 88 | size_t i; 89 | 90 | for (i = 0; i < LEVEL_ZERO_FUNCTABLE_COUNT; i++) 91 | { 92 | sym_ptr[i] = dlsym(handle, fn_names[i]); 93 | 94 | dl_error = dlerror(); 95 | 96 | if (dl_error) 97 | { 98 | printf("%s\n", dl_error); 99 | exit(1); 100 | } 101 | 102 | if (sym_ptr[i] == NULL) 103 | { 104 | printf("Symbol %s is not available!\n", fn_names[i]); 105 | exit(1); 106 | } 107 | } 108 | 109 | } 110 | 111 | #endif //GPU_ENABLE 112 | -------------------------------------------------------------------------------- /src_c/P2P/Makefile: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | TARGET=P2P 34 | BINARY:=IMB-P2P 35 | 36 | override CFLAGS += -O3 -Wall -Wextra -Werror 37 | override LDFLAGS += -lm 38 | 39 | ifeq ($(origin CC),default) 40 | CC=mpiicx 41 | endif 42 | 43 | all: $(BINARY) 44 | 45 | IMB_SRC = imb_p2p.c 46 | IMB_SRC += imb_p2p_pingpong.c 47 | IMB_SRC += imb_p2p_pingping.c 48 | IMB_SRC += imb_p2p_unirandom.c 49 | IMB_SRC += imb_p2p_birandom.c 50 | IMB_SRC += imb_p2p_corandom.c 51 | IMB_SRC += imb_p2p_stencil2d.c 52 | IMB_SRC += imb_p2p_stencil3d.c 53 | IMB_SRC += imb_p2p_sendrecv_replace.c 54 | 55 | IMB_OBJ = $(IMB_SRC:.c=.o) 56 | 57 | $(BINARY): $(IMB_OBJ) 58 | $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) 59 | 60 | %.o: %.c 61 | $(CC) $(CFLAGS) -c -o $@ $< 62 | 63 | clean: 64 | rm -f $(IMB_OBJ) $(BINARY) 65 | 66 | $(IMB_OBJ): $(HEADERS) Makefile 67 | 68 | .PHONY: clean all 69 | -------------------------------------------------------------------------------- /src_cpp/EXT/Makefile.EXT.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | 34 | include helpers/Makefile.*.mk 35 | 36 | override CPPFLAGS += -DEXT 37 | 38 | BECHMARK_SUITE_SRC += EXT/EXT_suite.cpp EXT/EXT_benchmark.cpp 39 | C_SRC = $(C_SRC_DIR)/IMB_benchlist.c \ 40 | $(C_SRC_DIR)/IMB_chk_diff.c \ 41 | $(C_SRC_DIR)/IMB_declare.c \ 42 | $(C_SRC_DIR)/IMB_err_handler.c \ 43 | $(C_SRC_DIR)/IMB_g_info.c \ 44 | $(C_SRC_DIR)/IMB_init.c \ 45 | $(C_SRC_DIR)/IMB_init_transfer.c \ 46 | $(C_SRC_DIR)/IMB_mem_manager.c \ 47 | $(C_SRC_DIR)/IMB_ones_accu.c \ 48 | $(C_SRC_DIR)/IMB_ones_bidir.c \ 49 | $(C_SRC_DIR)/IMB_ones_unidir.c \ 50 | $(C_SRC_DIR)/IMB_output.c \ 51 | $(C_SRC_DIR)/IMB_parse_name_ext.c \ 52 | $(C_SRC_DIR)/IMB_strgs.c \ 53 | $(C_SRC_DIR)/IMB_utils.c \ 54 | $(C_SRC_DIR)/IMB_user_set_info.c \ 55 | $(C_SRC_DIR)/IMB_warm_up.c \ 56 | $(C_SRC_DIR)/IMB_window.c 57 | C_OBJ=$(subst $(C_SRC_DIR),EXT,$(C_SRC:.c=.o)) 58 | ADDITIONAL_OBJ += $(C_OBJ) 59 | 60 | EXT/%.o: $(C_SRC_DIR)/%.c 61 | $(CC) $(CFLAGS) $(CPPFLAGS) -DEXT -c -o $@ $< 62 | -------------------------------------------------------------------------------- /src_cpp/EXT/Makefile_win.EXT.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | !INCLUDE helpers/Makefile_win.helpers.mk 34 | 35 | CPPFLAGS = $(CPPFLAGS) -DEXT 36 | CFLAGS = $(CFLAGS) -DEXT 37 | C_SRC_DIR = ../$(C_SRC_DIR) 38 | 39 | C_OBJ = IMB_benchlist.obj \ 40 | IMB_chk_diff.obj \ 41 | IMB_declare.obj \ 42 | IMB_err_handler.obj \ 43 | IMB_g_info.obj \ 44 | IMB_init.obj \ 45 | IMB_init_transfer.obj \ 46 | IMB_mem_manager.obj \ 47 | IMB_ones_accu.obj \ 48 | IMB_ones_bidir.obj \ 49 | IMB_ones_unidir.obj \ 50 | IMB_output.obj \ 51 | IMB_parse_name_ext.obj \ 52 | IMB_strgs.obj \ 53 | IMB_utils.obj \ 54 | IMB_user_set_info.obj \ 55 | IMB_warm_up.obj \ 56 | IMB_window.obj 57 | 58 | BECHMARK_SUITE_OBJ = EXT_suite.obj \ 59 | EXT_benchmark.obj\ 60 | imb.obj args_parser.obj \ 61 | args_parser_utests.obj \ 62 | scope.obj \ 63 | benchmark_suites_collection.obj 64 | 65 | {$(C_SRC_DIR)/}.c.obj: 66 | $(CC) /I"$(MPI_INCLUDE)" $(CFLAGS) -c $(C_SRC_DIR)/$*.c 67 | 68 | {../}.cpp.obj: 69 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c ../$*.cpp 70 | 71 | {EXT/}.cpp.obj: 72 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c EXT/$*.cpp 73 | -------------------------------------------------------------------------------- /src_cpp/HALO/Makefile.HALO.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | 34 | override CPPFLAGS += -DHALO 35 | override CPPFLAGS += -IHALO -IMT 36 | 37 | BECHMARK_SUITE_SRC += HALO/halo_suite.cpp HALO/halo_benchmark.cpp 38 | 39 | HEADERS += MT/MT_benchmark.h HALO/halo_benchmark.h 40 | 41 | WITH_OPENMP = 1 42 | 43 | -------------------------------------------------------------------------------- /src_cpp/HALO/halo_benchmark.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include "benchmark_suites_collection.h" 41 | #include "utils.h" 42 | 43 | #define WITH_VECTOR 44 | 45 | #define GLUE_TYPENAME2(A,B) A,B 46 | #define GLUE_TYPENAME3(A,B,C) A,B,C 47 | 48 | #include "halo_benchmark.h" 49 | 50 | using namespace std; 51 | 52 | namespace ndim_halo_benchmark { 53 | #include "benchmark_suite.h" 54 | 55 | DECLARE_INHERITED_TEMPLATE(HaloBenchmark >, simple_halo) 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src_cpp/IO/Makefile.IO.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | 34 | include helpers/Makefile.*.mk 35 | 36 | override CPPFLAGS += -DMPIIO 37 | 38 | BECHMARK_SUITE_SRC += IO/IO_suite.cpp IO/IO_benchmark.cpp 39 | C_SRC = $(C_SRC_DIR)/IMB_declare.c \ 40 | $(C_SRC_DIR)/IMB_init.c \ 41 | $(C_SRC_DIR)/IMB_mem_manager.c \ 42 | $(C_SRC_DIR)/IMB_benchlist.c \ 43 | $(C_SRC_DIR)/IMB_strgs.c \ 44 | $(C_SRC_DIR)/IMB_err_handler.c \ 45 | $(C_SRC_DIR)/IMB_parse_name_io.c \ 46 | $(C_SRC_DIR)/IMB_g_info.c \ 47 | $(C_SRC_DIR)/IMB_warm_up.c \ 48 | $(C_SRC_DIR)/IMB_open_close.c \ 49 | $(C_SRC_DIR)/IMB_output.c \ 50 | $(C_SRC_DIR)/IMB_utils.c \ 51 | $(C_SRC_DIR)/IMB_init_transfer.c \ 52 | $(C_SRC_DIR)/IMB_init_file.c \ 53 | $(C_SRC_DIR)/IMB_user_set_info.c \ 54 | $(C_SRC_DIR)/IMB_chk_diff.c \ 55 | $(C_SRC_DIR)/IMB_cpu_exploit.c \ 56 | $(C_SRC_DIR)/IMB_read.c \ 57 | $(C_SRC_DIR)/IMB_write.c 58 | C_OBJ=$(subst $(C_SRC_DIR),IO,$(C_SRC:.c=.o)) 59 | ADDITIONAL_OBJ += $(C_OBJ) 60 | 61 | IO/%.o: $(C_SRC_DIR)/%.c 62 | $(CC) $(CFLAGS) $(CPPFLAGS) -DMPIIO -c -o $@ $< 63 | -------------------------------------------------------------------------------- /src_cpp/IO/Makefile_win.IO.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | !INCLUDE helpers/Makefile_win.helpers.mk 34 | 35 | CPPFLAGS = $(CPPFLAGS) -DMPIIO 36 | CFLAGS = $(CFLAGS) -DMPIIO 37 | C_SRC_DIR = ../$(C_SRC_DIR) 38 | 39 | C_OBJ = IMB_declare.obj \ 40 | IMB_init.obj \ 41 | IMB_mem_manager.obj \ 42 | IMB_benchlist.obj \ 43 | IMB_strgs.obj \ 44 | IMB_err_handler.obj \ 45 | IMB_parse_name_io.obj \ 46 | IMB_g_info.obj \ 47 | IMB_warm_up.obj \ 48 | IMB_open_close.obj \ 49 | IMB_output.obj \ 50 | IMB_utils.obj \ 51 | IMB_init_transfer.obj \ 52 | IMB_init_file.obj \ 53 | IMB_user_set_info.obj \ 54 | IMB_chk_diff.obj \ 55 | IMB_cpu_exploit.obj \ 56 | IMB_read.obj \ 57 | IMB_write.obj 58 | 59 | BECHMARK_SUITE_OBJ = IO_suite.obj \ 60 | IO_benchmark.obj\ 61 | imb.obj args_parser.obj \ 62 | args_parser_utests.obj \ 63 | scope.obj \ 64 | benchmark_suites_collection.obj 65 | 66 | {$(C_SRC_DIR)/}.c.obj: 67 | $(CC) /I"$(MPI_INCLUDE)" $(CFLAGS) -c $(C_SRC_DIR)/$*.c 68 | 69 | {../}.cpp.obj: 70 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c ../$*.cpp 71 | 72 | {IO/}.cpp.obj: 73 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c IO/$*.cpp 74 | -------------------------------------------------------------------------------- /src_cpp/MPI1/Makefile.MPI1.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | 34 | include helpers/Makefile.*.mk 35 | 36 | override CPPFLAGS += -DMPI1 37 | 38 | BECHMARK_SUITE_LOCAL_SRC += MPI1/MPI1_suite.cpp MPI1/MPI1_benchmark.cpp 39 | C_SRC = $(C_SRC_DIR)/IMB_allgather.c \ 40 | $(C_SRC_DIR)/IMB_allgatherv.c \ 41 | $(C_SRC_DIR)/IMB_allreduce.c \ 42 | $(C_SRC_DIR)/IMB_alltoall.c \ 43 | $(C_SRC_DIR)/IMB_alltoallv.c \ 44 | $(C_SRC_DIR)/IMB_bandwidth.c \ 45 | $(C_SRC_DIR)/IMB_barrier.c \ 46 | $(C_SRC_DIR)/IMB_bcast.c \ 47 | $(C_SRC_DIR)/IMB_benchlist.c \ 48 | $(C_SRC_DIR)/IMB_chk_diff.c \ 49 | $(C_SRC_DIR)/IMB_cpu_exploit.c \ 50 | $(C_SRC_DIR)/IMB_declare.c \ 51 | $(C_SRC_DIR)/IMB_err_handler.c \ 52 | $(C_SRC_DIR)/IMB_exchange.c \ 53 | $(C_SRC_DIR)/IMB_gather.c \ 54 | $(C_SRC_DIR)/IMB_gatherv.c \ 55 | $(C_SRC_DIR)/IMB_g_info.c \ 56 | $(C_SRC_DIR)/IMB_init.c \ 57 | $(C_SRC_DIR)/IMB_init_transfer.c \ 58 | $(C_SRC_DIR)/IMB_mem_manager.c \ 59 | $(C_SRC_DIR)/IMB_output.c \ 60 | $(C_SRC_DIR)/IMB_parse_name_mpi1.c \ 61 | $(C_SRC_DIR)/IMB_pingping.c \ 62 | $(C_SRC_DIR)/IMB_pingpong.c \ 63 | $(C_SRC_DIR)/IMB_reduce.c \ 64 | $(C_SRC_DIR)/IMB_reduce_local.c \ 65 | $(C_SRC_DIR)/IMB_reduce_scatter.c \ 66 | $(C_SRC_DIR)/IMB_reduce_scatter_block.c \ 67 | $(C_SRC_DIR)/IMB_scatter.c \ 68 | $(C_SRC_DIR)/IMB_scatterv.c \ 69 | $(C_SRC_DIR)/IMB_sendrecv.c \ 70 | $(C_SRC_DIR)/IMB_strgs.c \ 71 | $(C_SRC_DIR)/IMB_utils.c \ 72 | $(C_SRC_DIR)/IMB_warm_up.c 73 | ifdef GPU_ENABLE 74 | override C_SRC += $(C_SRC_DIR)/IMB_gpu_common.c 75 | override CPPFLAGS += -DGPU_ENABLE 76 | override LDFLAGS += -ldl 77 | ifdef CUDA_INCLUDE_DIR 78 | override C_SRC += $(C_SRC_DIR)/IMB_cuda.c \ 79 | $(C_SRC_DIR)/IMB_cuda_api.c 80 | override CPPFLAGS += -I${CUDA_INCLUDE_DIR} -DCUDA_INCLUDE_DIR 81 | endif 82 | ifdef ZE_INCLUDE_DIR 83 | override C_SRC += $(C_SRC_DIR)/IMB_ze.c \ 84 | $(C_SRC_DIR)/IMB_ze_api.c 85 | override CPPFLAGS += -I${ZE_INCLUDE_DIR} -DZE_INCLUDE_DIR 86 | endif 87 | ifndef CUDA_INCLUDE_DIR 88 | ifndef ZE_INCLUDE_DIR 89 | ifneq (clean, $(filter clean,$(MAKECMDGOALS))) 90 | $(error CUDA_INCLUDE_DIR and ZE_INCLUDE_DIR are not set) 91 | endif 92 | endif 93 | endif 94 | SUBDIR:=GPU 95 | else 96 | SUBDIR:=CPU 97 | endif 98 | 99 | C_OBJ=$(subst $(C_SRC_DIR),MPI1/$(SUBDIR),$(C_SRC:.c=.o)) 100 | ADDITIONAL_OBJ += $(C_OBJ) 101 | BECHMARK_SUITE_LOCAL_OBJ=$(subst MPI1/,MPI1/$(SUBDIR)/,$(BECHMARK_SUITE_LOCAL_SRC:.cpp=.o)) 102 | ADDITIONAL_OBJ += $(BECHMARK_SUITE_LOCAL_OBJ) 103 | 104 | MPI1/$(SUBDIR)/%.o: $(C_SRC_DIR)/%.c $(SUBDIR) 105 | $(CC) $(CFLAGS) $(CPPFLAGS) -DMPI1 -c -o $@ $< 106 | 107 | MPI1/$(SUBDIR)/%.o: MPI1/%.cpp $(SUBDIR) 108 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DMPI1 -c -o $@ $< 109 | 110 | ${SUBDIR}: 111 | mkdir -p MPI1/${SUBDIR} 112 | -------------------------------------------------------------------------------- /src_cpp/MPI1/Makefile_win.MPI1.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | !INCLUDE helpers/Makefile_win.helpers.mk 34 | 35 | CFLAGS = $(CFLAGS) -DMPI1 36 | CPPFLAGS = $(CPPFLAGS) -DMPI1 37 | C_SRC_DIR = ../$(C_SRC_DIR) 38 | RC_FILE = ../WINDOWS/IMB-MPI1_VS_2017/IMB-MPI1.rc 39 | RC = rc.exe 40 | 41 | C_OBJ = IMB_declare.obj \ 42 | IMB_init.obj \ 43 | IMB_mem_manager.obj \ 44 | IMB_parse_name_mpi1.obj \ 45 | IMB_benchlist.obj \ 46 | IMB_err_handler.obj \ 47 | IMB_g_info.obj \ 48 | IMB_warm_up.obj \ 49 | IMB_output.obj \ 50 | IMB_pingpong.obj \ 51 | IMB_pingping.obj \ 52 | IMB_allreduce.obj \ 53 | IMB_reduce_scatter.obj \ 54 | IMB_reduce_scatter_block.obj \ 55 | IMB_reduce.obj \ 56 | IMB_reduce_local.obj \ 57 | IMB_exchange.obj \ 58 | IMB_bcast.obj \ 59 | IMB_barrier.obj \ 60 | IMB_allgather.obj \ 61 | IMB_allgatherv.obj \ 62 | IMB_alltoall.obj \ 63 | IMB_alltoallv.obj \ 64 | IMB_sendrecv.obj \ 65 | IMB_init_transfer.obj \ 66 | IMB_chk_diff.obj \ 67 | IMB_utils.obj \ 68 | IMB_strgs.obj \ 69 | IMB_cpu_exploit.obj \ 70 | IMB_gather.obj \ 71 | IMB_gatherv.obj \ 72 | IMB_scatter.obj \ 73 | IMB_scatterv.obj \ 74 | IMB_bandwidth.obj \ 75 | IMB-MPI1.res 76 | 77 | BECHMARK_SUITE_OBJ = MPI1_suite.obj \ 78 | MPI1_benchmark.obj\ 79 | imb.obj \ 80 | args_parser.obj \ 81 | args_parser_utests.obj \ 82 | scope.obj \ 83 | benchmark_suites_collection.obj 84 | 85 | {$(C_SRC_DIR)/}.c.obj: 86 | $(CC) /I"$(MPI_INCLUDE)" $(CFLAGS) -c $(C_SRC_DIR)/$*.c 87 | 88 | {../}.cpp.obj: 89 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c ../$*.cpp 90 | 91 | {MPI1/}.cpp.obj: 92 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c MPI1/$*.cpp 93 | 94 | all: resources 95 | 96 | resources: 97 | $(RC) /R /FO MPI1/IMB-MPI1.res $(RC_FILE) 98 | -------------------------------------------------------------------------------- /src_cpp/MPI4/Makefile.MPI4.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | 34 | include helpers/Makefile.*.mk 35 | 36 | override CPPFLAGS += -DMPI4 37 | 38 | BECHMARK_SUITE_LOCAL_SRC += MPI4/MPI4_suite.cpp MPI4/MPI4_benchmark.cpp 39 | C_SRC = $(C_SRC_DIR)/IMB_allgather.c \ 40 | $(C_SRC_DIR)/IMB_allgatherv.c \ 41 | $(C_SRC_DIR)/IMB_allreduce.c \ 42 | $(C_SRC_DIR)/IMB_alltoall.c \ 43 | $(C_SRC_DIR)/IMB_alltoallv.c \ 44 | $(C_SRC_DIR)/IMB_bandwidth.c \ 45 | $(C_SRC_DIR)/IMB_barrier.c \ 46 | $(C_SRC_DIR)/IMB_bcast.c \ 47 | $(C_SRC_DIR)/IMB_benchlist.c \ 48 | $(C_SRC_DIR)/IMB_chk_diff.c \ 49 | $(C_SRC_DIR)/IMB_cpu_exploit.c \ 50 | $(C_SRC_DIR)/IMB_declare.c \ 51 | $(C_SRC_DIR)/IMB_err_handler.c \ 52 | $(C_SRC_DIR)/IMB_exchange.c \ 53 | $(C_SRC_DIR)/IMB_gather.c \ 54 | $(C_SRC_DIR)/IMB_gatherv.c \ 55 | $(C_SRC_DIR)/IMB_g_info.c \ 56 | $(C_SRC_DIR)/IMB_init.c \ 57 | $(C_SRC_DIR)/IMB_init_transfer.c \ 58 | $(C_SRC_DIR)/IMB_mem_manager.c \ 59 | $(C_SRC_DIR)/IMB_output.c \ 60 | $(C_SRC_DIR)/IMB_init_transfer.c \ 61 | $(C_SRC_DIR)/IMB_user_set_info.c \ 62 | $(C_SRC_DIR)/IMB_parse_name_mpi4.c \ 63 | $(C_SRC_DIR)/IMB_pingping.c \ 64 | $(C_SRC_DIR)/IMB_pingpong.c \ 65 | $(C_SRC_DIR)/IMB_reduce.c \ 66 | $(C_SRC_DIR)/IMB_reduce_local.c \ 67 | $(C_SRC_DIR)/IMB_reduce_scatter.c \ 68 | $(C_SRC_DIR)/IMB_scatter.c \ 69 | $(C_SRC_DIR)/IMB_scatterv.c \ 70 | $(C_SRC_DIR)/IMB_sendrecv.c \ 71 | $(C_SRC_DIR)/IMB_strgs.c \ 72 | $(C_SRC_DIR)/IMB_utils.c \ 73 | $(C_SRC_DIR)/IMB_user_set_info.c \ 74 | $(C_SRC_DIR)/IMB_warm_up.c 75 | ifdef GPU_ENABLE 76 | override C_SRC += $(C_SRC_DIR)/IMB_gpu_common.c 77 | override CPPFLAGS += -DGPU_ENABLE 78 | override LDFLAGS += -ldl 79 | ifdef CUDA_INCLUDE_DIR 80 | override C_SRC += $(C_SRC_DIR)/IMB_cuda.c \ 81 | $(C_SRC_DIR)/IMB_cuda_api.c 82 | override CPPFLAGS += -I${CUDA_INCLUDE_DIR} -DCUDA_INCLUDE_DIR 83 | endif 84 | ifdef ZE_INCLUDE_DIR 85 | override C_SRC += $(C_SRC_DIR)/IMB_ze.c \ 86 | $(C_SRC_DIR)/IMB_ze_api.c 87 | override CPPFLAGS += -I${ZE_INCLUDE_DIR} -DZE_INCLUDE_DIR 88 | endif 89 | ifndef CUDA_INCLUDE_DIR 90 | ifndef ZE_INCLUDE_DIR 91 | $(error CUDA_INCLUDE_DIR and ZE_INCLUDE_DIR are not set) 92 | endif 93 | endif 94 | SUBDIR:=GPU 95 | else 96 | SUBDIR:=CPU 97 | endif 98 | 99 | C_OBJ=$(subst $(C_SRC_DIR),MPI4/$(SUBDIR),$(C_SRC:.c=.o)) 100 | ADDITIONAL_OBJ += $(C_OBJ) 101 | BECHMARK_SUITE_LOCAL_OBJ=$(subst MPI4/,MPI4/$(SUBDIR)/,$(BECHMARK_SUITE_LOCAL_SRC:.cpp=.o)) 102 | ADDITIONAL_OBJ += $(BECHMARK_SUITE_LOCAL_OBJ) 103 | 104 | MPI4/$(SUBDIR)/%.o: $(C_SRC_DIR)/%.c $(SUBDIR) 105 | $(CC) $(CFLAGS) $(CPPFLAGS) -DMPI4 -c -o $@ $< 106 | 107 | MPI4/$(SUBDIR)/%.o: MPI4/%.cpp $(SUBDIR) 108 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DMPI4 -c -o $@ $< 109 | 110 | ${SUBDIR}: 111 | mkdir -p MPI4/${SUBDIR} 112 | -------------------------------------------------------------------------------- /src_cpp/MT/MT_types.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include 36 | 37 | #define THREAD_NUM_STR_LEN_MAX 16 38 | #define THREAD_NUM_KEY "thread_id" 39 | 40 | struct thread_local_data_t { 41 | int warmup; 42 | int repeat; 43 | MPI_Comm comm; 44 | }; 45 | 46 | enum malopt_t { 47 | MALOPT_SERIAL, 48 | MALOPT_CONTINUOUS, 49 | MALOPT_PARALLEL 50 | }; 51 | 52 | enum barropt_t { 53 | BARROPT_NOBARRIER, 54 | BARROPT_NORMAL, 55 | BARROPT_SPECIAL 56 | }; 57 | 58 | static inline MPI_Comm duplicate_comm(int mode_multiple, int thread_num) 59 | { 60 | char thread_num_str[THREAD_NUM_STR_LEN_MAX] = { 0 }; 61 | MPI_Comm comm = MPI_COMM_WORLD, new_comm; 62 | MPI_Info info; 63 | 64 | if (mode_multiple) { 65 | MPI_Comm_dup(comm, &new_comm); 66 | MPI_Info_create(&info); 67 | snprintf(thread_num_str, THREAD_NUM_STR_LEN_MAX, "%d", thread_num); 68 | MPI_Info_set(info, THREAD_NUM_KEY, thread_num_str); 69 | MPI_Comm_set_info(new_comm, info); 70 | MPI_Info_free(&info); 71 | return new_comm; 72 | } 73 | return comm; 74 | } 75 | -------------------------------------------------------------------------------- /src_cpp/MT/Makefile.MT.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | override CPPFLAGS += -DMT 34 | override CPPFLAGS += -IMT 35 | 36 | BECHMARK_SUITE_SRC += MT/MT_suite.cpp MT/MT_benchmark.cpp 37 | 38 | HEADERS += MT/MT_benchmark.h 39 | 40 | WITH_OPENMP = 1 41 | -------------------------------------------------------------------------------- /src_cpp/MT/Makefile_win.MT.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | CPPFLAGS = $(CPPFLAGS) -DMT /openmp 34 | 35 | BECHMARK_SUITE_OBJ = MT_suite.obj \ 36 | MT_benchmark.obj\ 37 | imb.obj \ 38 | args_parser.obj \ 39 | args_parser_utests.obj \ 40 | scope.obj \ 41 | benchmark_suites_collection.obj 42 | 43 | {../}.cpp.obj: 44 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c ../$*.cpp 45 | 46 | {MT/}.cpp.obj: 47 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c MT/$*.cpp 48 | -------------------------------------------------------------------------------- /src_cpp/Makefile_win: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | CC = cl.exe 34 | CPP = cl.exe 35 | 36 | CFLAGS = $(CFLAGS) -DWIN32 -DWIN_IMB 37 | CPPFLAGS = $(CPPFLAGS) -DWIN32 -DWIN_IMB 38 | 39 | CLINKER = $(CC) 40 | CPPLINKER = $(CPP) 41 | 42 | MPI_INCLUDE = %I_MPI_ROOT%\intel64\include 43 | LIBS = %I_MPI_ROOT%\intel64\lib\release\impi.lib 44 | 45 | default: all 46 | 47 | !IFDEF TARGET 48 | 49 | !INCLUDE $(TARGET)/Makefile_win.$(TARGET).mk 50 | 51 | clean: 52 | @cd $(TARGET) 53 | del /f /q $(C_OBJ) $(BECHMARK_SUITE_OBJ) 54 | del /f /q IMB-$(TARGET).exe 55 | @cd .. 56 | del /f /q IMB-$(TARGET).exe 57 | 58 | all: MOVE_TO_TARGET_DIR $(TARGET) 59 | cd .. 60 | copy .\$(TARGET)\IMB-$(TARGET).exe 61 | 62 | $(TARGET): $(C_OBJ) $(BECHMARK_SUITE_OBJ) 63 | $(CPPLINKER) $(LDFLAGS) /FeIMB-$(TARGET) $(C_OBJ) $(BECHMARK_SUITE_OBJ) "$(LIB_PATH)" "$(LIBS)" 64 | 65 | MOVE_TO_TARGET_DIR: 66 | cd ./$(TARGET) 67 | 68 | .cpp.obj: 69 | $(CPP) /I"$(MPI_INCLUDE)" /I.. $(CPPFLAGS) -c $*.cpp 70 | !ELSE 71 | 72 | TARGET = IMB-RMA IMB-MT IMB-MPI1 IMB-NBC IMB-IO IMB-EXT 73 | CLEAN_TARGET = C_IMB-RMA C_IMB-MT C_IMB-MPI1 C_IMB-NBC C_IMB-IO C_IMB-EXT 74 | 75 | all: $(TARGET) 76 | 77 | $(TARGET): 78 | nmake -f Makefile_win TARGET=$(*:IMB-=) 79 | 80 | clean: $(CLEAN_TARGET) 81 | 82 | $(CLEAN_TARGET): 83 | nmake -f Makefile_win clean TARGET=$(*:C_IMB-=) 84 | !ENDIF 85 | -------------------------------------------------------------------------------- /src_cpp/NBC/Makefile.NBC.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | include helpers/Makefile.*.mk 34 | 35 | override CPPFLAGS += -DNBC 36 | 37 | BECHMARK_SUITE_SRC += NBC/NBC_suite.cpp NBC/NBC_benchmark.cpp 38 | C_SRC = $(C_SRC_DIR)/IMB_allgather.c \ 39 | $(C_SRC_DIR)/IMB_allgatherv.c \ 40 | $(C_SRC_DIR)/IMB_allreduce.c \ 41 | $(C_SRC_DIR)/IMB_alltoall.c \ 42 | $(C_SRC_DIR)/IMB_alltoallv.c \ 43 | $(C_SRC_DIR)/IMB_barrier.c \ 44 | $(C_SRC_DIR)/IMB_bcast.c \ 45 | $(C_SRC_DIR)/IMB_benchlist.c \ 46 | $(C_SRC_DIR)/IMB_chk_diff.c \ 47 | $(C_SRC_DIR)/IMB_cpu_exploit.c \ 48 | $(C_SRC_DIR)/IMB_declare.c \ 49 | $(C_SRC_DIR)/IMB_err_handler.c \ 50 | $(C_SRC_DIR)/IMB_gather.c \ 51 | $(C_SRC_DIR)/IMB_gatherv.c \ 52 | $(C_SRC_DIR)/IMB_g_info.c \ 53 | $(C_SRC_DIR)/IMB_init.c \ 54 | $(C_SRC_DIR)/IMB_init_transfer.c \ 55 | $(C_SRC_DIR)/IMB_mem_manager.c \ 56 | $(C_SRC_DIR)/IMB_output.c \ 57 | $(C_SRC_DIR)/IMB_parse_name_nbc.c \ 58 | $(C_SRC_DIR)/IMB_reduce.c \ 59 | $(C_SRC_DIR)/IMB_reduce_scatter.c \ 60 | $(C_SRC_DIR)/IMB_scatter.c \ 61 | $(C_SRC_DIR)/IMB_scatterv.c \ 62 | $(C_SRC_DIR)/IMB_sendrecv.c \ 63 | $(C_SRC_DIR)/IMB_strgs.c \ 64 | $(C_SRC_DIR)/IMB_utils.c \ 65 | $(C_SRC_DIR)/IMB_warm_up.c 66 | C_OBJ=$(subst $(C_SRC_DIR),NBC,$(C_SRC:.c=.o)) 67 | ADDITIONAL_OBJ += $(C_OBJ) 68 | 69 | NBC/%.o: $(C_SRC_DIR)/%.c 70 | $(CC) $(CFLAGS) $(CPPFLAGS) -DNBC -c -o $@ $< 71 | -------------------------------------------------------------------------------- /src_cpp/NBC/Makefile_win.NBC.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | !INCLUDE helpers/Makefile_win.helpers.mk 34 | 35 | CPPFLAGS = $(CPPFLAGS) -DNBC 36 | CFLAGS = $(CFLAGS) -DNBC 37 | C_SRC_DIR = ../$(C_SRC_DIR) 38 | RC_FILE = ../WINDOWS/IMB-NBC_VS_2017/IMB-NBC.rc 39 | RC = rc.exe 40 | 41 | C_OBJ = IMB_allgather.obj \ 42 | IMB_allgatherv.obj \ 43 | IMB_allreduce.obj \ 44 | IMB_alltoall.obj \ 45 | IMB_alltoallv.obj \ 46 | IMB_barrier.obj \ 47 | IMB_bcast.obj \ 48 | IMB_benchlist.obj \ 49 | IMB_chk_diff.obj \ 50 | IMB_cpu_exploit.obj \ 51 | IMB_declare.obj \ 52 | IMB_err_handler.obj \ 53 | IMB_gather.obj \ 54 | IMB_gatherv.obj \ 55 | IMB_g_info.obj \ 56 | IMB_init.obj \ 57 | IMB_init_transfer.obj \ 58 | IMB_mem_manager.obj \ 59 | IMB_output.obj \ 60 | IMB_parse_name_nbc.obj \ 61 | IMB_reduce.obj \ 62 | IMB_reduce_scatter.obj \ 63 | IMB_scatter.obj \ 64 | IMB_scatterv.obj \ 65 | IMB_sendrecv.obj \ 66 | IMB_strgs.obj \ 67 | IMB_utils.obj \ 68 | IMB_warm_up.obj \ 69 | IMB-NBC.res 70 | 71 | BECHMARK_SUITE_OBJ = NBC_suite.obj \ 72 | NBC_benchmark.obj\ 73 | imb.obj args_parser.obj \ 74 | args_parser_utests.obj \ 75 | scope.obj \ 76 | benchmark_suites_collection.obj 77 | 78 | {$(C_SRC_DIR)/}.c.obj: 79 | $(CC) /I"$(MPI_INCLUDE)" $(CFLAGS) -c $(C_SRC_DIR)/$*.c 80 | 81 | {../}.cpp.obj: 82 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c ../$*.cpp 83 | 84 | {NBC/}.cpp.obj: 85 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c NBC/$*.cpp 86 | 87 | all: resources 88 | 89 | resources: 90 | $(RC) /R /FO NBC/IMB-NBC.res $(RC_FILE) 91 | -------------------------------------------------------------------------------- /src_cpp/RMA/Makefile.RMA.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | include helpers/Makefile.*.mk 34 | 35 | override CPPFLAGS += -DRMA 36 | 37 | BECHMARK_SUITE_SRC += RMA/RMA_suite.cpp RMA/RMA_benchmark.cpp 38 | C_SRC = $(C_SRC_DIR)/IMB_utils.c \ 39 | $(C_SRC_DIR)/IMB_declare.c \ 40 | $(C_SRC_DIR)/IMB_init.c \ 41 | $(C_SRC_DIR)/IMB_mem_manager.c \ 42 | $(C_SRC_DIR)/IMB_benchlist.c \ 43 | $(C_SRC_DIR)/IMB_parse_name_rma.c \ 44 | $(C_SRC_DIR)/IMB_strgs.c \ 45 | $(C_SRC_DIR)/IMB_err_handler.c \ 46 | $(C_SRC_DIR)/IMB_g_info.c \ 47 | $(C_SRC_DIR)/IMB_warm_up.c \ 48 | $(C_SRC_DIR)/IMB_output.c \ 49 | $(C_SRC_DIR)/IMB_init_transfer.c \ 50 | $(C_SRC_DIR)/IMB_user_set_info.c \ 51 | $(C_SRC_DIR)/IMB_chk_diff.c \ 52 | $(C_SRC_DIR)/IMB_rma_put.c \ 53 | $(C_SRC_DIR)/IMB_cpu_exploit.c \ 54 | $(C_SRC_DIR)/IMB_rma_get.c \ 55 | $(C_SRC_DIR)/IMB_rma_atomic.c 56 | ifdef GPU_ENABLE 57 | override C_SRC += $(C_SRC_DIR)/IMB_gpu_common.c 58 | override CPPFLAGS += -DGPU_ENABLE 59 | override LDFLAGS += -ldl 60 | ifdef CUDA_INCLUDE_DIR 61 | override C_SRC += $(C_SRC_DIR)/IMB_cuda.c \ 62 | $(C_SRC_DIR)/IMB_cuda_api.c 63 | override CPPFLAGS += -I${CUDA_INCLUDE_DIR} -DCUDA_INCLUDE_DIR 64 | endif 65 | ifdef ZE_INCLUDE_DIR 66 | override C_SRC += $(C_SRC_DIR)/IMB_ze.c \ 67 | $(C_SRC_DIR)/IMB_ze_api.c 68 | override CPPFLAGS += -I${ZE_INCLUDE_DIR} -DZE_INCLUDE_DIR 69 | endif 70 | ifndef CUDA_INCLUDE_DIR 71 | ifndef ZE_INCLUDE_DIR 72 | ifneq (clean, $(filter clean,$(MAKECMDGOALS))) 73 | $(error CUDA_INCLUDE_DIR and ZE_INCLUDE_DIR are not set) 74 | endif 75 | endif 76 | endif 77 | SUBDIR:=GPU 78 | else 79 | SUBDIR:=CPU 80 | endif 81 | 82 | C_OBJ=$(subst $(C_SRC_DIR),RMA/$(SUBDIR),$(C_SRC:.c=.o)) 83 | ADDITIONAL_OBJ += $(C_OBJ) 84 | BECHMARK_SUITE_LOCAL_OBJ=$(subst RMA/,RMA/$(SUBDIR)/,$(BECHMARK_SUITE_LOCAL_SRC:.cpp=.o)) 85 | ADDITIONAL_OBJ += $(BECHMARK_SUITE_LOCAL_OBJ) 86 | 87 | RMA/$(SUBDIR)/%.o: $(C_SRC_DIR)/%.c $(SUBDIR) 88 | $(CC) $(CFLAGS) $(CPPFLAGS) -DRMA -c -o $@ $< 89 | 90 | RMA/$(SUBDIR)/%.o: RMA/%.cpp $(SUBDIR) 91 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -DRMA -c -o $@ $< 92 | 93 | ${SUBDIR}: 94 | mkdir -p RMA/${SUBDIR} 95 | -------------------------------------------------------------------------------- /src_cpp/RMA/Makefile_win.RMA.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | !INCLUDE helpers/Makefile_win.helpers.mk 34 | 35 | CPPFLAGS = $(CPPFLAGS) -DRMA 36 | CFLAGS = $(CFLAGS) -DRMA 37 | C_SRC_DIR = ../$(C_SRC_DIR) 38 | RC_FILE = ../WINDOWS/IMB-RMA_VS_2017/IMB-RMA.rc 39 | RC = rc.exe 40 | 41 | C_OBJ = IMB_declare.obj \ 42 | IMB_utils.obj \ 43 | IMB_init.obj \ 44 | IMB_mem_manager.obj \ 45 | IMB_benchlist.obj \ 46 | IMB_parse_name_rma.obj \ 47 | IMB_strgs.obj \ 48 | IMB_err_handler.obj \ 49 | IMB_g_info.obj \ 50 | IMB_warm_up.obj \ 51 | IMB_output.obj \ 52 | IMB_init_transfer.obj \ 53 | IMB_user_set_info.obj \ 54 | IMB_chk_diff.obj \ 55 | IMB_rma_put.obj \ 56 | IMB_cpu_exploit.obj \ 57 | IMB_rma_get.obj \ 58 | IMB_rma_atomic.obj \ 59 | IMB-RMA.res 60 | 61 | BECHMARK_SUITE_OBJ = RMA_suite.obj \ 62 | RMA_benchmark.obj\ 63 | imb.obj args_parser.obj \ 64 | args_parser_utests.obj \ 65 | scope.obj \ 66 | benchmark_suites_collection.obj 67 | 68 | {$(C_SRC_DIR)/}.c.obj: 69 | $(CC) /I"$(MPI_INCLUDE)" $(CFLAGS) -c $(C_SRC_DIR)/$*.c 70 | 71 | {../}.cpp.obj: 72 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c ../$*.cpp 73 | 74 | {RMA/}.cpp.obj: 75 | $(CPP) /I"$(MPI_INCLUDE)" /I. $(CPPFLAGS) -c RMA/$*.cpp 76 | 77 | all: resources 78 | 79 | resources: 80 | $(RC) /R /FO RMA/IMB-RMA.res $(RC_FILE) 81 | -------------------------------------------------------------------------------- /src_cpp/any.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #pragma once 34 | #include 35 | #include "smart_ptr.h" 36 | 37 | class any 38 | { 39 | struct holder_base 40 | { 41 | virtual void *get() const { return NULL; } 42 | virtual const std::type_info &get_type_id() const { return typeid(void); } 43 | virtual ~holder_base() {} 44 | int dummy; 45 | }; 46 | template 47 | struct holder : holder_base 48 | { 49 | smart_ptr storedObject; 50 | holder(smart_ptr pobject) : storedObject(pobject) {} 51 | virtual void *get() const { return storedObject.get(); } 52 | virtual const std::type_info &get_type_id() const { return typeid(type); } 53 | }; 54 | smart_ptr held; 55 | public: 56 | any() {} 57 | template 58 | any(smart_ptr objectToStore) : held(new holder(objectToStore)) 59 | {} 60 | template 61 | type *as() const { 62 | if (held.get() == NULL) 63 | return NULL; 64 | if (typeid(type) == held->get_type_id()) 65 | return static_cast(held->get()); 66 | else 67 | return NULL; 68 | } 69 | void detach_ptr() { held.detach(); } 70 | }; 71 | 72 | 73 | /* 74 | #include 75 | #include 76 | 77 | struct A 78 | { 79 | void say() { std::cout << "I am A" << std::endl; } 80 | ~A() { std::cout << "Destroyed an A" << std::endl; } 81 | }; 82 | 83 | struct B 84 | { 85 | void say() { std::cout << "I am B" << std::endl; } 86 | ~B() { std::cout << "Destroyed a B" << std::endl; } 87 | }; 88 | 89 | int main() 90 | { 91 | std::vector collection(4); 92 | collection[0] = smart_ptr(new A); 93 | collection[1] = smart_ptr(new B); 94 | collection[2] = smart_ptr(new A); 95 | collection[3] = smart_ptr(new A); 96 | for (size_t i = 0; i < collection.size(); i++) { 97 | A *A_ptr = collection[i].as(); 98 | B *B_ptr = collection[i].as(); 99 | if (A_ptr) A_ptr->say(); 100 | if (B_ptr) B_ptr->say(); 101 | } 102 | return 0; 103 | } 104 | */ 105 | -------------------------------------------------------------------------------- /src_cpp/benchmark.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #pragma once 34 | #include "smart_ptr.h" 35 | #include "scope.h" 36 | #include 37 | 38 | #define UNUSED(expr) do { (void)(expr); } while (0) 39 | #define IMB_INPUT_NAME_LEN 32 40 | #define IMB_INPUT_ARG_LEN 72 41 | 42 | class BenchmarkSuiteBase; 43 | class Benchmark { 44 | public: 45 | Benchmark() : initialized(false) {} 46 | virtual const std::string get_name() const { return std::string(""); } 47 | virtual Benchmark* create_myself() const { return NULL; } 48 | virtual void allocate_internals() {} 49 | virtual bool init_description() { return true; } 50 | virtual void init() { } 51 | virtual void run(const scope_item &) = 0; 52 | virtual void finalize() { } 53 | virtual bool is_default() { return true; } 54 | virtual std::vector get_comments() { return std::vector(0); } 55 | smart_ptr get_scope() { if (scope.get() == NULL) { scope.assign(new Scope); scope->commit(); } return scope; } 56 | virtual ~Benchmark() { } 57 | bool initialized; 58 | BenchmarkSuiteBase *suite; 59 | protected: 60 | smart_ptr scope; 61 | private: 62 | Benchmark &operator=(const Benchmark &) { return *this; } 63 | Benchmark(const Benchmark &) {} 64 | }; 65 | 66 | #define DEFINE_INHERITED(CLASS, SUITE_CLASS) static const char *name; \ 67 | virtual const std::string get_name() const { return name; } \ 68 | virtual Benchmark *create_myself() const { return new CLASS; } \ 69 | CLASS() { Benchmark::suite = SUITE_CLASS::register_elem(this); this->allocate_internals(); } 70 | 71 | #define DECLARE_INHERITED(CLASS, NAME) namespace { CLASS elem_ ## NAME; } const char *CLASS::name = #NAME; 72 | 73 | #ifdef __GNUC__ 74 | #define DECLARE_INHERITED_TEMPLATE(CLASS, NAME) namespace { CLASS elem_ ## NAME; } template<> const char *CLASS::name = #NAME; 75 | #else 76 | #define DECLARE_INHERITED_TEMPLATE(CLASS, NAME) namespace { CLASS elem_ ## NAME; } const char *CLASS::name = #NAME; 77 | #endif 78 | -------------------------------------------------------------------------------- /src_cpp/benchmark_suite_base.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include "smart_ptr.h" 36 | #include "benchmark.h" 37 | 38 | class args_parser; 39 | class Benchmark; 40 | 41 | class BenchmarkSuiteBase { 42 | public: 43 | enum BenchListFilter { ALL_BENCHMARKS, DEFAULT_BENCHMARKS }; 44 | virtual void init() {} 45 | virtual bool declare_args(args_parser &, 46 | std::ostream &output = std::cout) const { 47 | UNUSED(output); 48 | return true; 49 | } 50 | virtual bool prepare(const args_parser &, const std::vector &, 51 | const std::vector &, std::ostream &output = std::cout) { 52 | UNUSED(output); 53 | return true; 54 | } 55 | virtual void finalize(const std::vector &, std::ostream &output = std::cout) { 56 | UNUSED(output); 57 | } 58 | virtual void get_bench_list(std::set &, BenchListFilter filter = ALL_BENCHMARKS) const { UNUSED(filter); } 59 | virtual void get_bench_list(std::vector &, BenchListFilter filter = ALL_BENCHMARKS) const { UNUSED(filter); } 60 | virtual smart_ptr create(const std::string &) { return smart_ptr(); } 61 | virtual const std::string get_name() const = 0; 62 | virtual any get_parameter(const std::string &key) { UNUSED(key); return any(); } 63 | }; 64 | 65 | -------------------------------------------------------------------------------- /src_cpp/benchmark_suites_collection.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include "benchmark_suites_collection.h" 39 | #include "utils.h" 40 | #include "benchmark_suite.h" 41 | 42 | using namespace std; 43 | 44 | map *BenchmarkSuitesCollection::pnames = NULL; 45 | 46 | DECLARE_BENCHMARK_SUITE_STUFF(BS_GENERIC, __generic__) 47 | 48 | namespace { 49 | struct Dummy : public Benchmark { 50 | void run(const scope_item &) {} 51 | DEFINE_INHERITED(Dummy, BenchmarkSuite) 52 | }; 53 | DECLARE_INHERITED(Dummy, Dummy) 54 | } 55 | -------------------------------------------------------------------------------- /src_cpp/example/Makefile.example.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | 34 | override CPPFLAGS += -DEXAMPLE 35 | override CPPFLAGS += -Iexample 36 | 37 | BECHMARK_SUITE_SRC += example/example_benchmark1.cpp \ 38 | example/example_benchmark2.cpp \ 39 | example/example_benchmark3.cpp \ 40 | example/example_benchmark4.cpp \ 41 | example/example_benchmark5.cpp 42 | -------------------------------------------------------------------------------- /src_cpp/example/example_benchmark1.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ****************************************************************************/ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include "benchmark.h" 41 | #include "benchmark_suites_collection.h" 42 | #include "scope.h" 43 | #include "utils.h" 44 | 45 | using namespace std; 46 | 47 | // NOTE: The following example uses BS_GENERIC template of BenchmarkSuite. 48 | // One needs to take care when using it: 49 | // 1. Put benchmark_suite.h include directive and all its usage in the namespace 50 | // with a unique name. It is required to avoid multiple occurence of static variables 51 | // problem if BS_GENERIC is used by several suites as a base. 52 | // 2. Put DECLARE_BENCHMARK_SUITE_STUFF right after include directive 53 | // 3. Every benchmark you plan to put in suite must include DEFINE_INHERITED and 54 | // DECLARE_INHERITED macros. 55 | // All other stuff is automated. Enjoy! 56 | namespace example_suite1 { 57 | 58 | #include "benchmark_suite.h" 59 | DECLARE_BENCHMARK_SUITE_STUFF(BS_GENERIC, example_suite1) 60 | 61 | class ExampleBenchmark_1 : public Benchmark { 62 | public: 63 | virtual void run(const scope_item &item) { 64 | UNUSED(item); 65 | cout << get_name() << ": Hello world from example" << endl; 66 | } 67 | DEFINE_INHERITED(ExampleBenchmark_1, BenchmarkSuite); 68 | }; 69 | 70 | DECLARE_INHERITED(ExampleBenchmark_1, example1) 71 | } 72 | -------------------------------------------------------------------------------- /src_cpp/example/example_benchmark2.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ****************************************************************************/ 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include "benchmark.h" 41 | #include "benchmark_suites_collection.h" 42 | #include "scope.h" 43 | #include "utils.h" 44 | 45 | using namespace std; 46 | 47 | namespace example_suite2 { 48 | 49 | #include "benchmark_suite.h" 50 | DECLARE_BENCHMARK_SUITE_STUFF(BS_GENERIC, example_suite2) 51 | 52 | // EXAMPLE 2: benchmark scope is added by overloading init() virtual function 53 | class ExampleBenchmark_2 : public Benchmark { 54 | public: 55 | virtual void init() { 56 | VarLenScope *sc = new VarLenScope(0, 22); 57 | scope = sc; 58 | } 59 | virtual void run(const scope_item &item) { 60 | cout << get_name() << ": Hello world! size=" << item.len << endl; 61 | } 62 | DEFINE_INHERITED(ExampleBenchmark_2, BenchmarkSuite); 63 | }; 64 | 65 | DECLARE_INHERITED(ExampleBenchmark_2, example2) 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src_cpp/example/example_benchmark5.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ****************************************************************************/ 32 | 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #include "benchmark.h" 42 | #include "benchmark_suites_collection.h" 43 | #include "scope.h" 44 | #include "utils.h" 45 | 46 | using namespace std; 47 | 48 | 49 | // EXAMPLE 5: generic code, Benchmark class directly inherits from the base Benchmarks class. 50 | // Suite code directly inherits from BenchmarkSuiteBase class. 51 | // Registration is done by rather ugly direct register_elem() call from a constructor 52 | class ExampleBenchmark_5 : public Benchmark 53 | { 54 | virtual const string get_name() const { return "example5"; } 55 | virtual void run(const scope_item &) { std::cout << "Hello from example 5"; } 56 | }; 57 | 58 | class BenchmarkSuiteExample5 : public BenchmarkSuiteBase 59 | { 60 | static BenchmarkSuiteExample5 *instance; 61 | public: 62 | BenchmarkSuiteExample5() { 63 | if (instance == NULL) { 64 | instance = (BenchmarkSuiteExample5 *)0xffff; 65 | instance = new BenchmarkSuiteExample5(); 66 | BenchmarkSuitesCollection::register_elem(instance); 67 | } 68 | } 69 | virtual ~BenchmarkSuiteExample5() { 70 | if (instance != NULL) { 71 | BenchmarkSuiteExample5 *to_delete; 72 | to_delete = instance; 73 | instance = NULL; 74 | delete to_delete; 75 | } 76 | } 77 | virtual void get_bench_list(std::set &result, 78 | BenchListFilter filter = ALL_BENCHMARKS) const 79 | { 80 | UNUSED(filter); 81 | result.insert("example_bench5"); 82 | } 83 | virtual void get_bench_list(std::vector &result, 84 | BenchListFilter filter = ALL_BENCHMARKS) const 85 | { 86 | UNUSED(filter); 87 | result.push_back("example_bench5"); 88 | } 89 | virtual smart_ptr create(const std::string &name) 90 | { 91 | if (name == "example_bench5") { 92 | return smart_ptr(new ExampleBenchmark_5); 93 | } 94 | return smart_ptr(NULL); 95 | } 96 | virtual const std::string get_name() const { return "example_suite5"; }; 97 | }; 98 | 99 | BenchmarkSuiteExample5 *BenchmarkSuiteExample5::instance; 100 | namespace { BenchmarkSuiteExample5 bench_suite_ex5; } 101 | 102 | -------------------------------------------------------------------------------- /src_cpp/helpers/Makefile.helpers.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | C_SRC_DIR=../src_c 34 | override CPPFLAGS += -Ihelpers 35 | override CPPFLAGS += -I$(C_SRC_DIR) 36 | 37 | HEADERS += helpers/original_benchmark.h \ 38 | helpers/helper_IMB_functions.h 39 | -------------------------------------------------------------------------------- /src_cpp/helpers/Makefile_win.helpers.mk: -------------------------------------------------------------------------------- 1 | # ***************************************************************************** 2 | # * * 3 | # * Copyright (C) 2024 Intel Corporation * 4 | # * * 5 | # ***************************************************************************** 6 | 7 | # Redistribution and use in source and binary forms, with or without modification, 8 | # are permitted provided that the following conditions are met: 9 | 10 | # 1. Redistributions of source code must retain the above copyright notice, 11 | # this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright notice, 13 | # this list of conditions and the following disclaimer in the documentation 14 | # and/or other materials provided with the distribution. 15 | # 3. Neither the name of the copyright holder nor the names of its contributors 16 | # may be used to endorse or promote products derived from this software 17 | # without specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | # 31 | # *************************************************************************** 32 | 33 | C_SRC_DIR= ../src_c 34 | 35 | CPPFLAGS = $(CPPFLAGS) -I../helpers -I$(C_SRC_DIR) 36 | CFLAGS = $(CFLAGS) -I../helpers -I$(C_SRC_DIR) 37 | -------------------------------------------------------------------------------- /src_cpp/scope.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #include "scope.h" 34 | 35 | using namespace std; 36 | 37 | bool ScopeIterator::operator==(const ScopeIterator &other) { 38 | return other.scope.sequence.size() == scope.sequence.size() && other.n == n; 39 | } 40 | 41 | bool ScopeIterator::operator!=(const ScopeIterator &other) { 42 | return !operator==(other); 43 | } 44 | 45 | ScopeIterator &ScopeIterator::operator++() { 46 | n++; 47 | return *this; 48 | } 49 | 50 | ScopeIterator ScopeIterator::operator++(int) { 51 | ScopeIterator tmp(*this); 52 | operator++(); 53 | return tmp; 54 | } 55 | 56 | scope_item ScopeIterator::operator*() { 57 | return scope.sequence[n]; 58 | } 59 | 60 | ScopeIterator Scope::begin() { 61 | assert(formed); 62 | return ScopeIterator(*this, 0); 63 | } 64 | 65 | ScopeIterator Scope::end() { 66 | assert(formed); 67 | return ScopeIterator(*this, sequence.size()); 68 | } 69 | 70 | 71 | -------------------------------------------------------------------------------- /src_cpp/smart_ptr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include 36 | 37 | template 38 | class smart_ptr { 39 | private: 40 | typedef int counter_t; 41 | public: 42 | smart_ptr() : pointer(NULL), rc(NULL), detached(false) { } 43 | smart_ptr(T * p) : pointer(p), rc(p ? new counter_t(0) : NULL), detached(false) { increment(); } 44 | smart_ptr(const smart_ptr& rhs) : pointer(rhs.pointer), rc(rhs.rc), detached(rhs.detached) { increment(); } 45 | ~smart_ptr() { 46 | if(rc && decrement() == 0) { if (!detached) delete pointer; delete rc; } 47 | } 48 | void assign(T *p) { 49 | if(rc == NULL && pointer == NULL) { 50 | pointer = p; 51 | rc = (p ? new counter_t(0) : NULL); 52 | increment(); 53 | } else { 54 | throw std::logic_error("smart_ptr: assign: bad usage"); 55 | } 56 | } 57 | void swap(smart_ptr& rhs) { 58 | std::swap(pointer, rhs.pointer); 59 | std::swap(rc, rhs.rc); 60 | } 61 | void detach() { detached = true; } 62 | T *get() const { return pointer; } 63 | smart_ptr& operator=(const smart_ptr& rhs) { 64 | smart_ptr tmp(rhs); 65 | this->swap(tmp); 66 | return *this; 67 | } 68 | T& operator*() { return *pointer; } 69 | const T& operator*() const { return *pointer; } 70 | T* operator->() { return pointer; } 71 | const T* operator->() const { return pointer; } 72 | private: 73 | void increment() { if(rc) ++(*rc); } 74 | counter_t decrement() { return --(*rc); } 75 | 76 | T *pointer; 77 | counter_t *rc; 78 | bool detached; 79 | }; 80 | -------------------------------------------------------------------------------- /src_cpp/utils.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * * 3 | * Copyright (C) 2024 Intel Corporation * 4 | * * 5 | ***************************************************************************** 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 21 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 23 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 24 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 28 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 29 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | ***************************************************************************/ 32 | 33 | #pragma once 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | namespace set_operations { 40 | // to = to \/ from (in place set union) 41 | template 42 | void combine(T1 &to, T2 &from) { 43 | copy(from.begin(), from.end(), inserter(to, to.end())); 44 | } 45 | // from = from \ what (in place set difference) 46 | template 47 | void exclude(T1 &from, T2 &what) { 48 | for (typename T2::iterator what_it = what.begin(); 49 | what_it != what.end(); ++what_it) { 50 | do { 51 | typename T1::iterator it = find(from.begin(), from.end(), *what_it); 52 | if (it != from.end()) 53 | from.erase(it); 54 | else 55 | break; 56 | } while (true); 57 | } 58 | } 59 | // result = one \ two (set difference) 60 | template 61 | void diff(T1 &one, T2 &two, T3 &result) { 62 | set_difference(one.begin(), one.end(), two.begin(), two.end(), inserter(result, result.end())); 63 | } 64 | static inline const std::string to_lower(const std::string &in) { 65 | std::string out = in; 66 | transform(in.begin(), in.end(), out.begin(), ::tolower); 67 | return out; 68 | } 69 | template 70 | void preprocess_list(T &list) { 71 | T tmp; 72 | transform(list.begin(), list.end(), inserter(tmp, tmp.end()), to_lower); 73 | list = tmp; 74 | } 75 | struct case_insens_cmp { 76 | bool operator()(const std::string &lhs, const std::string &rhs) const { 77 | #ifdef WIN_IMB 78 | return stricmp(lhs.c_str(), rhs.c_str()) < 0; 79 | #else 80 | return ::strcasecmp(lhs.c_str(), rhs.c_str()) < 0 ; 81 | #endif 82 | } 83 | }; 84 | } 85 | 86 | --------------------------------------------------------------------------------