Skip to content

Commit

Permalink
Add hdspin-postprocess executable
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcarbone committed Dec 26, 2023
1 parent a274073 commit db8e08f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ if (${BUILD_TESTS})

endif()


# Build the core package

find_package(MPI REQUIRED)

if(MPI_FOUND)
Expand Down Expand Up @@ -83,3 +86,17 @@ else()
endif()

target_link_libraries(hdspin ${MPI_CXX_LIBRARIES})


# Build the postprocessing executable
# Useful for if the main job doesn't actually finish, but we want to just
# process what we have

add_executable(
hdspin-postprocess
src/main_postprocess.cpp
src/utils.cpp
src/processing_utils.cpp
)

target_link_libraries(hdspin-postprocess ${MPI_CXX_LIBRARIES})
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ int main(int argc, char *argv[])
"is faster, and selects that one."
)->check(CLI::IsMember({"standard", "gillespie", "auto"}));

// YOU LEFT OFF HERE!!!!
// Need to change this definition in the utils files
app.add_option(
"-n, --n_tracers", p.n_tracers,
"The number of simulations to run in total, defaults to 100."
Expand Down
10 changes: 10 additions & 0 deletions src/main_postprocess.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <mpi.h>
#include "processing_utils.h"


int main(int argc, char *argv[])
{
MPI_Init(&argc, &argv);
processing_utils::postprocess();
MPI_Finalize();
}
6 changes: 4 additions & 2 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,12 @@ void make_directories()
system(command.c_str());
}


// Does nothing for now
void cleanup_directories()
{
std::string command = "rm -r " + std::string(GRID_PATH);
system(command.c_str());
// std::string command = "rm -r " + std::string(GRID_PATH);
// system(command.c_str());
}

void make_energy_grid_logspace(const size_t log10_timesteps, const size_t n_gridpoints)
Expand Down

0 comments on commit db8e08f

Please # to comment.