Line data Source code
1 : //------------------------------------------------------------------------------ 2 : // LAGraph_GetNumThreads: get the # of threads to use 3 : //------------------------------------------------------------------------------ 4 : 5 : // LAGraph, (c) 2019-2022 by The LAGraph Contributors, All Rights Reserved. 6 : // SPDX-License-Identifier: BSD-2-Clause 7 : // 8 : // For additional details (including references to third party source code and 9 : // other files) see the LICENSE file or contact permission@sei.cmu.edu. See 10 : // Contributors.txt for a full list of contributors. Created, in part, with 11 : // funding and support from the U.S. Government (see Acknowledgments.txt file). 12 : // DM22-0790 13 : 14 : // Contributed by Timothy A. Davis, Texas A&M University 15 : 16 : //------------------------------------------------------------------------------ 17 : 18 : // LAGraph_get_nthreads: get # of threads that will be used by LAGraph. 19 : 20 : #include "LG_internal.h" 21 : 22 113 : int LAGraph_GetNumThreads 23 : ( 24 : // output: 25 : int *nthreads_outer, 26 : int *nthreads_inner, 27 : char *msg 28 : ) 29 : { 30 : 31 : //-------------------------------------------------------------------------- 32 : // check inputs 33 : //-------------------------------------------------------------------------- 34 : 35 113 : LG_CLEAR_MSG ; 36 113 : LG_ASSERT (nthreads_outer != NULL && nthreads_inner != NULL, 37 : GrB_NULL_POINTER) ; 38 : 39 : //-------------------------------------------------------------------------- 40 : // get number of threads 41 : //-------------------------------------------------------------------------- 42 : 43 112 : (*nthreads_outer) = LG_nthreads_outer ; 44 112 : (*nthreads_inner) = LG_nthreads_inner ; 45 112 : return (GrB_SUCCESS) ; 46 : }