block_index = get_first_block(peer, piece);
if (block_index != -1) {
block_length = PIECES_BLOCKS - block_index;
- block_length = min(BLOCKS_REQUESTED, block_length);
+ block_length = MIN(BLOCKS_REQUESTED, block_length);
send_request(peer, remote_peer->mailbox, piece, block_index, block_length);
}
}
task2 = NULL;
XBT_INFO("Received %lu", val2);
- MC_assert(min(val1, val2) == 1);
+ MC_assert(MIN(val1, val2) == 1);
MSG_task_receive(&task1, "mymailbox");
val1 = xbt_str_parse_int(MSG_task_get_name(task1), "Task name is not a numerical ID: %s");
#endif
-#if !defined (max) && !defined(__cplusplus)
-# define max(a,b) (((a) > (b)) ? (a) : (b))
-#endif
-#if !defined (min) && !defined(__cplusplus)
-# define min(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
#define TRUE 1
#define FALSE 0
smpi_datatype_extent(recvtype, &recvtype_true_lb, &recvtype_true_extent);
- tmp_buf_rl= (void*)smpi_get_tmp_sendbuffer(total_count*(max(recvtype_true_extent,recvtype_extent)));
+ tmp_buf_rl= (void*)smpi_get_tmp_sendbuffer(total_count*(MAX(recvtype_true_extent,recvtype_extent)));
/* adjust for potential negative lower bound in datatype */
tmp_buf = (void *)((char*)tmp_buf_rl - recvtype_true_lb);
/* If I'm not the root, then my recvbuf may not be valid, therefore
I have to allocate a temporary one */
if (rank != root) {
- recvbuf = (void *) smpi_get_tmp_recvbuffer(count*(max(extent,true_extent)));
+ recvbuf = (void *) smpi_get_tmp_recvbuffer(count*(MAX(extent,true_extent)));
recvbuf = (void *)((char*)recvbuf - true_lb);
}
if ((rank != root) || (sendbuf != MPI_IN_PLACE)) {
}
/* allocate temporary buffer to store incoming data */
- tmp_recvbuf = (void*)smpi_get_tmp_recvbuffer(recvcounts[rank]*(max(true_extent,extent))+1);
+ tmp_recvbuf = (void*)smpi_get_tmp_recvbuffer(recvcounts[rank]*(MAX(true_extent,extent))+1);
/* adjust for potential negative lower bound in datatype */
tmp_recvbuf = (void *)((char*)tmp_recvbuf - true_lb);
/* noncommutative and (non-pof2 or block irregular), use recursive doubling. */
/* need to allocate temporary buffer to receive incoming data*/
- tmp_recvbuf= (void *) smpi_get_tmp_recvbuffer( total_count*(max(true_extent,extent)));
+ tmp_recvbuf= (void *) smpi_get_tmp_recvbuffer( total_count*(MAX(true_extent,extent)));
/* adjust for potential negative lower bound in datatype */
tmp_recvbuf = (void *)((char*)tmp_recvbuf - true_lb);
/* need to allocate another temporary buffer to accumulate
results */
- tmp_results = (void *)smpi_get_tmp_sendbuffer( total_count*(max(true_extent,extent)));
+ tmp_results = (void *)smpi_get_tmp_sendbuffer( total_count*(MAX(true_extent,extent)));
/* adjust for potential negative lower bound in datatype */
tmp_results = (void *)((char*)tmp_results - true_lb);
set->fmt = xbt_strdup(eq + 1);
} else {
char buff[512];
- snprintf(buff, min(512, eq - dot), "%s", dot + 1);
+ snprintf(buff, MIN(512, eq - dot), "%s", dot + 1);
THROWF(arg_error, 0, "Unknown setting of the log category: '%s'",
buff);
}