1
1

(hopefully) fixed various pedantic warning about casts on 32bit machines. Not tried only have 64bits available.

This commit was SVN r15702.
Этот коммит содержится в:
Aurelien Bouteiller 2007-07-31 15:58:19 +00:00
родитель fd778a5539
Коммит 5a792a3fad
2 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -31,7 +31,7 @@ int vprotocol_pessimist_sender_based_init(const char *mmapfile, size_t size)
sb.sb_fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600); sb.sb_fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0600);
if(-1 == sb.sb_fd) if(-1 == sb.sb_fd)
{ {
opal_output(1, "pml_v: vprotocol_pessimist: sender_based_init: open (%s): %s", opal_output(0, "pml_v: vprotocol_pessimist: sender_based_init: open (%s): %s",
path, strerror(errno)); path, strerror(errno));
return -1; return -1;
} }
@ -44,19 +44,19 @@ void vprotocol_pessimist_sender_based_finalize(void)
if(sb.sb_comm != MPI_COMM_NULL) if(sb.sb_comm != MPI_COMM_NULL)
{ {
/* TODO: cleanup that works... /* TODO: check this has already been freed by MPI_Finalize
* ret = ompi_comm_free(&sb.sb_comm); * ret = ompi_comm_free(&sb.sb_comm);
* if(MPI_SUCCESS != ret) * if(MPI_SUCCESS != ret)
* opal_output(1, "pml_v: protocol_pessimist: sender_based_finalize: ompi_comm_free failed (%d)", ret); * opal_output(0, "pml_v: protocol_pessimist: sender_based_finalize: ompi_comm_free failed (%d)", ret);
*/ */
ret = munmap(sb.sb_addr, sb.sb_length); ret = munmap(sb.sb_addr, sb.sb_length);
if(-1 == ret) if(-1 == ret)
opal_output(1, "pml_v: protocol_pessimsit: sender_based_finalize: munmap (%p): %s", opal_output(0, "pml_v: protocol_pessimsit: sender_based_finalize: munmap (%p): %s",
sb.sb_addr, strerror(errno)); sb.sb_addr, strerror(errno));
} }
ret = close(sb.sb_fd); ret = close(sb.sb_fd);
if(-1 == ret) if(-1 == ret)
opal_output(1, "pml_v: protocol_pessimist: sender_based_finalize: close (%d): %s", opal_output(0, "pml_v: protocol_pessimist: sender_based_finalize: close (%d): %s",
sb.sb_fd, strerror(errno)); sb.sb_fd, strerror(errno));
} }
@ -73,12 +73,12 @@ void vprotocol_pessimist_sender_based_alloc(size_t len)
/* Take care of alignement of sb_offset */ /* Take care of alignement of sb_offset */
sb.sb_offset += (intptr_t) sb.sb_cursor - (intptr_t) sb.sb_addr; sb.sb_offset += (intptr_t) sb.sb_cursor - (intptr_t) sb.sb_addr;
sb.sb_cursor = (char *) (sb.sb_offset % sb.sb_pagesize); /* pos in window */ sb.sb_cursor = (char *) ((intptr_t) (sb.sb_offset % sb.sb_pagesize));
sb.sb_offset -= (off_t) sb.sb_cursor; /* position of window */ sb.sb_offset -= (intptr_t) sb.sb_cursor;
/* Adjusting sb_length for the largest application message to fit */ /* Adjusting sb_length for the largest application message to fit */
if(sb.sb_length < len) if(sb.sb_length < len)
sb.sb_length = len + (off_t) sb.sb_cursor; sb.sb_length = len + (size_t) sb.sb_cursor;
if(-1 == lseek(sb.sb_fd, sb.sb_offset + sb.sb_length, SEEK_SET)) if(-1 == lseek(sb.sb_fd, sb.sb_offset + sb.sb_length, SEEK_SET))
{ {

Просмотреть файл

@ -39,7 +39,7 @@ typedef struct vprotocol_pessimist_sender_based_header_t
int dst; int dst;
int tag; int tag;
uint32_t contextid; uint32_t contextid;
uint64_t sequence; vprotocol_pessimist_clock_t sequence;
} vprotocol_pessimist_sender_based_header_t; } vprotocol_pessimist_sender_based_header_t;
int vprotocol_pessimist_sender_based_init(const char *mmapfile, size_t size); int vprotocol_pessimist_sender_based_init(const char *mmapfile, size_t size);
@ -98,7 +98,7 @@ void vprotocol_pessimist_sender_based_alloc(size_t len);
mca_vprotocol_pessimist.sender_based.sb_cursor += sbhdr->size; \ mca_vprotocol_pessimist.sender_based.sb_cursor += sbhdr->size; \
mca_vprotocol_pessimist.sender_based.sb_vacant -= (sbhdr->size + \ mca_vprotocol_pessimist.sender_based.sb_vacant -= (sbhdr->size + \
sizeof(vprotocol_pessimist_sender_based_header_t)); \ sizeof(vprotocol_pessimist_sender_based_header_t)); \
V_OUTPUT_VERBOSE(70, "pessimist:\tsb\twrite\t%x\tsize %ld", VPESSIMIST_REQ(&req->req_base)->reqid, sbhdr->size); \ V_OUTPUT_VERBOSE(70, "pessimist:\tsb\twrite\t%"PRIpclock"\tsize %ld", VPESSIMIST_REQ(&req->req_base)->reqid, sbhdr->size); \
} while(0) } while(0)
/** Copy data associated to a pml_base_send_request_t to the sender based /** Copy data associated to a pml_base_send_request_t to the sender based