Skip to content

Commit 4a805d0

Browse files
committed
Merge branch 'develop' of https://github.com/stan-dev/cmdstan into develop
2 parents fa8b738 + b67ab56 commit 4a805d0

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ There are separate repositories here on GitHub for interfaces:
2626
* [CmdStanR](https://github.com/stan-dev/cmdstanr) (a lightweight interface to CmdStan for R users)
2727
* [PyStan](https://github.com/stan-dev/pystan) (Python interface)
2828
* [RStan](https://github.com/stan-dev/rstan) (R interface)
29+
* [MathematicaStan](https://github.com/stan-dev/MathematicaStan) (Mathematica interface)
2930

3031
### Source Repository
3132
CmdStan's source-code repository is hosted here on GitHub.

make/local.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@
3030

3131
# Adding other arbitrary C++ compiler flags
3232
# CXXFLAGS+= -funroll-loops
33+
34+
# Load more config from another location. Possibly useful on a shared system where
35+
# different users have different configurations.
36+
# -include $(HOME)/.config/stan/make.local

make/program

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ endif
8282
$(LINK.cpp) $(subst \,/,$*.o) $(CMDSTAN_MAIN_O) $(LDLIBS) $(SUNDIALS_TARGETS) $(MPI_TARGETS) $(TBB_TARGETS) $(subst \,/,$(OUTPUT_OPTION))
8383

8484
ifeq ($(OS),Windows_NT)
85+
ifneq (,$(TBB_TARGETS))
8586
ifeq (,$(findstring tbb.dll, $(notdir $(shell where tbb.dll))))
8687
@echo 'Intel TBB is not in PATH.'
8788
@echo 'Consider calling '
@@ -94,6 +95,7 @@ ifeq (,$(findstring tbb.dll, $(notdir $(shell where tbb.dll))))
9495
fi
9596
endif
9697
endif
98+
endif
9799

98100
$(patsubst %.cpp,%$(STAN_FLAGS).d,$(CMDSTAN_MAIN)) : $(CMDSTAN_MAIN)
99101
$(COMPILE.cpp) $(DEPFLAGS) $<

src/cmdstan/command.hpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -563,23 +563,17 @@ int command(int argc, const char *argv[]) {
563563
list_argument *algo = dynamic_cast<list_argument *>(
564564
parser.arg("method")->arg("sample")->arg("algorithm"));
565565
std::string algo_name = algo->value();
566-
bool use_fixed_param
567-
= model.num_params_r() == 0 || algo_name == "fixed_param";
568566

569567
bool adapt_engaged = get_arg_val<bool_argument>(parser, "method", "sample",
570568
"adapt", "engaged");
571-
if (!use_fixed_param && adapt_engaged == true && num_warmup == 0) {
569+
if (algo_name != "fixed_param" && adapt_engaged == true
570+
&& num_warmup == 0) {
572571
msg << "The number of warmup samples (num_warmup) must be greater than "
573572
<< "zero if adaptation is enabled." << std::endl;
574573
throw std::invalid_argument(msg.str());
575574
}
576575

577-
if (use_fixed_param) {
578-
if (algo_name != "fixed_param") {
579-
info(
580-
"Model contains no parameters, running fixed_param sampler, "
581-
"no updates to Markov chain");
582-
}
576+
if (algo_name == "fixed_param") {
583577
return_code = stan::services::sample::fixed_param(
584578
model, num_chains, init_contexts, random_seed, id, init_radius,
585579
num_samples, num_thin, refresh, interrupt, logger, init_writers,

src/test/interface/fixed_param_sampler_test.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ TEST(McmcFixedParamSampler, check_empty) {
6868
EXPECT_EQ(success, true);
6969
}
7070

71-
TEST(McmcFixedParamSampler, check_empty_but_algorithm_not_fixed_param) {
71+
TEST(McmcFixedParamSampler, check_empty_not_fixed_param) {
7272
std::vector<std::string> model_path;
7373
model_path.push_back("src");
7474
model_path.push_back("test");
@@ -88,8 +88,4 @@ TEST(McmcFixedParamSampler, check_empty_but_algorithm_not_fixed_param) {
8888
}
8989

9090
EXPECT_EQ(success, true);
91-
std::string expected_message
92-
= "Model contains no parameters, running fixed_param sampler";
93-
EXPECT_TRUE(
94-
boost::algorithm::contains(command_output.output, expected_message));
9591
}

0 commit comments

Comments
 (0)