Skip to content

Commit

Permalink
Merge pull request #22 from LLNL/develop
Browse files Browse the repository at this point in the history
Release 0.0.2
  • Loading branch information
mcfadden8 committed Mar 29, 2018
2 parents 940eac6 + f68e6cb commit 66d8224
Show file tree
Hide file tree
Showing 64 changed files with 4,059 additions and 1,242 deletions.
3 changes: 0 additions & 3 deletions .gitignore

This file was deleted.

13 changes: 10 additions & 3 deletions CMakeLists.txt
@@ -1,13 +1,20 @@
cmake_minimum_required (VERSION 3.5.2)
project(umap VERSION 0.0.1)
cmake_minimum_required (VERSION 3.5.1)
project(umap VERSION 0.0.2)

configure_file(
"${PROJECT_SOURCE_DIR}/config/config.h.in"
"${PROJECT_BINARY_DIR}/config/config.h"
)

if (NOT CMAKE_BUILD_TYPE)
message(STATUS "No build type selected, default to Debug")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
endif()

OPTION (BUILD_FITS "Build FITS-based Tests (requires qfits library)" FALSE)

set (FLAGS_ALL "-Wall")
set (FLAGS_DEBUG_ALL "-g -O0")
set (FLAGS_DEBUG_ALL "-g -O0 -DDEBUG")
set (FLAGS_RELEASE_ALL "-O3")

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 ${FLAGS_ALL}")
Expand Down
17 changes: 13 additions & 4 deletions README.md
@@ -1,4 +1,4 @@
# UMAP v0.0.1 (alpha)
# UMAP v0.0.2 (alpha)

Umap is a library that provides an mmap()-like interface to a simple, user-
space page fault handler based on the userfaultfd Linux feature (starting with
Expand Down Expand Up @@ -26,13 +26,22 @@ cmake -DCMAKE_INSTALL_PREFIX = <where you want the sofware> ..
make install
```

The default for cmake is to build a Debug version of the software. If you would like to build an optimized (-O3)
version, simply run
```bash
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX = <where you want the sofware> ..
```

## umap() Interface

The interface is currently a work in progress (see [umap.h](src/umap.h)).
The interface is currently a work in progress (see [umap.h](include/umap.h)).

## License

## Contact/Legal
- The license is [LGPL](/LICENSE).
- [thirdparty_licenses.md](/thirdparty_licenses.md)

The license is [LGPL](/LICENSE).
## Contact

Primary contact/Lead developer

Expand Down
7 changes: 7 additions & 0 deletions config/config.h.in
@@ -0,0 +1,7 @@
// the (cmake) configured options and settings for umap
#ifndef _UMAP_UMAPCONFIG_H
#define _UMAP_UMAPCONFIG_H
#define UMAP_VERSION_MAJOR @umap_VERSION_MAJOR@
#define UMAP_VERSION_MINOR @umap_VERSION_MINOR@
#define UMAP_VERSION_PATCH @umap_VERSION_PATCH@
#endif
64 changes: 64 additions & 0 deletions include/umap.h
@@ -0,0 +1,64 @@
/*
* This file is part of UMAP. For copyright information see the COPYRIGHT file in the top level directory, or at
* https://github.com/LLNL/umap/blob/master/COPYRIGHT This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License (as published by the Free Software Foundation)
* version 2.1 dated February 1999. This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms
* and conditions of the GNU Lesser General Public License for more details. You should have received a copy of the
* GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _UMAP_H_
#define _UMAP_H_
#include <sys/types.h>
#include <sys/mman.h>

typedef struct umap_backing_file {
int fd;
off_t data_size;
off_t data_offset; /* Offset of data portion in file */
} umap_backing_file;

#ifdef __cplusplus
extern "C" {
#endif

/*
* umap() is a wrapper around mmap(2) and userfaultfd(2) to allow for creating a mapping of pages managed in user-space.
*/
void* umap( void* addr, /* See mmap(2) */
size_t length, /* See mmap(2) */
int prot, /* See mmap(2) */
int flags, /* See below, see mmap(2) for general notes */
int fd, /* See mmap(2) */
off_t offset /* See mmap(2) */
);
int uunmap( void* addr, /* See mmap(2) */
size_t length /* See mmap(2) */
);

void* umap_mf(void* addr,
size_t length,
int prot,
int flags,
int num_backing_files,
umap_backing_file* backing_files
);

uint64_t umap_cfg_get_bufsize( void );
void umap_cfg_set_bufsize( uint64_t page_bufsize );
#ifdef __cplusplus
}
#endif

/*
* flags
*/
#define UMAP_PRIVATE MAP_PRIVATE // Note - UMAP_SHARED not currently supported
#define UMAP_FIXED MAP_FIXED // See mmap(2) - This flag is currently then only flag supported.

/*
* Return codes
*/
#define UMAP_FAILED (void *)-1
#endif // _UMAP_H_
13 changes: 9 additions & 4 deletions src/CMakeLists.txt
@@ -1,19 +1,24 @@
project(umap_libraries)

add_library(libumap SHARED umap.cpp)
add_library(libumap_static STATIC umap.cpp)
add_library(libumap SHARED umap.cpp umaplog.cpp)
add_library(libumap_static STATIC umap.cpp umaplog.cpp)
set_target_properties(libumap_static PROPERTIES OUTPUT_NAME libumap)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories(
BEFORE "${CMAKE_CURRENT_SOURCE_DIR}"
"${PROJECT_BINARY_DIR}/../config"
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
"${CMAKE_CURRENT_SOURCE_DIR}/../sysincludes"
)

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/include)

add_custom_command (
TARGET libumap
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/umap.h ${CMAKE_BINARY_DIR}/include/umap.h
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../include/umap.h ${CMAKE_BINARY_DIR}/include/umap.h
)

install(TARGETS libumap libumap_static
Expand Down
Binary file removed src/results/latencies-madv-handler-ap.png
Binary file not shown.
11 changes: 0 additions & 11 deletions src/results/threads-timings-madv-in-app.txt

This file was deleted.

11 changes: 0 additions & 11 deletions src/results/threads-timings-madv-in-handler.txt

This file was deleted.

Binary file removed src/results/threads-timings.numbers
Binary file not shown.

0 comments on commit 66d8224

Please sign in to comment.