Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Johannes Pfeifer
dynare
Commits
9557061f
Verified
Commit
9557061f
authored
Jun 26, 2019
by
Sébastien Villemot
Browse files
Add new num_procs MEX file for getting number of available processing units
parent
f2b61b3e
Changes
9
Hide whitespace changes
Inline
Side-by-side
mex/build/matlab/Makefile.am
View file @
9557061f
ACLOCAL_AMFLAGS
=
-I
../../../m4
ACLOCAL_AMFLAGS
=
-I
../../../m4
if
DO_SOMETHING
if
DO_SOMETHING
SUBDIRS
=
mjdgges kronecker bytecode block_kalman_filter sobol local_state_space_iterations perfect_foresight_problem
SUBDIRS
=
mjdgges kronecker bytecode block_kalman_filter sobol local_state_space_iterations perfect_foresight_problem
num_procs
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if
HAVE_MATIO
if
HAVE_MATIO
...
...
mex/build/matlab/configure.ac
View file @
9557061f
...
@@ -165,6 +165,7 @@ AC_CONFIG_FILES([Makefile
...
@@ -165,6 +165,7 @@ AC_CONFIG_FILES([Makefile
block_kalman_filter/Makefile
block_kalman_filter/Makefile
sobol/Makefile
sobol/Makefile
local_state_space_iterations/Makefile
local_state_space_iterations/Makefile
perfect_foresight_problem/Makefile])
perfect_foresight_problem/Makefile
num_procs/Makefile])
AC_OUTPUT
AC_OUTPUT
mex/build/matlab/num_procs/Makefile.am
0 → 100644
View file @
9557061f
include
../mex.am
include
../../num_procs.am
mex/build/num_procs.am
0 → 100644
View file @
9557061f
mex_PROGRAMS = num_procs
nodist_num_procs_SOURCES = num_procs.cc
BUILT_SOURCES = $(nodist_num_procs_SOURCES)
CLEANFILES = $(nodist_num_procs_SOURCES)
%.cc: $(top_srcdir)/../../sources/num_procs/%.cc
$(LN_S) -f $< $@
mex/build/octave/Makefile.am
View file @
9557061f
ACLOCAL_AMFLAGS
=
-I
../../../m4
ACLOCAL_AMFLAGS
=
-I
../../../m4
if
DO_SOMETHING
if
DO_SOMETHING
SUBDIRS
=
mjdgges kronecker bytecode block_kalman_filter sobol local_state_space_iterations perfect_foresight_problem
SUBDIRS
=
mjdgges kronecker bytecode block_kalman_filter sobol local_state_space_iterations perfect_foresight_problem
num_procs
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if
HAVE_MATIO
if
HAVE_MATIO
...
...
mex/build/octave/configure.ac
View file @
9557061f
...
@@ -128,6 +128,7 @@ AC_CONFIG_FILES([Makefile
...
@@ -128,6 +128,7 @@ AC_CONFIG_FILES([Makefile
block_kalman_filter/Makefile
block_kalman_filter/Makefile
sobol/Makefile
sobol/Makefile
local_state_space_iterations/Makefile
local_state_space_iterations/Makefile
perfect_foresight_problem/Makefile])
perfect_foresight_problem/Makefile
num_procs/Makefile])
AC_OUTPUT
AC_OUTPUT
mex/build/octave/num_procs/Makefile.am
0 → 100644
View file @
9557061f
EXEEXT
=
.mex
include
../mex.am
include
../../num_procs.am
mex/sources/Makefile.am
View file @
9557061f
...
@@ -14,7 +14,8 @@ EXTRA_DIST = \
...
@@ -14,7 +14,8 @@ EXTRA_DIST = \
local_state_space_iterations
\
local_state_space_iterations
\
gensylv
\
gensylv
\
dynare_simul_
\
dynare_simul_
\
perfect_foresight_problem
perfect_foresight_problem
\
num_procs
clean-local
:
clean-local
:
rm
-rf
`
find mex/sources
-name
*
.o
`
rm
-rf
`
find mex/sources
-name
*
.o
`
...
...
mex/sources/num_procs/num_procs.cc
0 → 100644
View file @
9557061f
/*
* Copyright © 2019 Dynare Team
*
* This file is part of Dynare.
*
* Dynare is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Dynare is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <thread>
#include <dynmex.h>
void
mexFunction
(
int
nlhs
,
mxArray
*
plhs
[],
int
nrhs
,
const
mxArray
*
prhs
[])
{
if
(
nrhs
!=
0
||
nlhs
!=
1
)
mexErrMsgTxt
(
"Must have zero input argument and one output argument"
);
plhs
[
0
]
=
mxCreateDoubleScalar
(
std
::
thread
::
hardware_concurrency
());
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment