From: navarrop Date: Mon, 2 Aug 2010 09:16:10 +0000 (+0000) Subject: Add Waitany for icomms to cmake tests. X-Git-Tag: v3_5~736 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3f379c89dee86f5abf7c050c686eca433fe25cc5 Add Waitany for icomms to cmake tests. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8085 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/buildtools/Cmake/AddTests.cmake b/buildtools/Cmake/AddTests.cmake index beb557504e..dc61123296 100644 --- a/buildtools/Cmake/AddTests.cmake +++ b/buildtools/Cmake/AddTests.cmake @@ -140,6 +140,9 @@ ADD_TEST(msg-properties ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/ ADD_TEST(msg-trace ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg trace/trace.tesh) ADD_TEST(msg-masterslave_cpu_ti ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg masterslave/masterslave_cpu_ti.tesh) ADD_TEST(msg_icomms ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg/icomms peer.tesh) +ADD_TEST(msg_icomms_waitany ${PROJECT_DIRECTORY}/examples/msg/icomms/peer3 + ${PROJECT_DIRECTORY}/examples/msg/icomms/small_platform.xml + ${PROJECT_DIRECTORY}/examples/msg/icomms/deployment_peer05.xml) IF(HAVE_TRACING) ADD_TEST(tracing-ms ${CMAKE_BINARY_DIR}/bin/tesh --cd ${PROJECT_DIRECTORY}/examples/msg tracing/ms.tesh) diff --git a/examples/msg/icomms/peer3.c b/examples/msg/icomms/peer3.c index 8ca347b6d7..a915724f9f 100755 --- a/examples/msg/icomms/peer3.c +++ b/examples/msg/icomms/peer3.c @@ -37,11 +37,11 @@ int sender(int argc, char *argv[]) { sprintf(mailbox,"receiver-%ld",(i % receivers_count)); sprintf(sprintf_buffer, "Task_%d", i); - task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size/pow(10,i), NULL); + task = MSG_task_create(sprintf_buffer, task_comp_size, task_comm_size, NULL); comm[i] = MSG_task_isend(task, mailbox); MSG_task_refcount_dec(task); xbt_dynar_push_as(d, msg_comm_t, comm[i]); - INFO3("Send to receiver-%ld %s comm_size %f",i % receivers_count,sprintf_buffer,task_comm_size/pow(10,i)); + INFO3("Send to receiver-%ld %s comm_size %f",i % receivers_count,sprintf_buffer,task_comm_size); } /* Here we are waiting for the completion of all communications*/ @@ -62,7 +62,6 @@ int sender(int argc, char *argv[]) res_irecv = MSG_task_irecv(&(task), mailbox); xbt_assert0(MSG_comm_wait(res_irecv,-1) == MSG_OK, "MSG_task_get failed"); MSG_task_destroy(task); - MSG_comm_destroy(res_irecv); } INFO0("Goodbye now!"); @@ -112,8 +111,8 @@ int receiver(int argc, char *argv[]) /* Here we tell to sender that all tasks are done*/ sprintf(mailbox,"finalize"); - res_irecv = MSG_task_isend(MSG_task_create("end", 0, 0, NULL), mailbox); - + res_irecv = MSG_task_isend(MSG_task_create(NULL, 0, 0, NULL), mailbox); + MSG_comm_wait(res_irecv,-1); INFO0("I'm done. See you!"); return 0; } /* end_of_receiver */