├── ChangeLog ├── AUTHORS ├── Makefile.am ├── testing ├── Makefile.am ├── ptest │ └── HPL.dat ├── timer │ └── HPL_timer_walltime.c ├── ptimer │ └── HPL_ptimer_walltime.c └── matgen │ └── HPL_rand.c ├── COPYING ├── include ├── hplai.hh ├── hplai_pmatgen.hh ├── hplai_misc.hh ├── hplai_panel.hh ├── hplai_auxil.hh ├── hpl_pmisc.h ├── hpl_pmatgen.h ├── hplai_ptest.hh ├── hpl_test.h ├── hplai_comm.hh ├── hpl.h ├── hpl_gesv.h ├── hpl_timer.h ├── hpl_ptimer.h ├── hpl_matgen.h └── hpl_misc.h ├── src ├── pgesv │ ├── HPLAI_pagesv.cc │ ├── HPLAI_plindx10.cc │ ├── HPL_pdgesv.c │ └── HPLAI_pagesv0.cc ├── panel │ ├── HPLAI_papanel_disp.cc │ ├── HPLAI_papanel_new.cc │ ├── HPLAI_papanel_free.cc │ ├── HPL_pdpanel_disp.c │ └── HPL_pdpanel_free.c ├── comm │ ├── HPLAI_binit.cc │ ├── HPLAI_copyL.cc │ ├── HPLAI_bcast.cc │ ├── HPLAI_bwait.cc │ ├── HPLAI_send.cc │ ├── HPLAI_recv.cc │ ├── HPL_copyL.c │ ├── HPL_binit.c │ └── HPL_bwait.c ├── grid │ ├── HPL_barrier.c │ ├── HPL_pnum.c │ ├── HPL_grid_exit.c │ ├── HPL_sum.c │ ├── HPL_max.c │ ├── HPL_min.c │ └── HPL_all_reduce.c ├── Makefile.am ├── auxil │ └── HPL_fprintf.c └── pfact │ ├── HPLAI_alocmax.cc │ └── HPLAI_pafact.cc ├── NEWS ├── configure.ac ├── COPYRIGHT └── README /ChangeLog: -------------------------------------------------------------------------------- 1 | See `NEWS` 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Junkang Huang 2 | Kan Wu i@wu-kan.cn 3 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = src testing 2 | 3 | AM_CPPFLAGS = -I$(top_srcdir)/include 4 | -------------------------------------------------------------------------------- /testing/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CPPFLAGS = -I$(top_srcdir)/include 3 | 4 | xhpl_LDADD = ../src/libhpl.a 5 | 6 | xhpl_ai_LDADD = ../src/libhpl_ai.a ../src/libhpl.a 7 | 8 | bin_PROGRAMS = xhpl_ai xhpl 9 | 10 | xhpl_ai_SOURCES = \ 11 | matgen/HPL_jumpit.c matgen/HPL_rand.c matgen/HPL_setran.c matgen/HPL_xjumpm.c \ 12 | matgen/HPL_lmul.c matgen/HPL_ladd.c \ 13 | pmatgen/HPLAI_pdmatgen.cc \ 14 | ptest/HPLAI_pddriver.cc ptest/HPLAI_pdinfo.cc ptest/HPLAI_pdtest.cc \ 15 | ptimer/HPL_ptimer.c ptimer/HPL_ptimer_cputime.c ptimer/HPL_ptimer_walltime.c 16 | 17 | xhpl_SOURCES = \ 18 | matgen/HPL_jumpit.c matgen/HPL_rand.c matgen/HPL_setran.c matgen/HPL_xjumpm.c \ 19 | matgen/HPL_lmul.c matgen/HPL_ladd.c \ 20 | pmatgen/HPL_pdmatgen.c \ 21 | ptest/HPL_pddriver.c ptest/HPL_pdinfo.c ptest/HPL_pdtest.c \ 22 | ptimer/HPL_ptimer.c ptimer/HPL_ptimer_cputime.c ptimer/HPL_ptimer_walltime.c 23 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 WuK 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /testing/ptest/HPL.dat: -------------------------------------------------------------------------------- 1 | HPLinpack benchmark input file 2 | Innovative Computing Laboratory, University of Tennessee 3 | HPL.out output file name (if any) 4 | 6 device out (6=stdout,7=stderr,file) 5 | 4 # of problems sizes (N) 6 | 29 30 34 35 Ns 7 | 4 # of NBs 8 | 1 2 3 4 NBs 9 | 0 PMAP process mapping (0=Row-,1=Column-major) 10 | 3 # of process grids (P x Q) 11 | 2 1 4 Ps 12 | 2 4 1 Qs 13 | 16.0 threshold 14 | 3 # of panel fact 15 | 0 1 2 PFACTs (0=left, 1=Crout, 2=Right) 16 | 2 # of recursive stopping criterium 17 | 2 4 NBMINs (>= 1) 18 | 1 # of panels in recursion 19 | 2 NDIVs 20 | 3 # of recursive panel fact. 21 | 0 1 2 RFACTs (0=left, 1=Crout, 2=Right) 22 | 1 # of broadcast 23 | 0 BCASTs (0=1rg,1=1rM,2=2rg,3=2rM,4=Lng,5=LnM) 24 | 1 # of lookahead depth 25 | 0 DEPTHs (>=0) 26 | 2 SWAP (0=bin-exch,1=long,2=mix) 27 | 64 swapping threshold 28 | 0 L1 in (0=transposed,1=no-transposed) form 29 | 0 U in (0=transposed,1=no-transposed) form 30 | 1 Equilibration (0=no,1=yes) 31 | 8 memory alignment in double (> 0) 32 | -------------------------------------------------------------------------------- /include/hplai.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_HH 25 | #define HPLAI_HH 26 | 27 | /* 28 | * --------------------------------------------------------------------- 29 | * Include files 30 | * --------------------------------------------------------------------- 31 | */ 32 | #include "hplai_misc.hh" 33 | #include "hplai_blas.hh" 34 | #include "hplai_auxil.hh" 35 | 36 | #include "hplai_pauxil.hh" 37 | #include "hplai_panel.hh" 38 | #include "hplai_pfact.hh" 39 | #include "hplai_pgesv.hh" 40 | 41 | #include "hplai_pmatgen.hh" 42 | #include "hplai_ptest.hh" 43 | 44 | #endif 45 | /* 46 | * End of hplai.hh 47 | */ 48 | -------------------------------------------------------------------------------- /include/hplai_pmatgen.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_PMATGEN_HH 25 | #define HPLAI_PMATGEN_HH 26 | 27 | /* 28 | * --------------------------------------------------------------------- 29 | * Include files 30 | * --------------------------------------------------------------------- 31 | */ 32 | #include "hplai_misc.hh" 33 | /* 34 | * --------------------------------------------------------------------- 35 | * Function prototypes 36 | * --------------------------------------------------------------------- 37 | */ 38 | #ifdef __cplusplus 39 | extern "C" 40 | { 41 | #endif 42 | 43 | void HPLAI_pdmatgen 44 | STDC_ARGS(( 45 | const HPL_T_grid *, 46 | const int, 47 | const int, 48 | const int, 49 | double *, 50 | const int, 51 | const int)); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | /* 59 | * End of hplai_pmatgen.hh 60 | */ 61 | -------------------------------------------------------------------------------- /src/pgesv/HPLAI_pagesv.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | void HPLAI_pagesv( 36 | HPL_T_grid *GRID, 37 | HPLAI_T_palg *ALGO, 38 | HPLAI_T_pmat *A) 39 | #else 40 | void HPLAI_pagesv(GRID, ALGO, A) 41 | HPL_T_grid *GRID; 42 | HPLAI_T_palg *ALGO; 43 | HPLAI_T_pmat *A; 44 | #endif 45 | { 46 | /* .. 47 | * .. Executable Statements .. 48 | */ 49 | if (A->n <= 0) 50 | return; 51 | 52 | A->info = 0; 53 | 54 | if ((ALGO->depth == 0) || (GRID->npcol == 1)) 55 | { 56 | HPLAI_pagesv0(GRID, ALGO, A); 57 | } 58 | else 59 | { 60 | HPLAI_pagesvK2(GRID, ALGO, A); 61 | } 62 | /* 63 | * Solve upper triangular system 64 | */ 65 | if (A->info == 0) 66 | HPLAI_patrsv(GRID, A); 67 | /* 68 | * End of HPLAI_pagesv 69 | */ 70 | } 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /include/hplai_misc.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_MISC_HH 25 | #define HPLAI_MISC_HH 26 | 27 | // Remove CXX bindings 28 | #if !defined(MPICH_SKIP_MPICXX) 29 | #define MPICH_SKIP_MPICXX 30 | #endif 31 | 32 | #if !defined(OMPI_SKIP_MPICXX) 33 | #define OMPI_SKIP_MPICXX 34 | #endif 35 | 36 | /* 37 | * --------------------------------------------------------------------- 38 | * Include files 39 | * --------------------------------------------------------------------- 40 | */ 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | #include "hpl.h" 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #include 53 | #include 54 | //use blaspp https://bitbucket.org/icl/blaspp/src/master/ 55 | #include 56 | 57 | /* 58 | * --------------------------------------------------------------------- 59 | * #define macros definitions 60 | * --------------------------------------------------------------------- 61 | */ 62 | #ifndef HPLAI_T_AFLOAT 63 | #define HPLAI_T_AFLOAT float 64 | #endif 65 | 66 | #define HPLAI_rone ((HPLAI_T_AFLOAT)HPL_rone) 67 | #define HPLAI_rtwo ((HPLAI_T_AFLOAT)HPL_rtwo) 68 | #define HPLAI_rzero ((HPLAI_T_AFLOAT)HPL_rzero) 69 | 70 | #define HPLAI_PTR HPL_PTR 71 | 72 | #endif 73 | /* 74 | * End of hplai_misc.hh 75 | */ 76 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | ============================================================== 2 | HPL-AI Mixed-Precision Benchmark v2.3d -- April 23, 2021 3 | ============================================================== 4 | 5 | History 6 | 7 | - 03/14/2021 HPL-AI Public release of Version 2.3a 8 | 9 | (deperated when n > 65536) 10 | 11 | Junkang Huang added the parallel GMRES and matrix construction 12 | part () for HPL-AI. 13 | Note that the GMRES did not check the backward-error, which may 14 | cause the result to be invalid. 15 | 16 | Kan Wu reimplemented HPL-AI with some bug fixes and some minor 17 | optimizations. The C souce code of hpl-2.3 remained the same, 18 | while took advantages of modern C++ features such as templates, 19 | overloading, and GPU backends via blaspp: 20 | -- [A] include/hplai*.hh 21 | -- [A] src/*/HPLAI_*.cc 22 | -- [A] testing/*/HPLAI_*.cc 23 | -- [M] configure.ac 24 | -- [M] src/Makefile.am 25 | -- [M] testing/Makefile.am 26 | 27 | - 03/24/2021 HPL-AI Public release of Version 2.3b 28 | 29 | (deperated when n > 65536) 30 | 31 | Kan Wu optimized the device blaspp routines through the 32 | strategy of buffering memory: the program will check whether 33 | the buffer size is sufficient at runtime, free and reallocate 34 | the buffer when necessary. Therefore, it is recommended to 35 | run the benchmark twice with the same parameters to obtain 36 | higher computation rate: 37 | -- [M] src/blas/HPLAI_blas.cc 38 | -- [M] testing/ptest/HPLAI_pdinfo.cc 39 | 40 | - 04/18/2021 HPL-AI Public release of Version 2.3c 41 | 42 | Kan Wu fixed the bug when n > 65536. 43 | -- [M] src/pgesv/HPLAI_pdgesv.cc 44 | 45 | Kan Wu added an option to use the half-precision computeType 46 | in cublasGemmEx (cuda@11: is required): 47 | -- [M] src/blas/HPLAI_blas.cc 48 | 49 | Kan Wu renamed the executable "xhplai" to "xhpl_ai", to be 50 | synced to HPL-AI-NVIDIA v1.0.0 in nvidia:hpc-benchmarks: 51 | -- [M] src/Makefile.am 52 | -- [M] testing/Makefile.am 53 | 54 | Kan Wu released the software at 55 | : 56 | -- [M] testing/ptest/HPLAI_pdinfo.cc 57 | 58 | - 04/23/2021 HPL-AI Public release of Version 2.3d: 59 | 60 | -- [M] testing/ptest/HPLAI_pdinfo.cc 61 | 62 | Kan Wu added support for AscendCL, and added a new strategy 63 | to enable GEMM to use CPU and GPU/NPU at the same time: 64 | -- [M] src/pgesv/HPLAI_blas.cc 65 | 66 | Kan Wu added added a compilation option BLAS_ILP64 to better 67 | support ILP64/32 BLAS: 68 | -- [M] src/pgesv/HPLAI_pdgesv.cc -------------------------------------------------------------------------------- /src/panel/HPLAI_papanel_disp.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | int HPLAI_papanel_disp( 36 | HPLAI_T_panel **PANEL) 37 | #else 38 | int HPLAI_papanel_disp(PANEL) 39 | HPLAI_T_panel **PANEL; 40 | #endif 41 | { 42 | /* 43 | * Purpose 44 | * ======= 45 | * 46 | * HPLAI_papanel_disp deallocates the panel structure and resources and 47 | * stores the error code returned by the panel factorization. 48 | * 49 | * Arguments 50 | * ========= 51 | * 52 | * PANEL (local input/output) HPLAI_T_panel * * 53 | * On entry, PANEL points to the address of the panel data 54 | * structure to be deallocated. 55 | * 56 | * --------------------------------------------------------------------- 57 | */ 58 | /* 59 | * .. Local Variables .. 60 | */ 61 | int mpierr; 62 | /* .. 63 | * .. Executable Statements .. 64 | */ 65 | /* 66 | * Deallocate the panel resources and panel structure 67 | */ 68 | mpierr = HPLAI_papanel_free(*PANEL); 69 | if (*PANEL) 70 | free(*PANEL); 71 | *PANEL = NULL; 72 | 73 | return (mpierr); 74 | /* 75 | * End of HPLAI_papanel_disp 76 | */ 77 | } 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | -------------------------------------------------------------------------------- /src/panel/HPLAI_papanel_new.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | void HPLAI_papanel_new( 36 | HPL_T_grid *GRID, 37 | HPLAI_T_palg *ALGO, 38 | const int M, 39 | const int N, 40 | const int JB, 41 | HPLAI_T_pmat *A, 42 | const int IA, 43 | const int JA, 44 | const int TAG, 45 | HPLAI_T_panel **PANEL) 46 | #else 47 | void HPLAI_papanel_new(GRID, ALGO, M, N, JB, A, IA, JA, TAG, PANEL) 48 | HPL_T_grid *GRID; 49 | HPL_T_palg *ALGO; 50 | const int M; 51 | const int N; 52 | const int JB; 53 | HPLAI_T_pmat *A; 54 | const int IA; 55 | const int JA; 56 | const int TAG; 57 | HPLAI_T_panel **PANEL; 58 | #endif 59 | { 60 | /* 61 | * .. Local Variables .. 62 | */ 63 | HPLAI_T_panel *p = NULL; 64 | /* .. 65 | * .. Executable Statements .. 66 | */ 67 | /* 68 | * Allocate the panel structure - Check for enough memory 69 | */ 70 | if (!(p = (HPLAI_T_panel *)malloc(sizeof(HPLAI_T_panel)))) 71 | { 72 | HPLAI_pabort(__LINE__, "HPLAI_papanel_new", "Memory allocation failed"); 73 | } 74 | 75 | HPLAI_papanel_init(GRID, ALGO, M, N, JB, A, IA, JA, TAG, p); 76 | *PANEL = p; 77 | /* 78 | * End of HPLAI_papanel_new 79 | */ 80 | } 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | -------------------------------------------------------------------------------- /src/comm/HPLAI_binit.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | int HPLAI_binit( 36 | HPLAI_T_panel *PANEL) 37 | #else 38 | int HPLAI_binit(PANEL) 39 | HPLAI_T_panel *PANEL; 40 | #endif 41 | { 42 | /* 43 | * .. Local Variables .. 44 | */ 45 | int ierr; 46 | HPL_T_TOP top; 47 | /* .. 48 | * .. Executable Statements .. 49 | */ 50 | if (PANEL->grid->npcol <= 1) 51 | return (HPL_SUCCESS); 52 | /* 53 | * Retrieve the selected virtual broadcast topology 54 | */ 55 | top = PANEL->algo->btopo; 56 | 57 | switch (top) 58 | { 59 | case HPL_1RING_M: 60 | ierr = HPLAI_binit_1rinM(PANEL); 61 | break; 62 | case HPL_1RING: 63 | ierr = HPLAI_binit_1ring(PANEL); 64 | break; 65 | case HPL_2RING_M: 66 | ierr = HPLAI_binit_2rinM(PANEL); 67 | break; 68 | case HPL_2RING: 69 | ierr = HPLAI_binit_2ring(PANEL); 70 | break; 71 | case HPL_BLONG_M: 72 | ierr = HPLAI_binit_blonM(PANEL); 73 | break; 74 | case HPL_BLONG: 75 | ierr = HPLAI_binit_blong(PANEL); 76 | break; 77 | default: 78 | ierr = HPL_SUCCESS; 79 | } 80 | 81 | return (ierr); 82 | /* 83 | * End of HPLAI_binit 84 | */ 85 | } 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | -------------------------------------------------------------------------------- /include/hplai_panel.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_PANEL_HH 25 | #define HPLAI_PANEL_HH 26 | /* 27 | * --------------------------------------------------------------------- 28 | * Include files 29 | * --------------------------------------------------------------------- 30 | */ 31 | #include "hplai_misc.hh" 32 | 33 | #include "hplai_pfact.hh" 34 | 35 | #ifdef __cplusplus 36 | extern "C" 37 | { 38 | #endif 39 | 40 | /* 41 | * --------------------------------------------------------------------- 42 | * panel function prototypes 43 | * --------------------------------------------------------------------- 44 | */ 45 | 46 | void HPLAI_papanel_new 47 | STDC_ARGS(( 48 | HPL_T_grid *, 49 | HPLAI_T_palg *, 50 | const int, 51 | const int, 52 | const int, 53 | HPLAI_T_pmat *, 54 | const int, 55 | const int, 56 | const int, 57 | HPLAI_T_panel **)); 58 | void HPLAI_papanel_init 59 | STDC_ARGS(( 60 | HPL_T_grid *, 61 | HPLAI_T_palg *, 62 | const int, 63 | const int, 64 | const int, 65 | HPLAI_T_pmat *, 66 | const int, 67 | const int, 68 | const int, 69 | HPLAI_T_panel *)); 70 | int HPLAI_papanel_disp 71 | STDC_ARGS(( 72 | HPLAI_T_panel **)); 73 | int HPLAI_papanel_free 74 | STDC_ARGS(( 75 | HPLAI_T_panel *)); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif 82 | /* 83 | * End of hplai_panel.hh 84 | */ 85 | -------------------------------------------------------------------------------- /include/hplai_auxil.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_AUXIL_HH 25 | #define HPLAI_AUXIL_HH 26 | /* 27 | * --------------------------------------------------------------------- 28 | * Include files 29 | * --------------------------------------------------------------------- 30 | */ 31 | #include "hplai_misc.hh" 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | #define HPLAI_NORM_A HPL_NORM_A 39 | #define HPLAI_NORM_1 HPL_NORM_1 40 | #define HPLAI_NORM_I HPL_NORM_I 41 | #define HPLAI_T_NORM HPL_T_NORM 42 | 43 | #define HPLAI_MACH_EPS HPL_MACH_EPS 44 | #define HPLAI_MACH_SFMIN HPL_MACH_SFMIN 45 | #define HPLAI_MACH_BASE HPL_MACH_BASE 46 | #define HPLAI_MACH_PREC HPL_MACH_PREC 47 | #define HPLAI_MACH_MLEN HPL_MACH_MLEN 48 | #define HPLAI_MACH_RND HPL_MACH_RND 49 | #define HPLAI_MACH_EMIN HPL_MACH_EMIN 50 | #define HPLAI_MACH_RMIN HPL_MACH_RMIN 51 | #define HPLAI_MACH_EMAX HPL_MACH_EMAX 52 | #define HPLAI_MACH_RMAX HPL_MACH_RMAX 53 | #define HPLAI_T_MACH HPL_T_MACH 54 | 55 | #define HPLAI_fprintf HPL_fprintf 56 | #define HPLAI_warn HPL_warn 57 | #define HPLAI_abort HPL_abort 58 | 59 | void HPLAI_alacpy 60 | STDC_ARGS(( 61 | const int, 62 | const int, 63 | const HPLAI_T_AFLOAT *, 64 | const int, 65 | HPLAI_T_AFLOAT *, 66 | const int)); 67 | void HPLAI_alatcpy 68 | STDC_ARGS(( 69 | const int, 70 | const int, 71 | const HPLAI_T_AFLOAT *, 72 | const int, 73 | HPLAI_T_AFLOAT *, 74 | const int)); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | /* 82 | * End of hplai_auxil.hh 83 | */ 84 | -------------------------------------------------------------------------------- /src/panel/HPLAI_papanel_free.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #include "hplai.hh" 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #ifdef STDC_HEADERS 32 | int HPLAI_papanel_free( 33 | HPLAI_T_panel *PANEL) 34 | #else 35 | int HPLAI_papanel_free(PANEL) 36 | HPLAI_T_panel *PANEL; 37 | #endif 38 | { 39 | /* 40 | * Purpose 41 | * ======= 42 | * 43 | * HPL_pdpanel_free deallocates the panel resources and stores the error 44 | * code returned by the panel factorization. 45 | * 46 | * Arguments 47 | * ========= 48 | * 49 | * PANEL (local input/output) HPL_T_panel * 50 | * On entry, PANEL points to the panel data structure from 51 | * which the resources should be deallocated. 52 | * 53 | * --------------------------------------------------------------------- 54 | */ 55 | /* .. 56 | * .. Executable Statements .. 57 | */ 58 | if (PANEL->pmat->info == 0) 59 | PANEL->pmat->info = *(PANEL->DINFO); 60 | #ifdef HPL_CALL_VSIPL 61 | /* 62 | * Release the blocks 63 | */ 64 | (void)vsip_blockrelease_d(PANEL->L1block, VSIP_TRUE); 65 | (void)vsip_blockrelease_d(PANEL->L2block, VSIP_TRUE); 66 | if (PANEL->grid->nprow > 1) 67 | (void)vsip_blockrelease_d(PANEL->Ublock, VSIP_TRUE); 68 | /* 69 | * Destroy blocks 70 | */ 71 | vsip_blockdestroy_d(PANEL->L1block); 72 | vsip_blockdestroy_d(PANEL->L2block); 73 | if (PANEL->grid->nprow > 1) 74 | vsip_blockdestroy_d(PANEL->Ublock); 75 | #endif 76 | 77 | if (PANEL->WORK) 78 | free(PANEL->WORK); 79 | if (PANEL->IWORK) 80 | free(PANEL->IWORK); 81 | 82 | return (MPI_SUCCESS); 83 | /* 84 | * End of HPLAI_papanel_free 85 | */ 86 | } 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | -------------------------------------------------------------------------------- /src/comm/HPLAI_copyL.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | void HPLAI_copyL( 36 | HPLAI_T_panel *PANEL) 37 | #else 38 | void HPLAI_copyL(PANEL) 39 | HPLAI_T_panel *PANEL; 40 | #endif 41 | { 42 | /* 43 | * Purpose 44 | * ======= 45 | * 46 | * HPLAI_copyL copies the panel of columns, the L1 replicated submatrix, 47 | * the pivot array and the info scalar into a contiguous workspace for 48 | * later broadcast. 49 | * 50 | * The copy of this panel into a contiguous buffer can be enforced by 51 | * specifying -DHPL_COPY_L in the architecture specific Makefile. 52 | * 53 | * Arguments 54 | * ========= 55 | * 56 | * PANEL (input/output) HPLAI_T_panel * 57 | * On entry, PANEL points to the current panel data structure 58 | * being broadcast. 59 | * 60 | * --------------------------------------------------------------------- 61 | */ 62 | /* 63 | * .. Local Variables .. 64 | */ 65 | int jb, lda; 66 | /* .. 67 | * .. Executable Statements .. 68 | */ 69 | if (PANEL->grid->mycol == PANEL->pcol) 70 | { 71 | jb = PANEL->jb; 72 | lda = PANEL->lda; 73 | 74 | if (PANEL->grid->myrow == PANEL->prow) 75 | { 76 | HPLAI_alacpy(PANEL->mp - jb, jb, Mptr(PANEL->A, jb, -jb, lda), 77 | lda, PANEL->L2, PANEL->ldl2); 78 | } 79 | else 80 | { 81 | HPLAI_alacpy(PANEL->mp, jb, Mptr(PANEL->A, 0, -jb, lda), 82 | lda, PANEL->L2, PANEL->ldl2); 83 | } 84 | } 85 | /* 86 | * End of HPLAI_copyL 87 | */ 88 | } 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | -------------------------------------------------------------------------------- /src/comm/HPLAI_bcast.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | int HPLAI_bcast( 36 | HPLAI_T_panel *PANEL, 37 | int *IFLAG) 38 | #else 39 | int HPLAI_bcast(PANEL, IFLAG) 40 | HPLAI_T_panel *PANEL; 41 | int *IFLAG; 42 | #endif 43 | { 44 | /* 45 | * .. Local Variables .. 46 | */ 47 | int ierr; 48 | HPL_T_TOP top; 49 | /* .. 50 | * .. Executable Statements .. 51 | */ 52 | if (PANEL == NULL) 53 | { 54 | *IFLAG = HPL_SUCCESS; 55 | return (HPL_SUCCESS); 56 | } 57 | if (PANEL->grid->npcol <= 1) 58 | { 59 | *IFLAG = HPL_SUCCESS; 60 | return (HPL_SUCCESS); 61 | } 62 | /* 63 | * Retrieve the selected virtual broadcast topology 64 | */ 65 | top = PANEL->algo->btopo; 66 | 67 | switch (top) 68 | { 69 | case HPL_1RING_M: 70 | ierr = HPLAI_bcast_1rinM(PANEL, IFLAG); 71 | break; 72 | case HPL_1RING: 73 | ierr = HPLAI_bcast_1ring(PANEL, IFLAG); 74 | break; 75 | case HPL_2RING_M: 76 | ierr = HPLAI_bcast_2rinM(PANEL, IFLAG); 77 | break; 78 | case HPL_2RING: 79 | ierr = HPLAI_bcast_2ring(PANEL, IFLAG); 80 | break; 81 | case HPL_BLONG_M: 82 | ierr = HPLAI_bcast_blonM(PANEL, IFLAG); 83 | break; 84 | case HPL_BLONG: 85 | ierr = HPLAI_bcast_blong(PANEL, IFLAG); 86 | break; 87 | default: 88 | ierr = HPL_SUCCESS; 89 | } 90 | 91 | return (ierr); 92 | /* 93 | * End of HPLAI_bcast 94 | */ 95 | } 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | AC_PREREQ([2.69]) 2 | 3 | AC_INIT(hplai, 2.3b, i@wu-kan.cn) 4 | AC_CONFIG_SRCDIR([include/hplai.hh]) 5 | AC_CONFIG_HEADERS([include/hplai_config.hh]) 6 | 7 | AX_PROG_CC_MPI 8 | 9 | AC_PROG_RANLIB 10 | 11 | AC_PROG_INSTALL 12 | 13 | AM_INIT_AUTOMAKE([subdir-objects]) 14 | 15 | AM_PROG_CC_C_O 16 | 17 | dnl 18 | dnl AX_BLAS requires Fortran compiler and detects fortran libraries in $FLIBS 19 | dnl 20 | dnl AX_BLAS(LIBS="$BLAS_LIBS $LIBS $FLIBS") 21 | dnl 22 | 23 | AC_DEFUN([HPL_BLAS], [ 24 | 25 | AC_PREREQ(2.69) 26 | 27 | hpl_blas_ok=no 28 | 29 | dnl FIXME: add --with-blas="" 30 | 31 | current_LIBS="$LIBS" 32 | 33 | cat < hplvars.txt 34 | name1=OpenBLAS 35 | rout1=dgemm_ 36 | libs1=-lopenblas -lm 37 | 38 | name2=Atlas Fortran BLAS 39 | rout2=dgemm_ 40 | libs2=-lf77blas -latlas 41 | 42 | name3=Sequential Intel MKL LP64 (group) 43 | rout3=dgemm_ 44 | libs3=-Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread 45 | 46 | name4=Sequential Intel MKL LP64 47 | rout4=dgemm_ 48 | libs4=-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread 49 | 50 | name5=AMD's ACML 51 | rout5=dgemm_ 52 | libs5=-lacml -lm 53 | 54 | name6=Accelerate 55 | rout6=dgemm_ 56 | libs6=-framework Accelerate 57 | 58 | name7=Apple VecLib 59 | rout7=dgemm_ 60 | libs7=-framework vecLib 61 | 62 | name8=IBM ESSL 63 | rout8=dgemm_ 64 | libs8=-lessl 65 | 66 | name9=NVIDIA nvblas 67 | rout9=dgemm_ 68 | libs9=-lnvblas 69 | 70 | name10=Generic BLAS 71 | rout10=dgemm_ 72 | libs10=-lblas 73 | 74 | HPLEOF 75 | for hpl_i in 1 2 3 4 5 6 7 8 9 10; 76 | do 77 | if test x$hpl_blas_ok = xno; then 78 | name="`grep ^name${hpl_i}= hplvars.txt | sed s/^name${hpl_i}=//`" 79 | rout="`grep ^rout${hpl_i}= hplvars.txt | sed s/^rout${hpl_i}=//`" 80 | libs="`grep ^libs${hpl_i}= hplvars.txt | sed s/^libs${hpl_i}=//`" 81 | AC_MSG_CHECKING([for [$]rout in [$]name]) 82 | 83 | LIBS="[$]libs" 84 | AC_TRY_LINK_FUNC([$]rout, [hpl_blas_ok=yes;BLAS_LIBS="[$]libs"]) 85 | LIBS="$current_LIBS" 86 | 87 | AC_MSG_RESULT($hpl_blas_ok) 88 | fi 89 | done 90 | rm hplvars.txt 91 | 92 | if test x$hpl_blas_ok = xno; then 93 | dnl 94 | AC_MSG_CHECKING([for dgemm_ in OpenBLAS]) 95 | AC_CHECK_LIB(openblas, dgemm_, [hpl_blas_ok=yes;BLAS_LIBS="-lopenblas"]) 96 | AC_MSG_RESULT($hpl_blas_ok) 97 | dnl 98 | fi 99 | 100 | AC_SUBST(BLAS_LIBS) 101 | 102 | # If present, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: 103 | if test x"$hpl_blas_ok" = xyes; then 104 | ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) 105 | : 106 | else 107 | hpl_blas_ok=no 108 | $2 109 | fi 110 | 111 | ])dnl HPL_BLAS 112 | 113 | HPL_BLAS(LIBS="$BLAS_LIBS $LIBS",AC_MSG_ERROR([BLAS not found])) 114 | 115 | dnl FIXME: test for CBLAS: Atlas, MKL, OpenBLAS, ESSL, ... 116 | dnl FIXME: test for GSL CBLAS 117 | 118 | AC_CHECK_FUNCS([dgemm_]) 119 | 120 | AC_CHECK_HEADERS([mpi.h]) 121 | 122 | AC_CHECK_HEADERS([blas.hh]) 123 | 124 | AC_PROG_CXX 125 | 126 | dnl FIXME: AX_CXX_CHECK_LIB(blaspp, [blas::blaspp_version()]) 127 | AC_CHECK_LIB(blaspp, dgemm_) 128 | 129 | AC_CONFIG_FILES([Makefile src/Makefile testing/Makefile]) 130 | 131 | AC_OUTPUT 132 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | ====================================================================== 2 | -- High Performance Computing Linpack Benchmark (HPL) 3 | HPL - 2.3 - December 2, 2018 4 | Antoine P. Petitet 5 | University of Tennessee, Knoxville 6 | Innovative Computing Laboratory 7 | (C) Copyright 2000-2008 All Rights Reserved 8 | 9 | -- Copyright notice and Licensing terms: 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions 13 | are met: 14 | 15 | 1. Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | 18 | 2. Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions, and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | 22 | 3. All advertising materials mentioning features or use of this 23 | software must display the following acknowledgement: 24 | This product includes software developed at the University of 25 | Tennessee, Knoxville, Innovative Computing Laboratory. 26 | 27 | 4. The name of the University, the name of the Laboratory, or the 28 | names of its contributors may not be used to endorse or promote 29 | products derived from this software without specific written 30 | permission. 31 | 32 | -- Disclaimer: 33 | 34 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | ====================================================================== 46 | -------------------------------------------------------------------------------- /src/comm/HPLAI_bwait.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | int HPLAI_bwait( 36 | HPLAI_T_panel *PANEL) 37 | #else 38 | int HPLAI_bwait(PANEL) 39 | HPLAI_T_panel *PANEL; 40 | #endif 41 | { 42 | /* 43 | * Purpose 44 | * ======= 45 | * 46 | * HPLAI_bwait HPLAI_bwait waits for the row broadcast of the current panel to 47 | * terminate. Successful completion is indicated by the returned error 48 | * code HPL_SUCCESS. 49 | * 50 | * Arguments 51 | * ========= 52 | * 53 | * PANEL (input/output) HPLAI_T_panel * 54 | * On entry, PANEL points to the current panel data structure 55 | * being broadcast. 56 | * 57 | * --------------------------------------------------------------------- 58 | */ 59 | /* 60 | * .. Local Variables .. 61 | */ 62 | int ierr; 63 | HPL_T_TOP top; 64 | /* .. 65 | * .. Executable Statements .. 66 | */ 67 | if (PANEL->grid->npcol <= 1) 68 | return (HPL_SUCCESS); 69 | /* 70 | * Retrieve the selected virtual broadcast topology 71 | */ 72 | top = PANEL->algo->btopo; 73 | 74 | switch (top) 75 | { 76 | case HPL_1RING_M: 77 | ierr = HPLAI_bwait_1rinM(PANEL); 78 | break; 79 | case HPL_1RING: 80 | ierr = HPLAI_bwait_1ring(PANEL); 81 | break; 82 | case HPL_2RING_M: 83 | ierr = HPLAI_bwait_2rinM(PANEL); 84 | break; 85 | case HPL_2RING: 86 | ierr = HPLAI_bwait_2ring(PANEL); 87 | break; 88 | case HPL_BLONG_M: 89 | ierr = HPLAI_bwait_blonM(PANEL); 90 | break; 91 | case HPL_BLONG: 92 | ierr = HPLAI_bwait_blong(PANEL); 93 | break; 94 | default: 95 | ierr = HPL_SUCCESS; 96 | } 97 | 98 | return (ierr); 99 | /* 100 | * End of HPLAI_bwait 101 | */ 102 | } 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | -------------------------------------------------------------------------------- /include/hpl_pmisc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_PMISC_H 47 | #define HPL_PMISC_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_misc.h" 54 | #include "mpi.h" 55 | 56 | #endif 57 | /* 58 | * End of hpl_pmisc.h 59 | */ 60 | -------------------------------------------------------------------------------- /include/hpl_pmatgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_PMATGEN_H 47 | #define HPL_PMATGEN_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_misc.h" 54 | #include "hpl_matgen.h" 55 | 56 | #include "hpl_pmisc.h" 57 | #include "hpl_pauxil.h" 58 | /* 59 | * --------------------------------------------------------------------- 60 | * Function prototypes 61 | * --------------------------------------------------------------------- 62 | */ 63 | void HPL_pdmatgen 64 | STDC_ARGS( ( 65 | const HPL_T_grid *, 66 | const int, 67 | const int, 68 | const int, 69 | double *, 70 | const int, 71 | const int 72 | ) ); 73 | 74 | #endif 75 | /* 76 | * End of hpl_pmatgen.h 77 | */ 78 | -------------------------------------------------------------------------------- /include/hplai_ptest.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_PTEST_HH 25 | #define HPLAI_PTEST_HH 26 | /* 27 | * --------------------------------------------------------------------- 28 | * Include files 29 | * --------------------------------------------------------------------- 30 | */ 31 | 32 | #include "hplai_misc.hh" 33 | 34 | #ifdef __cplusplus 35 | extern "C" 36 | { 37 | #endif 38 | /* 39 | * --------------------------------------------------------------------- 40 | * Data Structures 41 | * --------------------------------------------------------------------- 42 | */ 43 | #define HPLAI_S_test HPL_S_test 44 | #define HPLAI_T_test HPL_T_test 45 | 46 | /* 47 | * --------------------------------------------------------------------- 48 | * #define macro constants for testing only 49 | * --------------------------------------------------------------------- 50 | */ 51 | #define HPLAI_LINE_MAX HPL_LINE_MAX 52 | #define HPLAI_MAX_PARAM HPL_MAX_PARAM 53 | #define HPLAI_ISEED HPL_ISEED 54 | /* 55 | * --------------------------------------------------------------------- 56 | * global timers for timing analysis only 57 | * --------------------------------------------------------------------- 58 | */ 59 | #ifdef HPL_DETAILED_TIMING 60 | #define HPLAI_DETAILED_TIMING 61 | #define HPLAI_TIMING_BEG HPL_TIMING_BEG 62 | #define HPLAI_TIMING_N HPL_TIMING_N 63 | #define HPLAI_TIMING_RPFACT HPL_TIMING_RPFACT 64 | #define HPLAI_TIMING_PFACT HPL_TIMING_PFACT 65 | #define HPLAI_TIMING_MXSWP HPL_TIMING_MXSWP 66 | #define HPLAI_TIMING_UPDATE HPL_TIMING_UPDATE 67 | #define HPLAI_TIMING_LASWP HPL_TIMING_LASWP 68 | #define HPLAI_TIMING_PTRSV HPL_TIMING_PTRSV 69 | #endif 70 | /* 71 | * --------------------------------------------------------------------- 72 | * Function prototypes 73 | * --------------------------------------------------------------------- 74 | */ 75 | void HPLAI_pdinfo 76 | STDC_ARGS(( 77 | HPLAI_T_test *, 78 | int *, 79 | int *, 80 | int *, 81 | int *, 82 | HPL_T_ORDER *, 83 | int *, 84 | int *, 85 | int *, 86 | int *, 87 | HPLAI_T_FACT *, 88 | int *, 89 | int *, 90 | int *, 91 | int *, 92 | int *, 93 | HPLAI_T_FACT *, 94 | int *, 95 | HPLAI_T_TOP *, 96 | int *, 97 | int *, 98 | HPLAI_T_SWAP *, 99 | int *, 100 | int *, 101 | int *, 102 | int *, 103 | int *)); 104 | void HPLAI_pdtest 105 | STDC_ARGS(( 106 | HPLAI_T_test *, 107 | HPL_T_grid *, 108 | HPLAI_T_palg *, 109 | const int, 110 | const int)); 111 | 112 | #ifdef __cplusplus 113 | } 114 | #endif 115 | 116 | #endif 117 | /* 118 | * End of hplai_ptest.hh 119 | */ 120 | -------------------------------------------------------------------------------- /src/grid/HPL_barrier.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_barrier 54 | ( 55 | MPI_Comm COMM 56 | ) 57 | #else 58 | int HPL_barrier 59 | ( COMM ) 60 | MPI_Comm COMM; 61 | #endif 62 | { 63 | /* 64 | * Purpose 65 | * ======= 66 | * 67 | * HPL_barrier blocks the caller until all process members have call it. 68 | * The call returns at any process only after all group members have 69 | * entered the call. 70 | * 71 | * Arguments 72 | * ========= 73 | * 74 | * COMM (global/local input) MPI_Comm 75 | * The MPI communicator identifying the process collection. 76 | * 77 | * --------------------------------------------------------------------- 78 | */ 79 | /* 80 | * .. Local Variables .. 81 | */ 82 | int i=0; 83 | /* .. 84 | * .. Executable Statements .. 85 | */ 86 | return( HPL_broadcast( (void*)(&i), 1, HPL_INT, 0, COMM ) ); 87 | /* 88 | * End of HPL_barrier 89 | */ 90 | } 91 | -------------------------------------------------------------------------------- /src/comm/HPLAI_send.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | /* 34 | * Do not use MPI user-defined data types no matter what. This routine 35 | * is used for small contiguous messages. 36 | */ 37 | #ifdef HPL_USE_MPI_DATATYPE 38 | #undef HPL_USE_MPI_DATATYPE 39 | #endif 40 | 41 | #ifdef STDC_HEADERS 42 | int HPLAI_send( 43 | HPLAI_T_AFLOAT *SBUF, 44 | int SCOUNT, 45 | int DEST, 46 | int STAG, 47 | MPI_Comm COMM) 48 | #else 49 | int HPLAI_send(SBUF, SCOUNT, DEST, STAG, COMM) 50 | HPLAI_T_AFLOAT *SBUF; 51 | int SCOUNT; 52 | int DEST; 53 | int STAG; 54 | MPI_Comm COMM; 55 | #endif 56 | { 57 | /* 58 | * Purpose 59 | * ======= 60 | * 61 | * HPLAI_send is a simple wrapper around MPI_Send. Its main purpose is 62 | * to allow for some experimentation / tuning of this simple routine. 63 | * Successful completion is indicated by the returned error code 64 | * MPI_SUCCESS. In the case of messages of length less than or equal to 65 | * zero, this function returns immediately. 66 | * 67 | * Arguments 68 | * ========= 69 | * 70 | * SBUF (local input) HPLAI_T_AFLOAT * 71 | * On entry, SBUF specifies the starting address of buffer to be 72 | * sent. 73 | * 74 | * SCOUNT (local input) int 75 | * On entry, SCOUNT specifies the number of HPLAI_T_AFLOAT precision 76 | * entries in SBUF. SCOUNT must be at least zero. 77 | * 78 | * DEST (local input) int 79 | * On entry, DEST specifies the rank of the receiving process in 80 | * the communication space defined by COMM. 81 | * 82 | * STAG (local input) int 83 | * On entry, STAG specifies the message tag to be used for this 84 | * communication operation. 85 | * 86 | * COMM (local input) MPI_Comm 87 | * The MPI communicator identifying the communication space. 88 | * 89 | * --------------------------------------------------------------------- 90 | */ 91 | /* 92 | * .. Local Variables .. 93 | */ 94 | #ifdef HPL_USE_MPI_DATATYPE 95 | MPI_Datatype type; 96 | #endif 97 | int ierr; 98 | /* .. 99 | * .. Executable Statements .. 100 | */ 101 | if (SCOUNT <= 0) 102 | return (HPL_SUCCESS); 103 | 104 | #ifdef HPL_USE_MPI_DATATYPE 105 | ierr = MPI_Type_contiguous(SCOUNT, HPLAI_MPI_AFLOAT, &type); 106 | if (ierr == MPI_SUCCESS) 107 | ierr = MPI_Type_commit(&type); 108 | if (ierr == MPI_SUCCESS) 109 | ierr = MPI_Send((void *)(SBUF), 1, type, DEST, STAG, COMM); 110 | if (ierr == MPI_SUCCESS) 111 | ierr = MPI_Type_free(&type); 112 | #else 113 | ierr = MPI_Send((void *)(SBUF), SCOUNT, HPLAI_MPI_AFLOAT, DEST, STAG, COMM); 114 | #endif 115 | return ((ierr == MPI_SUCCESS ? HPL_SUCCESS : HPL_FAILURE)); 116 | /* 117 | * End of HPLAI_send 118 | */ 119 | } 120 | 121 | #ifdef __cplusplus 122 | } 123 | #endif 124 | -------------------------------------------------------------------------------- /testing/timer/HPL_timer_walltime.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | /* 53 | * Purpose 54 | * ======= 55 | * 56 | * HPL_timer_walltime returns the elapsed (wall-clock) time. 57 | * 58 | * 59 | * --------------------------------------------------------------------- 60 | */ 61 | 62 | #include 63 | #include 64 | 65 | #ifdef STDC_HEADERS 66 | double HPL_timer_walltime( void ) 67 | #else 68 | double HPL_timer_walltime() 69 | #endif 70 | { 71 | struct timeval tp; 72 | static long start=0, startu; 73 | 74 | if( !start ) 75 | { 76 | (void) gettimeofday( &tp, NULL ); 77 | start = tp.tv_sec; 78 | startu = tp.tv_usec; 79 | return( HPL_rzero ); 80 | } 81 | (void) gettimeofday( &tp, NULL ); 82 | 83 | return( (double)( tp.tv_sec - start ) + 84 | ( (double)( tp.tv_usec-startu ) / 1000000.0 ) ); 85 | } 86 | /* 87 | * End of HPL_timer_walltime 88 | */ 89 | -------------------------------------------------------------------------------- /include/hpl_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_TEST_H 47 | #define HPL_TEST_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_misc.h" 54 | #include "hpl_blas.h" 55 | #include "hpl_auxil.h" 56 | #include "hpl_gesv.h" 57 | 58 | #include "hpl_matgen.h" 59 | #include "hpl_timer.h" 60 | /* 61 | * --------------------------------------------------------------------- 62 | * Function prototypes 63 | * --------------------------------------------------------------------- 64 | */ 65 | void HPL_dinfo 66 | STDC_ARGS( 67 | ( FILE * *, int *, int *, int *, 68 | HPL_T_FACT *, int *, int *, int *, 69 | int *, int *, HPL_T_FACT *, int *, 70 | double *, double * ) ); 71 | void HPL_dtest 72 | STDC_ARGS( 73 | ( FILE *, const int, const int, const int, 74 | HPL_T_FACT, HPL_T_FACT, const int, const double, 75 | const double, int *, int *, int * ) ); 76 | 77 | #endif 78 | /* 79 | * End of hpl_test.h 80 | */ 81 | -------------------------------------------------------------------------------- /src/comm/HPLAI_recv.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | /* 34 | * Do not use MPI user-defined data types no matter what. This routine 35 | * is used for small contiguous messages. 36 | */ 37 | #ifdef HPL_USE_MPI_DATATYPE 38 | #undef HPL_USE_MPI_DATATYPE 39 | #endif 40 | 41 | #ifdef STDC_HEADERS 42 | int HPLAI_recv( 43 | HPLAI_T_AFLOAT *RBUF, 44 | int RCOUNT, 45 | int SRC, 46 | int RTAG, 47 | MPI_Comm COMM) 48 | #else 49 | int HPLAI_recv(RBUF, RCOUNT, SRC, RTAG, COMM) 50 | HPLAI_T_AFLOAT *RBUF; 51 | int RCOUNT; 52 | int SRC; 53 | int RTAG; 54 | MPI_Comm COMM; 55 | #endif 56 | { 57 | /* 58 | * Purpose 59 | * ======= 60 | * 61 | * HPLAI_recv is a simple wrapper around MPI_Recv. Its main purpose is 62 | * to allow for some experimentation / tuning of this simple routine. 63 | * Successful completion is indicated by the returned error code 64 | * HPL_SUCCESS. In the case of messages of length less than or equal to 65 | * zero, this function returns immediately. 66 | * 67 | * Arguments 68 | * ========= 69 | * 70 | * RBUF (local output) HPLAI_T_AFLOAT * 71 | * On entry, RBUF specifies the starting address of buffer to be 72 | * received. 73 | * 74 | * RCOUNT (local input) int 75 | * On entry, RCOUNT specifies the number of HPLAI_T_AFLOAT precision 76 | * entries in RBUF. RCOUNT must be at least zero. 77 | * 78 | * SRC (local input) int 79 | * On entry, SRC specifies the rank of the sending process in 80 | * the communication space defined by COMM. 81 | * 82 | * RTAG (local input) int 83 | * On entry, STAG specifies the message tag to be used for this 84 | * communication operation. 85 | * 86 | * COMM (local input) MPI_Comm 87 | * The MPI communicator identifying the communication space. 88 | * 89 | * --------------------------------------------------------------------- 90 | */ 91 | /* 92 | * .. Local Variables .. 93 | */ 94 | MPI_Status status; 95 | #ifdef HPL_USE_MPI_DATATYPE 96 | MPI_Datatype type; 97 | #endif 98 | int ierr; 99 | /* .. 100 | * .. Executable Statements .. 101 | */ 102 | if (RCOUNT <= 0) 103 | return (HPL_SUCCESS); 104 | 105 | #ifdef HPL_USE_MPI_DATATYPE 106 | ierr = MPI_Type_contiguous(RCOUNT, HPLAI_MPI_AFLOAT, &type); 107 | if (ierr == MPI_SUCCESS) 108 | ierr = MPI_Type_commit(&type); 109 | if (ierr == MPI_SUCCESS) 110 | ierr = MPI_Recv((void *)(RBUF), 1, type, SRC, RTAG, COMM, 111 | &status); 112 | if (ierr == MPI_SUCCESS) 113 | ierr = MPI_Type_free(&type); 114 | #else 115 | ierr = MPI_Recv((void *)(RBUF), RCOUNT, HPLAI_MPI_AFLOAT, SRC, RTAG, 116 | COMM, &status); 117 | #endif 118 | return ((ierr == MPI_SUCCESS ? HPL_SUCCESS : HPL_FAILURE)); 119 | /* 120 | * End of HPLAI_recv 121 | */ 122 | } 123 | 124 | #ifdef __cplusplus 125 | } 126 | #endif 127 | -------------------------------------------------------------------------------- /src/panel/HPL_pdpanel_disp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_pdpanel_disp 54 | ( 55 | HPL_T_panel * * PANEL 56 | ) 57 | #else 58 | int HPL_pdpanel_disp 59 | ( PANEL ) 60 | HPL_T_panel * * PANEL; 61 | #endif 62 | { 63 | /* 64 | * Purpose 65 | * ======= 66 | * 67 | * HPL_pdpanel_disp deallocates the panel structure and resources and 68 | * stores the error code returned by the panel factorization. 69 | * 70 | * Arguments 71 | * ========= 72 | * 73 | * PANEL (local input/output) HPL_T_panel * * 74 | * On entry, PANEL points to the address of the panel data 75 | * structure to be deallocated. 76 | * 77 | * --------------------------------------------------------------------- 78 | */ 79 | /* 80 | * .. Local Variables .. 81 | */ 82 | int mpierr; 83 | /* .. 84 | * .. Executable Statements .. 85 | */ 86 | /* 87 | * Deallocate the panel resources and panel structure 88 | */ 89 | mpierr = HPL_pdpanel_free( *PANEL ); 90 | if( *PANEL ) free( *PANEL ); 91 | *PANEL = NULL; 92 | 93 | return( mpierr ); 94 | /* 95 | * End of HPL_pdpanel_disp 96 | */ 97 | } 98 | -------------------------------------------------------------------------------- /include/hplai_comm.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | #ifndef HPLAI_COMM_HH 25 | #define HPLAI_COMM_HH 26 | /* 27 | * --------------------------------------------------------------------- 28 | * Include files 29 | * --------------------------------------------------------------------- 30 | */ 31 | #include "hplai_misc.hh" 32 | #include "hplai_panel.hh" 33 | /* 34 | * --------------------------------------------------------------------- 35 | * #define macro constants 36 | * --------------------------------------------------------------------- 37 | */ 38 | 39 | #ifdef __cplusplus 40 | extern "C" 41 | { 42 | #endif 43 | 44 | #define HPLAI_FAILURE HPL_FAILURE 45 | #define HPLAI_SUCCESS HPL_SUCCESS 46 | #define HPLAI_KEEP_TESTING HPL_KEEP_TESTING 47 | /* 48 | * --------------------------------------------------------------------- 49 | * comm function prototypes 50 | * --------------------------------------------------------------------- 51 | */ 52 | int HPLAI_send 53 | STDC_ARGS(( 54 | HPLAI_T_AFLOAT *, 55 | int, 56 | int, 57 | int, 58 | MPI_Comm)); 59 | int HPLAI_recv 60 | STDC_ARGS(( 61 | HPLAI_T_AFLOAT *, 62 | int, 63 | int, 64 | int, 65 | MPI_Comm)); 66 | int HPLAI_sdrv 67 | STDC_ARGS(( 68 | HPLAI_T_AFLOAT *, 69 | int, 70 | int, 71 | HPLAI_T_AFLOAT *, 72 | int, 73 | int, 74 | int, 75 | MPI_Comm)); 76 | int HPLAI_binit 77 | STDC_ARGS(( 78 | HPLAI_T_panel *)); 79 | int HPLAI_bcast 80 | STDC_ARGS(( 81 | HPLAI_T_panel *, 82 | int *)); 83 | int HPLAI_bwait 84 | STDC_ARGS(( 85 | HPLAI_T_panel *)); 86 | int HPLAI_packL 87 | STDC_ARGS(( 88 | HPLAI_T_panel *, 89 | const int, 90 | const int, 91 | const int)); 92 | void HPLAI_copyL 93 | STDC_ARGS(( 94 | HPLAI_T_panel *)); 95 | 96 | int HPLAI_binit_1ring STDC_ARGS((HPLAI_T_panel *)); 97 | int HPLAI_bcast_1ring STDC_ARGS((HPLAI_T_panel *, int *)); 98 | int HPLAI_bwait_1ring STDC_ARGS((HPLAI_T_panel *)); 99 | 100 | int HPLAI_binit_1rinM STDC_ARGS((HPLAI_T_panel *)); 101 | int HPLAI_bcast_1rinM STDC_ARGS((HPLAI_T_panel *, int *)); 102 | int HPLAI_bwait_1rinM STDC_ARGS((HPLAI_T_panel *)); 103 | 104 | int HPLAI_binit_2ring STDC_ARGS((HPLAI_T_panel *)); 105 | int HPLAI_bcast_2ring STDC_ARGS((HPLAI_T_panel *, int *)); 106 | int HPLAI_bwait_2ring STDC_ARGS((HPLAI_T_panel *)); 107 | 108 | int HPLAI_binit_2rinM STDC_ARGS((HPLAI_T_panel *)); 109 | int HPLAI_bcast_2rinM STDC_ARGS((HPLAI_T_panel *, int *)); 110 | int HPLAI_bwait_2rinM STDC_ARGS((HPLAI_T_panel *)); 111 | 112 | int HPLAI_binit_blong STDC_ARGS((HPLAI_T_panel *)); 113 | int HPLAI_bcast_blong STDC_ARGS((HPLAI_T_panel *, int *)); 114 | int HPLAI_bwait_blong STDC_ARGS((HPLAI_T_panel *)); 115 | 116 | int HPLAI_binit_blonM STDC_ARGS((HPLAI_T_panel *)); 117 | int HPLAI_bcast_blonM STDC_ARGS((HPLAI_T_panel *, int *)); 118 | int HPLAI_bwait_blonM STDC_ARGS((HPLAI_T_panel *)); 119 | 120 | #ifdef __cplusplus 121 | } 122 | #endif 123 | 124 | #endif 125 | /* 126 | * End of hplai_comm.hh 127 | */ 128 | -------------------------------------------------------------------------------- /testing/ptimer/HPL_ptimer_walltime.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | /* 53 | * Purpose 54 | * ======= 55 | * 56 | * HPL_ptimer_walltime returns the elapsed (wall-clock) time. 57 | * 58 | * 59 | * --------------------------------------------------------------------- 60 | */ 61 | 62 | #if defined( HPL_USE_GETTIMEOFDAY ) 63 | 64 | #include 65 | #include 66 | 67 | #ifdef STDC_HEADERS 68 | double HPL_ptimer_walltime( void ) 69 | #else 70 | double HPL_ptimer_walltime() 71 | #endif 72 | { 73 | struct timeval tp; 74 | static long start=0, startu; 75 | 76 | if( !start ) 77 | { 78 | (void) gettimeofday( &tp, NULL ); 79 | start = tp.tv_sec; 80 | startu = tp.tv_usec; 81 | return( HPL_rzero ); 82 | } 83 | (void) gettimeofday( &tp, NULL ); 84 | 85 | return( (double)( tp.tv_sec - start ) + 86 | ( (double)( tp.tv_usec-startu ) / 1000000.0 ) ); 87 | } 88 | 89 | #else 90 | 91 | #ifdef STDC_HEADERS 92 | double HPL_ptimer_walltime( void ) 93 | #else 94 | double HPL_ptimer_walltime() 95 | #endif 96 | { 97 | return( MPI_Wtime() ); 98 | } 99 | 100 | #endif 101 | /* 102 | * End of HPL_ptimer_walltime 103 | */ 104 | -------------------------------------------------------------------------------- /include/hpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_H 47 | #define HPL_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * HPL default compile options that can overridden in the Make. 51 | * --------------------------------------------------------------------- 52 | */ 53 | #ifndef HPL_NO_MPI_DATATYPE /* Use MPI user-defined data type */ 54 | #define HPL_USE_MPI_DATATYPE 55 | #endif 56 | 57 | #ifndef HPL_COPY_L /* do not copy L, use MPI user-defined data types */ 58 | #define HPL_NO_COPY_L 59 | #endif 60 | 61 | #ifndef HPL_DETAILED_TIMING /* Do not enable detailed timings */ 62 | #define HPL_NO_DETAILED_TIMING 63 | #endif 64 | 65 | #ifndef HPL_CALL_VSIPL /* Call the Fortran 77 BLAS interface */ 66 | #ifndef HPL_CALL_CBLAS /* there can be only one */ 67 | #define HPL_CALL_FBLAS 68 | #endif 69 | #endif 70 | /* 71 | * --------------------------------------------------------------------- 72 | * Include files 73 | * --------------------------------------------------------------------- 74 | */ 75 | #include "hpl_misc.h" 76 | #include "hpl_blas.h" 77 | #include "hpl_auxil.h" 78 | #include "hpl_gesv.h" 79 | 80 | #include "hpl_pmisc.h" 81 | #include "hpl_pauxil.h" 82 | #include "hpl_panel.h" 83 | #include "hpl_pfact.h" 84 | #include "hpl_pgesv.h" 85 | 86 | #include "hpl_timer.h" 87 | #include "hpl_matgen.h" 88 | #include "hpl_test.h" 89 | 90 | #include "hpl_ptimer.h" 91 | #include "hpl_pmatgen.h" 92 | #include "hpl_ptest.h" 93 | 94 | #endif 95 | /* 96 | * End of hpl.h 97 | */ 98 | -------------------------------------------------------------------------------- /include/hpl_gesv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_GESV_H 47 | #define HPL_GESV_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_misc.h" 54 | #include "hpl_blas.h" 55 | #include "hpl_auxil.h" 56 | /* 57 | * --------------------------------------------------------------------- 58 | * #typedefs and data structures 59 | * --------------------------------------------------------------------- 60 | */ 61 | typedef enum 62 | { 63 | HPL_LEFT_LOOKING = 301, /* Left looking lu fact variant */ 64 | HPL_CROUT = 302, /* Crout lu fact variant */ 65 | HPL_RIGHT_LOOKING = 303 /* Right looking lu fact variant */ 66 | } HPL_T_FACT; 67 | /* 68 | * --------------------------------------------------------------------- 69 | * Function prototypes 70 | * --------------------------------------------------------------------- 71 | */ 72 | void HPL_dgesv 73 | STDC_ARGS( 74 | ( const int, const int, const int, const HPL_T_FACT, 75 | const HPL_T_FACT, const int, double *, 76 | const int, int * ) ); 77 | void HPL_ipid 78 | STDC_ARGS( 79 | ( const int, double *, int *, int *, 80 | int *, int *, int *, int *, 81 | const int, const int, const int, const int, 82 | const int ) ); 83 | 84 | #endif 85 | /* 86 | * End of hpl_gesv.h 87 | */ 88 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/../include 2 | 3 | lib_LIBRARIES = libhpl_ai.a libhpl.a 4 | 5 | libhpl_ai_a_SOURCES = \ 6 | auxil/HPLAI_alatcpy.cc auxil/HPLAI_alacpy.cc \ 7 | blas/HPLAI_blas.cc \ 8 | comm/HPLAI_sdrv.cc comm/HPLAI_send.cc comm/HPLAI_recv.cc comm/HPLAI_bcast.cc \ 9 | comm/HPLAI_binit.cc comm/HPLAI_bwait.cc comm/HPLAI_blong.cc comm/HPLAI_1ring.cc \ 10 | comm/HPLAI_1rinM.cc comm/HPLAI_2rinM.cc comm/HPLAI_2ring.cc comm/HPLAI_blonM.cc comm/HPLAI_packL.cc \ 11 | comm/HPLAI_copyL.cc \ 12 | panel/HPLAI_papanel_disp.cc panel/HPLAI_papanel_free.cc panel/HPLAI_papanel_init.cc panel/HPLAI_papanel_new.cc \ 13 | pauxil/HPL_indxl2g.c pauxil/HPL_indxg2lp.c \ 14 | pauxil/HPLAI_alaswp00N.cc pauxil/HPLAI_alaswp01N.cc pauxil/HPLAI_alaswp01T.cc \ 15 | pauxil/HPLAI_alaswp02N.cc pauxil/HPLAI_alaswp03N.cc pauxil/HPLAI_alaswp03T.cc \ 16 | pauxil/HPLAI_alaswp04N.cc pauxil/HPLAI_alaswp04T.cc pauxil/HPLAI_alaswp05N.cc \ 17 | pauxil/HPLAI_alaswp05T.cc pauxil/HPLAI_alaswp06N.cc pauxil/HPLAI_alaswp06T.cc \ 18 | pauxil/HPLAI_alaswp10N.cc \ 19 | pfact/HPLAI_papanllN.cc pfact/HPLAI_papanllT.cc pfact/HPLAI_papanrlN.cc \ 20 | pfact/HPLAI_papanrlT.cc pfact/HPLAI_parpancrN.cc pfact/HPLAI_parpancrT.cc \ 21 | pfact/HPLAI_parpanllN.cc pfact/HPLAI_parpanllT.cc pfact/HPLAI_parpanrlN.cc pfact/HPLAI_parpanrlT.cc \ 22 | pfact/HPLAI_pamxswp.cc pfact/HPLAI_pafact.cc pfact/HPLAI_alocmax.cc \ 23 | pfact/HPLAI_papancrT.cc pfact/HPLAI_papancrN.cc \ 24 | pfact/HPLAI_alocswpN.cc pfact/HPLAI_alocswpT.cc \ 25 | pgesv/HPLAI_pdgesv.cc \ 26 | pgesv/HPLAI_pagesv0.cc pgesv/HPLAI_pagesv.cc pgesv/HPLAI_pagesvK2.cc \ 27 | pgesv/HPLAI_patrsv.cc \ 28 | pgesv/HPLAI_paupdateNN.cc pgesv/HPLAI_paupdateNT.cc pgesv/HPLAI_paupdateTN.cc pgesv/HPLAI_paupdateTT.cc \ 29 | pgesv/HPLAI_equil.cc pgesv/HPLAI_pipid.cc pgesv/HPLAI_plindx0.cc \ 30 | pgesv/HPLAI_plindx10.cc pgesv/HPLAI_plindx1.cc \ 31 | pgesv/HPLAI_rollN.cc pgesv/HPLAI_rollT.cc pgesv/HPLAI_spreadN.cc pgesv/HPLAI_spreadT.cc \ 32 | pgesv/HPLAI_palaswp00N.cc pgesv/HPLAI_palaswp00T.cc pgesv/HPLAI_palaswp01N.cc pgesv/HPLAI_palaswp01T.cc 33 | 34 | libhpl_a_SOURCES = \ 35 | auxil/HPL_dlatcpy.c auxil/HPL_fprintf.c auxil/HPL_dlacpy.c auxil/HPL_dlamch.c \ 36 | blas/HPL_dscal.c blas/HPL_dtrsm.c blas/HPL_dtrsv.c blas/HPL_idamax.c \ 37 | blas/HPL_dgemv.c blas/HPL_dscal.c blas/HPL_daxpy.c \ 38 | blas/HPL_dcopy.c blas/HPL_dgemm.c blas/HPL_dgemv.c blas/HPL_dger.c \ 39 | comm/HPL_sdrv.c comm/HPL_send.c comm/HPL_recv.c comm/HPL_bcast.c \ 40 | comm/HPL_binit.c comm/HPL_bwait.c comm/HPL_blong.c comm/HPL_1ring.c \ 41 | comm/HPL_1rinM.c comm/HPL_2rinM.c comm/HPL_2ring.c comm/HPL_blonM.c comm/HPL_packL.c \ 42 | grid/HPL_reduce.c grid/HPL_sum.c grid/HPL_grid_info.c grid/HPL_grid_init.c \ 43 | grid/HPL_all_reduce.c grid/HPL_broadcast.c grid/HPL_grid_exit.c grid/HPL_max.c \ 44 | grid/HPL_min.c grid/HPL_all_reduce.c grid/HPL_barrier.c \ 45 | panel/HPL_pdpanel_disp.c panel/HPL_pdpanel_free.c panel/HPL_pdpanel_init.c panel/HPL_pdpanel_new.c \ 46 | pauxil/HPL_pdlamch.c pauxil/HPL_pdlange.c \ 47 | pauxil/HPL_indxg2p.c pauxil/HPL_numroc.c pauxil/HPL_numrocI.c pauxil/HPL_numrocI.c \ 48 | pauxil/HPL_dlaswp00N.c pauxil/HPL_dlaswp01N.c pauxil/HPL_dlaswp01T.c \ 49 | pauxil/HPL_dlaswp02N.c pauxil/HPL_dlaswp03N.c pauxil/HPL_dlaswp03T.c \ 50 | pauxil/HPL_dlaswp04N.c pauxil/HPL_dlaswp04T.c pauxil/HPL_dlaswp05N.c \ 51 | pauxil/HPL_dlaswp05T.c pauxil/HPL_dlaswp06N.c pauxil/HPL_dlaswp06T.c \ 52 | pauxil/HPL_infog2l.c pauxil/HPL_dlaswp10N.c pauxil/HPL_pwarn.c \ 53 | pfact/HPL_pdpanllN.c pfact/HPL_pdpanllT.c pfact/HPL_pdpanrlN.c \ 54 | pfact/HPL_pdpanrlT.c pfact/HPL_pdrpancrN.c pfact/HPL_pdrpancrT.c \ 55 | pfact/HPL_pdrpanllN.c pfact/HPL_pdrpanllT.c pfact/HPL_pdrpanrlN.c pfact/HPL_pdrpanrlT.c \ 56 | pfact/HPL_pdmxswp.c pfact/HPL_pdfact.c pfact/HPL_dlocmax.c \ 57 | pfact/HPL_pdpancrT.c pfact/HPL_pdpancrN.c pfact/HPL_dlocmax.c \ 58 | pfact/HPL_dlocswpN.c pfact/HPL_dlocswpT.c pfact/HPL_pdmxswp.c \ 59 | pfact/HPL_pdpanllN.c pfact/HPL_pdpanllT.c pfact/HPL_pdpanrlN.c \ 60 | pfact/HPL_pdpanrlT.c pfact/HPL_pdrpancrN.c pfact/HPL_pdrpancrT.c \ 61 | pfact/HPL_pdrpanllN.c pfact/HPL_pdrpanllT.c pfact/HPL_pdrpanrlN.c \ 62 | pfact/HPL_pdrpanrlT.c pauxil/HPL_pabort.c pauxil/HPL_pdlamch.c \ 63 | pgesv/HPL_pdgesv0.c pgesv/HPL_pdgesv.c pgesv/HPL_pdgesvK1.c pgesv/HPL_pdgesvK2.c \ 64 | pgesv/HPL_pdupdateNN.c pgesv/HPL_pdupdateNT.c pgesv/HPL_pdupdateTN.c pgesv/HPL_pdupdateTT.c \ 65 | pgesv/HPL_equil.c pgesv/HPL_pipid.c pgesv/HPL_plindx0.c \ 66 | pgesv/HPL_plindx10.c pgesv/HPL_plindx1.c pgesv/HPL_plindx10.c \ 67 | pgesv/HPL_rollN.c pgesv/HPL_rollT.c pgesv/HPL_spreadN.c pgesv/HPL_spreadT.c \ 68 | pgesv/HPL_pdgesv0.c pgesv/HPL_pdgesv.c pgesv/HPL_pdgesvK1.c pgesv/HPL_pdgesvK2.c pgesv/HPL_pdgesv0.c pgesv/HPL_pdgesvK2.c \ 69 | pgesv/HPL_pdlaswp00N.c pgesv/HPL_pdlaswp00T.c pgesv/HPL_pdlaswp01N.c pgesv/HPL_pdlaswp01T.c \ 70 | pgesv/HPL_pdtrsv.c pgesv/HPL_pdupdateNN.c pgesv/HPL_pdupdateNT.c pgesv/HPL_pdupdateTN.c \ 71 | pgesv/HPL_pdupdateTT.c pgesv/HPL_logsort.c pgesv/HPL_perm.c 72 | -------------------------------------------------------------------------------- /include/hpl_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_TIMER_H 47 | #define HPL_TIMER_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_misc.h" 54 | /* 55 | * --------------------------------------------------------------------- 56 | * #define macro constants 57 | * --------------------------------------------------------------------- 58 | */ 59 | #define HPL_NTIMER 64 60 | #define HPL_TIMER_STARTFLAG 5.0 61 | #define HPL_TIMER_ERROR -1.0 62 | /* 63 | * --------------------------------------------------------------------- 64 | * type definitions 65 | * --------------------------------------------------------------------- 66 | */ 67 | typedef enum 68 | { HPL_WALL_TIME = 101, HPL_CPU_TIME = 102 } HPL_T_TIME; 69 | /* 70 | * --------------------------------------------------------------------- 71 | * Function prototypes 72 | * --------------------------------------------------------------------- 73 | */ 74 | double HPL_timer_cputime STDC_ARGS( ( void ) ); 75 | double HPL_timer_walltime STDC_ARGS( ( void ) ); 76 | 77 | void HPL_timer STDC_ARGS( ( const int ) ); 78 | void HPL_timer_boot STDC_ARGS( ( void ) ); 79 | void HPL_timer_enable STDC_ARGS( ( void ) ); 80 | void HPL_timer_disable STDC_ARGS( ( void ) ); 81 | double HPL_timer_inquire 82 | STDC_ARGS( 83 | ( const HPL_T_TIME, const int ) ); 84 | 85 | #endif 86 | /* 87 | * End of hpl_timer.h 88 | */ 89 | -------------------------------------------------------------------------------- /testing/matgen/HPL_rand.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | double HPL_rand( void ) 54 | #else 55 | double HPL_rand() 56 | #endif 57 | { 58 | /* 59 | * Purpose 60 | * ======= 61 | * 62 | * HPL_rand generates the next number in the random sequence. This 63 | * function ensures that this number lies in the interval (-0.5, 0.5]. 64 | * 65 | * The static array irand contains the information (2 integers) required 66 | * to generate the next number in the sequence X(n). This number is 67 | * computed as X(n) = (2^32 * irand[1] + irand[0]) / d - 0.5, where the 68 | * constant d is the largest 64 bit positive unsigned integer. The array 69 | * irand is then updated for the generation of the next number X(n+1) 70 | * in the random sequence as follows X(n+1) = a * X(n) + c. The 71 | * constants a and c should have been preliminarily stored in the arrays 72 | * ias and ics as 2 pairs of integers. The initialization of ias, ics 73 | * and irand is performed by the function HPL_setran. 74 | * 75 | * --------------------------------------------------------------------- 76 | */ 77 | /* 78 | * .. Local Variables .. 79 | */ 80 | int j[2]; 81 | /* .. 82 | * .. Executable Statements .. 83 | */ 84 | HPL_setran( 3, j ); 85 | /* 86 | * return number between -0.5 and 0.5 87 | */ 88 | return( HPL_HALF - 89 | (((j[0] & 65535) + ((unsigned)j[0] >> 16) * HPL_POW16) / HPL_DIVFAC * HPL_HALF + 90 | (j[1] & 65535) + ((unsigned)j[1] >> 16) * HPL_POW16) / HPL_DIVFAC * HPL_HALF ); 91 | /* 92 | * End of HPL_rand 93 | */ 94 | } 95 | -------------------------------------------------------------------------------- /src/panel/HPL_pdpanel_free.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | #include "hpl.h" 48 | 49 | #ifdef STDC_HEADERS 50 | int HPL_pdpanel_free 51 | ( 52 | HPL_T_panel * PANEL 53 | ) 54 | #else 55 | int HPL_pdpanel_free 56 | ( PANEL ) 57 | HPL_T_panel * PANEL; 58 | #endif 59 | { 60 | /* 61 | * Purpose 62 | * ======= 63 | * 64 | * HPL_pdpanel_free deallocates the panel resources and stores the error 65 | * code returned by the panel factorization. 66 | * 67 | * Arguments 68 | * ========= 69 | * 70 | * PANEL (local input/output) HPL_T_panel * 71 | * On entry, PANEL points to the panel data structure from 72 | * which the resources should be deallocated. 73 | * 74 | * --------------------------------------------------------------------- 75 | */ 76 | /* .. 77 | * .. Executable Statements .. 78 | */ 79 | if( PANEL->pmat->info == 0 ) PANEL->pmat->info = *(PANEL->DINFO); 80 | #ifdef HPL_CALL_VSIPL 81 | /* 82 | * Release the blocks 83 | */ 84 | (void) vsip_blockrelease_d( PANEL->L1block, VSIP_TRUE ); 85 | (void) vsip_blockrelease_d( PANEL->L2block, VSIP_TRUE ); 86 | if( PANEL->grid->nprow > 1 ) 87 | (void) vsip_blockrelease_d( PANEL->Ublock, VSIP_TRUE ); 88 | /* 89 | * Destroy blocks 90 | */ 91 | vsip_blockdestroy_d( PANEL->L1block ); 92 | vsip_blockdestroy_d( PANEL->L2block ); 93 | if( PANEL->grid->nprow > 1 ) 94 | vsip_blockdestroy_d( PANEL->Ublock ); 95 | #endif 96 | 97 | if( PANEL->WORK ) free( PANEL->WORK ); 98 | if( PANEL->IWORK ) free( PANEL->IWORK ); 99 | 100 | return( MPI_SUCCESS ); 101 | /* 102 | * End of HPL_pdpanel_free 103 | */ 104 | } 105 | -------------------------------------------------------------------------------- /src/comm/HPL_copyL.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | void HPL_copyL 54 | ( 55 | HPL_T_panel * PANEL 56 | ) 57 | #else 58 | void HPL_copyL 59 | ( PANEL ) 60 | HPL_T_panel * PANEL; 61 | #endif 62 | { 63 | /* 64 | * Purpose 65 | * ======= 66 | * 67 | * HPL_copyL copies the panel of columns, the L1 replicated submatrix, 68 | * the pivot array and the info scalar into a contiguous workspace for 69 | * later broadcast. 70 | * 71 | * The copy of this panel into a contiguous buffer can be enforced by 72 | * specifying -DHPL_COPY_L in the architecture specific Makefile. 73 | * 74 | * Arguments 75 | * ========= 76 | * 77 | * PANEL (input/output) HPL_T_panel * 78 | * On entry, PANEL points to the current panel data structure 79 | * being broadcast. 80 | * 81 | * --------------------------------------------------------------------- 82 | */ 83 | /* 84 | * .. Local Variables .. 85 | */ 86 | int jb, lda; 87 | /* .. 88 | * .. Executable Statements .. 89 | */ 90 | if( PANEL->grid->mycol == PANEL->pcol ) 91 | { 92 | jb = PANEL->jb; lda = PANEL->lda; 93 | 94 | if( PANEL->grid->myrow == PANEL->prow ) 95 | { 96 | HPL_dlacpy( PANEL->mp-jb, jb, Mptr( PANEL->A, jb, -jb, lda ), 97 | lda, PANEL->L2, PANEL->ldl2 ); 98 | } 99 | else 100 | { 101 | HPL_dlacpy( PANEL->mp, jb, Mptr( PANEL->A, 0, -jb, lda ), 102 | lda, PANEL->L2, PANEL->ldl2 ); 103 | } 104 | } 105 | /* 106 | * End of HPL_copyL 107 | */ 108 | } 109 | -------------------------------------------------------------------------------- /src/comm/HPL_binit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_binit 54 | ( 55 | HPL_T_panel * PANEL 56 | ) 57 | #else 58 | int HPL_binit 59 | ( PANEL ) 60 | HPL_T_panel * PANEL; 61 | #endif 62 | { 63 | /* 64 | * Purpose 65 | * ======= 66 | * 67 | * HPL_binit initializes a row broadcast. Successful completion is 68 | * indicated by the returned error code HPL_SUCCESS. 69 | * 70 | * Arguments 71 | * ========= 72 | * 73 | * PANEL (input/output) HPL_T_panel * 74 | * On entry, PANEL points to the current panel data structure 75 | * being broadcast. 76 | * 77 | * --------------------------------------------------------------------- 78 | */ 79 | /* 80 | * .. Local Variables .. 81 | */ 82 | int ierr; 83 | HPL_T_TOP top; 84 | /* .. 85 | * .. Executable Statements .. 86 | */ 87 | if( PANEL->grid->npcol <= 1 ) return( HPL_SUCCESS ); 88 | /* 89 | * Retrieve the selected virtual broadcast topology 90 | */ 91 | top = PANEL->algo->btopo; 92 | 93 | switch( top ) 94 | { 95 | case HPL_1RING_M : ierr = HPL_binit_1rinM( PANEL ); break; 96 | case HPL_1RING : ierr = HPL_binit_1ring( PANEL ); break; 97 | case HPL_2RING_M : ierr = HPL_binit_2rinM( PANEL ); break; 98 | case HPL_2RING : ierr = HPL_binit_2ring( PANEL ); break; 99 | case HPL_BLONG_M : ierr = HPL_binit_blonM( PANEL ); break; 100 | case HPL_BLONG : ierr = HPL_binit_blong( PANEL ); break; 101 | default : ierr = HPL_SUCCESS; 102 | } 103 | 104 | return( ierr ); 105 | /* 106 | * End of HPL_binit 107 | */ 108 | } 109 | -------------------------------------------------------------------------------- /src/grid/HPL_pnum.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_pnum 54 | ( 55 | const HPL_T_grid * GRID, 56 | const int MYROW, 57 | const int MYCOL 58 | ) 59 | #else 60 | int HPL_pnum 61 | ( GRID, MYROW, MYCOL ) 62 | const HPL_T_grid * GRID; 63 | const int MYROW; 64 | const int MYCOL; 65 | #endif 66 | { 67 | /* 68 | * Purpose 69 | * ======= 70 | * 71 | * HPL_pnum determines the rank of a process as a function of its 72 | * coordinates in the grid. 73 | * 74 | * Arguments 75 | * ========= 76 | * 77 | * GRID (local input) const HPL_T_grid * 78 | * On entry, GRID points to the data structure containing the 79 | * process grid information. 80 | * 81 | * MYROW (local input) const int 82 | * On entry, MYROW specifies the row coordinate of the process 83 | * whose rank is to be determined. MYROW must be greater than or 84 | * equal to zero and less than NPROW. 85 | * 86 | * MYCOL (local input) const int 87 | * On entry, MYCOL specifies the column coordinate of the 88 | * process whose rank is to be determined. MYCOL must be greater 89 | * than or equal to zero and less than NPCOL. 90 | * 91 | * --------------------------------------------------------------------- 92 | */ 93 | /* 94 | * .. Local Variables .. 95 | */ 96 | if( GRID->order == HPL_ROW_MAJOR ) 97 | return( MYROW * GRID->npcol + MYCOL ); 98 | else 99 | return( MYCOL * GRID->nprow + MYROW ); 100 | /* 101 | * End of HPL_pnum 102 | */ 103 | } 104 | -------------------------------------------------------------------------------- /src/comm/HPL_bwait.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_bwait 54 | ( 55 | HPL_T_panel * PANEL 56 | ) 57 | #else 58 | int HPL_bwait 59 | ( PANEL ) 60 | HPL_T_panel * PANEL; 61 | #endif 62 | { 63 | /* 64 | * Purpose 65 | * ======= 66 | * 67 | * HPL_bwait HPL_bwait waits for the row broadcast of the current panel to 68 | * terminate. Successful completion is indicated by the returned error 69 | * code HPL_SUCCESS. 70 | * 71 | * Arguments 72 | * ========= 73 | * 74 | * PANEL (input/output) HPL_T_panel * 75 | * On entry, PANEL points to the current panel data structure 76 | * being broadcast. 77 | * 78 | * --------------------------------------------------------------------- 79 | */ 80 | /* 81 | * .. Local Variables .. 82 | */ 83 | int ierr; 84 | HPL_T_TOP top; 85 | /* .. 86 | * .. Executable Statements .. 87 | */ 88 | if( PANEL->grid->npcol <= 1 ) return( HPL_SUCCESS ); 89 | /* 90 | * Retrieve the selected virtual broadcast topology 91 | */ 92 | top = PANEL->algo->btopo; 93 | 94 | switch( top ) 95 | { 96 | case HPL_1RING_M : ierr = HPL_bwait_1rinM( PANEL ); break; 97 | case HPL_1RING : ierr = HPL_bwait_1ring( PANEL ); break; 98 | case HPL_2RING_M : ierr = HPL_bwait_2rinM( PANEL ); break; 99 | case HPL_2RING : ierr = HPL_bwait_2ring( PANEL ); break; 100 | case HPL_BLONG_M : ierr = HPL_bwait_blonM( PANEL ); break; 101 | case HPL_BLONG : ierr = HPL_bwait_blong( PANEL ); break; 102 | default : ierr = HPL_SUCCESS; 103 | } 104 | 105 | return( ierr ); 106 | /* 107 | * End of HPL_bwait 108 | */ 109 | } 110 | -------------------------------------------------------------------------------- /include/hpl_ptimer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_PTIMER_H 47 | #define HPL_PTIMER_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_pmisc.h" 54 | /* 55 | * --------------------------------------------------------------------- 56 | * #define macro constants 57 | * --------------------------------------------------------------------- 58 | */ 59 | #define HPL_NPTIMER 64 60 | #define HPL_PTIMER_STARTFLAG 5.0 61 | #define HPL_PTIMER_ERROR -1.0 62 | /* 63 | * --------------------------------------------------------------------- 64 | * type definitions 65 | * --------------------------------------------------------------------- 66 | */ 67 | typedef enum 68 | { HPL_WALL_PTIME = 101, HPL_CPU_PTIME = 102 } HPL_T_PTIME; 69 | 70 | typedef enum 71 | { HPL_AMAX_PTIME = 201, HPL_AMIN_PTIME = 202, HPL_SUM_PTIME = 203 } 72 | HPL_T_PTIME_OP; 73 | /* 74 | * --------------------------------------------------------------------- 75 | * Function prototypes 76 | * --------------------------------------------------------------------- 77 | */ 78 | double HPL_ptimer_cputime STDC_ARGS( ( void ) ); 79 | double HPL_ptimer_walltime STDC_ARGS( ( void ) ); 80 | 81 | void HPL_ptimer STDC_ARGS( ( const int ) ); 82 | void HPL_ptimer_boot STDC_ARGS( ( void ) ); 83 | void HPL_ptimer_combine 84 | STDC_ARGS( 85 | ( MPI_Comm comm, const HPL_T_PTIME_OP, const HPL_T_PTIME, 86 | const int, const int, double * ) ); 87 | void HPL_ptimer_disable STDC_ARGS( ( void ) ); 88 | void HPL_ptimer_enable STDC_ARGS( ( void ) ); 89 | double HPL_ptimer_inquire 90 | STDC_ARGS( 91 | ( const HPL_T_PTIME, const int ) ); 92 | 93 | #endif 94 | /* 95 | * End of hpl_ptimer.h 96 | */ 97 | -------------------------------------------------------------------------------- /src/auxil/HPL_fprintf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | void HPL_fprintf 54 | ( 55 | FILE * STREAM, 56 | const char * FORM, 57 | ... 58 | ) 59 | #else 60 | void HPL_fprintf( va_alist ) 61 | va_dcl 62 | #endif 63 | { 64 | /* 65 | * Purpose 66 | * ======= 67 | * 68 | * HPL_fprintf is a wrapper around fprintf flushing the output stream. 69 | * 70 | * 71 | * Arguments 72 | * ========= 73 | * 74 | * STREAM (local input) FILE * 75 | * On entry, STREAM specifies the output stream. 76 | * 77 | * FORM (local input) const char * 78 | * On entry, FORM specifies the format, i.e., how the subsequent 79 | * arguments are converted for output. 80 | * 81 | * (local input) ... 82 | * On entry, ... is the list of arguments to be printed within 83 | * the format string. 84 | * 85 | * --------------------------------------------------------------------- 86 | */ 87 | /* 88 | * .. Local Variables .. 89 | */ 90 | va_list argptr; 91 | char cline[256]; 92 | #ifndef STDC_HEADERS 93 | FILE * STREAM; 94 | char * FORM; 95 | #endif 96 | /* .. 97 | * .. Executable Statements .. 98 | */ 99 | #ifdef STDC_HEADERS 100 | va_start( argptr, FORM ); 101 | #else 102 | va_start( argptr ); 103 | STREAM = va_arg( argptr, FILE * ); 104 | FORM = va_arg( argptr, char * ); 105 | #endif 106 | (void) vsprintf( cline, FORM, argptr ); 107 | va_end( argptr ); 108 | 109 | (void) fprintf( STREAM, "%s", cline ); 110 | (void) fflush( STREAM ); 111 | /* 112 | * End of HPL_fprintf 113 | */ 114 | } 115 | -------------------------------------------------------------------------------- /src/pfact/HPLAI_alocmax.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | void HPLAI_alocmax( 36 | HPLAI_T_panel *PANEL, 37 | const int N, 38 | const int II, 39 | const int JJ, 40 | HPLAI_T_AFLOAT *WORK) 41 | #else 42 | void HPLAI_alocmax(PANEL, N, II, JJ, WORK) 43 | HPLAI_T_panel *PANEL; 44 | const int N; 45 | const int II; 46 | const int JJ; 47 | HPLAI_T_AFLOAT *WORK; 48 | #endif 49 | { 50 | /* 51 | * Purpose 52 | * ======= 53 | * 54 | * HPLAI_alocmax finds the maximum entry in the current column and packs 55 | * the useful information in WORK[0:3]. On exit, WORK[0] contains the 56 | * local maximum absolute value scalar, WORK[1] is the corresponding 57 | * local row index, WORK[2] is the corresponding global row index, and 58 | * WORK[3] is the coordinate of the process owning this max. When N is 59 | * less than 1, the WORK[0:2] is initialized to zero, and WORK[3] is set 60 | * to the total number of process rows. 61 | * 62 | * Arguments 63 | * ========= 64 | * 65 | * PANEL (local input/output) HPLAI_T_panel * 66 | * On entry, PANEL points to the data structure containing the 67 | * panel information. 68 | * 69 | * N (local input) const int 70 | * On entry, N specifies the local number of rows of the column 71 | * of A on which we operate. 72 | * 73 | * II (local input) const int 74 | * On entry, II specifies the row offset where the column to be 75 | * operated on starts with respect to the panel. 76 | * 77 | * JJ (local input) const int 78 | * On entry, JJ specifies the column offset where the column to 79 | * be operated on starts with respect to the panel. 80 | * 81 | * WORK (local workspace) HPLAI_T_AFLOAT * 82 | * On entry, WORK is a workarray of size at least 4. On exit, 83 | * WORK[0] contains the local maximum absolute value scalar, 84 | * WORK[1] contains the corresponding local row index, WORK[2] 85 | * contains the corresponding global row index, and WORK[3] is 86 | * the coordinate of process owning this max. 87 | * 88 | * --------------------------------------------------------------------- 89 | */ 90 | /* 91 | * .. Local Variables .. 92 | */ 93 | HPLAI_T_AFLOAT *A; 94 | int kk, igindx, ilindx, myrow, nb, nprow; 95 | /* .. 96 | * .. Executable Statements .. 97 | */ 98 | if (N > 0) 99 | { 100 | A = Mptr(PANEL->A, II, JJ, PANEL->lda); 101 | myrow = PANEL->grid->myrow; 102 | nprow = PANEL->grid->nprow; 103 | nb = PANEL->nb; 104 | kk = PANEL->ii + II + (ilindx = blas::iamax(N, A, 1)); 105 | Mindxl2g(igindx, kk, nb, nb, myrow, 0, nprow); 106 | /* 107 | * WORK[0] := local maximum absolute value scalar, 108 | * WORK[1] := corresponding local row index, 109 | * WORK[2] := corresponding global row index, 110 | * WORK[3] := coordinate of process owning this max. 111 | */ 112 | WORK[0] = A[ilindx]; 113 | WORK[1] = (HPLAI_T_AFLOAT)(ilindx); 114 | WORK[2] = (HPLAI_T_AFLOAT)(igindx); 115 | WORK[3] = (HPLAI_T_AFLOAT)(myrow); 116 | } 117 | else 118 | { 119 | /* 120 | * If I do not have any row of A, then set the coordinate of the process 121 | * (WORK[3]) owning this "ghost" row, such that it will never be used, 122 | * even if there are only zeros in the current column of A. 123 | */ 124 | WORK[0] = WORK[1] = WORK[2] = HPLAI_rzero; 125 | WORK[3] = (HPLAI_T_AFLOAT)(PANEL->grid->nprow); 126 | } 127 | /* 128 | * End of HPLAI_alocmax 129 | */ 130 | } 131 | 132 | #ifdef __cplusplus 133 | } 134 | #endif 135 | -------------------------------------------------------------------------------- /src/grid/HPL_grid_exit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_grid_exit 54 | ( 55 | HPL_T_grid * GRID 56 | ) 57 | #else 58 | int HPL_grid_exit 59 | ( GRID ) 60 | HPL_T_grid * GRID; 61 | #endif 62 | { 63 | /* 64 | * Purpose 65 | * ======= 66 | * 67 | * HPL_grid_exit marks the process grid object for deallocation. The 68 | * returned error code MPI_SUCCESS indicates successful completion. 69 | * Other error codes are (MPI) implementation dependent. 70 | * 71 | * Arguments 72 | * ========= 73 | * 74 | * GRID (local input/output) HPL_T_grid * 75 | * On entry, GRID points to the data structure containing the 76 | * process grid to be released. 77 | * 78 | * --------------------------------------------------------------------- 79 | */ 80 | /* 81 | * .. Local Variables .. 82 | */ 83 | int hplerr = MPI_SUCCESS, mpierr; 84 | /* .. 85 | * .. Executable Statements .. 86 | */ 87 | if( GRID->all_comm != MPI_COMM_NULL ) 88 | { 89 | mpierr = MPI_Comm_free( &(GRID->row_comm) ); 90 | if( mpierr != MPI_SUCCESS ) hplerr = mpierr; 91 | mpierr = MPI_Comm_free( &(GRID->col_comm) ); 92 | if( mpierr != MPI_SUCCESS ) hplerr = mpierr; 93 | mpierr = MPI_Comm_free( &(GRID->all_comm) ); 94 | if( mpierr != MPI_SUCCESS ) hplerr = mpierr; 95 | } 96 | 97 | GRID->order = HPL_COLUMN_MAJOR; 98 | 99 | GRID->iam = GRID->myrow = GRID->mycol = -1; 100 | GRID->nprow = GRID->npcol = GRID->nprocs = -1; 101 | 102 | GRID->row_ip2 = GRID->row_hdim = GRID->row_ip2m1 = GRID->row_mask = -1; 103 | GRID->col_ip2 = GRID->col_hdim = GRID->col_ip2m1 = GRID->col_mask = -1; 104 | 105 | return( hplerr ); 106 | /* 107 | * End of HPL_grid_exit 108 | */ 109 | } 110 | -------------------------------------------------------------------------------- /src/pfact/HPLAI_pafact.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | void HPLAI_pafact( 36 | HPLAI_T_panel *PANEL) 37 | #else 38 | void HPLAI_pafact(PANEL) 39 | HPLAI_T_panel *PANEL; 40 | #endif 41 | { 42 | /* 43 | * Purpose 44 | * ======= 45 | * 46 | * HPLAI_pafact recursively factorizes a 1-dimensional panel of columns. 47 | * The RPFACT function pointer specifies the recursive algorithm to be 48 | * used, either Crout, Left- or Right looking. NBMIN allows to vary the 49 | * recursive stopping criterium in terms of the number of columns in the 50 | * panel, and NDIV allows to specify the number of subpanels each panel 51 | * should be divided into. Usuallly a value of 2 will be chosen. Finally 52 | * PFACT is a function pointer specifying the non-recursive algorithm to 53 | * to be used on at most NBMIN columns. One can also choose here between 54 | * Crout, Left- or Right looking. Empirical tests seem to indicate that 55 | * values of 4 or 8 for NBMIN give the best results. 56 | * 57 | * Bi-directional exchange is used to perform the swap::broadcast 58 | * operations at once for one column in the panel. This results in a 59 | * lower number of slightly larger messages than usual. On P processes 60 | * and assuming bi-directional links, the running time of this function 61 | * can be approximated by (when N is equal to N0): 62 | * 63 | * N0 * log_2( P ) * ( lat + ( 2*N0 + 4 ) / bdwth ) + 64 | * N0^2 * ( M - N0/3 ) * gam2-3 65 | * 66 | * where M is the local number of rows of the panel, lat and bdwth are 67 | * the latency and bandwidth of the network for HPLAI_T_AFLOAT precision real 68 | * words, and gam2-3 is an estimate of the Level 2 and Level 3 BLAS 69 | * rate of execution. The recursive algorithm allows indeed to almost 70 | * achieve Level 3 BLAS performance in the panel factorization. On a 71 | * large number of modern machines, this operation is however latency 72 | * bound, meaning that its cost can be estimated by only the latency 73 | * portion N0 * log_2(P) * lat. Mono-directional links will HPLAI_T_AFLOAT this 74 | * communication cost. 75 | * 76 | * Arguments 77 | * ========= 78 | * 79 | * PANEL (local input/output) HPLAI_T_panel * 80 | * On entry, PANEL points to the data structure containing the 81 | * panel information. 82 | * 83 | * --------------------------------------------------------------------- 84 | */ 85 | /* 86 | * .. Local Variables .. 87 | */ 88 | void *vptr = NULL; 89 | int align, jb; 90 | /* .. 91 | * .. Executable Statements .. 92 | */ 93 | jb = PANEL->jb; 94 | PANEL->n -= jb; 95 | PANEL->ja += jb; 96 | 97 | if ((PANEL->grid->mycol != PANEL->pcol) || (jb <= 0)) 98 | return; 99 | #ifdef HPL_DETAILED_TIMING 100 | HPL_ptimer(HPL_TIMING_RPFACT); 101 | #endif 102 | align = PANEL->algo->align; 103 | vptr = (void *)malloc(((size_t)(align) + 104 | (size_t)(((4 + ((unsigned int)(jb) << 1)) << 1))) * 105 | sizeof(HPLAI_T_AFLOAT)); 106 | if (vptr == NULL) 107 | { 108 | HPLAI_pabort(__LINE__, "HPLAI_pafact", "Memory allocation failed"); 109 | } 110 | /* 111 | * Factor the panel - Update the panel pointers 112 | */ 113 | PANEL->algo->rffun(PANEL, PANEL->mp, jb, 0, (HPLAI_T_AFLOAT *)HPL_PTR(vptr, ((size_t)(align) * sizeof(HPLAI_T_AFLOAT)))); 114 | if (vptr) 115 | free(vptr); 116 | 117 | PANEL->A = Mptr(PANEL->A, 0, jb, PANEL->lda); 118 | PANEL->nq -= jb; 119 | PANEL->jj += jb; 120 | #ifdef HPL_DETAILED_TIMING 121 | HPL_ptimer(HPL_TIMING_RPFACT); 122 | #endif 123 | /* 124 | * End of HPLAI_pafact 125 | */ 126 | } 127 | 128 | #ifdef __cplusplus 129 | } 130 | #endif 131 | -------------------------------------------------------------------------------- /include/hpl_matgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_MATGEN_H 47 | #define HPL_MATGEN_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #include "hpl_misc.h" 54 | #include "hpl_blas.h" 55 | #include "hpl_auxil.h" 56 | /* 57 | * --------------------------------------------------------------------- 58 | * #define macro constants 59 | * --------------------------------------------------------------------- 60 | */ 61 | #define HPL_MULT0 1284865837 62 | #define HPL_MULT1 1481765933 63 | #define HPL_IADD0 1 64 | #define HPL_IADD1 0 65 | #define HPL_DIVFAC 2147483648.0 66 | #define HPL_POW16 65536.0 67 | #define HPL_HALF 0.5 68 | /* 69 | * --------------------------------------------------------------------- 70 | * Function prototypes 71 | * --------------------------------------------------------------------- 72 | */ 73 | void HPL_dmatgen 74 | STDC_ARGS( ( 75 | const int, 76 | const int, 77 | double *, 78 | const int, 79 | const int 80 | ) ); 81 | void HPL_lmul 82 | STDC_ARGS( ( 83 | int *, 84 | int *, 85 | int * 86 | ) ); 87 | void HPL_ladd 88 | STDC_ARGS( ( 89 | int *, 90 | int *, 91 | int * 92 | ) ); 93 | void HPL_xjumpm 94 | STDC_ARGS( ( 95 | const int, 96 | int *, 97 | int *, 98 | int *, 99 | int *, 100 | int *, 101 | int * 102 | ) ); 103 | void HPL_setran 104 | STDC_ARGS( ( 105 | const int, 106 | int * 107 | ) ); 108 | void HPL_jumpit 109 | STDC_ARGS( ( 110 | int *, 111 | int *, 112 | int *, 113 | int * 114 | ) ); 115 | double HPL_rand STDC_ARGS( ( void ) ); 116 | 117 | #endif 118 | /* 119 | * End of hpl_matgen.h 120 | */ 121 | -------------------------------------------------------------------------------- /src/pgesv/HPLAI_plindx10.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef STDC_HEADERS 30 | void HPLAI_plindx10( 31 | HPLAI_T_panel *PANEL, 32 | const int K, 33 | const int *IPID, 34 | int *IPLEN, 35 | int *IPMAP, 36 | int *IPMAPM1) 37 | #else 38 | void HPLAI_plindx10(PANEL, K, IPID, IPLEN, IPMAP, IPMAPM1) 39 | HPLAI_T_panel *PANEL; 40 | const int K; 41 | const int *IPID; 42 | int *IPLEN; 43 | int *IPMAP; 44 | int *IPMAPM1; 45 | #endif 46 | { 47 | /* 48 | * Purpose 49 | * ======= 50 | * 51 | * HPLAI_plindx10 computes three arrays IPLEN, IPMAP and IPMAPM1 that 52 | * contain the logarithmic mapping information for the spreading phase. 53 | * 54 | * Arguments 55 | * ========= 56 | * 57 | * PANEL (local input/output) HPLAI_T_panel * 58 | * On entry, PANEL points to the data structure containing the 59 | * panel information. 60 | * 61 | * K (global input) const int 62 | * On entry, K specifies the number of entries in IPID. K is at 63 | * least 2*N, and at most 4*N. 64 | * 65 | * IPID (global input) const int * 66 | * On entry, IPID is an array of length K. The first K entries 67 | * of that array contain the src and final destination resulting 68 | * from the application of the interchanges. 69 | * 70 | * IPLEN (global output) int * 71 | * On entry, IPLEN is an array of dimension NPROW + 1. On exit, 72 | * this array is such that IPLEN[i] is the number of rows of A 73 | * in the processes before process IMAP[i] after the sort, with 74 | * the convention that IPLEN[nprow] is the total number of rows. 75 | * In other words, IPLEN[i+1] - IPLEN[i] is the local number of 76 | * rows of A that should be moved for each process. IPLEN is 77 | * such that the number of rows of the source process row can be 78 | * computed as IPLEN[1] - IPLEN[0], and the remaining entries of 79 | * this array are sorted so that the quantities IPLEN[i+1] - 80 | * IPLEN[i] are logarithmically sorted. 81 | * 82 | * IPMAP (global output) int * 83 | * On entry, IPMAP is an array of dimension NPROW. On exit, this 84 | * array contains the logarithmic mapping of the processes. In 85 | * other words, IPMAP[myrow] is the corresponding sorted process 86 | * coordinate. 87 | * 88 | * IPMAPM1 (global output) int * 89 | * On entry, IPMAPM1 is an array of dimension NPROW. On exit, 90 | * this array contains the inverse of the logarithmic mapping 91 | * contained in IPMAP: IPMAPM1[ IPMAP[i] ] = i, for all i in 92 | * [0.. NPROW) 93 | * 94 | * --------------------------------------------------------------------- 95 | */ 96 | /* 97 | * .. Local Variables .. 98 | */ 99 | int dst, dstrow, i, ia, icurrow, jb, nb, 100 | nprow, src, srcrow; 101 | /* .. 102 | * .. Executable Statements .. 103 | */ 104 | nprow = PANEL->grid->nprow; 105 | jb = PANEL->jb; 106 | nb = PANEL->nb; 107 | ia = PANEL->ia; 108 | icurrow = PANEL->prow; 109 | /* 110 | * Compute redundantly the local number of rows that each process has 111 | * and that belong to U in IPLEN[1 .. nprow+1] 112 | */ 113 | for (i = 0; i <= nprow; i++) 114 | IPLEN[i] = 0; 115 | 116 | for (i = 0; i < K; i += 2) 117 | { 118 | src = IPID[i]; 119 | Mindxg2p(src, nb, nb, srcrow, 0, nprow); 120 | if (srcrow == icurrow) 121 | { 122 | dst = IPID[i + 1]; 123 | Mindxg2p(dst, nb, nb, dstrow, 0, nprow); 124 | if ((dstrow != srcrow) || (dst - ia < jb)) 125 | IPLEN[dstrow + 1]++; 126 | } 127 | } 128 | /* 129 | * Logarithmic sort of the processes - compute IPMAP, IPLEN and IPMAPM1 130 | * (the inverse of IPMAP) 131 | */ 132 | HPLAI_logsort(nprow, icurrow, IPLEN, IPMAP, IPMAPM1); 133 | /* 134 | * End of HPLAI_plindx10 135 | */ 136 | } 137 | -------------------------------------------------------------------------------- /src/pgesv/HPL_pdgesv.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | void HPL_pdgesv 54 | ( 55 | HPL_T_grid * GRID, 56 | HPL_T_palg * ALGO, 57 | HPL_T_pmat * A 58 | ) 59 | #else 60 | void HPL_pdgesv 61 | ( GRID, ALGO, A ) 62 | HPL_T_grid * GRID; 63 | HPL_T_palg * ALGO; 64 | HPL_T_pmat * A; 65 | #endif 66 | { 67 | /* 68 | * Purpose 69 | * ======= 70 | * 71 | * HPL_pdgesv factors a N+1-by-N matrix using LU factorization with row 72 | * partial pivoting. The main algorithm is the "right looking" variant 73 | * with or without look-ahead. The lower triangular factor is left 74 | * unpivoted and the pivots are not returned. The right hand side is the 75 | * N+1 column of the coefficient matrix. 76 | * 77 | * Arguments 78 | * ========= 79 | * 80 | * GRID (local input) HPL_T_grid * 81 | * On entry, GRID points to the data structure containing the 82 | * process grid information. 83 | * 84 | * ALGO (global input) HPL_T_palg * 85 | * On entry, ALGO points to the data structure containing the 86 | * algorithmic parameters. 87 | * 88 | * A (local input/output) HPL_T_pmat * 89 | * On entry, A points to the data structure containing the local 90 | * array information. 91 | * 92 | * --------------------------------------------------------------------- 93 | */ 94 | /* .. 95 | * .. Executable Statements .. 96 | */ 97 | if( A->n <= 0 ) return; 98 | 99 | A->info = 0; 100 | 101 | if( ( ALGO->depth == 0 ) || ( GRID->npcol == 1 ) ) 102 | { 103 | HPL_pdgesv0( GRID, ALGO, A ); 104 | } 105 | else 106 | { 107 | HPL_pdgesvK2( GRID, ALGO, A ); 108 | } 109 | /* 110 | * Solve upper triangular system 111 | */ 112 | if( A->info == 0 ) HPL_pdtrsv( GRID, A ); 113 | /* 114 | * End of HPL_pdgesv 115 | */ 116 | } 117 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ############################################################## 3 | # 4 | # HPL-AI Mixed-Precision Benchmark v2.3d -- April 23, 2021 5 | # 6 | ############################################################## 7 | # 8 | # Check out for 9 | # the full document and the latest information. 10 | # 11 | ############################################################## 12 | # 13 | # A quick start to build and run a few tests via spack: 14 | # 15 | # git clone https://github.com/SYSU-SCC/sysu-scc-spack-repo 16 | # spack repo add --scope=site sysu-scc-spack-repo 17 | # spack install sysu-scc-spack-repo.hpl-ai 18 | # spack load hpl-ai 19 | # cp `spack location --install-dir hpl-ai`/bin/HPL.dat HPL.dat 20 | # mpirun -n 4 xhpl_ai 21 | # 22 | ############################################################## 23 | # 24 | # build from source: 25 | # 26 | # First the following softwares are required on your system: 27 | # C&C++ compiler, autoconf, autoconf-archive, automake, mpi, 28 | # blas, blaspp 29 | # 30 | # You can easily install and load the requirements via spack 31 | # . 32 | # 33 | # I just tested with the followings, while other versions or 34 | # libraries might work as well: 35 | 36 | spack unload -a 37 | spack load gcc@7.5.0 38 | spack load autoconf@2.69%gcc@7.5.0 39 | spack load autoconf-archive@2019.01.06%gcc@7.5.0 40 | spack load automake@1.16.2%gcc@7.5.0 41 | spack load mpich@3.2.1%gcc@7.5.0 42 | spack load blaspp%gcc@7.5.0+openmp \ 43 | ^openblas%gcc@7.5.0 threads=openmp 44 | 45 | # Then boostrap the configuration files by typing: 46 | 47 | autoreconf -ivf 48 | 49 | # The user is given the opportunity to compile the software 50 | # with some specific compile options: 51 | # 52 | # CPPFLAGS=" -DHPLAI_T_AFLOAT=double " 53 | # 54 | # CPPFLAGS=" -DHPLAI_DEVICE_BLASPP_GEMM " 55 | # 56 | # CPPFLAGS=" -DHPLAI_DEVICE_BLASPP_TRSM " 57 | # 58 | # CPPFLAGS=" -DHPLAI_GEN_BLASPP_TRSM " 59 | # (generic trsm had not been implemented in blaspp@2021.04.01 60 | # 61 | # CPPFLAGS=" -DHPL_COPY_L " 62 | # 63 | # CPPFLAGS=" -DHPL_CALL_CBLAS " 64 | # 65 | # CPPFLAGS=" -DHPL_CALL_VSIPL " 66 | # (deperated 67 | # 68 | # CPPFLAGS=" -DHPL_DETAILED_TIMING " 69 | # (deperated 70 | # 71 | # To configure the build and prepare for compilation run: 72 | 73 | if true; then 74 | ./configure 75 | else 76 | # Note: to use device blaspp routines, you may need to 77 | # enable device support of blaspp: 78 | # 79 | # spack load blaspp%gcc@7.5.0+openmp+cuda 80 | # 81 | # and then: 82 | # 83 | ./configure \ 84 | LIBS=" -lcudart -lcublas " \ 85 | CPPFLAGS=" -DBLASPP_WITH_CUBLAS \ 86 | -DHPLAI_DEVICE_BLASPP_GEMM \ 87 | -DHPLAI_DEVICE_BLASPP_TRSM " 88 | fi 89 | 90 | # Then compile: 91 | 92 | make -j 93 | 94 | # The configuration file must be called HPL.dat. 95 | # 96 | # You can copy the configuration file from the original HPL, 97 | # or create a configuration file anew. 98 | # 99 | # Most of the performance parameters can be tuned. 100 | 101 | if true; then 102 | cat >HPL.dat <= 1) 120 | 1 # of panels in recursion 121 | 2 NDIVs 122 | 1 # of recursive panel fact. 123 | 2 1 0 RFACTs (0=left, 1=Crout, 2=Right) 124 | 1 # of broadcast 125 | 0 2 BCASTs (0=1rg,1=1rM,2=2rg,3=2rM,4=Lng,5=LnM) 126 | 1 # of lookahead depth 127 | 1 DEPTHs (>=0) 128 | 1 SWAP (0=bin-exch,1=long,2=mix) 129 | 192 swapping threshold 130 | 1 L1 in (0=transposed,1=no-transposed) form 131 | 0 U in (0=transposed,1=no-transposed) form 132 | 1 Equilibration (0=no,1=yes) 133 | 16 memory alignment in HPLAI_T_AFLOAT (> 0) 134 | EOF 135 | else 136 | cp testing/ptest/HPL.dat HPL.dat 137 | fi 138 | 139 | # Finally run and compare with the original hpl-2.3: 140 | 141 | OMP_NUM_THREADS=2 $(which mpirun) -n 4 testing/xhpl 142 | OMP_NUM_THREADS=2 $(which mpirun) -n 4 testing/xhpl_ai 143 | 144 | # If you download HPL-AI via git, you can clean the builds by: 145 | 146 | git clean -d -f -q 147 | 148 | ############################################################## 149 | # 150 | # The newest version of HPL-AI is available at 151 | # 152 | # 153 | ############################################################## 154 | # 155 | # Bugs are tracked at 156 | # 157 | # 158 | ############################################################## 159 | # 160 | # The souce code of HPL-AI is licensed under `COPYING`. 161 | # 162 | # The souce code of hpl-2.3 is licensed under `COPYRIGHT`. 163 | # 164 | ############################################################## 165 | -------------------------------------------------------------------------------- /src/grid/HPL_sum.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | void HPL_sum 54 | ( 55 | const int N, 56 | const void * IN, 57 | void * INOUT, 58 | const HPL_T_TYPE DTYPE 59 | ) 60 | #else 61 | void HPL_sum 62 | ( N, IN, INOUT, DTYPE ) 63 | const int N; 64 | const void * IN; 65 | void * INOUT; 66 | const HPL_T_TYPE DTYPE; 67 | #endif 68 | { 69 | /* 70 | * Purpose 71 | * ======= 72 | * 73 | * HPL_sum combines (sum) two buffers. 74 | * 75 | * 76 | * Arguments 77 | * ========= 78 | * 79 | * N (input) const int 80 | * On entry, N specifies the length of the buffers to be 81 | * combined. N must be at least zero. 82 | * 83 | * IN (input) const void * 84 | * On entry, IN points to the input-only buffer to be combined. 85 | * 86 | * INOUT (input/output) void * 87 | * On entry, INOUT points to the input-output buffer to be 88 | * combined. On exit, the entries of this array contains the 89 | * combined results. 90 | * 91 | * DTYPE (input) const HPL_T_TYPE 92 | * On entry, DTYPE specifies the type of the buffers operands. 93 | * 94 | * --------------------------------------------------------------------- 95 | */ 96 | /* 97 | * .. Local Variables .. 98 | */ 99 | register int i; 100 | /* .. 101 | * .. Executable Statements .. 102 | */ 103 | if( DTYPE == HPL_INT ) 104 | { 105 | const int * a = (const int *)(IN); 106 | int * b = (int *)(INOUT); 107 | for( i = 0; i < N; i++ ) b[i] += a[i]; 108 | } 109 | else 110 | { 111 | const double * a = (const double *)(IN); 112 | double * b = (double *)(INOUT); 113 | for( i = 0; i < N; i++ ) b[i] += a[i]; 114 | } 115 | /* 116 | * End of HPL_sum 117 | */ 118 | } 119 | -------------------------------------------------------------------------------- /include/hpl_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | */ 46 | #ifndef HPL_MISC_H 47 | #define HPL_MISC_H 48 | /* 49 | * --------------------------------------------------------------------- 50 | * Include files 51 | * --------------------------------------------------------------------- 52 | */ 53 | #ifdef __STDC__ 54 | #define STDC_HEADERS 55 | #endif 56 | 57 | #include 58 | #include 59 | #include 60 | #include 61 | 62 | #ifdef STDC_HEADERS 63 | #include 64 | #define STDC_ARGS(p) p 65 | #else 66 | #include 67 | #define STDC_ARGS(p) () 68 | #endif 69 | 70 | #ifdef HPL_CALL_VSIPL 71 | #include 72 | #endif 73 | /* 74 | * --------------------------------------------------------------------- 75 | * #define macro constants 76 | * --------------------------------------------------------------------- 77 | */ 78 | #define HPL_rone 1.0 79 | #define HPL_rtwo 2.0 80 | #define HPL_rzero 0.0 81 | /* 82 | * --------------------------------------------------------------------- 83 | * #define macros definitions 84 | * --------------------------------------------------------------------- 85 | */ 86 | #define Mabs( a_ ) ( ( (a_) < 0 ) ? -(a_) : (a_) ) 87 | #define Mmin( a_, b_ ) ( ( (a_) < (b_) ) ? (a_) : (b_) ) 88 | #define Mmax( a_, b_ ) ( ( (a_) > (b_) ) ? (a_) : (b_) ) 89 | 90 | #define Mfloor(a,b) (((a)>0) ? (((a)/(b))) : (-(((-(a))+(b)-1)/(b)))) 91 | #define Mceil(a,b) ( ( (a)+(b)-1 ) / (b) ) 92 | #define Miceil(a,b) (((a)>0) ? ((((a)+(b)-1)/(b))) : (-((-(a))/(b)))) 93 | 94 | #define Mupcase(C) (((C)>96 && (C)<123) ? (C) & 0xDF : (C)) 95 | #define Mlowcase(C) (((C)>64 && (C)< 91) ? (C) | 32 : (C)) 96 | /* 97 | * Mptr returns a pointer to a_( i_, j_ ) for readability reasons and 98 | * also less silly errors ... 99 | */ 100 | #define Mptr( a_, i_, j_, lda_ ) \ 101 | ( (a_) + (size_t)(i_) + (size_t)(j_)*(size_t)(lda_) ) 102 | /* 103 | * Align pointer 104 | */ 105 | #define HPL_PTR( ptr_, al_ ) \ 106 | ( ( ( (size_t)(ptr_)+(al_)-1 ) / (al_) ) * (al_) ) 107 | #endif 108 | /* 109 | * End of hpl_misc.h 110 | */ 111 | -------------------------------------------------------------------------------- /src/grid/HPL_max.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | void HPL_max 54 | ( 55 | const int N, 56 | const void * IN, 57 | void * INOUT, 58 | const HPL_T_TYPE DTYPE 59 | ) 60 | #else 61 | void HPL_max 62 | ( N, IN, INOUT, DTYPE ) 63 | const int N; 64 | const void * IN; 65 | void * INOUT; 66 | const HPL_T_TYPE DTYPE; 67 | #endif 68 | { 69 | /* 70 | * Purpose 71 | * ======= 72 | * 73 | * HPL_max combines (max) two buffers. 74 | * 75 | * 76 | * Arguments 77 | * ========= 78 | * 79 | * N (input) const int 80 | * On entry, N specifies the length of the buffers to be 81 | * combined. N must be at least zero. 82 | * 83 | * IN (input) const void * 84 | * On entry, IN points to the input-only buffer to be combined. 85 | * 86 | * INOUT (input/output) void * 87 | * On entry, INOUT points to the input-output buffer to be 88 | * combined. On exit, the entries of this array contains the 89 | * combined results. 90 | * 91 | * DTYPE (input) const HPL_T_TYPE 92 | * On entry, DTYPE specifies the type of the buffers operands. 93 | * 94 | * --------------------------------------------------------------------- 95 | */ 96 | /* 97 | * .. Local Variables .. 98 | */ 99 | register int i; 100 | /* .. 101 | * .. Executable Statements .. 102 | */ 103 | if( DTYPE == HPL_INT ) 104 | { 105 | const int * a = (const int *)(IN); 106 | int * b = (int *)(INOUT); 107 | for( i = 0; i < N; i++ ) b[i] = Mmax( a[i], b[i] ); 108 | } 109 | else 110 | { 111 | const double * a = (const double *)(IN); 112 | double * b = (double *)(INOUT); 113 | for( i = 0; i < N; i++ ) b[i] = Mmax( a[i], b[i] ); 114 | } 115 | /* 116 | * End of HPL_max 117 | */ 118 | } 119 | -------------------------------------------------------------------------------- /src/grid/HPL_min.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | void HPL_min 54 | ( 55 | const int N, 56 | const void * IN, 57 | void * INOUT, 58 | const HPL_T_TYPE DTYPE 59 | ) 60 | #else 61 | void HPL_min 62 | ( N, IN, INOUT, DTYPE ) 63 | const int N; 64 | const void * IN; 65 | void * INOUT; 66 | const HPL_T_TYPE DTYPE; 67 | #endif 68 | { 69 | /* 70 | * Purpose 71 | * ======= 72 | * 73 | * HPL_min combines (min) two buffers. 74 | * 75 | * 76 | * Arguments 77 | * ========= 78 | * 79 | * N (input) const int 80 | * On entry, N specifies the length of the buffers to be 81 | * combined. N must be at least zero. 82 | * 83 | * IN (input) const void * 84 | * On entry, IN points to the input-only buffer to be combined. 85 | * 86 | * INOUT (input/output) void * 87 | * On entry, INOUT points to the input-output buffer to be 88 | * combined. On exit, the entries of this array contains the 89 | * combined results. 90 | * 91 | * DTYPE (input) const HPL_T_TYPE 92 | * On entry, DTYPE specifies the type of the buffers operands. 93 | * 94 | * --------------------------------------------------------------------- 95 | */ 96 | /* 97 | * .. Local Variables .. 98 | */ 99 | register int i; 100 | /* .. 101 | * .. Executable Statements .. 102 | */ 103 | if( DTYPE == HPL_INT ) 104 | { 105 | const int * a = (const int *)(IN); 106 | int * b = (int *)(INOUT); 107 | for( i = 0; i < N; i++ ) b[i] = Mmin( a[i], b[i] ); 108 | } 109 | else 110 | { 111 | const double * a = (const double *)(IN); 112 | double * b = (double *)(INOUT); 113 | for( i = 0; i < N; i++ ) b[i] = Mmin( a[i], b[i] ); 114 | } 115 | /* 116 | * End of HPL_min 117 | */ 118 | } 119 | -------------------------------------------------------------------------------- /src/pgesv/HPLAI_pagesv0.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2021 WuK 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /* 25 | * Include files 26 | */ 27 | #include "hplai.hh" 28 | 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | 34 | #ifdef STDC_HEADERS 35 | void HPLAI_pagesv0( 36 | HPL_T_grid *GRID, 37 | HPLAI_T_palg *ALGO, 38 | HPLAI_T_pmat *A) 39 | #else 40 | void HPLAI_pagesv0(GRID, ALGO, A) 41 | HPL_T_grid *GRID; 42 | HPLAI_T_palg *ALGO; 43 | HPLAI_T_pmat *A; 44 | #endif 45 | { 46 | /* 47 | * Purpose 48 | * ======= 49 | * 50 | * HPLAI_pagesv0 factors a N+1-by-N matrix using LU factorization with row 51 | * partial pivoting. The main algorithm is the "right looking" variant 52 | * without look-ahead. The lower triangular factor is left unpivoted and 53 | * the pivots are not returned. The right hand side is the N+1 column of 54 | * the coefficient matrix. 55 | * 56 | * Arguments 57 | * ========= 58 | * 59 | * GRID (local input) HPL_T_grid * 60 | * On entry, GRID points to the data structure containing the 61 | * process grid information. 62 | * 63 | * ALGO (global input) HPLAI_T_palg * 64 | * On entry, ALGO points to the data structure containing the 65 | * algorithmic parameters. 66 | * 67 | * A (local input/output) HPLAI_T_pmat * 68 | * On entry, A points to the data structure containing the local 69 | * array information. 70 | * 71 | * --------------------------------------------------------------------- 72 | */ 73 | /* 74 | * .. Local Variables .. 75 | */ 76 | HPLAI_T_panel **panel = NULL; 77 | HPLAI_T_UPD_FUN HPLAI_paupdate; 78 | int N, j, jb, n, nb, tag = MSGID_BEGIN_FACT, 79 | test = HPL_KEEP_TESTING; 80 | #ifdef HPL_PROGRESS_REPORT 81 | double start_time, time, gflops; 82 | #endif 83 | /* .. 84 | * .. Executable Statements .. 85 | */ 86 | if ((N = A->n) <= 0) 87 | return; 88 | 89 | #ifdef HPL_PROGRESS_REPORT 90 | start_time = HPL_timer_walltime(); 91 | #endif 92 | 93 | HPLAI_paupdate = ALGO->upfun; 94 | nb = A->nb; 95 | /* 96 | * Allocate a panel list of length 1 - Allocate panel[0] resources 97 | */ 98 | panel = (HPLAI_T_panel **)malloc(sizeof(HPLAI_T_panel *)); 99 | if (panel == NULL) 100 | { 101 | HPLAI_pabort(__LINE__, "HPLAI_pagesv0", "Memory allocation failed"); 102 | } 103 | 104 | HPLAI_papanel_new(GRID, ALGO, N, N + 1, Mmin(N, nb), A, 0, 0, tag, 105 | &panel[0]); 106 | /* 107 | * Loop over the columns of A 108 | */ 109 | for (j = 0; j < N; j += nb) 110 | { 111 | n = N - j; 112 | jb = Mmin(n, nb); 113 | #ifdef HPL_PROGRESS_REPORT 114 | /* if this is process 0,0 and not the first panel */ 115 | if (GRID->myrow == 0 && GRID->mycol == 0 && j > 0) 116 | { 117 | time = HPL_timer_walltime() - start_time; 118 | gflops = 2.0 * (N * (double)N * N - n * (double)n * n) / 3.0 / (time > 0.0 ? time : 1e-6) / 1e9; 119 | HPL_fprintf(stdout, "Column=%09d Fraction=%4.1f%% Gflops=%9.3e\n", j, j * 100.0 / N, gflops); 120 | } 121 | #endif 122 | /* 123 | * Release panel resources - re-initialize panel data structure 124 | */ 125 | (void)HPLAI_papanel_free(panel[0]); 126 | HPLAI_papanel_init(GRID, ALGO, n, n + 1, jb, A, j, j, tag, panel[0]); 127 | /* 128 | * Factor and broadcast current panel - update 129 | */ 130 | HPLAI_pafact(panel[0]); 131 | (void)HPLAI_binit(panel[0]); 132 | do 133 | { 134 | (void)HPLAI_bcast(panel[0], &test); 135 | } while (test != HPL_SUCCESS); 136 | (void)HPLAI_bwait(panel[0]); 137 | HPLAI_paupdate(NULL, NULL, panel[0], -1); 138 | /* 139 | * Update message id for next factorization 140 | */ 141 | tag = MNxtMgid(tag, MSGID_BEGIN_FACT, MSGID_END_FACT); 142 | } 143 | /* 144 | * Release panel resources and panel list 145 | */ 146 | (void)HPLAI_papanel_disp(&panel[0]); 147 | 148 | if (panel) 149 | free(panel); 150 | /* 151 | * End of HPLAI_pagesv0 152 | */ 153 | } 154 | 155 | #ifdef __cplusplus 156 | } 157 | #endif 158 | -------------------------------------------------------------------------------- /src/grid/HPL_all_reduce.c: -------------------------------------------------------------------------------- 1 | /* 2 | * -- High Performance Computing Linpack Benchmark (HPL) 3 | * HPL - 2.3 - December 2, 2018 4 | * Antoine P. Petitet 5 | * University of Tennessee, Knoxville 6 | * Innovative Computing Laboratory 7 | * (C) Copyright 2000-2008 All Rights Reserved 8 | * 9 | * -- Copyright notice and Licensing terms: 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions, and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * 22 | * 3. All advertising materials mentioning features or use of this 23 | * software must display the following acknowledgement: 24 | * This product includes software developed at the University of 25 | * Tennessee, Knoxville, Innovative Computing Laboratory. 26 | * 27 | * 4. The name of the University, the name of the Laboratory, or the 28 | * names of its contributors may not be used to endorse or promote 29 | * products derived from this software without specific written 30 | * permission. 31 | * 32 | * -- Disclaimer: 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 35 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY 38 | * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 41 | * DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 45 | * --------------------------------------------------------------------- 46 | */ 47 | /* 48 | * Include files 49 | */ 50 | #include "hpl.h" 51 | 52 | #ifdef STDC_HEADERS 53 | int HPL_all_reduce 54 | ( 55 | void * BUFFER, 56 | const int COUNT, 57 | const HPL_T_TYPE DTYPE, 58 | const HPL_T_OP OP, 59 | MPI_Comm COMM 60 | ) 61 | #else 62 | int HPL_all_reduce 63 | ( BUFFER, COUNT, DTYPE, OP, COMM ) 64 | void * BUFFER; 65 | const int COUNT; 66 | const HPL_T_TYPE DTYPE; 67 | const HPL_T_OP OP; 68 | MPI_Comm COMM; 69 | #endif 70 | { 71 | /* 72 | * Purpose 73 | * ======= 74 | * 75 | * HPL_all_reduce performs a global reduce operation across all 76 | * processes of a group leaving the results on all processes. 77 | * 78 | * Arguments 79 | * ========= 80 | * 81 | * BUFFER (local input/global output) void * 82 | * On entry, BUFFER points to the buffer to be combined. On 83 | * exit, this array contains the combined data and is identical 84 | * on all processes in the group. 85 | * 86 | * COUNT (global input) const int 87 | * On entry, COUNT indicates the number of entries in BUFFER. 88 | * COUNT must be at least zero. 89 | * 90 | * DTYPE (global input) const HPL_T_TYPE 91 | * On entry, DTYPE specifies the type of the buffers operands. 92 | * 93 | * OP (global input) const HPL_T_OP 94 | * On entry, OP is a pointer to the local combine function. 95 | * 96 | * COMM (global/local input) MPI_Comm 97 | * The MPI communicator identifying the process collection. 98 | * 99 | * --------------------------------------------------------------------- 100 | */ 101 | /* 102 | * .. Local Variables .. 103 | */ 104 | int hplerr; 105 | /* .. 106 | * .. Executable Statements .. 107 | */ 108 | hplerr = HPL_reduce( BUFFER, COUNT, DTYPE, OP, 0, COMM ); 109 | if( hplerr != MPI_SUCCESS ) return( hplerr ); 110 | return( HPL_broadcast( BUFFER, COUNT, DTYPE, 0, COMM ) ); 111 | /* 112 | * End of HPL_all_reduce 113 | */ 114 | } 115 | --------------------------------------------------------------------------------