diff --git a/src/adiar/adiar.cpp b/src/adiar/adiar.cpp index ee73a7946..4969e9593 100644 --- a/src/adiar/adiar.cpp +++ b/src/adiar/adiar.cpp @@ -70,14 +70,9 @@ namespace adiar } try { - // Initialise TPIE - tpie::tpie_init(_tpie_subsystems); - -#ifdef NDEBUG - // - add 'dev/null' output for TPIE logging in Production. Otherwise, TPIE will print - // everything to 'std::cerr'. - tpie::add_log_target(&_devnull); -#endif + // Set the temporary directory for TPIE before calling + // `tpie::tpie_init()`. This avoids a directory named `TPIE__<...>` + // at the default tmp path. // - file names tpie::tempname::set_default_base_name("ADIAR"); @@ -86,6 +81,15 @@ namespace adiar // - tmp directory if (temp_dir != "") { tpie::tempname::set_default_path(temp_dir); } + // Initialise TPIE + tpie::tpie_init(tpie::ALL); + +#ifdef NDEBUG + // - add 'dev/null' output for TPIE logging in Production. Otherwise, TPIE will print + // everything to 'std::cerr'. + tpie::add_log_target(&_devnull); +#endif + // - memory limit and block size tpie::get_memory_manager().set_limit(memory_limit_bytes); internal::set_block_size(internal::recommended_block_size(memory_limit_bytes));