Added DVFS and energy consumption support.
* Dramatically change the way files are handled. API and internals changed, but
this part of MSG was not considered as production grade either.
* Add explicit synchronization facilities through semaphores
+ * Add a new function MSG_host_get_process_list()
SMPI:
* SMPI is now included directly in the libsimgrid as the windows
/* int MSG_get_msgload(void); This function lacks specification; discard it */
XBT_PUBLIC(double) MSG_get_host_speed(msg_host_t h);
XBT_PUBLIC(int) MSG_host_get_core_number(msg_host_t h);
+XBT_PUBLIC(xbt_swag_t) MSG_host_get_process_list(msg_host_t h);
XBT_PUBLIC(int) MSG_host_is_avail(msg_host_t h);
XBT_PUBLIC(void) __MSG_host_destroy(msg_host_priv_t host);
XBT_PUBLIC(const char *) simcall_host_get_name(smx_host_t host);
XBT_PUBLIC(xbt_dict_t) simcall_host_get_properties(smx_host_t host);
XBT_PUBLIC(int) simcall_host_get_core(smx_host_t host);
+XBT_PUBLIC(xbt_swag_t) simcall_host_get_process_list(smx_host_t host);
XBT_PUBLIC(double) simcall_host_get_speed(smx_host_t host);
XBT_PUBLIC(double) simcall_host_get_available_speed(smx_host_t host);
/* Two possible states, 1 - CPU ON and 0 CPU OFF */
/** \ingroup m_host_management
- * \brief Return the number of core.
+ * \brief Return the number of cores.
+ *
+ * \param host a host
+ * \return the number of cores
*/
int MSG_host_get_core_number(msg_host_t h)
{
return (simcall_host_get_core(h));
}
+/** \ingroup m_host_management
+ * \brief Return the list of processes attached to an host.
+ *
+ * \param host a host
+ * \return a swag with the attached processes
+ */
+xbt_swag_t MSG_host_get_process_list(msg_host_t h)
+{
+ xbt_assert((h != NULL), "Invalid parameters");
+
+ return (simcall_host_get_process_list(h));
+}
+
+
/** \ingroup m_host_management
* \brief Returns the value of a given host property
*
get_core(host);
}
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t simcall, smx_host_t host){
+ return SIMIX_host_get_process_list(host);
+}
+
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host){
+ xbt_assert((host != NULL), "Invalid parameters (simix host is NULL)");
+ smx_host_priv_t host_priv = SIMIX_host_priv(host);
+
+ return host_priv->process_list;
+}
double SIMIX_pre_host_get_available_speed(smx_simcall_t simcall, smx_host_t host){
void SIMIX_host_autorestart(smx_host_t host);
xbt_dict_t SIMIX_host_get_properties(smx_host_t host);
int SIMIX_host_get_core(smx_host_t host);
+xbt_swag_t SIMIX_host_get_process_list(smx_host_t host);
double SIMIX_host_get_speed(smx_host_t host);
double SIMIX_host_get_available_speed(smx_host_t host);
int SIMIX_host_get_state(smx_host_t host);
const char* SIMIX_pre_host_get_name(smx_simcall_t, smx_host_t);
xbt_dict_t SIMIX_pre_host_get_properties(smx_simcall_t, smx_host_t);
int SIMIX_pre_host_get_core(smx_simcall_t, smx_host_t);
+xbt_swag_t SIMIX_pre_host_get_process_list(smx_simcall_t, smx_host_t host);
double SIMIX_pre_host_get_speed(smx_simcall_t, smx_host_t);
double SIMIX_pre_host_get_available_speed(smx_simcall_t, smx_host_t);
int SIMIX_pre_host_get_state(smx_simcall_t, smx_host_t);
ACTION(SIMCALL_HOST_GET_NAME, host_get_name, WITH_ANSWER, TSTRING(result), TSPEC(host, smx_host_t)) sep \
ACTION(SIMCALL_HOST_GET_PROPERTIES, host_get_properties, WITH_ANSWER, TSPEC(result, xbt_dict_t), TSPEC(host, smx_host_t)) sep \
ACTION(SIMCALL_HOST_GET_CORE, host_get_core, WITH_ANSWER, TINT(result), TSPEC(host, smx_host_t)) sep \
+ACTION(SIMCALL_HOST_GET_PROCESS_LIST, host_get_process_list, WITH_ANSWER, TSPEC(result, xbt_swag_t), TSPEC(host, smx_host_t)) sep \
ACTION(SIMCALL_HOST_GET_SPEED, host_get_speed, WITH_ANSWER, TDOUBLE(result), TSPEC(host, smx_host_t)) sep \
ACTION(SIMCALL_HOST_GET_AVAILABLE_SPEED, host_get_available_speed, WITH_ANSWER, TDOUBLE(result), TSPEC(host, smx_host_t)) sep \
ACTION(SIMCALL_HOST_GET_STATE, host_get_state, WITH_ANSWER, TINT(result), TSPEC(host, smx_host_t)) sep \
return simcall_BODY_host_get_core(host);
}
+/**
+ * \ingroup simix_host_management
+ * \brief Returns the list of processes attached to the host.
+ *
+ * \param host A SIMIX host
+ * \return the swag of attached processes
+ */
+xbt_swag_t simcall_host_get_process_list(smx_host_t host)
+{
+ return simcall_BODY_host_get_process_list(host);
+}
/**
int i, src, dst, rank, num_procs;
int X, Y, send_offset, recv_offset;
int my_row_base, my_col_base, src_row_base, block_size, num_reqs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
int i, src, dst, rank, num_procs, block_size, my_z_base;
int my_z, X, Y, Z, send_offset, recv_offset;
int two_dsize, my_row_base, my_col_base, src_row_base, src_z_base, num_reqs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
MPI_Status status, status2;
int i, to, from, rank, size;
int send_offset, recv_offset;
- int tag = 500;
+ int tag = COLL_TAG_ALLGATHER;
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
MPI_Status status;
int i, to, from, rank, size;
int send_offset, recv_offset;
- int tag = 500;
+ int tag = COLL_TAG_ALLGATHER;
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
MPI_Aint rextent, sextent;
rextent = smpi_datatype_get_extent(rtype);
sextent = smpi_datatype_get_extent(stype);
- int tag = 50;
+ int tag = COLL_TAG_ALLGATHER;
MPI_Request request;
MPI_Request rrequest_array[128];
// local int variables
int src, dst, rank, num_procs, count, remainder;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
int pof2 = 1;
// local string variables
MPI_Comm comm)
{
int comm_size, rank;
- int tag = 50;
+ int tag = COLL_TAG_ALLGATHER;
int i, j, send_offset, recv_offset;
int intra_rank, inter_rank, inter_comm_size, intra_comm_size;
int inter_dst, inter_src;
MPI_Status status;
int i, to, from, rank, size;
int send_offset, recv_offset;
- int tag = 500;
+ int tag = COLL_TAG_ALLGATHER;
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
*/
#include "colls_private.h"
- #define MCA_COLL_BASE_TAG_ALLGATHER 555
int
smpi_coll_tuned_allgather_ompi_neighborexchange(void *sbuf, int scount,
MPI_Datatype sdtype,
tmpsend = (char*)rbuf + rank * rcount * rext;
/* Sendreceive */
smpi_mpi_sendrecv(tmpsend, rcount, rdtype, neighbor[0],
- MCA_COLL_BASE_TAG_ALLGATHER,
+ COLL_TAG_ALLGATHER,
tmprecv, rcount, rdtype, neighbor[0],
- MCA_COLL_BASE_TAG_ALLGATHER,
+ COLL_TAG_ALLGATHER,
comm, MPI_STATUS_IGNORE);
/* Determine initial sending location */
/* Sendreceive */
smpi_mpi_sendrecv(tmpsend, 2 * rcount, rdtype,
neighbor[i_parity],
- MCA_COLL_BASE_TAG_ALLGATHER,
+ COLL_TAG_ALLGATHER,
tmprecv, 2 * rcount, rdtype,
neighbor[i_parity],
- MCA_COLL_BASE_TAG_ALLGATHER,
+ COLL_TAG_ALLGATHER,
comm, MPI_STATUS_IGNORE);
send_data_from = recv_data_from[i_parity];
MPI_Aint extent;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
MPI_Status status;
char *send_ptr = (char *) send_buff;
int i, j, k, dst, rank, num_procs, send_offset, recv_offset, tree_root;
int dst_tree_root, rank_tree_root, last_recv_count = 0, num_procs_completed;
int offset, tmp_mask;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
int mask = 1;
int success = 0;
int curr_count = recv_count;
int i, dst, send_base_offset, recv_base_offset, send_chunk, recv_chunk,
send_offset, recv_offset;
int rank, num_procs;
- int tag = 50;
+ int tag = COLL_TAG_ALLGATHER;
int mask;
int curr_count;
MPI_Aint extent;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
MPI_Status status;
char *sendptr = (char *) send_buff;
MPI_Aint rextent, sextent;
rextent = smpi_datatype_get_extent(rtype);
sextent = smpi_datatype_get_extent(stype);
- int tag = 50;
+ int tag = COLL_TAG_ALLGATHER;
MPI_Status status;
int i, send_offset, recv_offset;
int intra_rank, inter_rank;
MPI_Request *reqs, *req_ptr;
MPI_Aint extent;
int i, src, dst, rank, num_procs, num_reqs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHER;
MPI_Status status;
char *recv_ptr = (char *) recv_buff;
/* Short or medium size message and power-of-two no. of processes. Use
* recursive doubling algorithm */
#include "colls_private.h"
-#define MPIR_ALLGATHERV_TAG 222
int smpi_coll_tuned_allgatherv_mpich_rdb (
void *sendbuf,
int sendcount,
smpi_mpi_sendrecv(((char *)tmp_buf + send_offset * recvtype_extent),
curr_cnt, recvtype, dst,
- MPIR_ALLGATHERV_TAG,
+ COLL_TAG_ALLGATHERV,
((char *)tmp_buf + recv_offset * recvtype_extent),
total_count - recv_offset, recvtype, dst,
- MPIR_ALLGATHERV_TAG,
+ COLL_TAG_ALLGATHERV,
comm, &status);
/* for convenience, recv is posted for a bigger amount
than will be sent */
smpi_mpi_send(((char *)tmp_buf + offset),
last_recv_cnt,
recvtype, dst,
- MPIR_ALLGATHERV_TAG, comm);
+ COLL_TAG_ALLGATHERV, comm);
/* last_recv_cnt was set in the previous
receive. that's the amount of data to be
sent now. */
smpi_mpi_recv(((char *)tmp_buf + offset * recvtype_extent),
total_count - offset, recvtype,
- dst, MPIR_ALLGATHERV_TAG,
+ dst, COLL_TAG_ALLGATHERV,
comm, &status);
/* for convenience, recv is posted for a
bigger amount than will be sent */
*/
#include "colls_private.h"
-#define MCA_COLL_BASE_TAG_ALLGATHERV 444
/*
* ompi_coll_tuned_allgatherv_intra_bruck
*
/* Sendreceive */
smpi_mpi_sendrecv(rbuf, 1, new_sdtype, sendto,
- MCA_COLL_BASE_TAG_ALLGATHERV,
+ COLL_TAG_ALLGATHERV,
rbuf, 1, new_rdtype, recvfrom,
- MCA_COLL_BASE_TAG_ALLGATHERV,
+ COLL_TAG_ALLGATHERV,
comm, MPI_STATUS_IGNORE);
smpi_datatype_free(&new_sdtype);
smpi_datatype_free(&new_rdtype);
*/
#include "colls_private.h"
- #define MCA_COLL_BASE_TAG_ALLGATHERV 444
int
smpi_coll_tuned_allgatherv_ompi_neighborexchange(void *sbuf, int scount,
tmprecv = (char*)rbuf + rdispls[neighbor[0]] * rext;
tmpsend = (char*)rbuf + rdispls[rank] * rext;
smpi_mpi_sendrecv(tmpsend, rcounts[rank], rdtype,
- neighbor[0], MCA_COLL_BASE_TAG_ALLGATHERV,
+ neighbor[0], COLL_TAG_ALLGATHERV,
tmprecv, rcounts[neighbor[0]], rdtype,
- neighbor[0], MCA_COLL_BASE_TAG_ALLGATHERV,
+ neighbor[0], COLL_TAG_ALLGATHERV,
comm, MPI_STATUS_IGNORE);
/* Sendreceive */
smpi_mpi_sendrecv(tmpsend, 1, new_sdtype, neighbor[i_parity],
- MCA_COLL_BASE_TAG_ALLGATHERV,
+ COLL_TAG_ALLGATHERV,
tmprecv, 1, new_rdtype, neighbor[i_parity],
- MCA_COLL_BASE_TAG_ALLGATHERV,
+ COLL_TAG_ALLGATHERV,
comm, MPI_STATUS_IGNORE);
send_data_from = recv_data_from[i_parity];
MPI_Aint extent;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHERV;
MPI_Status status;
char *send_ptr = (char *) send_buff;
MPI_Aint extent;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLGATHERV;
MPI_Status status;
char *sendptr = (char *) send_buff;
smpi_coll_tuned_allreduce_NTS(void *sbuf, void *rbuf, int rcount,
MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
{
- int tag = 5000;
+ int tag = COLL_TAG_ALLREDUCE;
MPI_Status status;
int rank, i, size, count;
int send_offset, recv_offset;
smpi_coll_tuned_allreduce_lr(void *sbuf, void *rbuf, int rcount,
MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
{
- int tag = 5000;
+ int tag = COLL_TAG_ALLREDUCE;
MPI_Status status;
int rank, i, size, count;
int send_offset, recv_offset;
MPI_Datatype dtype, MPI_Op op,
MPI_Comm comm)
{
- int nprocs, rank, tag = 543;
+ int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
int mask, dst, pof2, newrank, rem, newdst, i,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint extent;
int count, MPI_Datatype dtype,
MPI_Op op, MPI_Comm comm)
{
- int nprocs, rank, type_size, tag = 543;
+ int nprocs, rank, type_size, tag = COLL_TAG_ALLREDUCE;
int mask, dst, pof2, newrank, rem, newdst, i,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint lb, extent;
MPI_Datatype dtype, MPI_Op op,
MPI_Comm comm)
{
- int nprocs, rank, tag = 543;
+ int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
int mask, dst, pof2, newrank, rem, newdst, i,
send_idx, recv_idx, last_idx, send_cnt, recv_cnt, *cnts, *disps;
MPI_Aint extent;
{
MPI_Status status;
MPI_Aint extent;
- int tag = 4321, rank, nprocs, send_size, newcnt, share;
+ int tag = COLL_TAG_ALLREDUCE, rank, nprocs, send_size, newcnt, share;
int pof2 = 1, mask, send_idx, recv_idx, dst, send_cnt, recv_cnt;
void *recv, *tmp_buf;
int smpi_coll_tuned_allreduce_rdb(void *sbuff, void *rbuff, int count,
MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
{
- int nprocs, rank, tag = 543;
+ int nprocs, rank, tag = COLL_TAG_ALLREDUCE;
int mask, dst, pof2, newrank, rem, newdst;
MPI_Aint extent, lb;
MPI_Status status;
{
int comm_size, rank;
void *tmp_buf;
- int tag = 50;
+ int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
int num_core = NUM_CORE;
{
int comm_size, rank;
void *tmp_buf;
- int tag = 50;
+ int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
int num_core = NUM_CORE;
MPI_Status status;
{
int comm_size, rank;
void *tmp_buf;
- int tag = 50;
+ int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
int num_core = NUM_CORE;
{
int comm_size, rank;
void *tmp_buf;
- int tag = 50;
+ int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
int num_core = NUM_CORE;
{
int comm_size, rank;
void *tmp_buf;
- int tag = 50;
+ int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
int num_core = NUM_CORE;
{
int comm_size, rank;
void *tmp_buf;
- int tag = 50;
+ int tag = COLL_TAG_ALLREDUCE;
int mask, src, dst;
MPI_Status status;
int num_core = NUM_CORE;
int i, j, src, dst, rank, num_procs, count, num_reqs;
int X, Y, send_offset, recv_offset;
int my_row_base, my_col_base, src_row_base, block_size;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALL;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
MPI_Status status, *statuses;
int i, j, src, dst, rank, num_procs, num_reqs, X, Y, Z, block_size, count;
int my_z, two_dsize, my_row_base, my_col_base, my_z_base, src_row_base;
- int src_z_base, send_offset, recv_offset, tag = 1;
+ int src_z_base, send_offset, recv_offset, tag = COLL_TAG_ALLTOALL;
char *tmp_buff1, *tmp_buff2;
int *blocks_length, *disps;
int i, src, dst, rank, num_procs, count, remainder, block, position;
- int pack_size, tag = 1, pof2 = 1;
+ int pack_size, tag = COLL_TAG_ALLTOALL, pof2 = 1;
char *tmp_buff;
*/
#include "colls_private.h"
-#define MCA_COLL_BASE_TAG_ALLTOALL 101
int smpi_coll_tuned_alltoall_ompi_pairwise(void *sbuf, int scount,
MPI_Datatype sdtype,
/* send and receive */
smpi_mpi_sendrecv( tmpsend, scount, sdtype, sendto,
- MCA_COLL_BASE_TAG_ALLTOALL,
+ COLL_TAG_ALLTOALL,
tmprecv, rcount, rdtype, recvfrom,
- MCA_COLL_BASE_TAG_ALLTOALL,
+ COLL_TAG_ALLTOALL,
comm, MPI_STATUS_IGNORE);
}
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs, next_partner;
- int tag = 1; /*, failure = 0; */
+ int tag = COLL_TAG_ALLTOALL; /*, failure = 0; */
char send_sync = 'a', recv_sync = 'b';
char *send_ptr = (char *) send_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 101;
+ int tag = COLL_TAG_ALLTOALL;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALL;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALL;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
int dst_tree_root, rank_tree_root, send_offset, recv_offset;
int rank, num_procs, j, k, dst, curr_size, max_size;
int last_recv_count = 0, tmp_mask, tree_root, num_procs_completed;
- int tag = 1, mask = 1, i = 0;
+ int tag = COLL_TAG_ALLTOALL, mask = 1, i = 0;
char *tmp_buff;
char *send_ptr = (char *) send_buff;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs, next_dst, next_src;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALL;
char send_sync = 'a', recv_sync = 'b';
char *send_ptr = (char *) send_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALL;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALL;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 11;
+ int tag = COLL_TAG_ALLTOALL;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
void *recv_buff, int recv_count,
MPI_Datatype recv_type, MPI_Comm comm)
{
- int i, rank, size, nreqs, src, dst, tag = 101;
+ int i, rank, size, nreqs, src, dst, tag = COLL_TAG_ALLTOALL;
char *psnd;
char *prcv;
MPI_Aint sndinc;
int *recvcounts, int *recvdisps, MPI_Datatype recvtype,
MPI_Comm comm)
{
- int system_tag = 777;
+ int system_tag = COLL_TAG_ALLTOALLV;
int i, rank, size, err, count;
MPI_Aint lb;
MPI_Aint sendext = 0;
#include "colls_private.h"
-#define MCA_COLL_BASE_TAG_ALLTOALLV 111
/*
* Linear functions are copied from the basic coll module. For
* some small number of nodes and/or small data sizes they are just as
prcv = ((char *) rbuf) + (rdisps[i] * rext);
*preq = smpi_irecv_init(prcv, rcounts[i], rdtype,
- i, MCA_COLL_BASE_TAG_ALLTOALLV, comm
+ i, COLL_TAG_ALLTOALLV, comm
);
preq++;
++nreqs;
psnd = ((char *) sbuf) + (sdisps[i] * sext);
*preq=smpi_isend_init(psnd, scounts[i], sdtype,
- i, MCA_COLL_BASE_TAG_ALLTOALLV, comm
+ i, COLL_TAG_ALLTOALLV, comm
);
preq++;
++nreqs;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs, next_partner;
- int tag = 1; /*, failure = 0; */
+ int tag = COLL_TAG_ALLTOALLV; /*, failure = 0; */
char send_sync = 'a', recv_sync = 'b';
char *send_ptr = (char *) send_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 101;
+ int tag = COLL_TAG_ALLTOALLV;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALLV;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALLV;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Aint send_chunk, recv_chunk;
MPI_Status s;
int i, src, dst, rank, num_procs, next_dst, next_src;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALLV;
char send_sync = 'a', recv_sync = 'b';
char *send_ptr = (char *) send_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALLV;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_ALLTOALLV;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
MPI_Status s;
MPI_Aint send_chunk, recv_chunk;
int i, src, dst, rank, num_procs;
- int tag = 11;
+ int tag = COLL_TAG_ALLTOALLV;
char *send_ptr = (char *) send_buff;
char *recv_ptr = (char *) recv_buff;
#include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_BARRIER 100
/*
* Barrier is ment to be a synchronous operation, as some BTLs can mark
* a request done before its passed to the NIC and progress might not be made
if (rank > 0) { /* receive message from the left */
smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
}
/* Send message to the right */
smpi_mpi_send((void*)NULL, 0, MPI_BYTE, right,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm);
/* root needs to receive from the last node */
if (rank == 0) {
smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
}
/* Allow nodes to exit */
if (rank > 0) { /* post Receive from left */
smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
}
/* send message to the right one */
smpi_mpi_send((void*)NULL, 0, MPI_BYTE, right,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm);
/* rank 0 post receive from the last node */
if (rank == 0) {
smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, left,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
}
/* send message to lower ranked node */
remote = rank - adjsize;
smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm, MPI_STATUS_IGNORE);
} else if (rank < (size - adjsize)) {
/* receive message from high level rank */
smpi_mpi_recv((void*)NULL, 0, MPI_BYTE, rank+adjsize,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
}
/* post receive from the remote node */
smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm, MPI_STATUS_IGNORE);
}
}
/* send enter message to higher ranked node */
remote = rank + adjsize;
smpi_mpi_send((void*)NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm);
}
/* send message to lower ranked node */
smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, to,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
NULL, 0, MPI_BYTE, from,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm, MPI_STATUS_IGNORE);
}
remote = (remote + 1) & 0x1;
smpi_mpi_sendrecv(NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
NULL, 0, MPI_BYTE, remote,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm, MPI_STATUS_IGNORE);
return (MPI_SUCCESS);
}
if (rank > 0) {
smpi_mpi_send (NULL, 0, MPI_BYTE, 0,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm);
smpi_mpi_recv (NULL, 0, MPI_BYTE, 0,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm, MPI_STATUS_IGNORE);
}
requests = (MPI_Request*)malloc( size * sizeof(MPI_Request) );
for (i = 1; i < size; ++i) {
requests[i] = smpi_mpi_irecv(NULL, 0, MPI_BYTE, MPI_ANY_SOURCE,
- MCA_COLL_BASE_TAG_BARRIER, comm
+ COLL_TAG_BARRIER, comm
);
}
smpi_mpi_waitall( size-1, requests+1, MPI_STATUSES_IGNORE );
for (i = 1; i < size; ++i) {
requests[i] = smpi_mpi_isend(NULL, 0, MPI_BYTE, i,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm
);
}
if (!(partner & (jump-1)) && partner < size) {
if (partner > rank) {
smpi_mpi_recv (NULL, 0, MPI_BYTE, partner,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
} else if (partner < rank) {
smpi_mpi_send (NULL, 0, MPI_BYTE, partner,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm);
}
}
if (!(partner & (jump-1)) && partner < size) {
if (partner > rank) {
smpi_mpi_send (NULL, 0, MPI_BYTE, partner,
- MCA_COLL_BASE_TAG_BARRIER,
+ COLL_TAG_BARRIER,
comm);
} else if (partner < rank) {
smpi_mpi_recv (NULL, 0, MPI_BYTE, partner,
- MCA_COLL_BASE_TAG_BARRIER, comm,
+ COLL_TAG_BARRIER, comm,
MPI_STATUS_IGNORE);
}
}
int smpi_coll_tuned_bcast_NTSB(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm)
{
- int tag = 5000;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
int rank, size;
int i;
int smpi_coll_tuned_bcast_NTSL_Isend(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm)
{
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
int smpi_coll_tuned_bcast_NTSL(void *buf, int count, MPI_Datatype datatype,
int root, MPI_Comm comm)
{
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = 5000;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *request_array;
int size;
int rank;
MPI_Status status;
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
size = smpi_comm_size(comm);
rank = smpi_comm_rank(comm);
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = 5000;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *request_array;
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
int rank, size;
int i, j, k;
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
int will_send[BCAST_ARRIVAL_PATTERN_AWARE_MAX_NODE];
int sent_count;
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
MPI_Datatype datatype, int root,
MPI_Comm comm)
{
- int tag = 50;
+ int tag = COLL_TAG_BCAST;
int header_tag = 10;
MPI_Status status;
MPI_Comm comm)
{
int src, dst, rank, num_procs, mask, relative_rank;
- int tag = 1;
+ int tag = COLL_TAG_BCAST;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
MPI_Comm comm)
{
int i, j, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_BCAST;
MPI_Aint extent;
extent = smpi_datatype_get_extent(data_type);
MPI_Request *reqs;
int i, rank, num_procs;
- int tag = 1;
+ int tag = COLL_TAG_BCAST;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
for( i = 0; i < tree->tree_nextsize; i++ ) {
send_reqs[i] = smpi_mpi_isend(tmpbuf, sendcount, datatype,
tree->tree_next[i],
- 777, comm);
+ COLL_TAG_BCAST, comm);
}
/* complete the sends before starting the next sends */
*/
req_index = 0;
recv_reqs[req_index]=smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
- tree->tree_prev, 777,
+ tree->tree_prev, COLL_TAG_BCAST,
comm);
for( segindex = 1; segindex < num_segments; segindex++ ) {
/* post new irecv */
recv_reqs[req_index]= smpi_mpi_irecv( tmpbuf + realsegsize, count_by_segment,
datatype, tree->tree_prev,
- 777,
+ COLL_TAG_BCAST,
comm);
/* wait for and forward the previous segment to children */
for( i = 0; i < tree->tree_nextsize; i++ ) {
send_reqs[i]=smpi_mpi_isend(tmpbuf, count_by_segment, datatype,
tree->tree_next[i],
- 777, comm );
+ COLL_TAG_BCAST, comm );
}
/* complete the sends before starting the next iteration */
for( i = 0; i < tree->tree_nextsize; i++ ) {
send_reqs[i] = smpi_mpi_isend(tmpbuf, sendcount, datatype,
tree->tree_next[i],
- 777, comm);
+ COLL_TAG_BCAST, comm);
}
smpi_mpi_waitall( tree->tree_nextsize, send_reqs,
*/
req_index = 0;
recv_reqs[req_index] = smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
- tree->tree_prev, 777,
+ tree->tree_prev, COLL_TAG_BCAST,
comm);
for( segindex = 1; segindex < num_segments; segindex++ ) {
tmpbuf += realsegsize;
/* post receive for the next segment */
recv_reqs[req_index] = smpi_mpi_irecv(tmpbuf, count_by_segment, datatype,
- tree->tree_prev, 777,
+ tree->tree_prev, COLL_TAG_BCAST,
comm);
/* wait on the previous segment */
smpi_mpi_wait( &recv_reqs[req_index ^ 0x1],
sendcount[i] = counts[i] - segindex*segcount[i];
/* send data */
smpi_mpi_send(tmpbuf[i], sendcount[i], datatype,
- tree->tree_next[i], 777, comm);
+ tree->tree_next[i], COLL_TAG_BCAST, comm);
/* update tmp buffer */
tmpbuf[i] += realsegsize[i];
}
*/
sendcount[lr] = segcount[lr];
base_req=smpi_mpi_irecv(tmpbuf[lr], sendcount[lr], datatype,
- tree->tree_prev, 777,
+ tree->tree_prev, COLL_TAG_BCAST,
comm);
for( segindex = 1; segindex < num_segments[lr]; segindex++ ) {
sendcount[lr] = counts[lr] - segindex*segcount[lr];
/* post new irecv */
new_req = smpi_mpi_irecv( tmpbuf[lr] + realsegsize[lr], sendcount[lr],
- datatype, tree->tree_prev, 777,
+ datatype, tree->tree_prev, COLL_TAG_BCAST,
comm);
/* wait for and forward current segment */
smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
for( i = 0; i < tree->tree_nextsize; i++ ) { /* send data to children (segcount[lr]) */
smpi_mpi_send( tmpbuf[lr], segcount[lr], datatype,
- tree->tree_next[i], 777,
+ tree->tree_next[i], COLL_TAG_BCAST,
comm);
} /* end of for each child */
smpi_mpi_waitall( 1, &base_req, MPI_STATUSES_IGNORE );
for( i = 0; i < tree->tree_nextsize; i++ ) { /* send data to children */
smpi_mpi_send(tmpbuf[lr], sendcount[lr], datatype,
- tree->tree_next[i], 777, comm);
+ tree->tree_next[i], COLL_TAG_BCAST, comm);
} /* end of for each child */
}
if (segindex == (num_segments[lr] - 1)) sendcount[lr] = counts[lr] - segindex*segcount[lr];
/* receive segments */
smpi_mpi_recv(tmpbuf[lr], sendcount[lr], datatype,
- tree->tree_prev, 777,
+ tree->tree_prev, COLL_TAG_BCAST,
comm, MPI_STATUS_IGNORE);
/* update the initial pointer to the buffer */
tmpbuf[lr] += realsegsize[lr];
if ( (size%2) != 0 && rank != root) {
smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
- pair, 777,
+ pair, COLL_TAG_BCAST,
tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
- pair, 777,
+ pair, COLL_TAG_BCAST,
comm, MPI_STATUS_IGNORE);
} else if ( (size%2) == 0 ) {
/* root sends right buffer to the last node */
if( rank == root ) {
smpi_mpi_send(tmpbuf[1], counts[1], datatype,
- (root+size-1)%size, 777, comm);
+ (root+size-1)%size, COLL_TAG_BCAST, comm);
}
/* last node receives right buffer from the root */
else if (rank == (root+size-1)%size) {
smpi_mpi_recv(tmpbuf[1], counts[1], datatype,
- root, 777,
+ root, COLL_TAG_BCAST,
comm, MPI_STATUS_IGNORE);
}
/* everyone else exchanges buffers */
else {
smpi_mpi_sendrecv( tmpbuf[lr], counts[lr], datatype,
- pair, 777,
+ pair, COLL_TAG_BCAST,
tmpbuf[(lr+1)%2], counts[(lr+1)%2], datatype,
- pair, 777,
+ pair, COLL_TAG_BCAST,
comm, MPI_STATUS_IGNORE);
}
}
int i, src, dst, rank, num_procs;
int mask, relative_rank, curr_size, recv_size, send_size, nbytes;
int scatter_size, left, right, next_src, *recv_counts, *disps;
- int tag = 1;
+ int tag = COLL_TAG_BCAST;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
int mask, relative_rank, curr_size, recv_size = 0, send_size, nbytes;
int scatter_size, tree_root, relative_dst, dst_tree_root;
int my_tree_root, offset, tmp_mask, num_procs_completed;
- int tag = 1;
+ int tag = COLL_TAG_BCAST;
rank = smpi_comm_rank(comm);
num_procs = smpi_comm_size(comm);
#include "colls_private.h"
#include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_GATHER 333
/* Todo: gather_intra_generic, gather_intra_binary, gather_intra_chain,
* gather_intra_pipeline, segmentation? */
int
rank, bmtree->tree_next[i], mycount);
smpi_mpi_recv(ptmp + total_recv*rextent, rcount*size-total_recv, rdtype,
- bmtree->tree_next[i], MCA_COLL_BASE_TAG_GATHER,
+ bmtree->tree_next[i], COLL_TAG_GATHER,
comm, &status);
total_recv += mycount;
smpi_mpi_send(ptmp, total_recv, sdtype,
bmtree->tree_prev,
- MCA_COLL_BASE_TAG_GATHER,
+ COLL_TAG_GATHER,
comm);
}
if (rank == root) {
first_segment_count );
smpi_mpi_recv(sbuf, 0, MPI_BYTE, root,
- MCA_COLL_BASE_TAG_GATHER,
+ COLL_TAG_GATHER,
comm, MPI_STATUS_IGNORE);
smpi_mpi_send(sbuf, first_segment_count, sdtype, root,
- MCA_COLL_BASE_TAG_GATHER,
+ COLL_TAG_GATHER,
comm);
smpi_mpi_send((char*)sbuf + extent * first_segment_count,
(scount - first_segment_count), sdtype,
- root, MCA_COLL_BASE_TAG_GATHER,
+ root, COLL_TAG_GATHER,
comm);
}
/* irecv for the first segment from i */
ptmp = (char*)rbuf + i * rcount * extent;
first_segment_req = smpi_mpi_irecv(ptmp, first_segment_count, rdtype, i,
- MCA_COLL_BASE_TAG_GATHER, comm
+ COLL_TAG_GATHER, comm
);
/* send sync message */
smpi_mpi_send(rbuf, 0, MPI_BYTE, i,
- MCA_COLL_BASE_TAG_GATHER,
+ COLL_TAG_GATHER,
comm);
/* irecv for the second segment */
ptmp = (char*)rbuf + (i * rcount + first_segment_count) * extent;
reqs[i]=smpi_mpi_irecv(ptmp, (rcount - first_segment_count),
- rdtype, i, MCA_COLL_BASE_TAG_GATHER, comm
+ rdtype, i, COLL_TAG_GATHER, comm
);
/* wait on the first segment to complete */
if (rank != root) {
smpi_mpi_send(sbuf, scount, sdtype, root,
- MCA_COLL_BASE_TAG_GATHER,
+ COLL_TAG_GATHER,
comm);
return MPI_SUCCESS;
}
}
} else {
smpi_mpi_recv(ptmp, rcount, rdtype, i,
- MCA_COLL_BASE_TAG_GATHER,
+ COLL_TAG_GATHER,
comm, MPI_STATUS_IGNORE);
err = MPI_SUCCESS;
}
MPI_Datatype datatype, MPI_Op op, int root,
MPI_Comm comm)
{
- int tag = 50;
+ int tag = COLL_TAG_REDUCE;
MPI_Status status;
MPI_Request *send_request_array;
MPI_Request *recv_request_array;
int rank;
rank = smpi_comm_rank(comm);
- int tag = 50;
+ int tag = COLL_TAG_REDUCE;
MPI_Status status;
MPI_Request request;
MPI_Request *send_request_array;
int comm_size, rank;
int mask, relrank, source;
int dst;
- int tag = 4321;
+ int tag = COLL_TAG_REDUCE;
MPI_Aint extent;
void *tmp_buf;
MPI_Aint true_lb, true_extent;
MPI_Datatype dtype, MPI_Op op,
int root, MPI_Comm comm)
{
- int i, tag = 4321;
+ int i, tag = COLL_TAG_REDUCE;
int size;
int rank;
MPI_Aint extent;
#include "colls_private.h"
#include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_REDUCE 555
reqs[inbi]=smpi_mpi_irecv(local_recvbuf, recvcount, datatype,
tree->tree_next[i],
- MCA_COLL_BASE_TAG_REDUCE, comm
+ COLL_TAG_REDUCE, comm
);
}
/* wait for previous req to complete, if any.
/* send combined/accumulated data to parent */
smpi_mpi_send( accumulator, prevcount,
datatype, tree->tree_prev,
- MCA_COLL_BASE_TAG_REDUCE,
+ COLL_TAG_REDUCE,
comm);
}
segindex * segment_increment,
count_by_segment, datatype,
tree->tree_prev,
- MCA_COLL_BASE_TAG_REDUCE,
+ COLL_TAG_REDUCE,
comm) ;
segindex++;
original_count -= count_by_segment;
segindex * segment_increment,
count_by_segment, datatype,
tree->tree_prev,
- MCA_COLL_BASE_TAG_REDUCE,
+ COLL_TAG_REDUCE,
comm);
original_count -= count_by_segment;
}
segindex * segment_increment,
count_by_segment, datatype,
tree->tree_prev,
- MCA_COLL_BASE_TAG_REDUCE,
+ COLL_TAG_REDUCE,
comm );
creq = (creq + 1) % max_outstanding_reqs;
segindex++;
if (root == rank) {
/* Receive result from rank io_root to recvbuf */
smpi_mpi_recv(recvbuf, count, datatype, io_root,
- MCA_COLL_BASE_TAG_REDUCE, comm,
+ COLL_TAG_REDUCE, comm,
MPI_STATUS_IGNORE);
if (MPI_IN_PLACE == sendbuf) {
free(use_this_sendbuf);
} else if (io_root == rank) {
/* Send result from use_this_recvbuf to root */
smpi_mpi_send(use_this_recvbuf, count, datatype, root,
- MCA_COLL_BASE_TAG_REDUCE,
+ COLL_TAG_REDUCE,
comm);
free(use_this_recvbuf);
}
if (rank != root) {
smpi_mpi_send(sbuf, count, dtype, root,
- MCA_COLL_BASE_TAG_REDUCE,
+ COLL_TAG_REDUCE,
comm);
return -1;
}
smpi_datatype_copy((char*)sbuf, count, dtype,(char*)rbuf, count, dtype);
} else {
smpi_mpi_recv(rbuf, count, dtype, size - 1,
- MCA_COLL_BASE_TAG_REDUCE, comm,
+ COLL_TAG_REDUCE, comm,
MPI_STATUS_IGNORE);
}
inbuf = (char*)sbuf;
} else {
smpi_mpi_recv(pml_buffer, count, dtype, i,
- MCA_COLL_BASE_TAG_REDUCE, comm,
+ COLL_TAG_REDUCE, comm,
MPI_STATUS_IGNORE);
inbuf = pml_buffer;
}
int recv_idx, last_idx = 0, newdst;
int dst, send_cnt, recv_cnt, newroot, newdst_tree_root;
int newroot_tree_root, new_count;
- int tag = 4321;
+ int tag = COLL_TAG_REDUCE;
void *send_ptr, *recv_ptr, *tmp_buf;
cnts = NULL;
#include "colls_private.h"
-#define MPIR_REDUCE_SCATTER_TAG 222
static inline int MPIU_Mirror_permutation(unsigned int x, int bits)
{
if (sendbuf != MPI_IN_PLACE)
smpi_mpi_sendrecv(((char *)sendbuf+disps[dst]*extent),
recvcounts[dst], datatype, dst,
- MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
+ COLL_TAG_SCATTER, tmp_recvbuf,
recvcounts[rank], datatype, src,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ COLL_TAG_SCATTER, comm,
MPI_STATUS_IGNORE);
else
smpi_mpi_sendrecv(((char *)recvbuf+disps[dst]*extent),
recvcounts[dst], datatype, dst,
- MPIR_REDUCE_SCATTER_TAG, tmp_recvbuf,
+ COLL_TAG_SCATTER, tmp_recvbuf,
recvcounts[rank], datatype, src,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ COLL_TAG_SCATTER, comm,
MPI_STATUS_IGNORE);
if (is_commutative || (src < rank)) {
}
smpi_mpi_sendrecv(outgoing_data + send_offset*true_extent,
- size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
+ size, datatype, peer, COLL_TAG_SCATTER,
incoming_data + recv_offset*true_extent,
- size, datatype, peer, MPIR_REDUCE_SCATTER_TAG,
+ size, datatype, peer, COLL_TAG_SCATTER,
comm, MPI_STATUS_IGNORE);
/* always perform the reduction at recv_offset, the data at send_offset
is now our peer's responsibility */
tmp_results. accumulation is done later below. */
smpi_mpi_sendrecv(tmp_results, 1, sendtype, dst,
- MPIR_REDUCE_SCATTER_TAG,
+ COLL_TAG_SCATTER,
tmp_recvbuf, 1, recvtype, dst,
- MPIR_REDUCE_SCATTER_TAG, comm,
+ COLL_TAG_SCATTER, comm,
MPI_STATUS_IGNORE);
received = 1;
}
&& (dst >= tree_root + nprocs_completed)) {
/* send the current result */
smpi_mpi_send(tmp_recvbuf, 1, recvtype,
- dst, MPIR_REDUCE_SCATTER_TAG,
+ dst, COLL_TAG_SCATTER,
comm);
}
/* recv only if this proc. doesn't have data and sender
(dst < tree_root + nprocs_completed) &&
(rank >= tree_root + nprocs_completed)) {
smpi_mpi_recv(tmp_recvbuf, 1, recvtype, dst,
- MPIR_REDUCE_SCATTER_TAG,
+ COLL_TAG_SCATTER,
comm, MPI_STATUS_IGNORE);
received = 1;
}
#include "colls_private.h"
#include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_REDUCE_SCATTER 222
/*
* Recursive-halving function is (*mostly*) copied from the BASIC coll module.
* I have removed the part which handles "large" message sizes
if (rank < 2 * remain) {
if ((rank & 1) == 0) {
smpi_mpi_send(result_buf, count, dtype, rank + 1,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm);
/* we don't participate from here on out */
tmp_rank = -1;
} else {
smpi_mpi_recv(recv_buf, count, dtype, rank - 1,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm, MPI_STATUS_IGNORE);
/* integrate their results into our temp results */
if (send_count > 0 && recv_count != 0) {
request=smpi_mpi_irecv(recv_buf + (ptrdiff_t)tmp_disps[recv_index] * extent,
recv_count, dtype, peer,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm);
if (MPI_SUCCESS != err) {
xbt_free(tmp_rcounts);
if (recv_count > 0 && send_count != 0) {
smpi_mpi_send(result_buf + (ptrdiff_t)tmp_disps[send_index] * extent,
send_count, dtype, peer,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm);
if (MPI_SUCCESS != err) {
xbt_free(tmp_rcounts);
if ((rank & 1) == 0) {
if (rcounts[rank]) {
smpi_mpi_recv(rbuf, rcounts[rank], dtype, rank + 1,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm, MPI_STATUS_IGNORE);
}
} else {
if (rcounts[rank - 1]) {
smpi_mpi_send(result_buf + disps[rank - 1] * extent,
rcounts[rank - 1], dtype, rank - 1,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm);
}
}
inbi = 0;
/* Initialize first receive from the neighbor on the left */
reqs[inbi]=smpi_mpi_irecv(inbuf[inbi], max_block_count, dtype, recv_from,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER, comm
+ COLL_TAG_REDUCE_SCATTER, comm
);
tmpsend = accumbuf + (ptrdiff_t)displs[recv_from] * extent;
smpi_mpi_send(tmpsend, rcounts[recv_from], dtype, send_to,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm);
for (k = 2; k < size; k++) {
/* Post irecv for the current block */
reqs[inbi]=smpi_mpi_irecv(inbuf[inbi], max_block_count, dtype, recv_from,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER, comm
+ COLL_TAG_REDUCE_SCATTER, comm
);
/* Wait on previous block to arrive */
/* send previous block to send_to */
smpi_mpi_send(tmprecv, rcounts[prevblock], dtype, send_to,
- MCA_COLL_BASE_TAG_REDUCE_SCATTER,
+ COLL_TAG_REDUCE_SCATTER,
comm);
}
#include "colls_private.h"
#include "coll_tuned_topo.h"
-#define MCA_COLL_BASE_TAG_SCATTER 111
int
smpi_coll_tuned_scatter_ompi_binomial(void *sbuf, int scount,
if (rank != root) {
/* recv from parent on non-root */
smpi_mpi_recv(ptmp, rcount*size, rdtype, bmtree->tree_prev,
- MCA_COLL_BASE_TAG_SCATTER, comm, &status);
+ COLL_TAG_SCATTER, comm, &status);
/* local copy to rbuf */
err = smpi_datatype_copy(ptmp, scount, sdtype,
rbuf, rcount, rdtype);
smpi_mpi_send(ptmp + total_send*sextent, mycount, sdtype,
bmtree->tree_next[i],
- MCA_COLL_BASE_TAG_SCATTER,
+ COLL_TAG_SCATTER,
comm);
total_send += mycount;
} else {
/* recv from parent on leaf nodes */
smpi_mpi_recv(ptmp, rcount, rdtype, bmtree->tree_prev,
- MCA_COLL_BASE_TAG_SCATTER, comm, &status);
+ COLL_TAG_SCATTER, comm, &status);
}
//!FIXME : store the tree, as done in ompi, instead of calculating it each time ?
xbt_free(bmtree);
if (rank != root) {
smpi_mpi_recv(rbuf, rcount, rdtype, root,
- MCA_COLL_BASE_TAG_SCATTER,
+ COLL_TAG_SCATTER,
comm, MPI_STATUS_IGNORE);
return MPI_SUCCESS;
}
}
} else {
smpi_mpi_send(ptmp, scount, sdtype, i,
- MCA_COLL_BASE_TAG_SCATTER,
+ COLL_TAG_SCATTER,
comm);
}
if (MPI_SUCCESS != err) {
int in_use;
} s_smpi_mpi_datatype_t;
+
+#define COLL_TAG_REDUCE 111
+#define COLL_TAG_SCATTER 222
+#define COLL_TAG_SCATTERV 333
+#define COLL_TAG_GATHER 444
+#define COLL_TAG_ALLGATHER 555
+#define COLL_TAG_ALLGATHERV 666
+#define COLL_TAG_BARRIER 777
+#define COLL_TAG_REDUCE_SCATTER 888
+#define COLL_TAG_ALLTOALLV 999
+#define COLL_TAG_ALLTOALL 1111
+#define COLL_TAG_GATHERV 2222
+#define COLL_TAG_BCAST 3333
+#define COLL_TAG_ALLREDUCE 4444
//*****************************************************************************************
typedef struct s_smpi_mpi_request {
MPI_Request requests[2];
MPI_Status stats[2];
int myid=smpi_process_index();
- if ((dst == myid) && (src == myid)) {
+ if ((smpi_group_index(smpi_comm_group(comm), dst) == myid) && (smpi_group_index(smpi_comm_group(comm), src) == myid)) {
smpi_datatype_copy(sendbuf, sendcount, sendtype,
recvbuf, recvcount, recvtype);
return;
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_GATHER;
int rank, size, src, index;
MPI_Aint lb = 0, recvext = 0;
MPI_Request *requests;
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_GATHERV;
int rank, size, src, index;
MPI_Aint lb = 0, recvext = 0;
MPI_Request *requests;
int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_ALLGATHER;
int rank, size, other, index;
MPI_Aint lb = 0, recvext = 0;
MPI_Request *requests;
int *recvcounts, int *displs,
MPI_Datatype recvtype, MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_ALLGATHERV;
int rank, size, other, index;
MPI_Aint lb = 0, recvext = 0;
MPI_Request *requests;
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_SCATTER;
int rank, size, dst, index;
MPI_Aint lb = 0, sendext = 0;
MPI_Request *requests;
MPI_Datatype sendtype, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_SCATTERV;
int rank, size, dst, index;
MPI_Aint lb = 0, sendext = 0;
MPI_Request *requests;
MPI_Datatype datatype, MPI_Op op, int root,
MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = COLL_TAG_REDUCE;
int rank, size, src, index;
MPI_Aint lb = 0, dataext = 0;
MPI_Request *requests;
void **tmpbufs;
+ char* sendtmpbuf = (char*) sendbuf;
+ if( sendbuf == MPI_IN_PLACE ) {
+ sendtmpbuf = (char *)recvbuf;
+ }
+
rank = smpi_comm_rank(comm);
size = smpi_comm_size(comm);
//non commutative case, use a working algo from openmpi
if(!smpi_op_is_commute(op)){
- smpi_coll_tuned_reduce_ompi_basic_linear(sendbuf, recvbuf, count,
+ smpi_coll_tuned_reduce_ompi_basic_linear(sendtmpbuf, recvbuf, count,
datatype, op, root, comm);
return;
}
if(rank != root) {
// Send buffer to root
- smpi_mpi_send(sendbuf, count, datatype, root, system_tag, comm);
+ smpi_mpi_send(sendtmpbuf, count, datatype, root, system_tag, comm);
} else {
// FIXME: check for errors
smpi_datatype_extent(datatype, &lb, &dataext);
// Local copy from root
- if (sendbuf && recvbuf)
- smpi_datatype_copy(sendbuf, count, datatype, recvbuf, count, datatype);
+ if (sendtmpbuf && recvbuf)
+ smpi_datatype_copy(sendtmpbuf, count, datatype, recvbuf, count, datatype);
// Receive buffers from senders
//TODO: make a MPI_barrier here ?
requests = xbt_new(MPI_Request, size - 1);
void smpi_mpi_scan(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
{
- int system_tag = 666;
+ int system_tag = 888;
int rank, size, other, index;
MPI_Aint lb = 0, dataext = 0;
MPI_Request *requests;
MPI_Comm smpi_comm_split(MPI_Comm comm, int color, int key)
{
- int system_tag = 666;
+ int system_tag = 123;
int index, rank, size, i, j, count, reqs;
int* sendbuf;
int* recvbuf;
size = 0;
for (i = 0; i < n; i++) {
for (rank = ranges[i][0]; /* First */
- rank >= 0 && rank <= ranges[i][1]; /* Last */
- rank += ranges[i][2] /* Stride */ ) {
+ rank >= 0; /* Last */
+ ) {
size++;
+
+ rank += ranges[i][2]; /* Stride */
+ if (ranges[i][0]<ranges[i][1]){
+ if(rank > ranges[i][1])
+ break;
+ }else{
+ if(rank < ranges[i][1])
+ break;
+ }
}
}
- if (size == smpi_group_size(group)) {
- *newgroup = group;
- } else {
+
*newgroup = smpi_group_new(size);
j = 0;
for (i = 0; i < n; i++) {
for (rank = ranges[i][0]; /* First */
- rank >= 0 && rank <= ranges[i][1]; /* Last */
- rank += ranges[i][2] /* Stride */ ) {
+ rank >= 0; /* Last */
+ ) {
index = smpi_group_index(group, rank);
smpi_group_set_mapping(*newgroup, index, j);
j++;
+ rank += ranges[i][2]; /* Stride */
+ if (ranges[i][0]<ranges[i][1]){
+ if(rank > ranges[i][1])
+ break;
+ }else{
+ if(rank < ranges[i][1])
+ break;
+ }
}
}
- }
+ //}
}
smpi_group_use(*newgroup);
retval = MPI_SUCCESS;
retval = MPI_ERR_GROUP;
} else if (newcomm == NULL) {
retval = MPI_ERR_ARG;
- } else {
+ } else if(smpi_group_rank(group,smpi_process_index())==MPI_UNDEFINED){
+ *newcomm= MPI_COMM_NULL;
+ retval = MPI_SUCCESS;
+ }else{
+
*newcomm = smpi_comm_new(group);
retval = MPI_SUCCESS;
}
-/* Copyright (c) 2009, 2010, 2011, 2012. The SimGrid Team.
+/* Copyright (c) 2009 - 2013. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
}
typedef struct {
- xbt_dynar_t isends; /* of MPI_Request */
xbt_dynar_t irecvs; /* of MPI_Request */
} s_smpi_replay_globals_t, *smpi_replay_globals_t;
static MPI_Datatype decode_datatype(const char *const action)
{
// Declared datatypes,
-
+
switch(atoi(action))
{
case 0:
break;
default:
MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
-
+
}
return MPI_CURRENT_TYPE;
}
int i;
XBT_DEBUG("Initialize the counters");
smpi_replay_globals_t globals = xbt_new(s_smpi_replay_globals_t, 1);
- globals->isends = xbt_dynar_new(sizeof(MPI_Request),NULL);
globals->irecvs = xbt_dynar_new(sizeof(MPI_Request),NULL);
if(action[2]) MPI_DEFAULT_TYPE= MPI_DOUBLE; // default MPE dataype
else MPI_DEFAULT_TYPE= MPI_BYTE; // default TAU datatype
-
+
smpi_process_set_user_data((void*) globals);
/* start a simulated timer */
if (!reqq) {
reqq=xbt_new0(xbt_dynar_t,active_processes);
-
+
for(i=0;i<active_processes;i++){
reqq[i]=xbt_dynar_new(sizeof(MPI_Request),NULL);
}
smpi_replay_globals_t globals =
(smpi_replay_globals_t) smpi_process_get_user_data();
if (globals){
- XBT_DEBUG("There are %lu isends and %lu irecvs in the dynars",
- xbt_dynar_length(globals->isends),xbt_dynar_length(globals->irecvs));
- xbt_dynar_free_container(&(globals->isends));
+ XBT_DEBUG("There are %lu irecvs in the dynar",
+ xbt_dynar_length(globals->irecvs));
xbt_dynar_free_container(&(globals->irecvs));
}
free(globals);
} else {
MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
}
-
+
#ifdef HAVE_TRACING
int rank = smpi_comm_rank(MPI_COMM_WORLD);
TRACE_smpi_computing_out(rank);
if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
- smpi_replay_globals_t globals =
- (smpi_replay_globals_t) smpi_process_get_user_data();
#ifdef HAVE_TRACING
int rank = smpi_comm_rank(MPI_COMM_WORLD);
TRACE_smpi_computing_out(rank);
#endif
request = smpi_mpi_isend(NULL, size, MPI_CURRENT_TYPE, to, 0,MPI_COMM_WORLD);
-
+
#ifdef HAVE_TRACING
TRACE_smpi_ptp_out(rank, rank, dst_traced, __FUNCTION__);
request->send = 1;
TRACE_smpi_computing_in(rank);
#endif
- xbt_dynar_push(globals->isends,&request);
xbt_dynar_push(reqq[smpi_comm_rank(MPI_COMM_WORLD)],&request);
log_timed_action (action, clock);
if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-
+
#ifdef HAVE_TRACING
int rank = smpi_comm_rank(MPI_COMM_WORLD);
int src_traced = smpi_group_rank(smpi_comm_group(MPI_COMM_WORLD), from);
smpi_replay_globals_t globals =
(smpi_replay_globals_t) smpi_process_get_user_data();
-
+
if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
#endif
request = smpi_mpi_irecv(NULL, size, MPI_CURRENT_TYPE, from, 0, MPI_COMM_WORLD);
-
+
#ifdef HAVE_TRACING
TRACE_smpi_ptp_out(rank, src_traced, rank, __FUNCTION__);
request->recv = 1;
if (count_requests>0) {
MPI_Request requests[count_requests];
MPI_Status status[count_requests];
-
+
/* The reqq is an array of dynars. Its index corresponds to the rank.
Thus each rank saves its own requests to the array request. */
xbt_dynar_foreach(reqq[smpi_comm_rank(MPI_COMM_WORLD)],i,requests[i]);
-
+
#ifdef HAVE_TRACING
//save information from requests
-
+
xbt_dynar_t srcs = xbt_dynar_new(sizeof(int), NULL);
xbt_dynar_t dsts = xbt_dynar_new(sizeof(int), NULL);
xbt_dynar_t recvs = xbt_dynar_new(sizeof(int), NULL);
xbt_dynar_free(&recvs);
TRACE_smpi_computing_in(rank_traced);
#endif
-
+
xbt_dynar_reset(reqq[smpi_comm_rank(MPI_COMM_WORLD)]);
}
log_timed_action (action, clock);
MPI_CURRENT_TYPE=decode_datatype(action[4]);
}
}
-
+
#ifdef HAVE_TRACING
int rank = smpi_comm_rank(MPI_COMM_WORLD);
TRACE_smpi_computing_out(rank);
double clock = smpi_process_simulated_elapsed();
int root=0;
MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-
+
if(action[4]) {
- root= atoi(action[4]);
- if(action[5]) {
- MPI_CURRENT_TYPE=decode_datatype(action[5]);
- }
+ root= atoi(action[4]);
+ if(action[5]) {
+ MPI_CURRENT_TYPE=decode_datatype(action[5]);
+ }
}
#ifdef HAVE_TRACING
static void action_allReduce(const char *const *action) {
double comm_size = parse_double(action[2]);
double comp_size = parse_double(action[3]);
-
+
if(action[4]) MPI_CURRENT_TYPE=decode_datatype(action[4]);
else MPI_CURRENT_TYPE= MPI_DEFAULT_TYPE;
-
+
double clock = smpi_process_simulated_elapsed();
#ifdef HAVE_TRACING
int rank = smpi_comm_rank(MPI_COMM_WORLD);
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
- mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
+ mpi_coll_reduce_fun(NULL, NULL, comm_size, MPI_CURRENT_TYPE, MPI_OP_NULL, 0, MPI_COMM_WORLD);
smpi_execute_flops(comp_size);
- mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
+ mpi_coll_bcast_fun(NULL, comm_size, MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
TRACE_smpi_computing_in(rank);
int send_size = parse_double(action[2]);
int recv_size = parse_double(action[3]);
MPI_Datatype MPI_CURRENT_TYPE2;
-
+
if(action[4]) {
MPI_CURRENT_TYPE=decode_datatype(action[4]);
MPI_CURRENT_TYPE2=decode_datatype(action[5]);
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
-
+
mpi_coll_alltoall_fun(send, send_size, MPI_CURRENT_TYPE, recv, recv_size, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
#ifdef HAVE_TRACING
static void action_gather(const char *const *action) {
-
-
/*
The structure of the gather action for the rank 0 (total 4 processes)
is the following:
3) 0 is the root node
4) 0 is the send datatype id, see decode_datatype()
5) 0 is the recv datatype id, see decode_datatype()
-
*/
double clock = smpi_process_simulated_elapsed();
int comm_size = smpi_comm_size(MPI_COMM_WORLD);
MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
}
- void *send = calloc(send_size, smpi_datatype_size(MPI_CURRENT_TYPE));
- void *recv = calloc(recv_size, smpi_datatype_size(MPI_CURRENT_TYPE2));
+ void *send = calloc(send_size, smpi_datatype_size(MPI_CURRENT_TYPE));
+ void *recv = calloc(recv_size, smpi_datatype_size(MPI_CURRENT_TYPE2));
int root=atoi(action[4]);
int rank = smpi_process_index();
static void action_reducescatter(const char *const *action) {
-
+
/*
The structure of the reducescatter action for the rank 0 (total 4 processes)
is the following:
1) The first four values after the name of the action declare the recvcounts array
2) The value 11346849 is the amount of instructions
3) The last value corresponds to the datatype, see decode_datatype().
-
+
We analyze a MPI_Reduce_scatter call to one MPI_Reduce and one MPI_Scatterv.
-
+
*/
double clock = smpi_process_simulated_elapsed();
smpi_mpi_scatterv(NULL, recvcounts, disps, MPI_CURRENT_TYPE, NULL,
recvcounts[rank], MPI_CURRENT_TYPE, 0, MPI_COMM_WORLD);
smpi_execute_flops(comp_size);
-
-
+
+
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
TRACE_smpi_computing_in(rank);
static void action_allgatherv(const char *const *action) {
-
+
/*
The structure of the allgatherv action for the rank 0 (total 4 processes)
is the following:
*/
double clock = smpi_process_simulated_elapsed();
-
+
int comm_size = smpi_comm_size(MPI_COMM_WORLD);
int i=0;
int sendcount=atoi(action[2]);
TRACE_smpi_computing_out(rank);
TRACE_smpi_collective_in(rank, -1, __FUNCTION__);
#endif
-
+
mpi_coll_allgatherv_fun(sendbuf, sendcount, MPI_CURRENT_TYPE, recvbuf, recvcounts, disps, MPI_CURRENT_TYPE2, MPI_COMM_WORLD);
#ifdef HAVE_TRACING
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
TRACE_smpi_computing_in(rank);
#endif
-
+
log_timed_action (action, clock);
xbt_free(sendbuf);
xbt_free(recvbuf);
4) 100*sizeof(int) is the size of the receiver buffer
5) 1 70 10 5 is the recvcounts array
6) 1 5 77 90 is the rdispls array
-
+
*/
-
-
+
+
double clock = smpi_process_simulated_elapsed();
-
+
int comm_size = smpi_comm_size(MPI_COMM_WORLD);
int send_buf_size=0,recv_buf_size=0,i=0;
int *sendcounts = xbt_new0(int, comm_size);
int *recvdisps = xbt_new0(int, comm_size);
MPI_Datatype MPI_CURRENT_TYPE2;
-
+
send_buf_size=parse_double(action[2]);
recv_buf_size=parse_double(action[3+2*comm_size]);
if(action[4+4*comm_size]) {
MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
}
-
+
void *sendbuf = calloc(send_buf_size, smpi_datatype_size(MPI_CURRENT_TYPE));
void *recvbuf = calloc(recv_buf_size, smpi_datatype_size(MPI_CURRENT_TYPE2));
recvcounts[i] = atoi(action[i+4+2*comm_size]);
recvdisps[i] = atoi(action[i+4+3*comm_size]);
}
-
+
#ifdef HAVE_TRACING
int rank = MPI_COMM_WORLD != MPI_COMM_NULL ? smpi_process_index() : -1;
TRACE_smpi_collective_out(rank, -1, __FUNCTION__);
TRACE_smpi_computing_in(rank);
#endif
-
+
log_timed_action (action, clock);
xbt_free(sendbuf);
xbt_free(recvbuf);
xbt_free(recvcounts);
xbt_free(senddisps);
xbt_free(recvdisps);
-
-
}
void smpi_replay_init(int *argc, char***argv){
}
/* Free the communicator */
- if (newcomm != MPI_COMM_NULL)
+ //if (newcomm != MPI_COMM_NULL)
//MPI_Comm_free( &newcomm );
Test_Waitforall( );
MPI_Finalize();