ADD_TEST(mc-bugged1-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
ADD_TEST(mc-bugged2-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged2.tesh)
ADD_TEST(mc-centralized-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc centralized.tesh)
- ADD_TEST(mc-bugged1-liveness-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh)
- ADD_TEST(mc-chord-neverjoin-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/chord chord_neverjoin.tesh)
- ADD_TEST(mc-test-snapshot-comparison1 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison1.tesh)
- ADD_TEST(mc-test-snapshot-comparison2 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison2.tesh)
- ADD_TEST(mc-test-snapshot-comparison3 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison3.tesh)
- ADD_TEST(mc-test-snapshot-comparison4 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison4.tesh)
- ADD_TEST(mc-test-snapshot-comparison5 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison5.tesh)
+ if(PROCESSOR_x86_64) # liveness model-checking works only on 64bits (for now ...)
+ ADD_TEST(mc-bugged1-liveness-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1_liveness.tesh)
+ ADD_TEST(mc-chord-neverjoin-ucontext ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/chord --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/chord chord_neverjoin.tesh)
+ ADD_TEST(mc-test-snapshot-comparison1 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison1.tesh)
+ ADD_TEST(mc-test-snapshot-comparison2 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison2.tesh)
+ ADD_TEST(mc-test-snapshot-comparison3 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison3.tesh)
+ ADD_TEST(mc-test-snapshot-comparison4 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison4.tesh)
+ ADD_TEST(mc-test-snapshot-comparison5 ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:ucontext --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc/test --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc/test snapshot_comparison5.tesh)
+ endif()
endif()
if(HAVE_RAWCTX)
ADD_TEST(mc-bugged1-raw ${CMAKE_BINARY_DIR}/bin/tesh ${TESH_OPTION} --cfg contexts/factory:raw --setenv bindir=${CMAKE_BINARY_DIR}/examples/msg/mc --cd ${CMAKE_HOME_DIRECTORY}/examples/msg/mc bugged1.tesh)
src/xbt/mmalloc/mmtrace.awk
src/xbt/mmalloc/mrealloc.c
src/xbt/setset_private.h
+ src/win32/config.h
+ src/xbt/win32_ucontext.c
+ include/xbt/win32_ucontext.h
tools/tesh/run_context.h
tools/tesh/tesh.h
)
#! ./tesh
! expect signal SIGABRT
-! timeout 120
+! timeout 200
$ ${bindir:=.}/chord_liveness --cfg=model-check:1 --cfg=contexts/factory:ucontext "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1'
> [ 0.000000] (0:@) type in variable = 2
XBT_INFO("**** End test ****");
- return 0;
+ xbt_abort();
}
int main(int argc, char **argv){
! expect signal SIGABRT
! timeout 200
-$ ${bindir:=.}/snapshot_comparison1 --cfg=model-check:1 --cfg=contexts/factory:ucontext "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ ${bindir:=.}/snapshot_comparison1 --cfg=model-check:1 "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1'
> [ 0.000000] (0:@) type in variable = 2
> [ 0.000000] (0:@) Check the liveness property promela
-> [ 1.000000] (1:test@HostA) **** Start test ****
-> [ 1.000000] (1:test@HostA) Take two successive snapshots (No modification)
-> [ 1.000000] (1:test@HostA) First snapshot
-> [ 3.000000] (1:test@HostA) Second snapshot
-> [ 3.000000] (1:test@HostA) Test result : 0 (0 = state equality, 1 = different states)
-> [ 3.000000] (1:test@HostA) **** End test ****
-> [ 0.000000] (0:@) Next pair (depth = 5) already reached !
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) | ACCEPTANCE CYCLE |
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) Counter-example that violates formula :
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_COMPARE_SNAPSHOTS ((null))
-> [ 0.000000] (0:@) End of system requests but evolution in Büchi automaton
-> [ 0.000000] (0:@) Expanded pairs = 5
-> [ 0.000000] (0:@) Visited pairs = 4
-> [ 0.000000] (0:@) Expanded / Visited = 0.800000
+> [ 0.000000] (1:test@HostA) **** Start test ****
+> [ 0.000000] (1:test@HostA) Take two successive snapshots (No modification)
+> [ 0.000000] (1:test@HostA) First snapshot
+> [ 0.000000] (1:test@HostA) Second snapshot
+> [ 0.000000] (1:test@HostA) Test result : 0 (0 = state equality, 1 = different states)
+> [ 0.000000] (1:test@HostA) **** End test ****
xbt_free(toto);
- return 0;
+ xbt_abort();
}
int main(int argc, char **argv){
> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1'
> [ 0.000000] (0:@) type in variable = 2
> [ 0.000000] (0:@) Check the liveness property promela
-> [ 1.000000] (1:test@HostA) **** Start test ****
-> [ 1.000000] (1:test@HostA) Malloc after first snapshot
-> [ 2.000000] (1:test@HostA) First snapshot
-> [ 2.000000] (1:test@HostA) Toto allocated
-> [ 3.000000] (1:test@HostA) Second snapshot
-> [ 3.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
-> [ 3.000000] (1:test@HostA) **** End test ****
-> [ 0.000000] (0:@) Next pair (depth = 5) already reached !
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) | ACCEPTANCE CYCLE |
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) Counter-example that violates formula :
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_COMPARE_SNAPSHOTS ((null))
-> [ 0.000000] (0:@) End of system requests but evolution in Büchi automaton
-> [ 0.000000] (0:@) Expanded pairs = 5
-> [ 0.000000] (0:@) Visited pairs = 4
-> [ 0.000000] (0:@) Expanded / Visited = 0.800000
+> [ 0.000000] (1:test@HostA) **** Start test ****
+> [ 0.000000] (1:test@HostA) Malloc after first snapshot
+> [ 0.000000] (1:test@HostA) First snapshot
+> [ 0.000000] (1:test@HostA) Toto allocated
+> [ 0.000000] (1:test@HostA) Second snapshot
+> [ 0.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
+> [ 0.000000] (1:test@HostA) **** End test ****
XBT_INFO("**** End test ****");
- return 0;
+ xbt_abort();
}
int main(int argc, char **argv){
> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1'
> [ 0.000000] (0:@) type in variable = 2
> [ 0.000000] (0:@) Check the liveness property promela
-> [ 1.000000] (1:test@HostA) **** Start test ****
-> [ 1.000000] (1:test@HostA) Malloc and free after first snapshot
-> [ 2.000000] (1:test@HostA) First snapshot
-> [ 2.000000] (1:test@HostA) Toto allocated
-> [ 2.000000] (1:test@HostA) Toto free
-> [ 3.000000] (1:test@HostA) Second snapshot
-> [ 3.000000] (1:test@HostA) Test result : 0 (0 = state equality, 1 = different states)
-> [ 3.000000] (1:test@HostA) **** End test ****
-> [ 0.000000] (0:@) Next pair (depth = 5) already reached !
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) | ACCEPTANCE CYCLE |
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) Counter-example that violates formula :
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_COMPARE_SNAPSHOTS ((null))
-> [ 0.000000] (0:@) End of system requests but evolution in Büchi automaton
-> [ 0.000000] (0:@) Expanded pairs = 5
-> [ 0.000000] (0:@) Visited pairs = 4
-> [ 0.000000] (0:@) Expanded / Visited = 0.800000
+> [ 0.000000] (1:test@HostA) **** Start test ****
+> [ 0.000000] (1:test@HostA) Malloc and free after first snapshot
+> [ 0.000000] (1:test@HostA) First snapshot
+> [ 0.000000] (1:test@HostA) Toto allocated
+> [ 0.000000] (1:test@HostA) Toto free
+> [ 0.000000] (1:test@HostA) Second snapshot
+> [ 0.000000] (1:test@HostA) Test result : 0 (0 = state equality, 1 = different states)
+> [ 0.000000] (1:test@HostA) **** End test ****
XBT_INFO("**** End test ****");
- return 0;
+ xbt_abort();
}
int main(int argc, char **argv){
> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1'
> [ 0.000000] (0:@) type in variable = 2
> [ 0.000000] (0:@) Check the liveness property promela
-> [ 1.000000] (1:test@HostA) **** Start test ****
-> [ 1.000000] (1:test@HostA) Free after first snapshot
-> [ 1.000000] (1:test@HostA) Toto allocated
-> [ 2.000000] (1:test@HostA) First snapshot
-> [ 2.000000] (1:test@HostA) Toto free
-> [ 2.000000] (1:test@HostA) Second snapshot
-> [ 3.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
-> [ 3.000000] (1:test@HostA) **** End test ****
-> [ 0.000000] (0:@) Next pair (depth = 5) already reached !
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) | ACCEPTANCE CYCLE |
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) Counter-example that violates formula :
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_COMPARE_SNAPSHOTS ((null))
-> [ 0.000000] (0:@) End of system requests but evolution in Büchi automaton
-> [ 0.000000] (0:@) Expanded pairs = 5
-> [ 0.000000] (0:@) Visited pairs = 4
-> [ 0.000000] (0:@) Expanded / Visited = 0.800000
\ No newline at end of file
+> [ 0.000000] (1:test@HostA) **** Start test ****
+> [ 0.000000] (1:test@HostA) Free after first snapshot
+> [ 0.000000] (1:test@HostA) Toto allocated
+> [ 0.000000] (1:test@HostA) First snapshot
+> [ 0.000000] (1:test@HostA) Toto free
+> [ 0.000000] (1:test@HostA) Second snapshot
+> [ 0.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
+> [ 0.000000] (1:test@HostA) **** End test ****
\ No newline at end of file
XBT_INFO("**** End test ****");
- return 0;
+ xbt_abort();
}
int main(int argc, char **argv){
> [ 0.000000] (0:@) Configuration change: Set 'model-check' to '1'
> [ 0.000000] (0:@) type in variable = 2
> [ 0.000000] (0:@) Check the liveness property promela
-> [ 1.000000] (1:test@HostA) **** Start test ****
-> [ 1.000000] (1:test@HostA) Increment local variable
-> [ 1.000000] (1:test@HostA) j = 0
-> [ 2.000000] (1:test@HostA) First snapshot
-> [ 2.000000] (1:test@HostA) j = 1
-> [ 3.000000] (1:test@HostA) Second snapshot
-> [ 3.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
-> [ 3.000000] (1:test@HostA) **** End test ****
-> [ 0.000000] (0:@) Next pair (depth = 5) already reached !
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) | ACCEPTANCE CYCLE |
-> [ 0.000000] (0:@) *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-> [ 0.000000] (0:@) Counter-example that violates formula :
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_SNAPSHOT ((null))
-> [ 0.000000] (0:@) [(1)test] MC_COMPARE_SNAPSHOTS ((null))
-> [ 0.000000] (0:@) End of system requests but evolution in Büchi automaton
-> [ 0.000000] (0:@) Expanded pairs = 5
-> [ 0.000000] (0:@) Visited pairs = 4
-> [ 0.000000] (0:@) Expanded / Visited = 0.800000
+> [ 0.000000] (1:test@HostA) **** Start test ****
+> [ 0.000000] (1:test@HostA) Increment local variable
+> [ 0.000000] (1:test@HostA) j = 0
+> [ 0.000000] (1:test@HostA) First snapshot
+> [ 0.000000] (1:test@HostA) j = 1
+> [ 0.000000] (1:test@HostA) Second snapshot
+> [ 0.000000] (1:test@HostA) Test result : 1 (0 = state equality, 1 = different states)
+> [ 0.000000] (1:test@HostA) **** End test ****
continue;
}else{
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose)){
- XBT_VERB("Different global variable in libsimgrid : %s", current_var->name);
+ XBT_VERB("Different global variable in libsimgrid : %s at addresses %p - %p (size = %zu)", current_var->name, (char *)d1+offset, (char *)d2+offset, current_var->size);
}
return 1;
}
|| (strcmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), ".data") == 0)
|| (strcmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), ".bss") == 0)
|| (strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "stderr", 6) == 0)
+ || (strncmp(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 1, char*), "counter", 7) == 0)
|| ((size_t)strtoul(xbt_dynar_get_as(line_tokens, xbt_dynar_length(line_tokens) - 2, char*), NULL, 16) == 0))
continue;
int src;
int dst;
int tag;
+ //to handle cases where we have an unknown sender
+ //We can't override src, tag, and size, because the request may be reused later
+ int real_src;
+ int real_tag;
+ int truncated;
+ size_t real_size;
MPI_Comm comm;
smx_action_t action;
unsigned flags;
xbt_assert(ref, "Cannot match recv against null reference");
xbt_assert(req, "Cannot match recv against null request");
- return (ref->src == MPI_ANY_SOURCE || req->src == ref->src)
- && (ref->tag == MPI_ANY_TAG || req->tag == ref->tag);
+ if((ref->src == MPI_ANY_SOURCE || req->src == ref->src)
+ && (ref->tag == MPI_ANY_TAG || req->tag == ref->tag)){
+ //we match, we can transfer some values
+ // FIXME : move this to the copy function ?
+ if(ref->src == MPI_ANY_SOURCE)ref->real_src = req->src;
+ if(ref->tag == MPI_ANY_TAG)ref->real_tag = req->tag;
+ if(ref->real_size < req->real_size) ref->truncated = 1;
+ else ref->truncated = 0;
+ return 1;
+ }else return 0;
}
static int match_send(void* a, void* b,smx_action_t ignored) {
XBT_DEBUG("Trying to match a send of src %d against %d, tag %d against %d",ref->src,req->src, ref->tag, req->tag);
xbt_assert(ref, "Cannot match send against null reference");
xbt_assert(req, "Cannot match send against null request");
- return (req->src == MPI_ANY_SOURCE || req->src == ref->src)
- && (req->tag == MPI_ANY_TAG || req->tag == ref->tag);
+
+ if((req->src == MPI_ANY_SOURCE || req->src == ref->src)
+ && (req->tag == MPI_ANY_TAG || req->tag == ref->tag))
+ {
+ if(req->src == MPI_ANY_SOURCE)req->real_src = ref->src;
+ if(req->tag == MPI_ANY_TAG)req->real_tag = ref->tag;
+ if(req->real_size < ref->real_size) req->truncated = 1;
+ else ref->truncated = 0;
+ return 1;
+ } else return 0;
}
static MPI_Request build_request(void *buf, int count,
mailbox = smpi_process_mailbox_small();
else
mailbox = smpi_process_mailbox();
-
- // FIXME: SIMIX does not yet support non-contiguous datatypes
- request->action = simcall_comm_irecv(mailbox, request->buf, &request->size, &match_recv, request);
+ // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
+ request->real_size=request->size;
+ request->action = simcall_comm_irecv(mailbox, request->buf, &request->real_size, &match_recv, request);
+ if (request->action)request->action->comm.refcount++;
} else {
int receiver = smpi_group_index(smpi_comm_group(request->comm), request->dst);
}
XBT_DEBUG("Send request %p is detached; buf %p copied into %p",request,oldbuf,request->buf);
}
+ // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
+ request->real_size=request->size;
request->action =
simcall_comm_isend(mailbox, request->size, -1.0,
- request->buf, request->size,
+ request->buf, request->real_size,
&match_send,
&smpi_mpi_request_free_voidp, // how to free the userdata if a detached send fails
request,
// detach if msg size < eager/rdv switch limit
request->detached);
+ if (request->action)request->action->comm.refcount++;
#ifdef HAVE_TRACING
/* FIXME: detached sends are not traceable (request->action == NULL) */
static void finish_wait(MPI_Request * request, MPI_Status * status)
{
MPI_Request req = *request;
- // if we have a sender, we should use its data, and not the data from the receive
- //FIXME : mail fail if req->action has already been freed, the pointer being invalid
- if((req->action)&&
- (req->src==MPI_ANY_SOURCE || req->tag== MPI_ANY_TAG))
- req = (MPI_Request)SIMIX_comm_get_src_data((*request)->action);
if(status != MPI_STATUS_IGNORE) {
- status->MPI_SOURCE = req->src;
- status->MPI_TAG = req->tag;
- //if((*request)->action && ((MPI_Request)SIMIX_comm_get_src_data((*request)->action))->size == (*request)->size)
- status->MPI_ERROR = MPI_SUCCESS;
- //else status->MPI_ERROR = MPI_ERR_TRUNCATE;
+ status->MPI_SOURCE = req->src == MPI_ANY_SOURCE ? req->real_src : req->src;
+ status->MPI_TAG = req->tag == MPI_ANY_TAG ? req->real_tag : req->tag;
+ if(req->truncated)
+ status->MPI_ERROR = MPI_ERR_TRUNCATE;
+ else status->MPI_ERROR = MPI_SUCCESS ;
// this handles the case were size in receive differs from size in send
// FIXME: really this should just contain the count of receive-type blocks,
// right?
- status->count = req->size;
+ status->count = req->real_size;
}
req = *request;
print_request("Finishing", req);
MPI_Datatype datatype = req->old_type;
+
if(datatype->has_subtype == 1){
// This part handles the problem of non-contignous memory
// the unserialization at the reception
s_smpi_subtype_t *subtype = datatype->substruct;
if(req->flags & RECV) {
- subtype->unserialize(req->buf, req->old_buf, req->size/smpi_datatype_size(datatype) , datatype->substruct);
+ subtype->unserialize(req->buf, req->old_buf, req->real_size/smpi_datatype_size(datatype) , datatype->substruct);
}
if(req->detached == 0) free(req->buf);
}
if(req->flags & NON_PERSISTENT) {
- if(req->action &&
+ if(req->flags & RECV &&
+ req->action &&
(req->action->state == SIMIX_DONE))
{
MPI_Request sender_request = (MPI_Request)SIMIX_comm_get_src_data(req->action);
smpi_mpi_request_free(&sender_request);
}
}
+
+
+ if(req->action){
+ //if we want to free our request, we have to invalidate it at the other end of the comm
+ if(req->flags & SEND){
+ req->action->comm.src_data=MPI_REQUEST_NULL;
+ }else{
+ req->action->comm.dst_data=MPI_REQUEST_NULL;
+ }
+
+ smx_action_t temp=req->action;
+ if(req->action->comm.refcount == 1)req->action = NULL;
+ SIMIX_comm_destroy(temp);
+ }
+
+
+
smpi_mpi_request_free(request);
+
+
} else {
+ if(req->action)SIMIX_comm_destroy(req->action);
req->action = NULL;
}
}
status->MPI_SOURCE = req->src;
status->MPI_TAG = req->tag;
status->MPI_ERROR = MPI_SUCCESS;
- status->count = req->size;
+ status->count = req->real_size;
}
}
else *flag = 0;
#include "surf/surf_routing.h"
#include "surf/surfxml_parse_values.h"
-#include <pcre.h> /* regular expression library */
-
/**
* @ingroup SURF_build_api
* @brief A library containing all known workstations
#include "surf/surf_routing.h"
#include "surf/surfxml_parse_values.h"
-#include <pcre.h> /* regular expression library */
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
static int no_bypassroute_declared = 1;
#uses MPI_Errors
#RunTest trunc 2 "*** Testing Message truncation ***"
-#TODO: handle MPI_ERR_IN_STATUS
-#RunTest truncmult 2 '*** Testing Message trunction in multiple completions ***'
+
+RunTest truncmult 2 '*** Testing Message trunction in multiple completions ***'
RunTest nullproc 2 "*** Testing handling of MPI_PROC_NULL ***"