#define NON_PERSISTENT 0x2
#define SEND 0x4
#define RECV 0x8
-#define RECV_DELETE 0x10
-
+#define RECV_DELETE 0x10
+#define ISEND 0x20
+#define SSEND 0x40
// this struct is here to handle the problem of non-contignous data
// for each such structure these function should be implemented (vector
// index hvector hindex struct)
int dst, int tag, MPI_Comm comm);
MPI_Request smpi_mpi_recv_init(void *buf, int count, MPI_Datatype datatype,
int src, int tag, MPI_Comm comm);
+MPI_Request smpi_mpi_ssend_init(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm);
void smpi_mpi_start(MPI_Request request);
void smpi_mpi_startall(int count, MPI_Request * requests);
void smpi_mpi_request_free(MPI_Request * request);
int dst, int tag, MPI_Comm comm);
MPI_Request smpi_mpi_isend(void *buf, int count, MPI_Datatype datatype,
int dst, int tag, MPI_Comm comm);
+MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm);
+MPI_Request smpi_mpi_ssend(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm);
MPI_Request smpi_irecv_init(void *buf, int count, MPI_Datatype datatype,
int src, int tag, MPI_Comm comm);
MPI_Request smpi_mpi_irecv(void *buf, int count, MPI_Datatype datatype,
return request;
}
+MPI_Request smpi_mpi_ssend_init(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request =
+ build_request(buf, count, datatype, smpi_comm_rank(comm), dst, tag,
+ comm, PERSISTENT | SSEND | SEND);
+ request->refcount++;
+ return request;
+}
+
MPI_Request smpi_mpi_recv_init(void *buf, int count, MPI_Datatype datatype,
int src, int tag, MPI_Comm comm)
{
XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf);
mailbox = smpi_process_remote_mailbox(receiver);
}
- if (request->size < sg_cfg_get_int("smpi/send_is_detached_thres") ) { //(FIXME: this limit should be configurable)
+ if ( (! (request->flags & SSEND)) && (request->size < sg_cfg_get_int("smpi/send_is_detached_thres"))) {
void *oldbuf = NULL;
request->detached = 1;
request->refcount++;
{
MPI_Request request =
build_request(buf, count, datatype, smpi_comm_rank(comm), dst, tag,
- comm, NON_PERSISTENT | SEND);
+ comm, NON_PERSISTENT | ISEND | SEND);
+
+ smpi_mpi_start(request);
+ return request;
+}
+
+MPI_Request smpi_mpi_issend(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request =
+ build_request(buf, count, datatype, smpi_comm_rank(comm), dst, tag,
+ comm, NON_PERSISTENT | ISEND | SSEND | SEND);
+ smpi_mpi_start(request);
+ return request;
+}
+MPI_Request smpi_mpi_ssend(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm)
+{
+ MPI_Request request = smpi_mpi_issend(buf, count, datatype, dst, tag, comm);
smpi_mpi_start(request);
return request;
}
return retval;
}
+int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request) {
+ int retval;
+
+ smpi_bench_end();
+ if (request == NULL) {
+ retval = MPI_ERR_ARG;
+ } else if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (dst == MPI_PROC_NULL) {
+ retval = MPI_SUCCESS;
+ } else {
+ *request = smpi_mpi_ssend_init(buf, count, datatype, dst, tag, comm);
+ retval = MPI_SUCCESS;
+ }
+ smpi_bench_begin();
+ return retval;
+}
+
int PMPI_Start(MPI_Request * request)
{
int retval;
return retval;
}
+int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request) {
+ int retval;
+
+ smpi_bench_end();
+ if (request == NULL) {
+ retval = MPI_ERR_ARG;
+ } else if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (dst == MPI_PROC_NULL) {
+ *request = MPI_REQUEST_NULL;
+ retval = MPI_SUCCESS;
+ } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
+ retval = MPI_ERR_COMM;
+ } else if (count < 0) {
+ retval = MPI_ERR_COUNT;
+ } else if (buf==NULL && count > 0) {
+ retval = MPI_ERR_COUNT;
+ } else if (datatype == MPI_DATATYPE_NULL){
+ retval = MPI_ERR_TYPE;
+ } else if(tag<0 && tag != MPI_ANY_TAG){
+ retval = MPI_ERR_TAG;
+ } else {
+
+#ifdef HAVE_TRACING
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ TRACE_smpi_computing_out(rank);
+ int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
+ TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
+ TRACE_smpi_send(rank, rank, dst_traced);
+#endif
+
+ *request = smpi_mpi_issend(buf, count, datatype, dst, tag, comm);
+ retval = MPI_SUCCESS;
+#ifdef HAVE_TRACING
+ TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+ (*request)->send = 1;
+ TRACE_smpi_computing_in(rank);
+#endif
+ }
+
+ smpi_bench_begin();
+ return retval;
+}
int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
MPI_Comm comm, MPI_Status * status)
return retval;
}
+
+
+int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm) {
+ int retval;
+
+ smpi_bench_end();
+
+ if (comm == MPI_COMM_NULL) {
+ retval = MPI_ERR_COMM;
+ } else if (dst == MPI_PROC_NULL) {
+ retval = MPI_SUCCESS;
+ } else if (dst >= smpi_group_size(smpi_comm_group(comm)) || dst <0){
+ retval = MPI_ERR_COMM;
+ } else if (count < 0) {
+ retval = MPI_ERR_COUNT;
+ } else if (buf==NULL && count > 0) {
+ retval = MPI_ERR_COUNT;
+ } else if (datatype == MPI_DATATYPE_NULL){
+ retval = MPI_ERR_TYPE;
+ } else if(tag<0 && tag != MPI_ANY_TAG){
+ retval = MPI_ERR_TAG;
+ } else {
+
+ #ifdef HAVE_TRACING
+ int rank = comm != MPI_COMM_NULL ? smpi_process_index() : -1;
+ TRACE_smpi_computing_out(rank);
+ int dst_traced = smpi_group_index(smpi_comm_group(comm), dst);
+ TRACE_smpi_ptp_in(rank, rank, dst_traced, __FUNCTION__);
+ TRACE_smpi_send(rank, rank, dst_traced);
+ #endif
+
+ smpi_mpi_ssend(buf, count, datatype, dst, tag, comm);
+ retval = MPI_SUCCESS;
+
+ #ifdef HAVE_TRACING
+ TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
+ TRACE_smpi_computing_in(rank);
+ #endif
+ }
+
+ smpi_bench_begin();
+ return retval;}
+
+
int PMPI_Sendrecv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dst, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int src, int recvtag,
return not_yet_implemented();
}
-int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) {
- return not_yet_implemented();
-}
-int PMPI_Ssend_init(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
- return not_yet_implemented();
-}
int PMPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm* comm_out) {
return not_yet_implemented();
return not_yet_implemented();
}
-int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request* request) {
- return not_yet_implemented();
-}
-
-
int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
return not_yet_implemented();
}