Protect the standard header file, and allow the PML V to compile
on Windows. This commit was SVN r17250.
Этот коммит содержится в:
родитель
ca8eb1fb30
Коммит
c5d5fcf50a
@ -14,13 +14,19 @@
|
|||||||
#include "ompi_config.h"
|
#include "ompi_config.h"
|
||||||
#include "opal/mca/base/mca_base_param.h"
|
#include "opal/mca/base/mca_base_param.h"
|
||||||
#include "ompi/mca/pml/base/pml_base_request.h"
|
#include "ompi/mca/pml/base/pml_base_request.h"
|
||||||
|
#ifdef HAVE_INTTYPES_H
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#endif /* HAVE_INTTYPES_H */
|
||||||
|
|
||||||
BEGIN_C_DECLS
|
BEGIN_C_DECLS
|
||||||
|
|
||||||
/* Make sure -Wformat is happy... */
|
/* Make sure -Wformat is happy... */
|
||||||
typedef uint64_t vprotocol_pessimist_clock_t;
|
typedef uint64_t vprotocol_pessimist_clock_t;
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
#define PRIpclock "%llx"
|
||||||
|
#else
|
||||||
#define PRIpclock PRIx64
|
#define PRIpclock PRIx64
|
||||||
|
#endif /* __WINDOWS__ */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
VPROTOCOL_PESSIMIST_EVENT_TYPE_MATCHING,
|
VPROTOCOL_PESSIMIST_EVENT_TYPE_MATCHING,
|
||||||
|
@ -52,7 +52,7 @@ static int sb_mmap_file_open(const char *path)
|
|||||||
static void sb_mmap_file_close(void)
|
static void sb_mmap_file_close(void)
|
||||||
{
|
{
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
closeHandle(sb.sb_fd);
|
CloseHandle(sb.sb_fd);
|
||||||
#else
|
#else
|
||||||
int ret = close(sb.sb_fd);
|
int ret = close(sb.sb_fd);
|
||||||
if(-1 == ret)
|
if(-1 == ret)
|
||||||
@ -75,12 +75,12 @@ static void sb_mmap_alloc(void)
|
|||||||
|
|
||||||
sb.sb_addr = (uintptr_t) MapViewOfFile(sb.sb_map, FILE_MAP_ALL_ACCESS, 0,
|
sb.sb_addr = (uintptr_t) MapViewOfFile(sb.sb_map, FILE_MAP_ALL_ACCESS, 0,
|
||||||
sb.sb_offset, sb.sb_length);
|
sb.sb_offset, sb.sb_length);
|
||||||
if(NULL == sb.sb_addr)
|
if(NULL == (void*)sb.sb_addr)
|
||||||
{
|
{
|
||||||
V_OUTPUT_ERR("pml_v: vprotocol_pessimist: sender_based_alloc: mmap: %s",
|
V_OUTPUT_ERR("pml_v: vprotocol_pessimist: sender_based_alloc: mmap: %s",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
closeHandle(sb.sb_map);
|
CloseHandle(sb.sb_map);
|
||||||
closeHandle(sb.sb_fd);
|
CloseHandle(sb.sb_fd);
|
||||||
ompi_mpi_abort(MPI_COMM_NULL, MPI_ERR_NO_SPACE, false);
|
ompi_mpi_abort(MPI_COMM_NULL, MPI_ERR_NO_SPACE, false);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -111,8 +111,8 @@ static void sb_mmap_alloc(void)
|
|||||||
static void sb_mmap_free(void)
|
static void sb_mmap_free(void)
|
||||||
{
|
{
|
||||||
#if defined(__WINDOWS__)
|
#if defined(__WINDOWS__)
|
||||||
UnmapViewOfFile(sb.sb_addr);
|
UnmapViewOfFile( (LPCVOID)sb.sb_addr);
|
||||||
closeHandle(sb.sb_map);
|
CloseHandle(sb.sb_map);
|
||||||
#else
|
#else
|
||||||
int ret = munmap((void *) sb.sb_addr, sb.sb_length);
|
int ret = munmap((void *) sb.sb_addr, sb.sb_length);
|
||||||
if(-1 == ret)
|
if(-1 == ret)
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user