git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7847
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
/* Build a dynar of all communications I could get something from */
xbt_dynar_t comms = xbt_dynar_new(sizeof(smx_comm_t),NULL);
unsigned int cursor;
/* Build a dynar of all communications I could get something from */
xbt_dynar_t comms = xbt_dynar_new(sizeof(smx_comm_t),NULL);
unsigned int cursor;
+ int got = 0;
+ smx_comm_t comm;
gras_socket_t sock;
gras_trp_sg_sock_data_t *sock_data;
xbt_dynar_foreach(trp_proc->sockets,cursor,sock) {
gras_socket_t sock;
gras_trp_sg_sock_data_t *sock_data;
xbt_dynar_foreach(trp_proc->sockets,cursor,sock) {
}
VERB1("Wait on %ld 'sockets'",xbt_dynar_length(comms));
/* Wait for the end of any of these communications */
}
VERB1("Wait on %ld 'sockets'",xbt_dynar_length(comms));
/* Wait for the end of any of these communications */
- int got = SIMIX_network_waitany(comms);
- smx_comm_t comm;
+ got = SIMIX_network_waitany(comms);
/* retrieve the message sent in that communication */
xbt_dynar_get_cpy(comms,got,&(comm));
/* retrieve the message sent in that communication */
xbt_dynar_get_cpy(comms,got,&(comm));
int whole_payload_size = 0; /* msg->payload_size is used to memcpy the payload.
This is used to report the load onto the simulator. It also counts the size of pointed stuff */
gras_msg_t msg; /* message to send */
int whole_payload_size = 0; /* msg->payload_size is used to memcpy the payload.
This is used to report the load onto the simulator. It also counts the size of pointed stuff */
gras_msg_t msg; /* message to send */
+ smx_comm_t comm;
+ gras_trp_sg_sock_data_t *sock_data = NULL;
/*initialize gras message */
msg = xbt_new(s_gras_msg_t, 1);
msg->expe = sock;
/*initialize gras message */
msg = xbt_new(s_gras_msg_t, 1);
msg->expe = sock;
whole_payload_size = gras_datadesc_memcpy(msgtype->ctn_type,
payload, msg->payl);
}
whole_payload_size = gras_datadesc_memcpy(msgtype->ctn_type,
payload, msg->payl);
}
- gras_trp_sg_sock_data_t *sock_data = (gras_trp_sg_sock_data_t *) sock->data;
- smx_comm_t comm;
+ sock_data = (gras_trp_sg_sock_data_t *) sock->data;
+
SIMIX_network_send(sock_data->im_server ? sock_data->rdv_client : sock_data->rdv_client,
whole_payload_size,-1,-1,&msg,sizeof(void*),&comm,msg);
SIMIX_network_send(sock_data->im_server ? sock_data->rdv_client : sock_data->rdv_client,
whole_payload_size,-1,-1,&msg,sizeof(void*),&comm,msg);
* for more details.
*/
xbt_dynar_t SD_daxload(const char*filename) {
* for more details.
*/
xbt_dynar_t SD_daxload(const char*filename) {
+ xbt_dict_cursor_t cursor;
+ SD_task_t file;
+ char *name;
FILE* in_file = fopen(filename,"r");
xbt_assert1(in_file, "Unable to open \"%s\"\n", filename);
input_buffer = dax__create_buffer(in_file, 10);
FILE* in_file = fopen(filename,"r");
xbt_assert1(in_file, "Unable to open \"%s\"\n", filename);
input_buffer = dax__create_buffer(in_file, 10);
* Files not produced in the system are said to be produced by root task (top of DAG).
* Files not consumed in the system are said to be consumed by end task (bottom of DAG).
*/
* Files not produced in the system are said to be produced by root task (top of DAG).
* Files not consumed in the system are said to be consumed by end task (bottom of DAG).
*/
- xbt_dict_cursor_t cursor;
- SD_task_t file;
- char *name;
xbt_dict_foreach(files,cursor,name,file) {
unsigned int cpt1,cpt2;
xbt_dict_foreach(files,cursor,name,file) {
unsigned int cpt1,cpt2;
+ SD_task_t newfile = NULL;
SD_dependency_t depbefore,depafter;
if (xbt_dynar_length(file->tasks_before) == 0) {
xbt_dynar_foreach(file->tasks_after,cpt2,depafter) {
SD_dependency_t depbefore,depafter;
if (xbt_dynar_length(file->tasks_before) == 0) {
xbt_dynar_foreach(file->tasks_after,cpt2,depafter) {
WARN2("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
file->name,depbefore->src->name);
}
WARN2("File %s is produced and consumed by task %s. This loop dependency will prevent the execution of the task.",
file->name,depbefore->src->name);
}
- SD_task_t newfile = SD_task_create_comm_e2e(file->name,NULL,file->amount);
+ newfile = SD_task_create_comm_e2e(file->name,NULL,file->amount);
SD_task_dependency_add(NULL,NULL,depbefore->src,newfile);
SD_task_dependency_add(NULL,NULL,newfile,depafter->dst);
xbt_dynar_push(result,&newfile);
SD_task_dependency_add(NULL,NULL,depbefore->src,newfile);
SD_task_dependency_add(NULL,NULL,newfile,depafter->dst);
xbt_dynar_push(result,&newfile);