Commit edfdacf0 authored by Cianciosa, Mark's avatar Cianciosa, Mark
Browse files

Merge branch 'workflows' into 'main'

Create a workflow manager infrastructure to enable more complex kernel deployments.

See merge request !4
parents f24a28ab 97ccef85
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -66,11 +66,6 @@ target_link_libraries (gpu_lib
                       $<$<BOOL:${USE_METAL}>:metal_lib>
                       $<$<BOOL:${USE_CUDA}>:cuda_lib>
)
target_compile_definitions (gpu_lib
                            INTERFACE
                            $<$<BOOL:${USE_METAL}>:USE_GPU>
                            $<$<BOOL:${USE_CUDA}>:USE_GPU>
)

#-------------------------------------------------------------------------------
#  Sanitizer options
+7 −11
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
#include <thread>
#include <random>

#include "../graph_framework/cpu_backend.hpp"
#include "../graph_framework/backend.hpp"
#include "../graph_framework/solver.hpp"
#include "../graph_framework/timing.hpp"

@@ -17,7 +17,7 @@ void write_time(const std::string &name, const std::chrono::nanoseconds time);
//------------------------------------------------------------------------------
///  @brief Main program of the driver.
///
///  @param[in] t Current Time.
///  @params[in] t Current Time.
//------------------------------------------------------------------------------
template<typename base>
static base solution(const base t) {
@@ -27,8 +27,8 @@ static base solution(const base t) {
//------------------------------------------------------------------------------
///  @brief Main program of the driver.
///
///  @param[in] argc Number of commandline arguments.
///  @param[in] argv Array of commandline arguments.
///  @params[in] argc Number of commandline arguments.
///  @params[in] argv Array of commandline arguments.
//------------------------------------------------------------------------------
int main(int argc, const char * argv[]) {
    START_GPU
@@ -45,17 +45,13 @@ int main(int argc, const char * argv[]) {
    const size_t num_rays = 1000000;

    std::vector<std::thread> threads(0);
#if USE_GPU
    if constexpr (jit::can_jit<base> ()) {
    if constexpr (jit::use_gpu<base> ()) {
        threads.resize(1);
    } else {
#endif
        threads.resize(std::max(std::min(std::thread::hardware_concurrency(),
                                         static_cast<unsigned int> (num_rays)),
                                static_cast<unsigned int> (1)));
#if USE_GPU
    }
#endif

    for (size_t i = 0, ie = threads.size(); i < ie; i++) {
        threads[i] = std::thread([num_times, num_rays] (const size_t thread_number,
@@ -102,7 +98,7 @@ int main(int argc, const char * argv[]) {
            solver::rk4<dispersion::cold_plasma<base>>
                solve(omega, kx, ky, kz, x, y, z, t, 60.0/num_times, eq);
            solve.init(kx);
            solve.compile(num_rays);
            solve.compile();
            if (thread_number == 0) {
                solve.print_dispersion();
                std::cout << std::endl;
@@ -135,7 +131,7 @@ int main(int argc, const char * argv[]) {
            if (thread_number == 0) {
                solve.print(sample);
            } else {
                solve.sync();
                solve.sync_host();
            }

        }, i, threads.size());
+36 −20
Original line number Diff line number Diff line
@@ -3,13 +3,11 @@
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 50;
	objectVersion = 53;
	objects = {

/* Begin PBXBuildFile section */
		C71342662947D57900672AD4 /* metal_context.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C71342652947D57900672AD4 /* metal_context.hpp */; };
		C713426A2947F39400672AD4 /* Metal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C71342682947F36100672AD4 /* Metal.framework */; };
		C721EA9A2833FF7800EAFB2D /* equilibrium.hpp in Headers */ = {isa = PBXBuildFile; fileRef = C721EA992833FF7800EAFB2D /* equilibrium.hpp */; };
		C79141B622DAAD0C00E0BA0D /* xrays.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C79141B522DAAD0C00E0BA0D /* xrays.cpp */; };
		C7E5644528A2A1AA000F31A2 /* backend_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C7931E7328074F540033B488 /* backend_test.cpp */; };
		C7E5645128A2A1DD000F31A2 /* dispersion_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C7931E6B28073BCA0033B488 /* dispersion_test.cpp */; };
@@ -128,13 +126,12 @@
		C721EA992833FF7800EAFB2D /* equilibrium.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = equilibrium.hpp; sourceTree = "<group>"; };
		C723210222DC0D0A006BBF13 /* arithmetic.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = arithmetic.hpp; sourceTree = "<group>"; };
		C725CD792840088000D0EDE2 /* physics_test.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = physics_test.cpp; sourceTree = "<group>"; };
		C72D922D280489D10051BAF2 /* backend_protocall.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = backend_protocall.hpp; sourceTree = "<group>"; };
		C72D922E28048D720051BAF2 /* cpu_backend.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = cpu_backend.hpp; sourceTree = "<group>"; };
		C77E6DF522DD64E700469621 /* trigonometry.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = trigonometry.hpp; sourceTree = "<group>"; };
		C79141A622DA9BF200E0BA0D /* libgraph_framework.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgraph_framework.a; sourceTree = BUILT_PRODUCTS_DIR; };
		C79141AE22DA9C3000E0BA0D /* node.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = node.hpp; sourceTree = "<group>"; };
		C79141B322DAAD0C00E0BA0D /* graph_driver */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = graph_driver; sourceTree = BUILT_PRODUCTS_DIR; };
		C79141B522DAAD0C00E0BA0D /* xrays.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = xrays.cpp; sourceTree = "<group>"; };
		C7922EEB29E0ABDF000BB9C7 /* workflow.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = workflow.hpp; sourceTree = "<group>"; };
		C7931E6A28073BCA0033B488 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
		C7931E6B28073BCA0033B488 /* dispersion_test.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = dispersion_test.cpp; sourceTree = "<group>"; };
		C7931E6C28073BCA0033B488 /* solver_test.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = solver_test.cpp; sourceTree = "<group>"; };
@@ -145,6 +142,8 @@
		C7931E7128073BF30033B488 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
		C7931E7228073BFC0033B488 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
		C7931E7328074F540033B488 /* backend_test.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = backend_test.cpp; sourceTree = "<group>"; };
		C7B677D829E45C9500D3ADC6 /* backend.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = backend.hpp; sourceTree = "<group>"; };
		C7B677DA29E464AE00D3ADC6 /* cpu_context.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = cpu_context.hpp; sourceTree = "<group>"; };
		C7CEA0042948D02A00F61D09 /* timing.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = timing.hpp; sourceTree = "<group>"; };
		C7CEA0052948EB0F00F61D09 /* cuda_context.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = cuda_context.hpp; sourceTree = "<group>"; };
		C7E5643E28A2A16F000F31A2 /* backend_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = backend_test; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -286,18 +285,19 @@
			children = (
				C7931E7028073BE70033B488 /* CMakeLists.txt */,
				C79141AE22DA9C3000E0BA0D /* node.hpp */,
				C7922EEB29E0ABDF000BB9C7 /* workflow.hpp */,
				C71C1FF727F61DFA006997C2 /* math.hpp */,
				C71C1FF827F621E7006997C2 /* vector.hpp */,
				C723210222DC0D0A006BBF13 /* arithmetic.hpp */,
				C77E6DF522DD64E700469621 /* trigonometry.hpp */,
				C71C1FF527F5379D006997C2 /* dispersion.hpp */,
				C71C1FF627F5F5A8006997C2 /* solver.hpp */,
				C72D922D280489D10051BAF2 /* backend_protocall.hpp */,
				C72D922E28048D720051BAF2 /* cpu_backend.hpp */,
				C7B677D829E45C9500D3ADC6 /* backend.hpp */,
				C721EA992833FF7800EAFB2D /* equilibrium.hpp */,
				C713425B29413F0500672AD4 /* jit.hpp */,
				C713425C2942665300672AD4 /* register.hpp */,
				C71342652947D57900672AD4 /* metal_context.hpp */,
				C7B677DA29E464AE00D3ADC6 /* cpu_context.hpp */,
				C7CEA0052948EB0F00F61D09 /* cuda_context.hpp */,
				C7CEA0042948D02A00F61D09 /* timing.hpp */,
			);
@@ -337,8 +337,6 @@
			isa = PBXHeadersBuildPhase;
			buildActionMask = 2147483647;
			files = (
				C71342662947D57900672AD4 /* metal_context.hpp in Headers */,
				C721EA9A2833FF7800EAFB2D /* equilibrium.hpp in Headers */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
@@ -538,7 +536,8 @@
		C791419E22DA9BF200E0BA0D /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastUpgradeCheck = 1410;
				BuildIndependentTargetsInParallel = YES;
				LastUpgradeCheck = 1430;
				ORGANIZATIONNAME = "Cianciosa, Mark R.";
				TargetAttributes = {
					C79141A522DA9BF200E0BA0D = {
@@ -701,7 +700,7 @@
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "c++17";
				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
@@ -739,9 +738,11 @@
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					USE_METAL,
					USE_REDUCE,
					"CXX=\\\"c++\\\"",
					"DEBUG=1",
					"$(inherited)",
					USE_METAL,
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -768,7 +769,7 @@
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "c++17";
				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
@@ -803,7 +804,12 @@
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				GCC_C_LANGUAGE_STANDARD = gnu11;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_PREPROCESSOR_DEFINITIONS = USE_METAL;
				GCC_PREPROCESSOR_DEFINITIONS = (
					USE_METAL,
					USE_REDUCE,
					"CXX=\\\"c++\\\"",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -830,6 +836,8 @@
				DEVELOPMENT_TEAM = 2M4J3Y9U5K;
				EXECUTABLE_PREFIX = lib;
				MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
				OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
				OTHER_LDFLAGS = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
				SKIP_INSTALL = YES;
			};
@@ -843,6 +851,8 @@
				DEVELOPMENT_TEAM = 2M4J3Y9U5K;
				EXECUTABLE_PREFIX = lib;
				MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
				OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
				OTHER_LDFLAGS = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
				SKIP_INSTALL = YES;
			};
@@ -851,11 +861,14 @@
		C79141B822DAAD0C00E0BA0D /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
				CODE_SIGN_IDENTITY = "-";
				CODE_SIGN_STYLE = Automatic;
				DEAD_CODE_STRIPPING = YES;
				DEVELOPMENT_TEAM = "";
				GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
				MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
				OTHER_CPLUSPLUSFLAGS = "-fsanitize=float-divide-by-zero";
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
			name = Debug;
@@ -863,11 +876,15 @@
		C79141B922DAAD0C00E0BA0D /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
				CODE_SIGN_IDENTITY = "-";
				CODE_SIGN_STYLE = Automatic;
				DEAD_CODE_STRIPPING = YES;
				DEVELOPMENT_TEAM = "";
				GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
				MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
				OTHER_CPLUSPLUSFLAGS = "";
				OTHER_LDFLAGS = "";
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
			name = Release;
@@ -1043,7 +1060,7 @@
		C7E5649728A2A34A000F31A2 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
				CODE_SIGN_IDENTITY = "-";
				CODE_SIGN_STYLE = Automatic;
				DEAD_CODE_STRIPPING = YES;
@@ -1055,7 +1072,7 @@
		C7E5649828A2A34A000F31A2 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
				CLANG_CXX_LANGUAGE_STANDARD = "c++20";
				CODE_SIGN_IDENTITY = "-";
				CODE_SIGN_STYLE = Automatic;
				DEAD_CODE_STRIPPING = YES;
@@ -1068,12 +1085,10 @@
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CODE_SIGN_IDENTITY = "-";
				"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
				CODE_SIGN_STYLE = Automatic;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
				MACOSX_DEPLOYMENT_TARGET = 12.6;
				PRODUCT_NAME = "$(TARGET_NAME)";
			};
@@ -1083,6 +1098,7 @@
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CODE_SIGN_IDENTITY = "-";
				"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
				CODE_SIGN_STYLE = Automatic;
				MACOSX_DEPLOYMENT_TARGET = 12.6;
+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "1410"
   LastUpgradeVersion = "1430"
   version = "1.3">
   <BuildAction
      parallelizeBuildables = "YES"
+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "1410"
   LastUpgradeVersion = "1430"
   version = "1.3">
   <BuildAction
      parallelizeBuildables = "YES"
Loading