Skip to content

Commit 687b261

Browse files
committed
Fix always creating profile.csv
1 parent 07e3e4f commit 687b261

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ clean: clean-tests
283283
$(RM) bin/stanc$(EXE) bin/stansummary$(EXE) bin/print$(EXE) bin/diagnose$(EXE)
284284
$(RM) -r bin/cmdstan
285285
@echo ' removing cached compiler objects'
286-
$(RM) $(wildcard src/cmdstan/main*.o) $(wildcard $(STAN)src/stan/model/model_header*.hpp.gch)
287-
$(RM) -r $(STAN)src/stan/model/model_header.hpp.gch/
286+
$(RM) $(wildcard src/cmdstan/main*.o)
287+
$(RM) -r $(wildcard $(STAN)src/stan/model/model_header*.hpp.gch)
288288
@echo ' removing built example model'
289289
$(RM) examples/bernoulli/bernoulli$(EXE) examples/bernoulli/bernoulli.o examples/bernoulli/bernoulli.d examples/bernoulli/bernoulli.hpp $(wildcard examples/bernoulli/*.csv)
290290

src/cmdstan/command.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ int command(int argc, const char *argv[]) {
786786
}
787787
}
788788
} // end static HMC
789-
} // ---- sample end ---- //
789+
} // ---- sample end ---- //
790790
} else if (user_method->arg("variational")) {
791791
// ---- variational start ---- //
792792
list_argument *algo = dynamic_cast<list_argument *>(
@@ -831,7 +831,7 @@ int command(int argc, const char *argv[]) {
831831
//////////////////////////////////////////////////
832832

833833
stan::math::profile_map &profile_data = get_stan_profile_data();
834-
if (profile_data.size() > 0) {
834+
if (profile_data.begin() != profile_data.end()) {
835835
std::string profile_file_name
836836
= get_arg_val<string_argument>(parser, "output", "profile_file");
837837
std::fstream profile_stream(profile_file_name.c_str(), std::fstream::out);

0 commit comments

Comments
 (0)