Commit 1b9a6e37 authored by Neil McGlohon's avatar Neil McGlohon
Browse files

Merge branch 'workloads' of xgitlab.cels.anl.gov:codes/codes into dfp-online-workloads

parents aeb2cd91 6d89c6d8
...@@ -57,6 +57,12 @@ AM_CPPFLAGS += ${RECORDER_CPPFLAGS} ...@@ -57,6 +57,12 @@ AM_CPPFLAGS += ${RECORDER_CPPFLAGS}
src_libcodes_la_SOURCES += src/workload/methods/codes-recorder-io-wrkld.c src_libcodes_la_SOURCES += src/workload/methods/codes-recorder-io-wrkld.c
endif endif
if USE_ONLINE
AM_CPPFLAGS += ${ARGOBOTS_CFLAGS} ${SWM_CFLAGS} -DUSE_ONLINE=1
LDADD += ${SWM_LIBS} ${ARGOBOTS_LIBS}
src_libcodes_la_SOURCES += src/workload/methods/codes-online-comm-wrkld.C
endif
if USE_DUMPI if USE_DUMPI
AM_CPPFLAGS += ${DUMPI_CFLAGS} -DUSE_DUMPI=1 AM_CPPFLAGS += ${DUMPI_CFLAGS} -DUSE_DUMPI=1
src_libcodes_la_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c src_libcodes_la_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c
......
...@@ -19,6 +19,9 @@ extern "C" { ...@@ -19,6 +19,9 @@ extern "C" {
#include <ross.h> #include <ross.h>
#include "configuration.h" #include "configuration.h"
#ifdef USE_ONLINE
#include <abt.h>
#endif
#define MAX_NAME_LENGTH_WKLD 512 #define MAX_NAME_LENGTH_WKLD 512
/* implementations included with codes */ /* implementations included with codes */
...@@ -30,6 +33,7 @@ typedef struct recorder_params recorder_params; ...@@ -30,6 +33,7 @@ typedef struct recorder_params recorder_params;
/* struct to hold the actual data from a single MPI event*/ /* struct to hold the actual data from a single MPI event*/
typedef struct dumpi_trace_params dumpi_trace_params; typedef struct dumpi_trace_params dumpi_trace_params;
typedef struct checkpoint_wrkld_params checkpoint_wrkld_params; typedef struct checkpoint_wrkld_params checkpoint_wrkld_params;
typedef struct online_comm_params online_comm_params;
struct iomock_params struct iomock_params
{ {
...@@ -77,6 +81,11 @@ struct dumpi_trace_params { ...@@ -77,6 +81,11 @@ struct dumpi_trace_params {
#endif #endif
}; };
struct online_comm_params {
char workload_name[MAX_NAME_LENGTH_WKLD];
char file_path[MAX_NAME_LENGTH_WKLD];
int nprocs;
};
struct checkpoint_wrkld_params struct checkpoint_wrkld_params
{ {
int nprocs; /* number of workload processes */ int nprocs; /* number of workload processes */
...@@ -218,14 +227,14 @@ struct codes_workload_op ...@@ -218,14 +227,14 @@ struct codes_workload_op
} collective; } collective;
struct { struct {
int count; int count;
unsigned int* req_ids; uint32_t* req_ids;
} waits; } waits;
struct { struct {
unsigned int req_id; uint32_t req_id;
} wait; } wait;
struct struct
{ {
unsigned int req_id; uint32_t req_id;
} }
free; free;
}u; }u;
...@@ -306,6 +315,13 @@ int codes_workload_get_rank_cnt( ...@@ -306,6 +315,13 @@ int codes_workload_get_rank_cnt(
const char* params, const char* params,
int app_id); int app_id);
/* Finalize the workload */
int codes_workload_finalize(
const char* type,
const char* params,
int app_id,
int rank);
/* for debugging/logging: print an individual operation to the specified file */ /* for debugging/logging: print an individual operation to the specified file */
void codes_workload_print_op( void codes_workload_print_op(
FILE *f, FILE *f,
...@@ -324,6 +340,7 @@ struct codes_workload_method ...@@ -324,6 +340,7 @@ struct codes_workload_method
void (*codes_workload_get_next)(int app_id, int rank, struct codes_workload_op *op); void (*codes_workload_get_next)(int app_id, int rank, struct codes_workload_op *op);
void (*codes_workload_get_next_rc2)(int app_id, int rank); void (*codes_workload_get_next_rc2)(int app_id, int rank);
int (*codes_workload_get_rank_cnt)(const char* params, int app_id); int (*codes_workload_get_rank_cnt)(const char* params, int app_id);
int (*codes_workload_finalize)(const char* params, int app_id, int rank);
}; };
......
...@@ -104,6 +104,24 @@ fi ...@@ -104,6 +104,24 @@ fi
AM_CONDITIONAL(USE_DARSHAN, [test "x${use_darshan}" = xyes]) AM_CONDITIONAL(USE_DARSHAN, [test "x${use_darshan}" = xyes])
# check for Argobots
AC_ARG_WITH([online],[AS_HELP_STRING([--with-online@<:@=DIR@:>@],
[Build with the online workloads and argobots support])],
[use_online=yes],[use_online=no])
if test "x${use_online}" != "x" ; then
AM_CONDITIONAL(USE_ONLINE, true)
PKG_CHECK_MODULES_STATIC([ARGOBOTS], [argobots], [],
[AC_MSG_ERROR([Could not find working argobots installation via pkg-config])])
PKG_CHECK_MODULES_STATIC([SWM], [swm], [],
[AC_MSG_ERROR([Could not find working swm installation via pkg-config])])
PKG_CHECK_VAR([SWM_DATAROOTDIR], [swm], [datarootdir], [],
[AC_MSG_ERROR[Could not find shared directory in SWM]])
AC_DEFINE_UNQUOTED([SWM_DATAROOTDIR], ["$SWM_DATAROOTDIR"], [if using json
data files])
else
AM_CONDITIONAL(USE_ONLINE, false)
fi
# check for Recorder # check for Recorder
AM_CONDITIONAL(USE_RECORDER, true) AM_CONDITIONAL(USE_RECORDER, true)
RECORDER_CPPFLAGS="-DUSE_RECORDER=1" RECORDER_CPPFLAGS="-DUSE_RECORDER=1"
......
...@@ -14,11 +14,15 @@ python_cflags=@PYTHON_CFLAGS@ ...@@ -14,11 +14,15 @@ python_cflags=@PYTHON_CFLAGS@
python_libs=@PYTHON_LIBS@ python_libs=@PYTHON_LIBS@
boost_cflags=@BOOST_CFLAGS@ boost_cflags=@BOOST_CFLAGS@
boost_libs=@BOOST_LIBS@ boost_libs=@BOOST_LIBS@
argobots_libs=@ARGOBOTS_LIBS@
argobots_cflags=@ARGOBOTS_CFLAGS@
swm_libs=@SWM_LIBS@
swm_cflags=@SWM_CFLAGS@
Name: codes-base Name: codes-base
Description: Base functionality for CODES storage simulation Description: Base functionality for CODES storage simulation
Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@
URL: http://trac.mcs.anl.gov/projects/CODES URL: http://trac.mcs.anl.gov/projects/CODES
Requires: Requires:
Libs: -L${libdir} -lcodes ${ross_libs} ${darshan_libs} ${dumpi_libs} ${cortex_libs} Libs: -L${libdir} -lcodes ${ross_libs} ${argobots_libs} ${swm_libs} ${darshan_libs} ${dumpi_libs} ${cortex_libs}
Cflags: -I${includedir} ${ross_cflags} ${darshan_cflags} ${dumpi_cflags} ${cortex_cflags} Cflags: -I${includedir} ${swm_datarootdir} ${ross_cflags} ${darshan_cflags} ${swm_cflags} ${argobots_cflags} ${dumpi_cflags} ${cortex_cflags}
...@@ -41,7 +41,7 @@ PARAMS ...@@ -41,7 +41,7 @@ PARAMS
# bandwidth in GiB/s for compute node-router channels # bandwidth in GiB/s for compute node-router channels
cn_bandwidth="16.0"; cn_bandwidth="16.0";
# ROSS message size # ROSS message size
message_size="608"; message_size="624";
# number of compute nodes connected to router, dictated by dragonfly config # number of compute nodes connected to router, dictated by dragonfly config
# file # file
num_cns_per_router="4"; num_cns_per_router="4";
......
...@@ -23,6 +23,6 @@ PARAMS ...@@ -23,6 +23,6 @@ PARAMS
local_bandwidth="5.25"; local_bandwidth="5.25";
global_bandwidth="4.7"; global_bandwidth="4.7";
cn_bandwidth="5.25"; cn_bandwidth="5.25";
message_size="608"; message_size="624";
routing="adaptive"; routing="adaptive";
} }
...@@ -4,12 +4,20 @@ ...@@ -4,12 +4,20 @@
* *
*/ */
#include <mpi.h> #include <mpi.h>
#ifdef USE_ONLINE
#include <abt.h>
#endif
#include "codes/codes-mpi-replay.h" #include "codes/codes-mpi-replay.h"
int main(int argc, char** argv) { int main(int argc, char** argv) {
MPI_Init(&argc,&argv);
MPI_Init(&argc,&argv);
#ifdef USE_ONLINE
ABT_init(argc, argv);
#endif
// int rank, size; // int rank, size;
// MPI_Comm_rank(MPI_COMM_WORLD,&rank); // MPI_Comm_rank(MPI_COMM_WORLD,&rank);
// MPI_Comm_size(MPI_COMM_WORLD,&size); // MPI_Comm_size(MPI_COMM_WORLD,&size);
...@@ -22,6 +30,10 @@ int main(int argc, char** argv) { ...@@ -22,6 +30,10 @@ int main(int argc, char** argv) {
modelnet_mpi_replay(MPI_COMM_WORLD,&argc,&argv); modelnet_mpi_replay(MPI_COMM_WORLD,&argc,&argv);
int flag; int flag;
#ifdef USE_ONLINE
ABT_finalize();
#endif
MPI_Finalized(&flag); MPI_Finalized(&flag);
if(!flag) MPI_Finalize(); if(!flag) MPI_Finalize();
return 0; return 0;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <ross.h> #include <ross.h>
#include <inttypes.h> #include <inttypes.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/resource.h>
#include "codes/codes-workload.h" #include "codes/codes-workload.h"
#include "codes/codes.h" #include "codes/codes.h"
#include "codes/configuration.h" #include "codes/configuration.h"
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define TRACE -1 #define TRACE -1
#define MAX_WAIT_REQS 512 #define MAX_WAIT_REQS 512
#define CS_LP_DBG 1 #define CS_LP_DBG 1
#define RANK_HASH_TABLE_SZ 2000 #define RANK_HASH_TABLE_SZ 512
#define NW_LP_NM "nw-lp" #define NW_LP_NM "nw-lp"
#define lprintf(_fmt, ...) \ #define lprintf(_fmt, ...) \
do {if (CS_LP_DBG) printf(_fmt, __VA_ARGS__);} while (0) do {if (CS_LP_DBG) printf(_fmt, __VA_ARGS__);} while (0)
...@@ -37,13 +37,14 @@ static int debug_cols = 0; ...@@ -37,13 +37,14 @@ static int debug_cols = 0;
/* Turning on this option slows down optimistic mode substantially. Only turn /* Turning on this option slows down optimistic mode substantially. Only turn
* on if you get issues with wait-all completion with traces. */ * on if you get issues with wait-all completion with traces. */
static int preserve_wait_ordering = 0; static int preserve_wait_ordering = 0;
static int enable_msg_tracking = 0; static int enable_msg_tracking = 1;
static int is_synthetic = 0; static int is_synthetic = 0;
tw_lpid TRACK_LP = -1; tw_lpid TRACK_LP = -1;
int nprocs = 0; int nprocs = 0;
static double total_syn_data = 0; static double total_syn_data = 0;
static int unmatched = 0; static int unmatched = 0;
char workload_type[128]; char workload_type[128];
char workload_name[128];
char workload_file[8192]; char workload_file[8192];
char offset_file[8192]; char offset_file[8192];
static int wrkld_id; static int wrkld_id;
...@@ -51,14 +52,18 @@ static int num_net_traces = 0; ...@@ -51,14 +52,18 @@ static int num_net_traces = 0;
static int num_dumpi_traces = 0; static int num_dumpi_traces = 0;
static int64_t EAGER_THRESHOLD = 8192; static int64_t EAGER_THRESHOLD = 8192;
static long num_ops = 0;
static upper_threshold = 1048576;
static int alloc_spec = 0; static int alloc_spec = 0;
static tw_stime self_overhead = 10.0; static tw_stime self_overhead = 10.0;
static tw_stime mean_interval = 100000; static tw_stime mean_interval = 100000;
static int payload_sz = 1024; static int payload_sz = 1024;
/* Doing LP IO*/ /* Doing LP IO*/
static char * params = NULL;
static char lp_io_dir[256] = {'\0'}; static char lp_io_dir[256] = {'\0'};
static char sampling_dir[32] = {'\0'}; static char sampling_dir[32] = {'\0'};
static char mpi_msg_dir[32] = {'\0'};
static lp_io_handle io_handle; static lp_io_handle io_handle;
static unsigned int lp_io_use_suffix = 0; static unsigned int lp_io_use_suffix = 0;
static int do_lp_io = 0; static int do_lp_io = 0;
...@@ -89,10 +94,11 @@ typedef struct nw_message nw_message; ...@@ -89,10 +94,11 @@ typedef struct nw_message nw_message;
typedef unsigned int dumpi_req_id; typedef unsigned int dumpi_req_id;
static int net_id = 0; static int net_id = 0;
static float noise = 2.0; static float noise = 0.1;
static int num_nw_lps = 0, num_mpi_lps = 0; static int num_nw_lps = 0, num_mpi_lps = 0;
static int num_syn_clients; static int num_syn_clients;
static int syn_type = 0;
FILE * workload_log = NULL; FILE * workload_log = NULL;
FILE * msg_size_log = NULL; FILE * msg_size_log = NULL;
...@@ -195,7 +201,7 @@ struct msg_size_info ...@@ -195,7 +201,7 @@ struct msg_size_info
int num_msgs; int num_msgs;
tw_stime agg_latency; tw_stime agg_latency;
tw_stime avg_latency; tw_stime avg_latency;
struct qhash_head * hash_link; struct qhash_head hash_link;
struct qlist_head ql; struct qlist_head ql;
}; };
typedef struct mpi_msgs_queue mpi_msgs_queue; typedef struct mpi_msgs_queue mpi_msgs_queue;
...@@ -279,6 +285,7 @@ struct nw_state ...@@ -279,6 +285,7 @@ struct nw_state
int max_arr_size; int max_arr_size;
struct mpi_workload_sample * mpi_wkld_samples; struct mpi_workload_sample * mpi_wkld_samples;
char output_buf[512]; char output_buf[512];
//char output_buf2[512];
char col_stats[64]; char col_stats[64];
}; };
...@@ -319,6 +326,7 @@ struct nw_message ...@@ -319,6 +326,7 @@ struct nw_message
double saved_delay; double saved_delay;
int64_t saved_num_bytes; int64_t saved_num_bytes;
int saved_syn_length; int saved_syn_length;
struct codes_workload_op * mpi_op;
} rc; } rc;
}; };
...@@ -403,7 +411,7 @@ static void update_message_size( ...@@ -403,7 +411,7 @@ static void update_message_size(
struct qhash_head * hash_link = NULL; struct qhash_head * hash_link = NULL;
tw_stime msg_init_time = qitem->req_init_time; tw_stime msg_init_time = qitem->req_init_time;
if(!ns->msg_sz_table) if(ns->msg_sz_table == NULL)
ns->msg_sz_table = qhash_init(msg_size_hash_compare, quickhash_64bit_hash, RANK_HASH_TABLE_SZ); ns->msg_sz_table = qhash_init(msg_size_hash_compare, quickhash_64bit_hash, RANK_HASH_TABLE_SZ);
hash_link = qhash_search(ns->msg_sz_table, &(qitem->num_bytes)); hash_link = qhash_search(ns->msg_sz_table, &(qitem->num_bytes));
...@@ -419,9 +427,11 @@ static void update_message_size( ...@@ -419,9 +427,11 @@ static void update_message_size(
msg_info->num_msgs = 1; msg_info->num_msgs = 1;
msg_info->agg_latency = tw_now(lp) - msg_init_time; msg_info->agg_latency = tw_now(lp) - msg_init_time;
msg_info->avg_latency = msg_info->agg_latency; msg_info->avg_latency = msg_info->agg_latency;
qhash_add(ns->msg_sz_table, &(msg_info->msg_size), msg_info->hash_link); assert(ns->msg_sz_table);
// printf("\n Msg size %lld aggregate latency %f num messages %d ", msg_info->msg_size, msg_info->agg_latency, msg_info->num_msgs);
qhash_add(ns->msg_sz_table, &(msg_info->msg_size), &(msg_info->hash_link));
qlist_add(&msg_info->ql, &ns->msg_sz_list); qlist_add(&msg_info->ql, &ns->msg_sz_list);
//printf("\n Msg size %d aggregate latency %f num messages %d ", m->fwd.num_bytes, msg_info->agg_latency, msg_info->num_msgs);
} }
else else
{ {
...@@ -429,7 +439,7 @@ static void update_message_size( ...@@ -429,7 +439,7 @@ static void update_message_size(
tmp->num_msgs++; tmp->num_msgs++;
tmp->agg_latency += tw_now(lp) - msg_init_time; tmp->agg_latency += tw_now(lp) - msg_init_time;
tmp->avg_latency = (tmp->agg_latency / tmp->num_msgs); tmp->avg_latency = (tmp->agg_latency / tmp->num_msgs);
// printf("\n Msg size %d aggregate latency %f num messages %d ", qitem->num_bytes, tmp->agg_latency, tmp->num_msgs); // printf("\n Msg size %lld aggregate latency %f num messages %d ", qitem->num_bytes, tmp->agg_latency, tmp->num_msgs);
} }
} }
static void notify_background_traffic_rc( static void notify_background_traffic_rc(
...@@ -748,7 +758,18 @@ void arrive_syn_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp) ...@@ -748,7 +758,18 @@ void arrive_syn_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp)
(void)bf; (void)bf;
(void)lp; (void)lp;
// printf("\n Data arrived %d total data %ld ", m->fwd.num_bytes, s->syn_data); if(s->local_rank == 0)
{
printf("\n Data arrived %lld rank %llu total data %ld ", m->fwd.num_bytes, s->nw_id, s->syn_data);
if(s->syn_data > upper_threshold)
{
struct rusage mem_usage;
int who = RUSAGE_SELF;
int err = getrusage(who, &mem_usage);
printf("\n Memory usage %lf gigabytes", ((double)mem_usage.ru_maxrss / (1024.0 * 1024.0)));
upper_threshold += 1048576;
}
}
int data = m->fwd.num_bytes; int data = m->fwd.num_bytes;
s->syn_data += data; s->syn_data += data;
num_syn_bytes_recvd += data; num_syn_bytes_recvd += data;
...@@ -773,7 +794,7 @@ static void print_msgs_queue(struct qlist_head * head, int is_send) ...@@ -773,7 +794,7 @@ static void print_msgs_queue(struct qlist_head * head, int is_send)
qlist_for_each(ent, head) qlist_for_each(ent, head)
{ {
current = qlist_entry(ent, mpi_msgs_queue, ql); current = qlist_entry(ent, mpi_msgs_queue, ql);
printf(" \n Source %d Dest %d bytes %"PRId64" tag %d ", current->source_rank, current->dest_rank, current->num_bytes, current->tag); //printf(" \n Source %d Dest %d bytes %"PRId64" tag %d ", current->source_rank, current->dest_rank, current->num_bytes, current->tag);
} }
} }
static void print_completed_queue(tw_lp * lp, struct qlist_head * head) static void print_completed_queue(tw_lp * lp, struct qlist_head * head)
...@@ -928,6 +949,7 @@ static void codes_exec_mpi_wait_rc(nw_state* s, tw_bf * bf, tw_lp* lp, nw_messag ...@@ -928,6 +949,7 @@ static void codes_exec_mpi_wait_rc(nw_state* s, tw_bf * bf, tw_lp* lp, nw_messag
index++; index++;
} }
} }
//get_next_mpi_operation_rc(s, bf, lp, m);
codes_issue_next_event_rc(lp); codes_issue_next_event_rc(lp);
return; return;
} }
...@@ -964,6 +986,7 @@ static void codes_exec_mpi_wait(nw_state* s, tw_bf * bf, nw_message * m, tw_lp* ...@@ -964,6 +986,7 @@ static void codes_exec_mpi_wait(nw_state* s, tw_bf * bf, nw_message * m, tw_lp*
tw_output(lp, "\n wait matched at post %d ", req_id); tw_output(lp, "\n wait matched at post %d ", req_id);
print_completed_queue(lp, &s->completed_reqs); print_completed_queue(lp, &s->completed_reqs);
} }
//get_next_mpi_operation(s, bf, m, lp);
return; return;
} }
++index; ++index;
...@@ -975,7 +998,7 @@ static void codes_exec_mpi_wait(nw_state* s, tw_bf * bf, nw_message * m, tw_lp* ...@@ -975,7 +998,7 @@ static void codes_exec_mpi_wait(nw_state* s, tw_bf * bf, nw_message * m, tw_lp*
print_completed_queue(lp, &s->completed_reqs); print_completed_queue(lp, &s->completed_reqs);
}*/ }*/
/* If not, add the wait operation in the pending 'waits' list. */ /* If not, add the wait operation in the pending 'waits' list. */
struct pending_waits* wait_op = (struct pending_waits*)malloc(sizeof(struct pending_waits)); struct pending_waits* wait_op = (struct pending_waits*)calloc(1, sizeof(struct pending_waits));
wait_op->op_type = mpi_op->op_type; wait_op->op_type = mpi_op->op_type;
wait_op->req_ids[0] = req_id; wait_op->req_ids[0] = req_id;
wait_op->count = 1; wait_op->count = 1;
...@@ -1013,6 +1036,7 @@ static void codes_exec_mpi_wait_all_rc( ...@@ -1013,6 +1036,7 @@ static void codes_exec_mpi_wait_all_rc(
{ {
add_completed_reqs(s, lp, m->fwd.num_matched); add_completed_reqs(s, lp, m->fwd.num_matched);
codes_issue_next_event_rc(lp); codes_issue_next_event_rc(lp);
//get_next_mpi_operation_rc(s, bf, lp, m);
} }
return; return;
} }
...@@ -1088,11 +1112,12 @@ static void codes_exec_mpi_wait_all( ...@@ -1088,11 +1112,12 @@ static void codes_exec_mpi_wait_all(
free(wait_op); free(wait_op);
s->wait_op = NULL; s->wait_op = NULL;
codes_issue_next_event(lp); codes_issue_next_event(lp);
//get_next_mpi_operation(s, bf, lp, m);
} }
else else
{ {
/* If not, add the wait operation in the pending 'waits' list. */ /* If not, add the wait operation in the pending 'waits' list. */
struct pending_waits* wait_op = (struct pending_waits*)malloc(sizeof(struct pending_waits)); struct pending_waits* wait_op = (struct pending_waits*)calloc(1, sizeof(struct pending_waits));
wait_op->count = count; wait_op->count = count;
wait_op->op_type = mpi_op->op_type; wait_op->op_type = mpi_op->op_type;
assert(count < MAX_WAIT_REQS); assert(count < MAX_WAIT_REQS);
...@@ -1169,6 +1194,7 @@ static int rm_matching_rcv(nw_state * ns, ...@@ -1169,6 +1194,7 @@ static int rm_matching_rcv(nw_state * ns,
{ {
bf->c8 = 1; bf->c8 = 1;
codes_issue_next_event(lp); codes_issue_next_event(lp);
//get_next_mpi_operation(s, bf, lp, m);
} }
qlist_del(&qi->ql); qlist_del(&qi->ql);
...@@ -1238,6 +1264,7 @@ static int rm_matching_send(nw_state * ns, ...@@ -1238,6 +1264,7 @@ static int rm_matching_send(nw_state * ns,
{ {
bf->c6 = 1; bf->c6 = 1;
codes_issue_next_event(lp); codes_issue_next_event(lp);
//get_next_mpi_operation(s, bf, lp, m);
} }
...@@ -1279,10 +1306,13 @@ static void codes_exec_comp_delay( ...@@ -1279,10 +1306,13 @@ static void codes_exec_comp_delay(
nw_message* msg; nw_message* msg;
m->rc.saved_delay = s->compute_time; m->rc.saved_delay = s->compute_time;
s->compute_time += s_to_ns(mpi_op->u.delay.seconds); s->compute_time += mpi_op->u.delay.nsecs;
ts = s_to_ns(mpi_op->u.delay.seconds); ts = mpi_op->u.delay.nsecs;
if(ts <= 0)
ts = g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
//ts = s_to_ns(mpi_op->u.delay.seconds);
ts += g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise); // ts += g_tw_lookahead + 0.1 + tw_rand_exponential(lp->rng, noise);
assert(ts > 0); assert(ts > 0);
e = tw_event_new( lp->gid, ts , lp ); e = tw_event_new( lp->gid, ts , lp );
...@@ -1361,7 +1391,7 @@ static void codes_exec_mpi_recv( ...@@ -1361,7 +1391,7 @@ static void codes_exec_mpi_recv(
m->rc.saved_recv_time = s->recv_time; m->rc.saved_recv_time = s->recv_time;
m->rc.saved_num_bytes = mpi_op->u.recv.num_bytes; m->rc.saved_num_bytes = mpi_op->u.recv.num_bytes;
mpi_msgs_queue * recv_op = (mpi_msgs_queue*) malloc(sizeof(mpi_msgs_queue)); mpi_msgs_queue * recv_op = (mpi_msgs_queue*) calloc(1, sizeof(mpi_msgs_queue));
recv_op->req_init_time = tw_now(lp); recv_op->req_init_time = tw_now(lp);
recv_op->op_type = mpi_op->op_type; recv_op->op_type = mpi_op->op_type;
recv_op->source_rank = mpi_op->u.recv.source_rank; recv_op->source_rank = mpi_op->u.recv.source_rank;
...@@ -1426,14 +1456,15 @@ static void codes_exec_mpi_send_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_ ...@@ -1426,14 +1456,15 @@ static void codes_exec_mpi_send_rc(nw_state * s, tw_bf * bf, nw_message * m, tw_
model_net_event_rc2(lp, &m->event_rc); model_net_event_rc2(lp, &m->event_rc);
if(bf->c4)
codes_issue_next_event_rc(lp);