X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6e9f0031ab47e172c38c52e2ae81c335a46b1d46..a30eb8d63c2291f6b50b935cecf16139b372f9f2:/src/gras/DataDesc/ddt_exchange.c diff --git a/src/gras/DataDesc/ddt_exchange.c b/src/gras/DataDesc/ddt_exchange.c index 36af95d0ac..d369df62c3 100644 --- a/src/gras/DataDesc/ddt_exchange.c +++ b/src/gras/DataDesc/ddt_exchange.c @@ -231,7 +231,7 @@ gras_datadesc_copy_rec(gras_cbps_t state, if (e.category != not_found_error) RETHROW; reference_is_to_cpy = 1; - xbt_ex_free(e); + xbt_ex_free(&e); } if (reference_is_to_cpy) { @@ -287,7 +287,7 @@ gras_datadesc_copy_rec(gras_cbps_t state, case e_gras_datadesc_type_cat_array: { gras_dd_cat_array_t array_data; - long int count; + long int array_count; char *src_ptr=src; char *dst_ptr=dst; long int elm_size; @@ -295,12 +295,12 @@ gras_datadesc_copy_rec(gras_cbps_t state, array_data = type->category.array_data; /* determine and send the element count */ - count = array_data.fixed_size; - if (count == 0) - count = subsize; - if (count == 0) { - count = array_data.dynamic_size(type,state,src); - xbt_assert1(count >=0, + array_count = array_data.fixed_size; + if (array_count == 0) + array_count = subsize; + if (array_count == 0) { + array_count = array_data.dynamic_size(type,state,src); + xbt_assert1(array_count >=0, "Invalid (negative) array size for type %s",type->name); } @@ -308,21 +308,24 @@ gras_datadesc_copy_rec(gras_cbps_t state, sub_type = array_data.type; elm_size = sub_type->aligned_size[GRAS_THISARCH]; if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) { - VERB1("Array of %ld scalars, copy it in one shot",count); - memcpy(dst, src, sub_type->aligned_size[GRAS_THISARCH] * count); - count += sub_type->aligned_size[GRAS_THISARCH] * count; + VERB1("Array of %ld scalars, copy it in one shot",array_count); + memcpy(dst, src, sub_type->aligned_size[GRAS_THISARCH] * array_count); + count += sub_type->aligned_size[GRAS_THISARCH] * array_count; } else if (sub_type->category_code == e_gras_datadesc_type_cat_array && sub_type->category.array_data.fixed_size > 0 && sub_type->category.array_data.type->category_code == e_gras_datadesc_type_cat_scalar) { - VERB1("Array of %ld fixed array of scalars, copy it in one shot",count); + VERB1("Array of %ld fixed array of scalars, copy it in one shot", + array_count); memcpy(dst,src,sub_type->category.array_data.type->aligned_size[GRAS_THISARCH] - * count * sub_type->category.array_data.fixed_size); + * array_count * sub_type->category.array_data.fixed_size); count += sub_type->category.array_data.type->aligned_size[GRAS_THISARCH] - * count * sub_type->category.array_data.fixed_size; + * array_count * sub_type->category.array_data.fixed_size; } else { - for (cpt=0; cptcycle); src_ptr += elm_size; @@ -387,8 +390,12 @@ gras_datadesc_send_rec(gras_socket_t sock, VERB2("Send a %s (%s)", type->name, gras_datadesc_cat_names[type->category_code]); + if (!strcmp(type->name,"string")) + VERB1("value: '%s'",*(char**)data); + if (type->send) { type->send(type,state,data); + DEBUG0("Run the emission callback"); } switch (type->category_code) { @@ -412,8 +419,10 @@ gras_datadesc_send_rec(gras_socket_t sock, sub_type = field->type; - if (field->send) + if (field->send) { + DEBUG1("Run the emission callback of field %s", field->name); field->send(type,state,field_data); + } VERB1("Send field %s",field->name); gras_datadesc_send_rec(sock,state,refs,sub_type, field_data, @@ -473,7 +482,7 @@ gras_datadesc_send_rec(gras_socket_t sock, sub_type = ref_data.type; if (sub_type == NULL) { sub_type = (*ref_data.selector)(type,state,data); - gras_dd_send_int(sock, &(sub_type->code),1 /*stable*/); + gras_dd_send_int(sock, (int*) &(sub_type->code),1 /*stable*/); } /* Send the actual value of the pointer for cycle handling */ @@ -502,7 +511,7 @@ gras_datadesc_send_rec(gras_socket_t sock, if (e.category != not_found_error) RETHROW; reference_is_to_send = 1; - xbt_ex_free(e); + xbt_ex_free(&e); } if (reference_is_to_send) { @@ -666,8 +675,10 @@ gras_datadesc_recv_rec(gras_socket_t sock, field_data,-1, detect_cycle || sub_type->cycle); - if (field->recv) + if (field->recv) { + DEBUG1("Run the reception callback of field %s", field->name); field->recv(type,state,(void*)l_data); + } } VERB1("<< Received all fields of the structure %s", type->name); @@ -755,7 +766,7 @@ gras_datadesc_recv_rec(gras_socket_t sock, if (e.category != not_found_error) RETHROW; reference_is_to_recv = 1; - xbt_ex_free(e); + xbt_ex_free(&e); } if (reference_is_to_recv) { int subsubcount = 0; @@ -894,6 +905,9 @@ gras_datadesc_recv_rec(gras_socket_t sock, if (type->recv) type->recv(type,state,l_data); + if (!strcmp(type->name,"string")) + VERB1("value: '%s'",*(char**)l_data); + } /**