Skip to content

Commit

Permalink
Merge branch 'main' into add-cuda-rosenbrock-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sjsprecious committed Jun 21, 2024
2 parents 9a9454b + 854ca2d commit fa1b8a6
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 77 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
xcode_macos_13:
runs-on: macos-13
continue-on-error: true
strategy:
matrix:
# all available versions of xcode: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
Expand All @@ -62,6 +63,7 @@ jobs:
macos_lateset:
runs-on: macos-latest
continue-on-error: true
strategy:
matrix:
compiler:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose -j 10
clang:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,9 @@ jobs:
cd build
ctest -C Debug --rerun-failed --output-on-failure . --verbose
msvc2019:
runs-on: windows-2019
strategy:
matrix:
build_type: [Release]
architecture: [Win32, x64]

steps:
- uses: actions/checkout@v4

- name: Run CMake
run: cmake -S . -B build -D MICM_ENABLE_PROFILE=ON -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} -G "Visual Studio 16 2019" -A ${{ matrix.architecture }}

- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 10

- name: Test
run: cd build ; ctest -j 10 -C ${{ matrix.build_type }} --output-on-failure

msvc2022:
runs-on: windows-2022
continue-on-error: true
strategy:
matrix:
build_type: [Release]
Expand All @@ -74,6 +56,7 @@ jobs:

clang:
runs-on: windows-2019
continue-on-error: true
strategy:
matrix:
version: [11, 12, 13, 14, 15]
Expand All @@ -91,6 +74,7 @@ jobs:

clang-cl-11:
runs-on: windows-2019
continue-on-error: true
strategy:
matrix:
architecture: [Win32, x64]
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(CMAKE_CXX_CLANG_TIDY "")

if(MICM_ENABLE_EXAMPLES)
add_executable(micmDriver example.cpp)
add_executable(micmDriver example.cpp util_example.cpp)
target_link_libraries(micmDriver PUBLIC musica::micm)
set_target_properties(micmDriver PROPERTIES OUTPUT_NAME "micm")

Expand Down
19 changes: 1 addition & 18 deletions examples/example.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
#include "util_example.cpp"
#include "util_example.hpp"

#include <micm/configure/solver_config.hpp>
#include <micm/process/arrhenius_rate_constant.hpp>
#include <micm/process/branched_rate_constant.hpp>
#include <micm/process/surface_rate_constant.hpp>
#include <micm/process/ternary_chemical_activation_rate_constant.hpp>
#include <micm/process/troe_rate_constant.hpp>
#include <micm/process/tunneling_rate_constant.hpp>
#include <micm/solver/solver_builder.hpp>
#include <micm/solver/rosenbrock.hpp>

#include <algorithm>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>

namespace fs = std::filesystem;
using namespace micm;
Expand Down
28 changes: 2 additions & 26 deletions examples/util_example.cpp
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
#include "util_example.hpp"

#include <filesystem>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <vector>

namespace fs = std::filesystem;

/// @brief Struct of mapping keys in certain type to its initial condition values
struct InitialConditions
{
std::unordered_map<std::string, double> environments;
std::unordered_map<std::string, std::vector<double>> concentrations;
std::unordered_map<std::string, std::vector<double>> custom_rate_params;

bool empty()
{
return environments.empty();
}

bool is_incomplete()
{
return !status_;
}

void incomplete_parsing()
{
status_ = false;
}

private:
bool status_ = true;
};

/// @brief Reads CSV file and creates InitialConditions object
/// holding initial values for input data
Expand Down
37 changes: 37 additions & 0 deletions examples/util_example.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

#include <unordered_map>
#include <string>
#include <vector>

/// @brief Struct of mapping keys in certain type to its initial condition values
struct InitialConditions
{
std::unordered_map<std::string, double> environments;
std::unordered_map<std::string, std::vector<double>> concentrations;
std::unordered_map<std::string, std::vector<double>> custom_rate_params;

bool empty()
{
return environments.empty();
}

bool is_incomplete()
{
return !status_;
}

void incomplete_parsing()
{
status_ = false;
}

private:
bool status_ = true;
};

/// @brief Reads CSV file and creates InitialConditions object
/// holding initial values for input data
/// @param filename
/// @return InitialCondtions object
InitialConditions readCSVToMap(const std::string& filename);
2 changes: 0 additions & 2 deletions include/micm/solver/cuda_solver_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
*/
#pragma once

#include "rosenbrock_solver_parameters.hpp"

#include <micm/solver/cuda_rosenbrock.hpp>
#include <micm/solver/rosenbrock_solver_parameters.hpp>

Expand Down
10 changes: 5 additions & 5 deletions include/micm/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ namespace micm {
extern "C" {
#endif

const char* GetMicmVersion()
inline const char* GetMicmVersion()
{
return "3.5.0";
}
unsigned GetMicmVersionMajor()
inline unsigned GetMicmVersionMajor()
{
return 3;
}
unsigned GetMicmVersionMinor()
inline unsigned GetMicmVersionMinor()
{
return 5+0;
}
unsigned GetMicmVersionPatch()
inline unsigned GetMicmVersionPatch()
{
return 0+0;
}
unsigned GetMicmVersionTweak()
inline unsigned GetMicmVersionTweak()
{
return +0;
}
Expand Down
10 changes: 5 additions & 5 deletions src/version.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ namespace micm {
extern "C" {
#endif

const char* GetMicmVersion()
inline const char* GetMicmVersion()
{
return "@micm_VERSION@";
}
unsigned GetMicmVersionMajor()
inline unsigned GetMicmVersionMajor()
{
return @micm_VERSION_MAJOR@;
}
unsigned GetMicmVersionMinor()
inline unsigned GetMicmVersionMinor()
{
return @micm_VERSION_MINOR@+0;
}
unsigned GetMicmVersionPatch()
inline unsigned GetMicmVersionPatch()
{
return @micm_VERSION_PATCH@+0;
}
unsigned GetMicmVersionTweak()
inline unsigned GetMicmVersionTweak()
{
return @micm_VERSION_TWEAK@+0;
}
Expand Down

0 comments on commit fa1b8a6

Please sign in to comment.