Skip to content

Commit

Permalink
Merge pull request #226 from codes-org/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
nmcglohon authored Jul 12, 2022
2 parents 579a734 + c7ab8f1 commit 181701e
Show file tree
Hide file tree
Showing 56 changed files with 19,013 additions and 1,936 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,5 @@

# generated files from test runs
ross.csv

install-mastiff/include/codes/model-net-method.h
configure.ac
configure.ac
configure.ac

install-mastiff/include/codes/model-net-method.h
106 changes: 106 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
cmake_minimum_required(VERSION 3.10)

# set the project name and version
project(codes LANGUAGES C CXX VERSION 2.0)

include(CMakePrintHelpers)
cmake_print_variables(CMAKE_CURRENT_SOURCE_DIR)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/cmake/")
cmake_print_variables(CMAKE_MODULE_PATH)

set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}" CACHE PATH "Where to install CODES")

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)

#prevent cmake from stripping the runtime path (important if shared libraries are imported)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

set(ROSS_PKG_CONFIG_PATH "" CACHE PATH "Where is ROSS PKG_CONFIG is installed?")
set(SWM_PKG_CONFIG_PATH "" CACHE PATH "Where is the SWM PKG_CONFIG installed?")
set(ARGOBOTS_PKG_CONFIG_PATH "" CACHE PATH "Where is argobots PKG_COPNFIG installed? Necessary for SWM")
set(DAMARIS_PKG_CONFIG_PATH "" CACHE PATH "Where is the damaris PKG_CONFIG installed?")


find_package(PkgConfig REQUIRED)
set(ENV{PKG_CONFIG_PATH} "${ROSS_PKG_CONFIG_PATH}:${SWM_PKG_CONFIG_PATH}:${ARGOBOTS_PKG_CONFIG_PATH}")
pkg_check_modules(ROSS REQUIRED IMPORTED_TARGET ross)

# MPI
include(SetupMPI)
if(MPI_C_FOUND)
include_directories(${MPI_C_INCLUDE_PATH})
list(APPEND CODES_EXTERNAL_LIBS ${MPI_C_LIBRARIES})
else(MPI_C_FOUND)
message("WARNING: Could not find MPI!")
message(" Either add an MPI compiler to your path (using modules)")
message(" Or force CMake to build using the correct compiler (`export CC=mpicc`)")
endif(MPI_C_FOUND)


## DUMPI
set(DUMPI_BUILD_PATH "" CACHE PATH "Directory where dumpi include and lib are installed")
find_library(DUMPI_LIB undumpi PATHS ${DUMPI_BUILD_PATH}/lib)
if(NOT DUMPI_LIB)
message(STATUS "Undumpi library not found, DUMPI trace workloads disabled")
unset(USE_DUMPI)
else(DUMPI_LIB)
message(STATUS "Undumpi library found ${DUMPI_LIB}")
set(DUMPI_INCLUDE "${DUMPI_BUILD_PATH}/include" CACHE PATH "Dumpi library include")
set(DUMPI_CFLAGS "-I${DUMPI_INCLUDE}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DUMPI_CFLAGS}")
add_definitions(-DUSE_DUMPI=1)
set(USE_DUMPI true)
endif()

## SWM
pkg_check_modules(SWM IMPORTED_TARGET swm)
if(NOT SWM_FOUND)
message(STATUS "SWM Library Not Found, Online workloads disabled")
else(SWM_FOUND)
message(STATUS "SWM Library Found: ${SWM_LIBRARIES}")
pkg_check_modules(ARGOBOTS REQUIRED IMPORTED_TARGET argobots)
if(NOT ARGOBOTS_FOUND)
message(STATUS "Argobots Library Not Found, Online workloads disabled")
else(ARGOBOTS_FOUND)
message(STATUS "Argobots Library Found: ${ARGOBOTS_LIBRARIES}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARGOBOTS_CFLAGS} -I${ARGOBOTS_INCLUDE}")

pkg_get_variable(SWM_DATAROOTDIR swm datarootdir)
cmake_print_variables(SWM_DATAROOTDIR)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SWM_CFLAGS} -I${SWM_INCLUDE}")
add_definitions(-DUSE_ONLINE=1)
set(USE_ONLINE true)
endif()
endif()

## RECORDER
option(USE_RECORDER "use recorder io workload" ON)
if(USE_RECORDER)
add_definitions(-DUSE_RECORDER=1)
endif()

## DARSHAN


## DAMARIS
# pkg_check_modules(DAMARIS IMPORTED_TARGET)
# if(NOT DAMARIS_FOUND)
# message(STATUS "DAMARIS Library not found, Damaris disabled")
# else(DAMARIS_FOUND)
# set(USE_DAMARIS true)
# endif()

cmake_print_variables(CMAKE_C_FLAGS)
add_subdirectory(src)


configure_file(codes_config.h.in codes_config.h)



2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# *_DEVELOP BRANCH REQUIRES ROSS "`tiebreaker`" BRANCH_*

# CODES Discrete-event Simulation Framework

### [Join our CODES user mailing list](https://mailchi.mp/75d0c8aa42c3/codes-user-group) to stay up to date with major changes, events, and news!
Expand Down
5 changes: 4 additions & 1 deletion codes/codes-workload.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" {
#include "configuration.h"

#ifdef USE_ONLINE
#include <abt.h>
#include "abt.h"
#endif
#define MAX_NAME_LENGTH_WKLD 512

Expand Down Expand Up @@ -173,6 +173,9 @@ enum codes_workload_op_type
CODES_WK_MPI_COLL_WRITE,
/* collective_read */
CODES_WK_MPI_COLL_READ,

/* intrumentation */
CODES_WK_MARK,
};

/* I/O operation paramaters */
Expand Down
89 changes: 89 additions & 0 deletions codes/congestion-controller-core.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#ifndef CONGESTION_CONTROLLER_CORE_H
#define CONGESTION_CONTROLLER_CORE_H

/**
* congestion-controller.h -- Organizing state and behavior for congestion management
* Neil McGlohon
*
* Copyright (c) 2019 Rensselaer Polytechnic Institute
*/
#include <ross.h>
#include <codes/codes-jobmap.h>
#define MAX_PATTERN_LEN 32
#define MAX_PORT_COUNT 256

#ifdef __cplusplus
extern "C" {
#endif

extern int g_congestion_control_enabled;
extern tw_stime g_congestion_control_notif_latency;
extern const tw_optdef cc_app_opt [];

// Defines congestion (aggregate of stall)
typedef enum congestion_status
{
UNCONGESTED = 0,
CONGESTED = 1
} congestion_status;

typedef enum controller_type
{
CC_ROUTER = 1,
CC_TERMINAL = 2
} controller_type;

/* Enumeration of types of events sent between congestion controllers */
typedef enum cc_event_t
{
CC_SIGNAL_NORMAL = 1001,
CC_SIGNAL_ABATE,
CC_BANDWIDTH_CHECK,
CC_SIM_ACK // A 'simulated' ack message sent from receiving terminal to original to let it know that its packet was ejected
} cc_event_t;

typedef struct congestion_control_message
{
short type; //type of event
tw_lpid sender_lpid; //lpid of the sender
int app_id;

// Reverse computation values
double saved_window;
double saved_rate;
double saved_bw;
double saved_new_bw; //for commit
tw_stime msg_time; // for commit
unsigned int saved_ejected_bytes;
int num_cc_rngs;
short to_congest;
short to_decongest;

short received_new_while_congested;
int saved_term_id;
double saved_expire_time;

// Dangerous - same LP dynamic RC state -- if this message is to be sent between two LPs, DON'T USE THIS FIELD
size_t size_abated;
size_t size_deabated;
unsigned int* danger_rc_abated;
unsigned int* danger_rc_deabated;
} congestion_control_message;

extern void congestion_control_register_terminal_lpname(char lp_name[]);
extern void congestion_control_register_router_lpname(char lp_name[]);

extern int congestion_control_set_jobmap(struct codes_jobmap_ctx *jobmap_ctx, int net_id);
extern int congestion_control_is_jobmap_set();
extern int congestion_control_get_job_count();
extern struct codes_jobmap_ctx* congestion_control_get_jobmap();
extern void congestion_control_notify_rank_completion(tw_lp *lp);
extern void congestion_control_notify_rank_completion_rc(tw_lp *lp);
extern void congestion_control_notify_job_completion(tw_lp *lp, int app_id);
extern void congestion_control_notify_job_completion_rc(tw_lp *lp, int app_id);

#ifdef __cplusplus
}
#endif

#endif /* end of include guard */
Loading

0 comments on commit 181701e

Please sign in to comment.