init counters
This commit was SVN r9395.
Этот коммит содержится в:
родитель
754b424266
Коммит
d1d8967844
@ -65,6 +65,7 @@ int mca_bml_base_btl_array_reserve(mca_bml_base_btl_array_t* array, size_t size)
|
|||||||
#if OMPI_ENABLE_DEBUG_RELIABILITY
|
#if OMPI_ENABLE_DEBUG_RELIABILITY
|
||||||
|
|
||||||
extern double mca_bml_base_error_rate;
|
extern double mca_bml_base_error_rate;
|
||||||
|
extern int mca_bml_base_error_count;
|
||||||
|
|
||||||
struct mca_bml_base_context_t {
|
struct mca_bml_base_context_t {
|
||||||
size_t index;
|
size_t index;
|
||||||
@ -96,11 +97,11 @@ int mca_bml_base_send(
|
|||||||
{
|
{
|
||||||
static int count;
|
static int count;
|
||||||
des->des_context = bml_btl;
|
des->des_context = bml_btl;
|
||||||
if(count <= 0 && mca_bml_base_error_rate > 0) {
|
if(mca_bml_base_error_count <= 0 && mca_bml_base_error_rate > 0) {
|
||||||
count = (int) ((mca_bml_base_error_rate * rand())/(RAND_MAX+1.0));
|
mca_bml_base_error_count = (int) ((mca_bml_base_error_rate * rand())/(RAND_MAX+1.0));
|
||||||
if(count % 2) {
|
if(mca_bml_base_error_count % 2) {
|
||||||
/* local completion - network "drops" packet */
|
/* local completion - network "drops" packet */
|
||||||
opal_output(0, "dropping data\n");
|
opal_output(0, "%s:%d: dropping data\n", __FILE__, __LINE__);
|
||||||
des->des_cbfunc(bml_btl->btl, bml_btl->btl_endpoint, des, OMPI_SUCCESS);
|
des->des_cbfunc(bml_btl->btl, bml_btl->btl_endpoint, des, OMPI_SUCCESS);
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
@ -108,7 +109,7 @@ int mca_bml_base_send(
|
|||||||
mca_bml_base_context_t* ctx = (mca_bml_base_context_t*)
|
mca_bml_base_context_t* ctx = (mca_bml_base_context_t*)
|
||||||
malloc(sizeof(mca_bml_base_context_t));
|
malloc(sizeof(mca_bml_base_context_t));
|
||||||
if(NULL != ctx) {
|
if(NULL != ctx) {
|
||||||
opal_output(0, "corrupting data\n");
|
opal_output(0, "%s:%d: corrupting data\n", __FILE__, __LINE__);
|
||||||
ctx->index = (size_t) ((des->des_src[0].seg_len * rand() * 1.0) / (RAND_MAX + 1.0));
|
ctx->index = (size_t) ((des->des_src[0].seg_len * rand() * 1.0) / (RAND_MAX + 1.0));
|
||||||
ctx->cbfunc = des->des_cbfunc;
|
ctx->cbfunc = des->des_cbfunc;
|
||||||
ctx->cbdata = des->des_cbdata;
|
ctx->cbdata = des->des_cbdata;
|
||||||
@ -118,7 +119,7 @@ int mca_bml_base_send(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count--;
|
mca_bml_base_error_count--;
|
||||||
des->des_context = (void*) bml_btl;
|
des->des_context = (void*) bml_btl;
|
||||||
return bml_btl->btl_send(
|
return bml_btl->btl_send(
|
||||||
bml_btl->btl,
|
bml_btl->btl,
|
||||||
|
@ -30,6 +30,7 @@ opal_list_t mca_bml_base_components_available;
|
|||||||
|
|
||||||
#if OMPI_ENABLE_DEBUG_RELIABILITY
|
#if OMPI_ENABLE_DEBUG_RELIABILITY
|
||||||
double mca_bml_base_error_rate;
|
double mca_bml_base_error_rate;
|
||||||
|
int mca_bml_base_error_count;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int mca_bml_base_open( void ) {
|
int mca_bml_base_open( void ) {
|
||||||
@ -60,6 +61,11 @@ int mca_bml_base_open( void ) {
|
|||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
srand(getpid() * tv.tv_usec);
|
srand(getpid() * tv.tv_usec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* initialize count */
|
||||||
|
if(mca_bml_base_error_rate > 0) {
|
||||||
|
mca_bml_base_error_count = (int) ((mca_bml_base_error_rate * rand())/(RAND_MAX+1.0));
|
||||||
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
#endif
|
#endif
|
||||||
return mca_btl_base_open();
|
return mca_btl_base_open();
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user