}
INFO0("Test the BW between me and one of the sensors");
- TRY(amok_bw_test(peer,buf_size,exp_size,msg_size,&sec,&bw));
+ TRYOLD(amok_bw_test(peer,buf_size,exp_size,msg_size,&sec,&bw));
INFO6("Experience between me and %s:%d (%d kb in msgs of %d kb) took %f sec, achieving %f kb/s",
argv[1],atoi(argv[2]),
exp_size,msg_size,
sec,bw);
INFO0("Test the BW between the two sensors");
- TRY(amok_bw_request(argv[1],atoi(argv[2]),argv[3],atoi(argv[4]),
+ TRYOLD(amok_bw_request(argv[1],atoi(argv[2]),argv[3],atoi(argv[4]),
buf_size,exp_size,msg_size,&sec,&bw));
INFO2("Experience took took %f sec, achieving %f kb/s",
sec,bw);
/* ask sensors to quit */
gras_msgtype_declare("quit",NULL);
- TRY(gras_msg_send(peer,gras_msgtype_by_name("quit"), NULL));
+ TRYOLD(gras_msg_send(peer,gras_msgtype_by_name("quit"), NULL));
gras_socket_close(peer);
- TRY(gras_socket_client(argv[3],atoi(argv[4]),&peer));
- TRY(gras_msg_send(peer,gras_msgtype_by_name("quit"), NULL));
+ TRYOLD(gras_socket_client(argv[3],atoi(argv[4]),&peer));
+ TRYOLD(gras_msg_send(peer,gras_msgtype_by_name("quit"), NULL));
gras_socket_close(peer);
gras_socket_close(g->sock);
/** @brief return the error code if != no_error
* @hideinitializer
*/
-#define TRY(action) do { \
+#define TRYOLD(action) do { \
if ((errcode=action) != no_error) { \
ERROR1("'%s' error raising...", xbt_error_name(errcode)); \
return errcode; \
ERROR1("Error %s encountered while sending the BW request.", xbt_error_name(errcode));
return errcode;
}
- TRY(gras_socket_meas_accept(measMasterIn,&measIn));
+ TRYOLD(gras_socket_meas_accept(measMasterIn,&measIn));
if ((errcode=gras_msg_wait(60,gras_msgtype_by_name("BW handshake ACK"),
NULL,&request_ack))) {
DEBUG1("Got ACK; conduct the experiment (msg_size=%ld)",request->msg_size);
*sec=gras_os_time();
- TRY(gras_socket_meas_send(measOut,120,request->exp_size,request->msg_size));
- TRY(gras_socket_meas_recv(measIn,120,1,1));
+ TRYOLD(gras_socket_meas_send(measOut,120,request->exp_size,request->msg_size));
+ TRYOLD(gras_socket_meas_recv(measIn,120,1,1));
/*catch
ERROR1("Error %s encountered while sending the BW experiment.",
/* FIXME: tell error to remote */
return 1;
}
- TRY(gras_socket_meas_accept(measMasterIn,&measIn));
+ TRYOLD(gras_socket_meas_accept(measMasterIn,&measIn));
DEBUG4("BW handshake answered. buf_size=%lu exp_size=%lu msg_size=%lu port=%d",
answer->buf_size,answer->exp_size,answer->msg_size,answer->host.port);
- TRY(gras_socket_meas_recv(measIn, 120,request->exp_size,request->msg_size));
- TRY(gras_socket_meas_send(measOut,120,1,1));
+ TRYOLD(gras_socket_meas_recv(measIn, 120,request->exp_size,request->msg_size));
+ TRYOLD(gras_socket_meas_send(measOut,120,1,1));
/*catch
ERROR1("Error %s encountered while receiving the experiment.",
request->host.name = (char*)to_name;
request->host.port = to_port;
- TRY(gras_socket_client(from_name,from_port,&sock));
- TRY(gras_msg_send(sock,gras_msgtype_by_name("BW request"),&request));
+ TRYOLD(gras_socket_client(from_name,from_port,&sock));
+ TRYOLD(gras_msg_send(sock,gras_msgtype_by_name("BW request"),&request));
free(request);
- TRY(gras_msg_wait(240,gras_msgtype_by_name("BW result"),NULL, &result));
+ TRYOLD(gras_msg_wait(240,gras_msgtype_by_name("BW result"),NULL, &result));
*sec=result->sec;
*bw =result->bw;
bw_res_t result = xbt_new0(s_bw_res,1);
gras_socket_t peer;
- TRY(gras_socket_client(request->host.name,request->host.port,&peer));
- TRY(amok_bw_test(peer,
+ TRYOLD(gras_socket_client(request->host.name,request->host.port,&peer));
+ TRYOLD(amok_bw_test(peer,
request->buf_size,request->exp_size,request->msg_size,
&(result->sec),&(result->bw)));
- TRY(gras_msg_send(expeditor,gras_msgtype_by_name("BW result"),&result));
+ TRYOLD(gras_msg_send(expeditor,gras_msgtype_by_name("BW result"),&result));
gras_os_sleep(1);
gras_socket_close(peer);
}
if (int_type->size[GRAS_THISARCH] >= int_type->size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)i, int_type->size[r_arch]));
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)i, int_type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(int_type,1,r_arch, i,i));
+ TRYOLD(gras_dd_convert_elm(int_type,1,r_arch, i,i));
} else {
void *ptr = xbt_malloc(int_type->size[r_arch]);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr, int_type->size[r_arch]));
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr, int_type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(int_type,1,r_arch, ptr,i));
+ TRYOLD(gras_dd_convert_elm(int_type,1,r_arch, ptr,i));
free(ptr);
}
DEBUG1("recv_int(%d)",*i);
switch (type->category_code) {
case e_gras_datadesc_type_cat_scalar:
- TRY(gras_trp_chunk_send(sock, data, type->size[GRAS_THISARCH]));
+ TRYOLD(gras_trp_chunk_send(sock, data, type->size[GRAS_THISARCH]));
break;
case e_gras_datadesc_type_cat_struct: {
field->send(type,state,field_data);
VERB1("Send field %s",field->name);
- TRY(gras_datadesc_send_rec(sock,state,refs,sub_type, field_data,
+ TRYOLD(gras_datadesc_send_rec(sock,state,refs,sub_type, field_data,
detect_cycle || sub_type->cycle));
}
type->name, field_num, xbt_dynar_length(union_data.fields));
/* Send the field number */
- TRY(gras_dd_send_int(sock, field_num));
+ TRYOLD(gras_dd_send_int(sock, field_num));
/* Send the content */
field = xbt_dynar_get_as(union_data.fields, field_num, gras_dd_cat_field_t);
if (field->send)
field->send(type,state,data);
- TRY(gras_datadesc_send_rec(sock,state,refs, sub_type, data,
+ TRYOLD(gras_datadesc_send_rec(sock,state,refs, sub_type, data,
detect_cycle || sub_type->cycle));
break;
sub_type = ref_data.type;
if (sub_type == NULL) {
sub_type = (*ref_data.selector)(type,state,data);
- TRY(gras_dd_send_int(sock, sub_type->code));
+ TRYOLD(gras_dd_send_int(sock, sub_type->code));
}
/* Send the actual value of the pointer for cycle handling */
xbt_assert(pointer_type);
}
- TRY(gras_trp_chunk_send(sock, (char*)data,
+ TRYOLD(gras_trp_chunk_send(sock, (char*)data,
pointer_type->size[GRAS_THISARCH]));
/* Send the pointed data only if not already sent */
VERB1("Sending data referenced at %p", (void*)*ref);
if (detect_cycle)
xbt_dict_set_ext(refs, (char*)ref, sizeof(void*), ref, NULL);
- TRY(gras_datadesc_send_rec(sock,state,refs, sub_type, *ref,
+ TRYOLD(gras_datadesc_send_rec(sock,state,refs, sub_type, *ref,
detect_cycle || sub_type->cycle));
} else if (errcode == no_error) {
count = array_data.dynamic_size(type,state,data);
xbt_assert1(count >=0,
"Invalid (negative) array size for type %s",type->name);
- TRY(gras_dd_send_int(sock, count));
+ TRYOLD(gras_dd_send_int(sock, count));
}
/* send the content */
elm_size = sub_type->aligned_size[GRAS_THISARCH];
if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
VERB1("Array of %ld scalars, send it in one shot",count);
- TRY(gras_trp_chunk_send(sock, data,
+ TRYOLD(gras_trp_chunk_send(sock, data,
sub_type->aligned_size[GRAS_THISARCH] * 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, send it in one shot",count);
- TRY(gras_trp_chunk_send(sock, data,
+ TRYOLD(gras_trp_chunk_send(sock, data,
sub_type->category.array_data.type->aligned_size[GRAS_THISARCH]
* count * sub_type->category.array_data.fixed_size));
} else {
for (cpt=0; cpt<count; cpt++) {
- TRY(gras_datadesc_send_rec(sock,state,refs, sub_type, ptr,
+ TRYOLD(gras_datadesc_send_rec(sock,state,refs, sub_type, ptr,
detect_cycle || sub_type->cycle));
ptr += elm_size;
}
switch (type->category_code) {
case e_gras_datadesc_type_cat_scalar:
if (type->size[GRAS_THISARCH] == type->size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)l_data, type->size[r_arch]));
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)l_data, type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(type,1,r_arch, l_data,l_data));
+ TRYOLD(gras_dd_convert_elm(type,1,r_arch, l_data,l_data));
} else {
void *ptr = xbt_malloc(type->size[r_arch]);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr, type->size[r_arch]));
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr, type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(type,1,r_arch, ptr,l_data));
+ TRYOLD(gras_dd_convert_elm(type,1,r_arch, ptr,l_data));
free(ptr);
}
break;
sub_type = field->type;
- TRY(gras_datadesc_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_recv_rec(sock,state,refs, sub_type,
r_arch,NULL,0,
field_data,-1,
detect_cycle || sub_type->cycle));
"Please call gras_datadesc_declare_union_close on %s before receiving it",
type->name);
/* retrieve the field number */
- TRY(gras_dd_recv_int(sock, r_arch, &field_num));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &field_num));
if (field_num < 0)
RAISE1(mismatch_error,
"Received union field for %s is negative", type->name);
field = xbt_dynar_get_as(union_data.fields, field_num, gras_dd_cat_field_t);
sub_type = field->type;
- TRY(gras_datadesc_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_recv_rec(sock,state,refs, sub_type,
r_arch,NULL,0,
l_data,-1,
detect_cycle || sub_type->cycle));
sub_type = ref_data.type;
if (sub_type == NULL) {
int ref_code;
- TRY(gras_dd_recv_int(sock, r_arch, &ref_code));
- TRY(gras_datadesc_by_id(ref_code, &sub_type));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &ref_code));
+ TRYOLD(gras_datadesc_by_id(ref_code, &sub_type));
}
/* Get the actual value of the pointer for cycle handling */
r_ref = xbt_malloc(pointer_type->size[r_arch]);
- TRY(gras_trp_chunk_recv(sock, (char*)r_ref,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)r_ref,
pointer_type->size[r_arch]));
/* Receive the pointed data only if not already sent */
subsubcount = array_data.fixed_size;
if (subsubcount == 0)
- TRY(gras_dd_recv_int(sock, r_arch, &subsubcount));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &subsubcount));
subsub_type = array_data.type;
- TRY(gras_dd_alloc_ref(refs,
+ TRYOLD(gras_dd_alloc_ref(refs,
subsub_type->size[GRAS_THISARCH] * subsubcount,
r_ref,pointer_type->size[r_arch],
(char**)&l_referenced,
detect_cycle));
} else {
- TRY(gras_dd_alloc_ref(refs,sub_type->size[GRAS_THISARCH],
+ TRYOLD(gras_dd_alloc_ref(refs,sub_type->size[GRAS_THISARCH],
r_ref,pointer_type->size[r_arch],
(char**)&l_referenced,
detect_cycle));
}
- TRY(gras_datadesc_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_recv_rec(sock,state,refs, sub_type,
r_arch,r_ref,pointer_type->size[r_arch],
(char*)l_referenced, subsubcount,
detect_cycle || sub_type->cycle));
if (count == 0)
count = subsize;
if (count == 0)
- TRY(gras_dd_recv_int(sock, r_arch, &count));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &count));
if (count == 0)
RAISE1(mismatch_error,
"Invalid (=0) array size for type %s",type->name);
VERB1("Array of %d scalars, get it in one shoot", count);
if (sub_type->aligned_size[GRAS_THISARCH] >=
sub_type->aligned_size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)l_data,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)l_data,
sub_type->aligned_size[r_arch] * count));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(sub_type,count,r_arch, l_data,l_data));
+ TRYOLD(gras_dd_convert_elm(sub_type,count,r_arch, l_data,l_data));
} else {
ptr = xbt_malloc(sub_type->aligned_size[r_arch] * count);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr,
sub_type->size[r_arch] * count));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(sub_type,count,r_arch, ptr,l_data));
+ TRYOLD(gras_dd_convert_elm(sub_type,count,r_arch, ptr,l_data));
free(ptr);
}
} else if (sub_type->category_code == e_gras_datadesc_type_cat_array &&
VERB1("Array of %d fixed array of scalars, get it in one shot",count);
if (subsub_type->aligned_size[GRAS_THISARCH] >=
subsub_type->aligned_size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)l_data,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)l_data,
subsub_type->aligned_size[r_arch] * count *
array_data.fixed_size));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, l_data,l_data));
+ TRYOLD(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, l_data,l_data));
} else {
ptr = xbt_malloc(subsub_type->aligned_size[r_arch] * count*array_data.fixed_size);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr,
subsub_type->size[r_arch] * count*array_data.fixed_size));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, ptr,l_data));
+ TRYOLD(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, ptr,l_data));
free(ptr);
}
ptr = l_data;
for (cpt=0; cpt<count; cpt++) {
- TRY(gras_datadesc_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_recv_rec(sock,state,refs, sub_type,
r_arch, NULL, 0, ptr,-1,
detect_cycle || sub_type->cycle));
switch (type->category_code) {
case e_gras_datadesc_type_cat_scalar:
- printf(" TRY(gras_trp_chunk_send(sock, data, %lu));\n",type->size[GRAS_THISARCH]);
+ printf(" TRYOLD(gras_trp_chunk_send(sock, data, %lu));\n",type->size[GRAS_THISARCH]);
break;
case e_gras_datadesc_type_cat_struct: {
printf(" VERB1(\"Send field %s\");\n",field->name);
printf(" data += %lu;\n",field->offset[GRAS_THISARCH]);
- TRY(gras_datadesc_gen_send_rec(sock,state,refs,sub_type, field_data,
+ TRYOLD(gras_datadesc_gen_send_rec(sock,state,refs,sub_type, field_data,
detect_cycle || sub_type->cycle));
printf(" data -= %lu;\n",field->offset[GRAS_THISARCH]);
type->name, xbt_dynar_length(union_data.fields));
/* Send the field number */
- printf("TRY(gras_dd_send_int(sock, field_num));\n");
+ printf("TRYOLD(gras_dd_send_int(sock, field_num));\n");
/* Send the content */
field = xbt_dynar_get_as(union_data.fields, field_num, gras_dd_cat_field_t);
if (field->send)
field->send(state,data);
- TRY(gras_datadesc_gen_send_rec(sock,state,refs, sub_type, data,
+ TRYOLD(gras_datadesc_gen_send_rec(sock,state,refs, sub_type, data,
detect_cycle || sub_type->cycle));
break;
sub_type = ref_data.type;
if (sub_type == NULL) {
sub_type = (*ref_data.selector)(state,data);
- TRY(gras_dd_send_int(sock, sub_type->code));
+ TRYOLD(gras_dd_send_int(sock, sub_type->code));
}
/* Send the actual value of the pointer for cycle handling */
xbt_assert(pointer_type);
}
- TRY(gras_trp_chunk_send(sock, (char*)data,
+ TRYOLD(gras_trp_chunk_send(sock, (char*)data,
pointer_type->size[GRAS_THISARCH]));
/* Send the pointed data only if not already sent */
VERB1("Sending data referenced at %p", (void*)*ref);
if (detect_cycle)
xbt_dict_set_ext(refs, (char*)ref, sizeof(void*), ref, NULL);
- TRY(gras_datadesc_gen_send_rec(sock,state,refs, sub_type, *ref,
+ TRYOLD(gras_datadesc_gen_send_rec(sock,state,refs, sub_type, *ref,
detect_cycle || sub_type->cycle));
} else if (errcode == no_error) {
count = array_data.dynamic_size(state,data);
xbt_assert1(count >=0,
"Invalid (negative) array size for type %s",type->name);
- TRY(gras_dd_send_int(sock, count));
+ TRYOLD(gras_dd_send_int(sock, count));
}
/* send the content */
elm_size = sub_type->aligned_size[GRAS_THISARCH];
if (sub_type->category_code == e_gras_datadesc_type_cat_scalar) {
VERB1("Array of %ld scalars, send it in one shot",count);
- TRY(gras_trp_chunk_send(sock, data,
+ TRYOLD(gras_trp_chunk_send(sock, data,
sub_type->aligned_size[GRAS_THISARCH] * 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, send it in one shot",count);
- TRY(gras_trp_chunk_send(sock, data,
+ TRYOLD(gras_trp_chunk_send(sock, data,
sub_type->category.array_data.type->aligned_size[GRAS_THISARCH]
* count * sub_type->category.array_data.fixed_size));
} else {
for (cpt=0; cpt<count; cpt++) {
- TRY(gras_datadesc_gen_send_rec(sock,state,refs, sub_type, ptr,
+ TRYOLD(gras_datadesc_gen_send_rec(sock,state,refs, sub_type, ptr,
detect_cycle || sub_type->cycle));
ptr += elm_size;
}
switch (type->category_code) {
case e_gras_datadesc_type_cat_scalar:
if (type->size[GRAS_THISARCH] == type->size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)l_data, type->size[r_arch]));
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)l_data, type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(type,1,r_arch, l_data,l_data));
+ TRYOLD(gras_dd_convert_elm(type,1,r_arch, l_data,l_data));
} else {
void *ptr = xbt_malloc(type->size[r_arch]);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr, type->size[r_arch]));
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr, type->size[r_arch]));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(type,1,r_arch, ptr,l_data));
+ TRYOLD(gras_dd_convert_elm(type,1,r_arch, ptr,l_data));
free(ptr);
}
break;
sub_type = field->type;
- TRY(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
r_arch,NULL,0,
field_data,-1,
detect_cycle || sub_type->cycle));
"Please call gras_datadesc_declare_union_close on %s before receiving it",
type->name);
/* retrieve the field number */
- TRY(gras_dd_recv_int(sock, r_arch, &field_num));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &field_num));
if (field_num < 0)
RAISE1(mismatch_error,
"Received union field for %s is negative", type->name);
field = xbt_dynar_get_as(union_data.fields, field_num, gras_dd_cat_field_t);
sub_type = field->type;
- TRY(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
r_arch,NULL,0,
l_data,-1,
detect_cycle || sub_type->cycle));
sub_type = ref_data.type;
if (sub_type == NULL) {
int ref_code;
- TRY(gras_dd_recv_int(sock, r_arch, &ref_code));
- TRY(gras_datadesc_by_id(ref_code, &sub_type));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &ref_code));
+ TRYOLD(gras_datadesc_by_id(ref_code, &sub_type));
}
/* Get the actual value of the pointer for cycle handling */
r_ref = xbt_malloc(pointer_type->size[r_arch]);
- TRY(gras_trp_chunk_recv(sock, (char*)r_ref,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)r_ref,
pointer_type->size[r_arch]));
/* Receive the pointed data only if not already sent */
subsubcount = array_data.fixed_size;
if (subsubcount == 0)
- TRY(gras_dd_recv_int(sock, r_arch, &subsubcount));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &subsubcount));
subsub_type = array_data.type;
- TRY(gras_dd_alloc_ref(refs,
+ TRYOLD(gras_dd_alloc_ref(refs,
subsub_type->size[GRAS_THISARCH] * subsubcount,
r_ref,pointer_type->size[r_arch],
(char**)&l_referenced,
detect_cycle));
} else {
- TRY(gras_dd_alloc_ref(refs,sub_type->size[GRAS_THISARCH],
+ TRYOLD(gras_dd_alloc_ref(refs,sub_type->size[GRAS_THISARCH],
r_ref,pointer_type->size[r_arch],
(char**)&l_referenced,
detect_cycle));
}
- TRY(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
r_arch,r_ref,pointer_type->size[r_arch],
(char*)l_referenced, subsubcount,
detect_cycle || sub_type->cycle));
if (count == 0)
count = subsize;
if (count == 0)
- TRY(gras_dd_recv_int(sock, r_arch, &count));
+ TRYOLD(gras_dd_recv_int(sock, r_arch, &count));
if (count == 0)
RAISE1(mismatch_error,
"Invalid (=0) array size for type %s",type->name);
VERB1("Array of %d scalars, get it in one shoot", count);
if (sub_type->aligned_size[GRAS_THISARCH] >=
sub_type->aligned_size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)l_data,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)l_data,
sub_type->aligned_size[r_arch] * count));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(sub_type,count,r_arch, l_data,l_data));
+ TRYOLD(gras_dd_convert_elm(sub_type,count,r_arch, l_data,l_data));
} else {
ptr = xbt_malloc(sub_type->aligned_size[r_arch] * count);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr,
sub_type->size[r_arch] * count));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(sub_type,count,r_arch, ptr,l_data));
+ TRYOLD(gras_dd_convert_elm(sub_type,count,r_arch, ptr,l_data));
free(ptr);
}
} else if (sub_type->category_code == e_gras_datadesc_type_cat_array &&
VERB1("Array of %d fixed array of scalars, get it in one shot",count);
if (subsub_type->aligned_size[GRAS_THISARCH] >=
subsub_type->aligned_size[r_arch]) {
- TRY(gras_trp_chunk_recv(sock, (char*)l_data,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)l_data,
subsub_type->aligned_size[r_arch] * count *
array_data.fixed_size));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, l_data,l_data));
+ TRYOLD(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, l_data,l_data));
} else {
ptr = xbt_malloc(subsub_type->aligned_size[r_arch] * count*array_data.fixed_size);
- TRY(gras_trp_chunk_recv(sock, (char*)ptr,
+ TRYOLD(gras_trp_chunk_recv(sock, (char*)ptr,
subsub_type->size[r_arch] * count*array_data.fixed_size));
if (r_arch != GRAS_THISARCH)
- TRY(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, ptr,l_data));
+ TRYOLD(gras_dd_convert_elm(subsub_type,count*array_data.fixed_size,r_arch, ptr,l_data));
free(ptr);
}
ptr = l_data;
for (cpt=0; cpt<count; cpt++) {
- TRY(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
+ TRYOLD(gras_datadesc_gen_recv_rec(sock,state,refs, sub_type,
r_arch, NULL, 0, ptr,-1,
detect_cycle || sub_type->cycle));
DEBUG3("send '%s' to %s:%d", msgtype->name,
gras_socket_peer_name(sock),gras_socket_peer_port(sock));
- TRY(gras_trp_chunk_send(sock, GRAS_header, 6));
+ TRYOLD(gras_trp_chunk_send(sock, GRAS_header, 6));
- TRY(gras_datadesc_send(sock, string_type, &msgtype->name));
+ TRYOLD(gras_datadesc_send(sock, string_type, &msgtype->name));
if (msgtype->ctn_type)
- TRY(gras_datadesc_send(sock, msgtype->ctn_type, payload));
- TRY(gras_trp_flush(sock));
+ TRYOLD(gras_datadesc_send(sock, msgtype->ctn_type, payload));
+ TRYOLD(gras_trp_flush(sock));
return no_error;
}
DEBUG2("Handle an incoming message using protocol %d (remote is %s)",
(int)header[4],gras_datadesc_arch_name(r_arch));
- TRY(gras_datadesc_recv(sock, string_type, r_arch, &msg_name));
+ TRYOLD(gras_datadesc_recv(sock, string_type, r_arch, &msg_name));
errcode = xbt_set_get_by_name(_gras_msgtype_set,
msg_name,(xbt_set_elm_t*)msgtype);
if (errcode != no_error)
"Dynamic array as payload is forbided for now (FIXME?).",
"Reference to dynamic array is allowed.");
*payload = xbt_malloc(*payload_size);
- TRY(gras_datadesc_recv(sock, (*msgtype)->ctn_type, r_arch, *payload));
+ TRYOLD(gras_datadesc_recv(sock, (*msgtype)->ctn_type, r_arch, *payload));
} else {
*payload = NULL;
*payload_size = 0;
}
while (1) {
- TRY(gras_trp_select(timeout - now + start, &expeditor_res));
- TRY(gras_msg_recv(expeditor_res, &msgt_got, &payload_got, &payload_size_got));
+ TRYOLD(gras_trp_select(timeout - now + start, &expeditor_res));
+ TRYOLD(gras_msg_recv(expeditor_res, &msgt_got, &payload_got, &payload_size_got));
if (msgt_got->code == msgt_want->code) {
if (expeditor)
*expeditor=expeditor_res;
/* not a socket but an ear. accept on it and serve next socket */
gras_socket_t accepted=NULL;
- TRY((sock_iter->plugin->socket_accept)(sock_iter,&accepted));
+ TRYOLD((sock_iter->plugin->socket_accept)(sock_iter,&accepted));
DEBUG2("accepted=%p,&accepted=%p",accepted,&accepted);
accepted->meas = sock_iter->meas;
} else {
MSG_host_get_name(MSG_host_self()),
timeout);
- TRY(MSG_channel_select_from((m_channel_t) pd->chan, timeout, &r_pid));
+ TRYOLD(MSG_channel_select_from((m_channel_t) pd->chan, timeout, &r_pid));
if (r_pid < 0) {
DEBUG0("TIMEOUT");
/* Socket to expeditor not created yet */
DEBUG0("Create a socket to the expeditor");
- TRY(gras_trp_plugin_get_by_name("buf",&trp));
+ TRYOLD(gras_trp_plugin_get_by_name("buf",&trp));
gras_trp_socket_new(1,dst);
(*dst)->plugin = trp;
DEBUG2("Create a server socket from plugin %s on port %d",
gras_if_RL() ? "tcp" : "sg",
port);
- TRY(gras_trp_plugin_get_by_name((measurement? (gras_if_RL() ? "tcp" : "sg")
+ TRYOLD(gras_trp_plugin_get_by_name((measurement? (gras_if_RL() ? "tcp" : "sg")
:"buf"),
&trp));
*dst = NULL;
- TRY(gras_trp_plugin_get_by_name((measurement? (gras_if_RL() ? "tcp" : "sg")
+ TRYOLD(gras_trp_plugin_get_by_name((measurement? (gras_if_RL() ? "tcp" : "sg")
:"buf"),
&trp));
CDEBUG5(trp_meas,"Sent %lu of %lu (msg_size=%ld) to %s:%d",
exp_sofar,exp_size,msg_size,
gras_socket_peer_name(peer), gras_socket_peer_port(peer));
- TRY(gras_trp_chunk_send(peer,chunk,msg_size));
+ TRYOLD(gras_trp_chunk_send(peer,chunk,msg_size));
}
CDEBUG5(trp_meas,"Sent %lu of %lu (msg_size=%ld) to %s:%d",
exp_sofar,exp_size,msg_size,
CDEBUG5(trp_meas,"Recvd %ld of %lu (msg_size=%ld) from %s:%d",
exp_sofar,exp_size,msg_size,
gras_socket_peer_name(peer), gras_socket_peer_port(peer));
- TRY(gras_trp_chunk_recv(peer,chunk,msg_size));
+ TRYOLD(gras_trp_chunk_recv(peer,chunk,msg_size));
}
CDEBUG5(trp_meas,"Recvd %ld of %lu (msg_size=%ld) from %s:%d",
exp_sofar,exp_size,msg_size,
return no_error;
}
- TRY((peer->plugin->socket_accept)(peer,accepted));
+ TRYOLD((peer->plugin->socket_accept)(peer,accepted));
(*accepted)->meas = peer->meas;
CDEBUG1(trp_meas,"meas_accepted onto %d",(*accepted)->sd);
gras_trp_buf_plug_data_t *data =xbt_new(gras_trp_buf_plug_data_t,1);
XBT_IN;
- TRY(gras_trp_plugin_get_by_name(gras_if_RL() ? "tcp" : "sg",
+ TRYOLD(gras_trp_plugin_get_by_name(gras_if_RL() ? "tcp" : "sg",
&_buf_super));
DEBUG1("Derivate a buffer plugin from %s",gras_if_RL() ? "tcp" : "sg");
xbt_error_t errcode;
XBT_IN;
- TRY(_buf_super->socket_client(_buf_super,sock));
+ TRYOLD(_buf_super->socket_client(_buf_super,sock));
sock->plugin = self;
gras_trp_buf_init_sock(sock);
xbt_error_t errcode;
XBT_IN;
- TRY(_buf_super->socket_server(_buf_super,sock));
+ TRYOLD(_buf_super->socket_server(_buf_super,sock));
sock->plugin = self;
gras_trp_buf_init_sock(sock);
return no_error;
xbt_error_t errcode;
XBT_IN;
- TRY(_buf_super->socket_accept(sock,dst));
+ TRYOLD(_buf_super->socket_accept(sock,dst));
(*dst)->plugin = sock->plugin;
gras_trp_buf_init_sock(*dst);
XBT_OUT;
data->out.size,size-chunk_pos,size,(int)chunk_pos,chunk);
if (data->out.size == data->buffsize) /* out of space. Flush it */
- TRY(gras_trp_buf_flush(sock));
+ TRYOLD(gras_trp_buf_flush(sock));
}
XBT_OUT;
data->in.size = -1;
}
- TRY(_buf_super->chunk_recv(sock, data->in.data, data->in.size));
+ TRYOLD(_buf_super->chunk_recv(sock, data->in.data, data->in.size));
if (gras_if_RL()) {
data->in.pos=0;
gras_socket_peer_name(sock),gras_socket_peer_port(sock));
if (gras_if_RL()) {
size = (int)htonl(size);
- TRY(_buf_super->chunk_send(sock,(char*) &size, 4));
+ TRYOLD(_buf_super->chunk_send(sock,(char*) &size, 4));
} else {
memcpy(data->out.data, &size, 4);
}
DEBUG3("Send the chunk (size=%d) to %s:%d",data->out.size,
gras_socket_peer_name(sock),gras_socket_peer_port(sock));
- TRY(_buf_super->chunk_send(sock, data->out.data, data->out.size));
+ TRYOLD(_buf_super->chunk_send(sock, data->out.data, data->out.size));
VERB1("Chunk sent (size=%d)",data->out.size);
if (XBT_LOG_ISENABLED(trp_buf,xbt_log_priority_debug))
hexa_print("chunck sent ",data->out.data,data->out.size);
gras_trp_socket_new(0,dst);
- TRY(gras_trp_plugin_get_by_name("file",&trp));
+ TRYOLD(gras_trp_plugin_get_by_name("file",&trp));
(*dst)->plugin=trp;
if (strcmp("-", path)) {
gras_trp_socket_new(1,dst);
- TRY(gras_trp_plugin_get_by_name("file",&trp));
+ TRYOLD(gras_trp_plugin_get_by_name("file",&trp));
(*dst)->plugin=trp;
case xbt_cfgelm_host:
str = va_arg(pa, char *);
i=va_arg(pa,int);
- TRY(xbt_cfg_set_host(cfg,name,str,i));
+ TRYOLD(xbt_cfg_set_host(cfg,name,str,i));
break;
case xbt_cfgelm_string:
str=va_arg(pa, char *);
- TRY(xbt_cfg_set_string(cfg, name, str));
+ TRYOLD(xbt_cfg_set_string(cfg, name, str));
break;
case xbt_cfgelm_int:
i=va_arg(pa,int);
- TRY(xbt_cfg_set_int(cfg,name,i));
+ TRYOLD(xbt_cfg_set_int(cfg,name,i));
break;
case xbt_cfgelm_double:
d=va_arg(pa,double);
- TRY(xbt_cfg_set_double(cfg,name,d));
+ TRYOLD(xbt_cfg_set_double(cfg,name,d));
break;
default:
xbt_error_t errcode;
VERB2("Configuration setting: %s=%d",name,val);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
if (variable->max == 1) {
if (variable->cb_rm && xbt_dynar_length(variable->content))
xbt_error_t errcode;
VERB2("Configuration setting: %s=%f",name,val);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
if (variable->max == 1) {
if (variable->cb_rm && xbt_dynar_length(variable->content))
char *newval = xbt_strdup(val);
VERB2("Configuration setting: %s=%s",name,val);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
if (variable->max == 1) {
if (variable->cb_rm && xbt_dynar_length(variable->content))
val->name = xbt_strdup(name);
val->port = port;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_host,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_host,&variable));
if (variable->max == 1) {
if (variable->cb_rm && xbt_dynar_length(variable->content))
"Cannot remove value %d from the config element %s since it's already at its minimal size (=%d)",
val,name,variable->min);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
xbt_dynar_foreach(variable->content,cpt,seen) {
if (seen == val) {
"Cannot remove value %f from the config element %s since it's already at its minimal size (=%d)",
val,name,variable->min);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
xbt_dynar_foreach(variable->content,cpt,seen) {
if (seen == val) {
"Cannot remove value %s from the config element %s since it's already at its minimal size (=%d)",
name,val,variable->min);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
xbt_dynar_foreach(variable->content,cpt,seen) {
if (!strcpy(seen,val)) {
"Cannot remove value %s:%d from the config element %s since it's already at its minimal size (=%d)",
host,port,name,variable->min);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_host,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_host,&variable));
xbt_dynar_foreach(variable->content,cpt,seen) {
if (!strcpy(seen->name,host) && seen->port == port) {
"Cannot remove %dth value from the config element %s since it's already at its minimal size (=%d)",
pos,name,variable->min);
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_any,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_any,&variable));
if (variable->cb_rm) (*variable->cb_rm)(name, pos);
xbt_dynar_remove_at(variable->content, pos, NULL);
xbt_cfgelm_t variable;
xbt_error_t errcode;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
if (xbt_dynar_length(variable->content) > 1) {
WARN2("You asked for the first value of the config element '%s', but there is %lu values",
xbt_cfgelm_t variable;
xbt_error_t errcode;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
if (xbt_dynar_length(variable->content) > 1) {
WARN2("You asked for the first value of the config element '%s', but there is %lu values\n",
*val=NULL;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
if (xbt_dynar_length(variable->content) > 1) {
WARN2("You asked for the first value of the config element '%s', but there is %lu values\n",
xbt_error_t errcode;
xbt_host_t *val;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_host,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_host,&variable));
if (xbt_dynar_length(variable->content) > 1) {
WARN2("You asked for the first value of the config element '%s', but there is %lu values\n",
xbt_cfgelm_t variable;
xbt_error_t errcode;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
*val = xbt_dynar_get_as(variable->content, pos, int);
return no_error;
}
xbt_cfgelm_t variable;
xbt_error_t errcode;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_double,&variable));
*val = xbt_dynar_get_as(variable->content, pos, double);
return no_error;
}
xbt_cfgelm_t variable;
xbt_error_t errcode;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_string,&variable));
*val = xbt_dynar_get_as(variable->content, pos, char*);
return no_error;
}
xbt_error_t errcode;
xbt_host_t *val;
- TRY (xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
+ TRYOLD(xbt_cfgelm_get(cfg,name,xbt_cfgelm_int,&variable));
val = xbt_dynar_get_ptr(variable->content, pos);
*port = val->port;
*host = val->name;
/*OUT*/char **key) {
xbt_error_t errcode = no_error;
- TRY(__cursor_not_null(cursor));
+ TRYOLD(__cursor_not_null(cursor));
*key = xbt_dynar_get_as(cursor->keys, cursor->pos - 1, char*);
char *key = NULL;
int key_len = 0;
- TRY(__cursor_not_null(cursor));
+ TRYOLD(__cursor_not_null(cursor));
key = xbt_dynar_get_as(cursor->keys, cursor->pos-1, char *);
key_len = xbt_dynar_get_as(cursor->key_lens, cursor->pos_len-1, int);
- TRY(xbt_dictelm_get_ext(cursor->head, key, key_len, data));
+ TRYOLD(xbt_dictelm_get_ext(cursor->head, key, key_len, data));
return errcode;
}
p_child = xbt_dynar_get_as(head->sub, pos, s_xbt_dictelm_t*);
/*DEBUG5("Recurse on child %d of %p to remove %.*s (prefix=%d)",
pos, (void*)p_child, key+offset, key_len-offset,offset);*/
- TRY(_xbt_dictelm_remove_rec(p_child, key, key_len, offset));
+ TRYOLD(_xbt_dictelm_remove_rec(p_child, key, key_len, offset));
_collapse_if_need(head, pos, old_offset);
return no_error;
i, thislevel, thislen, thiskey, (int)thislen,thiskey);
/* search the dict of next level: let mismatch raise if not found */
- TRY(xbt_dict_get_ext(thislevel, thiskey, thislen, (void*)&nextlevel));
+ TRYOLD(xbt_dict_get_ext(thislevel, thiskey, thislen, (void*)&nextlevel));
}
xbt_dynar_get_cpy(keys, i, &thiskey);
/* write */
if (direction == RW)
- TRY(gras_socket_client_from_file(filename,&sock));
+ TRYOLD(gras_socket_client_from_file(filename,&sock));
if (direction == WRITE || direction == RW)
- TRY(gras_datadesc_send(sock, type, src));
-/* TRY(gras_datadesc_gen_send(sock, type, src));*/
+ TRYOLD(gras_datadesc_send(sock, type, src));
+/* TRYOLD(gras_datadesc_gen_send(sock, type, src));*/
if (direction == RW)
gras_socket_close(sock);
/* read */
if (direction == RW)
- TRY(gras_socket_server_from_file(filename,&sock));
+ TRYOLD(gras_socket_server_from_file(filename,&sock));
if (direction == READ || direction == RW)
- TRY(gras_datadesc_recv(sock, type, r_arch, dst));
+ TRYOLD(gras_datadesc_recv(sock, type, r_arch, dst));
if (direction == RW)
gras_socket_close(sock);
int i=5,j;
INFO0("---- Test on integer ----");
- TRY(write_read(gras_datadesc_by_name("int"), &i,&j, sock,direction));
+ TRYOLD(write_read(gras_datadesc_by_name("int"), &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert(i == j);
}
float i=5.0,j;
INFO0("---- Test on float ----");
- TRY(write_read(gras_datadesc_by_name("float"), &i,&j, sock,direction));
+ TRYOLD(write_read(gras_datadesc_by_name("float"), &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert2(i == j,"%f != %f",i,j);
}
double i=-3252355.1234,j;
INFO0("---- Test on double ----");
- TRY(write_read(gras_datadesc_by_name("double"), &i,&j, sock,direction));
+ TRYOLD(write_read(gras_datadesc_by_name("double"), &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert2(i == j,"%f != %f",i,j);
}
gras_datadesc_by_name("int"),
SIZE);
- TRY(write_read(my_type, &i,&j, sock,direction));
+ TRYOLD(write_read(my_type, &i,&j, sock,direction));
if (direction == READ || direction == RW) {
for (cpt=0; cpt<SIZE; cpt++) {
DEBUG1("Test spot %d",cpt);
DEBUG2("Push %d, length=%lu",cpt, xbt_dynar_length(i));
}
/* xbt_dynar_dump(i);*/
- TRY(write_read(my_type, &i,&j, sock, direction));
+ TRYOLD(write_read(my_type, &i,&j, sock, direction));
/* xbt_dynar_dump(j);*/
if (direction == READ || direction == RW) {
for (cpt=0; cpt<64; cpt++){
my_type = gras_datadesc_ref("int*",gras_datadesc_by_name("int"));
- TRY(write_read(my_type, &i,&j, sock,direction));
+ TRYOLD(write_read(my_type, &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert(*i == *j);
free(j);
int cpt;
INFO0("---- Test on string (ref to dynamic array) ----");
- TRY(write_read(gras_datadesc_by_name("string"), &i,&j,
+ TRYOLD(write_read(gras_datadesc_by_name("string"), &i,&j,
sock,direction));
if (direction == READ || direction == RW) {
for (cpt=0; cpt<strlen(i); cpt++) {
i->a = 2235; i->b = 433425;
i->c = -23423; i->d = -235235;
- TRY(write_read(my_type, &i,&j, sock,direction));
+ TRYOLD(write_read(my_type, &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert2(i->a == j->a,"i->a=%d != j->a=%d",i->a,j->a);
xbt_assert(i->b == j->b);
i->c1 = 's'; i->l1 = 123455;
i->c2 = 'e'; i->l2 = 774531;
- TRY(write_read(my_type, &i,&j, sock,direction));
+ TRYOLD(write_read(my_type, &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert(i->c1 == j->c1);
xbt_assert(i->c2 == j->c2);
i->hete.c1 = 's'; i->hete.l1 = 123455;
i->hete.c2 = 'e'; i->hete.l2 = 774531;
- TRY(write_read(my_type, &i,&j, sock,direction));
+ TRYOLD(write_read(my_type, &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert(i->homo.a == j->homo.a);
xbt_assert(i->homo.b == j->homo.b);
i = cons( 12355, cons( 246264 , cons( 23263, NULL)));
j = NULL;
- TRY(write_read(gras_datadesc_by_name("chained_list_t*"),
+ TRYOLD(write_read(gras_datadesc_by_name("chained_list_t*"),
&i,&j,
sock,direction));
if (direction == READ || direction == RW) {
j = NULL;
gras_datadesc_cycle_set(gras_datadesc_by_name("chained_list_t*"));
- TRY(write_read(gras_datadesc_by_name("chained_list_t*"),
+ TRYOLD(write_read(gras_datadesc_by_name("chained_list_t*"),
&i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_dynar_push(i,&s1);
}
- TRY(write_read(my_type, &i,&j, sock, direction));
+ TRYOLD(write_read(my_type, &i,&j, sock, direction));
if (direction == READ || direction == RW) {
for (cpt=0; cpt< 64; cpt++) {
sprintf(buf,"%d",cpt);
for (cpt2=0; cpt2<106; cpt2++)
i.Cddsdde[cpt][cpt2] = ((double)cpt) * ((double)cpt2);
}
- TRY(write_read(gras_datadesc_by_symbol(s_pbio),
+ TRYOLD(write_read(gras_datadesc_by_symbol(s_pbio),
&i,&j, sock,direction));
if (direction == READ || direction == RW) {
/* Check that the data match */
ddt=gras_datadesc_ref("Clause*",ddt);
- TRY(write_read(ddt, &i,&j, sock,direction));
+ TRYOLD(write_read(ddt, &i,&j, sock,direction));
if (direction == READ || direction == RW) {
xbt_assert(i->num_lits == j->num_lits);
for (cpt=0; cpt<i->num_lits; cpt++)
if (direction == WRITE) {
TRYFAIL(gras_socket_client_from_file(filename,&sock));
- TRY(gras_datadesc_send(sock, gras_datadesc_by_name("char"),
+ TRYOLD(gras_datadesc_send(sock, gras_datadesc_by_name("char"),
&r_arch_char));
}
if (direction == READ) {
TRYFAIL(gras_socket_server_from_file(filename,&sock));
- TRY(gras_datadesc_recv(sock, gras_datadesc_by_name("char"),
+ TRYOLD(gras_datadesc_recv(sock, gras_datadesc_by_name("char"),
gras_arch_selfid(), &r_arch_char));
INFO3("This datafile was generated on %s (%d), I'm %s.",
gras_datadesc_arch_name(r_arch_char),(int)r_arch_char,
print " INFO0(\"---- Test on all possible struct having 3 fields (".(($max_i+1)*($max_j+1)*($max_k+1)*($max_l+1))." structs) ----\");\n";
for $i (0..$max_i) { for $j (0..$max_j) { for $k (0..$max_k) { for $l (0..$max_l) {
my $struct=$abrev[$i].$abrev[$j].$abrev[$k].$abrev[$l];
- print " TRY(write_read(gras_datadesc_by_symbol($struct), &my_$struct, &my_${struct}2, sock,direction));\n";
+ print " TRYOLD(write_read(gras_datadesc_by_symbol($struct), &my_$struct, &my_${struct}2, sock,direction));\n";
print " if (direction == READ || direction == RW) {\n";
print " int failed = 0;\n";
print " test(my_$struct.a == my_${struct}2.a);\n";