1 //------------------------------------------------------------------------------
2 // GB_mex_omp_max_threads: omp_get_max_threads ( )
3 //------------------------------------------------------------------------------
4 
5 // SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
6 // SPDX-License-Identifier: Apache-2.0
7 
8 //------------------------------------------------------------------------------
9 
10 // Returns the # of threads reported by omp_get_max_threads, if GraphBLAS was
11 // compiled with OpenMP.  Otherwise, returns 1.
12 
13 #include "GB_mex.h"
14 
15 #define USAGE "nthreads_max = GB_mex_omp_max_threads ;"
16 
mexFunction(int nargout,mxArray * pargout[],int nargin,const mxArray * pargin[])17 void mexFunction
18 (
19     int nargout,
20     mxArray *pargout [ ],
21     int nargin,
22     const mxArray *pargin [ ]
23 )
24 {
25     int omp_nthreads_max = GB_Global_omp_get_max_threads ( ) ;
26     pargout [0] = mxCreateDoubleScalar (omp_nthreads_max) ;
27 }
28 
29