diff --git a/octotiger/radiation/kernel_interface.hpp b/octotiger/radiation/kernel_interface.hpp index b291e943f..f333fc763 100644 --- a/octotiger/radiation/kernel_interface.hpp +++ b/octotiger/radiation/kernel_interface.hpp @@ -163,7 +163,7 @@ namespace octotiger { namespace radiation { static std::atomic_size_t next_index(0); std::size_t index = next_index++; - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { dumper::save_case_args(index, opts().eos, opts().problem, opts().dual_energy_sw1, opts().dual_energy_sw2, physcon().A, physcon().B, physcon().c, fgamma, dt, clightinv, er_i, fx_i, @@ -176,7 +176,7 @@ namespace octotiger { namespace radiation { tau, fgamma, U, mmw, X_spc, Z_spc, dt, clightinv); #if defined(OCTOTIGER_DUMP_RADIATION_CASES) - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { dumper::save_case_outs(index, sx, sy, sz, egas, tau, U); }).get(); #endif diff --git a/octotiger/util.hpp b/octotiger/util.hpp index 760248bfb..5aaf88229 100644 --- a/octotiger/util.hpp +++ b/octotiger/util.hpp @@ -42,7 +42,7 @@ int file_copy(const char* fin, const char* fout); template int lprint( const char* log, const char* str, Args&&...args) { // run output on separate thread - auto f = hpx::threads::run_as_os_thread([&]() -> int + auto f = hpx::run_as_os_thread([&]() -> int { if(!opts().disable_output) { FILE* fp = fopen (log, "at"); diff --git a/src/io/silo_in.cpp b/src/io/silo_in.cpp index 6ef1af302..68d87cd61 100644 --- a/src/io/silo_in.cpp +++ b/src/io/silo_in.cpp @@ -123,7 +123,7 @@ void load_options_from_silo(std::string fname, DBfile *db) { } }; if (db == nullptr) { - GET(hpx::threads::run_as_os_thread(func)); + GET(hpx::run_as_os_thread(func)); } else { func(); } @@ -135,7 +135,7 @@ void load_options_from_silo(std::string fname, DBfile *db) { void load_open(std::string fname, dir_map_type map) { // printf("LOAD OPENED on proc %i\n", hpx::get_locality_id()); load_options_from_silo(fname, db_); /**/ - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { db_ = DBOpenReal(fname.c_str(), DB_UNKNOWN, DB_READ); read_silo_var rr; silo_output_time() = rr(db_, "cgs_time"); /**/ @@ -187,7 +187,7 @@ node_server::node_server(const node_location &loc) : static const auto hydro_names = grid::get_hydro_field_names(); load.vars.resize(hydro_names.size()); load.outflows.resize(hydro_names.size()); - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { static std::mutex mtx; std::lock_guard lock(mtx); const auto this_file = iter->second.filename; @@ -264,19 +264,19 @@ void load_data_from_silo(std::string fname, node_server *root_ptr, hpx::id_type const integer nprocs = opts().all_localities.size(); static int sz = localities.size(); - DBfile *db = GET(hpx::threads::run_as_os_thread(DBOpenReal, fname.c_str(), DB_UNKNOWN, DB_READ)); - silo_epoch() = GET(hpx::threads::run_as_os_thread(read_silo_var(), db, "epoch")); + DBfile *db = GET(hpx::run_as_os_thread(DBOpenReal, fname.c_str(), DB_UNKNOWN, DB_READ)); + silo_epoch() = GET(hpx::run_as_os_thread(read_silo_var(), db, "epoch")); silo_epoch()++;std ::vector node_list; std::vector positions; std::vector> futs; int node_count; if (db != nullptr) { - DBmultimesh *master_mesh = GET(hpx::threads::run_as_os_thread([&]() { + DBmultimesh *master_mesh = GET(hpx::run_as_os_thread([&]() { return DBGetMultimesh(db, "quadmesh"); })); const int chunk_size = std::ceil(real(master_mesh->nblocks) / real(sz)); - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { const read_silo_var ri; node_count = ri(db, "node_count"); node_list.resize(node_count); @@ -284,7 +284,7 @@ void load_data_from_silo(std::string fname, node_server *root_ptr, hpx::id_type DBReadVar(db, "node_list", node_list.data()); DBReadVar(db, "node_positions", positions.data()); }).get(); - GET(hpx::threads::run_as_os_thread(DBClose, db)); + GET(hpx::run_as_os_thread(DBClose, db)); std::map load_locs; for (int i = 0; i < master_mesh->nblocks; i++) { load_locs.insert(split_mesh_id(master_mesh->meshnames[i])); @@ -307,7 +307,7 @@ void load_data_from_silo(std::string fname, node_server *root_ptr, hpx::id_type // printf("Sending LOAD OPEN to %i\n", i); futs.push_back(hpx::async < load_open_action > (opts().all_localities[i], fname, this_dir)); } - GET(hpx::threads::run_as_os_thread(DBFreeMultimesh, master_mesh)); + GET(hpx::run_as_os_thread(DBFreeMultimesh, master_mesh)); for (auto &f : futs) { GET(f); } diff --git a/src/io/silo_out.cpp b/src/io/silo_out.cpp index 109bb332e..e80ce9c56 100644 --- a/src/io/silo_out.cpp +++ b/src/io/silo_out.cpp @@ -168,7 +168,7 @@ void output_stage3(std::string fname, int cycle, int gn, int gb, int ge) { const auto dir = opts().data_dir; std::string this_fname = dir + fname + ".silo.data/" + std::to_string(gn) + std::string(".silo"); double dtime = silo_output_rotation_time(); - hpx::threads::run_as_os_thread([&this_fname, this_id, &dtime, gb, gn, ge](integer cycle) { + hpx::run_as_os_thread([&this_fname, this_id, &dtime, gb, gn, ge](integer cycle) { DBfile *db; if (this_id == gb) { // printf( "Create %s %i %i %i %i\n", this_fname.c_str(), this_id, gn, gb, ge); @@ -259,7 +259,7 @@ void output_stage4(std::string fname, int cycle) { std::string this_fname = opts().data_dir + "/" + fname + std::string(".silo"); double dtime = silo_output_rotation_time(); double rtime = silo_output_rotation_time(); - hpx::threads::run_as_os_thread([&this_fname, fname, nfields, &rtime](int cycle) { + hpx::run_as_os_thread([&this_fname, fname, nfields, &rtime](int cycle) { auto *db = DBCreateReal(this_fname.c_str(), DB_CLOBBER, DB_LOCAL, "Octo-tiger", SILO_DRIVER); double dtime = silo_output_time(); float ftime = dtime; @@ -518,7 +518,7 @@ void output_all(node_server *root_ptr, std::string fname, int cycle, bool block) } std::string dir = opts().data_dir + "/" + fname + ".silo.data"; - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { auto rc = mkdir(dir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); if (rc != 0 && errno != EEXIST) { printf("Could not create directory for SILO file. mkdir failed with error. code: %i name: %s", errno, std::strerror(errno)); diff --git a/src/node_server_actions_3.cpp b/src/node_server_actions_3.cpp index 6d69c4f46..8086c1224 100644 --- a/src/node_server_actions_3.cpp +++ b/src/node_server_actions_3.cpp @@ -417,7 +417,7 @@ void node_server::execute_solver(bool scf, node_count_type ngrids) { // run output on separate thread if (!opts().disable_output) { - hpx::threads::run_as_os_thread([=]() { + hpx::run_as_os_thread([=]() { FILE *fp = fopen((opts().data_dir + "step.dat").c_str(), "at"); if (fp == NULL) { printf( "Unable to open step.dat for writing %s\n", std::strerror(errno)); @@ -430,7 +430,7 @@ void node_server::execute_solver(bool scf, node_count_type ngrids) { }); // do not wait for it to finish } - /* hpx::threads::run_as_os_thread( */ + /* hpx::run_as_os_thread( */ /* [=]() { */ { const auto vr = sqrt(sqr(dt_.ur[sx_i]) + sqr(dt_.ur[sy_i]) + sqr(dt_.ur[sz_i])) / dt_.ur[0]; @@ -457,7 +457,7 @@ void node_server::execute_solver(bool scf, node_count_type ngrids) { ngrids = regrid(me.get_gid(), omega, new_floor, false); // run output on separate thread - auto need_break = hpx::threads::run_as_os_thread([&]() { + auto need_break = hpx::run_as_os_thread([&]() { // set_omega_and_pivot(); bench_stop = hpx::chrono::high_resolution_clock::now() / 1e9; if (scf || opts().bench) { @@ -502,7 +502,7 @@ void node_server::execute_solver(bool scf, node_count_type ngrids) { } if (opts().bench && !opts().disable_output) { - hpx::threads::run_as_os_thread([&]() { + hpx::run_as_os_thread([&]() { FILE *fp = fopen((opts().data_dir + "scaling.dat").c_str(), "at"); const auto nproc = options::all_localities.size(); @@ -678,7 +678,7 @@ future node_server::local_step(integer steps) { if (opts().print_times_per_timestep) timestep_util::add_time_per_timestep(time_elapsed); - hpx::threads::run_as_os_thread([=]() { + hpx::run_as_os_thread([=]() { printf("%i %e %e %e %e\n", local_step_num, double(current_time), double(dt_.dt), time_elapsed, rotational_time); }); // do not wait for output to finish } diff --git a/src/util.cpp b/src/util.cpp index 6240e1ee6..ad34eb406 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -43,7 +43,7 @@ real LambertW(real z) { int file_copy(const char* fin, const char* fout) { // run output on separate thread - auto f = hpx::threads::run_as_os_thread([&]() + auto f = hpx::run_as_os_thread([&]() { constexpr size_t chunk_size = BUFSIZ; char buffer[chunk_size];