Commit 9a9768e5 authored by Youngsung Kim's avatar Youngsung Kim
Browse files

Test passed on Windows

parent 8d5eff20
Loading
Loading
Loading
Loading
+23 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ include(cmake/machine.cmake)
set_environment()

project(triton CXX)
set(CMAKE_CXX_STANDARD 17) # minimum C++ standard to support Kokkos
set(CMAKE_CXX_STANDARD 20) # minimum C++ standard to support Kokkos
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

@@ -27,7 +27,28 @@ add_subdirectory(${TRITON_SOURCE_DIR}/external)

# build triton
add_executable(${TRITON_EXECUTABLE} ./src/main.cpp)
target_link_libraries(${TRITON_EXECUTABLE} PUBLIC kokkos)
target_link_libraries(${TRITON_EXECUTABLE} PUBLIC kokkos MPI::MPI_CXX)

if(WIN32)
    if(MPI_CXX_INCLUDE_PATH)
        target_include_directories(${TRITON_EXECUTABLE} PRIVATE ${MPI_CXX_INCLUDE_PATH})
    endif()
    if(MPI_C_INCLUDE_PATH)
        target_include_directories(${TRITON_EXECUTABLE} PRIVATE ${MPI_C_INCLUDE_PATH})
    endif()
endif()

# Windows specific
if(WIN32)
    target_compile_definitions(${TRITON_EXECUTABLE} PRIVATE 
        _CRT_SECURE_NO_WARNINGS
        _USE_MATH_DEFINES
        NOMINMAX
    )
    target_compile_options(${TRITON_EXECUTABLE} PRIVATE /EHsc) 
    # Link ws2_32 for Winsock (used in win_compat.h)
    target_link_libraries(${TRITON_EXECUTABLE} PRIVATE ws2_32)
endif()

if (ENSEMBLE_BUILD)
  target_link_libraries(${TRITON_EXECUTABLE} PUBLIC yaml-cpp)
+2 −1
Original line number Diff line number Diff line
@echo off

set TRITON_BACKEND=SERIAL
set TRITON_ARCH=SKL
REM set TRITON_ARCH=HSW
REM SKL BDW

set TRITON_COMPILER=mpic++
set TRITON_RUN_COMMAND=mpirun -n 8
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#define CONFIG_UTILS_H

#include "string_utils.h"
#include "win_compat.h"

namespace ConfigUtils
{
+10 −0
Original line number Diff line number Diff line
@@ -21,7 +21,11 @@

#include <Kokkos_Core.hpp>
#include <Kokkos_StdAlgorithms.hpp>
#ifndef _WIN32
#include <libgen.h> // to fix "use of undeclared basename" error
#else
#include "win_compat.h"
#endif
#define AUTO_LABEL() const_cast<char*>((std::string(__FILE__) + ":" + std::to_string(__LINE__)).c_str())

#define DEBUG() {Kokkos::fence(); MPI_Barrier(MPI_COMM_WORLD); std::cout << __FILE__ << " , " << __LINE__ << std::endl;}
@@ -146,7 +150,13 @@ typedef double value_t; /**< Data type to represent floating-point number. It
#define OK GREEN << "[OK] " << RESET	    /**< Success Message */
#define INFO GRAY << "[INFO] " << RESET	    /**< Info Message */
#define WARN YELLOW << "[!!] " << RESET	    /**< Warning Message */
#ifdef ERROR
#undef ERROR
#endif
#define ERROR  RED << "[ERROR] " << RESET	/**< Error Message */
#ifdef IN
#undef IN
#endif
#define IN GRAY << "[..] " << RESET	        /**< Other Message 1 */
#define DASH BLUE << "[--] " << RESET	    /**< Other Message 2 */

+15 −0
Original line number Diff line number Diff line
@@ -23,13 +23,19 @@
#include <map>
#include <fstream>
#include <vector>
#ifndef _WIN32
#include <sys/time.h>
#endif
#include <sys/stat.h>
#ifndef _WIN32
#include <unistd.h>
#endif
#include <algorithm>
#include <sstream>
#include <iomanip>
#ifndef _WIN32
#include <dirent.h>
#endif
#include <cmath>
#include <cstring>

@@ -37,6 +43,14 @@
#include <omp.h>
#endif

// Windows Compatibility
#include "win_compat.h"

// Only include dirent.h if NOT Windows (or if we have a compat wrapper, but we verified it's likely unused)
#ifndef _WIN32
#include <dirent.h>
#endif

#include "mpi.h"
#include "Ensify.h"

@@ -86,6 +100,7 @@ int main(int argc, char* argv[])

    //initialize
    model.initialize(rank, size);
    
    //simulate
    model.simulate();
  }
Loading