Skip to content

Commit

Permalink
removed gui from CI
Browse files Browse the repository at this point in the history
  • Loading branch information
xLPMG committed Jan 8, 2024
1 parent 43140b9 commit 9bf3f5f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Sanitize
run: |
scons mode=debug+san omp=gnu
scons mode=debug+san omp=gnu gui=no
./build/tests
./build/tsunami_lab configs/minimalConfig.json
scons mode=release+san omp=gnu
Expand All @@ -54,12 +54,12 @@ jobs:
- name: Valgrind
run: |
scons mode=debug omp=gnu
scons mode=debug omp=gnu gui=no
valgrind ./build/tests
valgrind ./build/tsunami_lab configs/minimalConfig.json
- name: Release
run: |
scons omp=gnu
scons omp=gnu gui=no
./build/tests
./build/tsunami_lab configs/minimalConfig.json
53 changes: 29 additions & 24 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,34 @@ void setupFolders()
}
#endif

void configureFiles()
{
l_outputFileName = l_configData.value("outputFileName", "solution");
l_netCdfOutputPathString = "solutions/" + l_outputFileName + ".nc";
l_netcdfOutputPath = l_netCdfOutputPathString.c_str();

// check if checkpoint exists
l_checkPointFilePathString = "checkpoints/" + l_outputFileName + ".nc";
l_checkPointFilePath = l_checkPointFilePathString.c_str();
l_checkpointExists = std::filesystem::exists(l_checkPointFilePathString);
// checkpoint file found
if (l_checkpointExists)
{
std::cout << "Found checkpoint file: " << l_checkPointFilePath << std::endl;
l_setupChoice = "CHECKPOINT";
}
else
{
// no checkpoint but solution file exists
if (std::filesystem::exists(l_netCdfOutputPathString))
{
std::cout << "Solution file exists but no checkpoint was found. The solution will be deleted." << std::endl;
std::filesystem::remove(l_netCdfOutputPathString);
}
l_setupChoice = l_configData.value("setup", "CIRCULARDAMBREAK2D");
}
}

void loadConfiguration()
{
l_solver = l_configData.value("solver", "fwave");
Expand Down Expand Up @@ -725,30 +753,7 @@ int main(int i_argc,
std::ifstream l_configFile(l_configFilePath);
l_configData = json::parse(l_configFile);
#ifndef BENCHMARK
l_outputFileName = l_configData.value("outputFileName", "solution");
l_netCdfOutputPathString = "solutions/" + l_outputFileName + ".nc";
l_netcdfOutputPath = l_netCdfOutputPathString.c_str();

// check if checkpoint exists
l_checkPointFilePathString = "checkpoints/" + l_outputFileName + ".nc";
l_checkPointFilePath = l_checkPointFilePathString.c_str();
l_checkpointExists = std::filesystem::exists(l_checkPointFilePathString);
// checkpoint file found
if (l_checkpointExists)
{
std::cout << "Found checkpoint file: " << l_checkPointFilePath << std::endl;
l_setupChoice = "CHECKPOINT";
}
else
{
// no checkpoint but solution file exists
if (std::filesystem::exists(l_netCdfOutputPathString))
{
std::cout << "Solution file exists but no checkpoint was found. The solution will be deleted." << std::endl;
std::filesystem::remove(l_netCdfOutputPathString);
}
l_setupChoice = l_configData.value("setup", "CIRCULARDAMBREAK2D");
}
configureFiles();
#else
l_setupChoice = l_configData.value("setup", "CIRCULARDAMBREAK2D");
if (l_setupChoice == "CHECKPOINT")
Expand Down

0 comments on commit 9bf3f5f

Please sign in to comment.