if (root != leader_of_root) {
if (leader_comm_rank == leader_root) {
- displs = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
- sendcnts = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+ displs = new int[leader_comm_size];
+ sendcnts = new int[leader_comm_size];
sendcnts[0] = node_sizes[0] * nbytes;
displs[0] = 0;
leader_root, leader_comm);
} else {
if (leader_comm_rank == leader_root) {
- displs = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
- sendcnts = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+ displs = new int[leader_comm_size];
+ sendcnts = new int[leader_comm_size];
sendcnts[0] = node_sizes[0] * sendcnt;
displs[0] = 0;
leader_comm);
}
if (leader_comm_rank == leader_root) {
- xbt_free(displs);
- xbt_free(sendcnts);
+ delete[] displs;
+ delete[] sendcnts;
}
} else {
if (leader_of_root != root) {
if (root != leader_of_root) {
if (leader_comm_rank == leader_root) {
- displs = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
- sendcnts = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+ displs = new int[leader_comm_size];
+ sendcnts = new int[leader_comm_size];
sendcnts[0] = node_sizes[0] * nbytes;
displs[0] = 0;
leader_root, leader_comm);
} else {
if (leader_comm_rank == leader_root) {
- displs = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
- sendcnts = static_cast<int*>(xbt_malloc(sizeof(int) * leader_comm_size));
+ displs = new int[leader_comm_size];
+ sendcnts = new int[leader_comm_size];
sendcnts[0] = node_sizes[0] * sendcnt;
displs[0] = 0;
leader_comm);
}
if (leader_comm_rank == leader_root) {
- xbt_free(displs);
- xbt_free(sendcnts);
+ delete[] displs;
+ delete[] sendcnts;
}
} else {
if (leader_of_root != root) {