2015-02-19 13:41:41 -07:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
|
2012-02-22 23:32:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2006 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* Copyright (c) 2006 Voltaire. All rights reserved.
|
2015-09-16 09:09:49 -04:00
|
|
|
* Copyright (c) 2012-2015 NVIDIA Corporation. All rights reserved.
|
2015-02-19 13:41:41 -07:00
|
|
|
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
* reserved.
|
2012-02-22 23:32:36 +00:00
|
|
|
*
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
#ifndef MCA_RCACHE_RGPUSM_H
|
|
|
|
#define MCA_RCACHE_RGPUSM_H
|
2012-02-22 23:32:36 +00:00
|
|
|
|
George did the work and deserves all the credit for it. Ralph did the merge, and deserves whatever blame results from errors in it :-)
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL
All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic.
This commit was SVN r32317.
2014-07-26 00:47:28 +00:00
|
|
|
#include "opal_config.h"
|
2012-02-22 23:32:36 +00:00
|
|
|
#include "opal/class/opal_list.h"
|
2015-02-19 13:41:41 -07:00
|
|
|
#include "opal/class/opal_free_list.h"
|
2015-11-02 12:07:08 -07:00
|
|
|
#include "opal/mca/rcache/rcache.h"
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
BEGIN_C_DECLS
|
|
|
|
|
2015-11-02 12:07:08 -07:00
|
|
|
struct mca_rcache_rgpusm_component_t {
|
|
|
|
mca_rcache_base_component_t super;
|
2012-02-22 23:32:36 +00:00
|
|
|
char* rcache_name;
|
2013-03-27 21:09:41 +00:00
|
|
|
unsigned long long rcache_size_limit;
|
2012-02-22 23:32:36 +00:00
|
|
|
bool print_stats;
|
2013-03-27 21:09:41 +00:00
|
|
|
int leave_pinned;
|
2012-02-22 23:32:36 +00:00
|
|
|
int output;
|
2015-09-16 09:09:49 -04:00
|
|
|
bool empty_cache;
|
2012-02-22 23:32:36 +00:00
|
|
|
};
|
2015-11-02 12:07:08 -07:00
|
|
|
typedef struct mca_rcache_rgpusm_component_t mca_rcache_rgpusm_component_t;
|
2012-02-22 23:32:36 +00:00
|
|
|
|
2015-11-02 12:07:08 -07:00
|
|
|
OPAL_DECLSPEC extern mca_rcache_rgpusm_component_t mca_rcache_rgpusm_component;
|
2012-02-22 23:32:36 +00:00
|
|
|
|
2015-11-02 12:07:08 -07:00
|
|
|
struct mca_rcache_rgpusm_module_t {
|
|
|
|
mca_rcache_base_module_t super;
|
2015-02-19 13:41:41 -07:00
|
|
|
opal_free_list_t reg_list;
|
2012-02-22 23:32:36 +00:00
|
|
|
opal_list_t lru_list;
|
|
|
|
uint32_t stat_cache_hit;
|
|
|
|
uint32_t stat_cache_valid;
|
|
|
|
uint32_t stat_cache_invalid;
|
|
|
|
uint32_t stat_cache_miss;
|
|
|
|
uint32_t stat_evicted;
|
|
|
|
uint32_t stat_cache_found;
|
|
|
|
uint32_t stat_cache_notfound;
|
2015-11-02 12:07:08 -07:00
|
|
|
mca_rcache_base_vma_module_t *vma_module;
|
|
|
|
}; typedef struct mca_rcache_rgpusm_module_t mca_rcache_rgpusm_module_t;
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
/*
|
2015-11-02 12:07:08 -07:00
|
|
|
* Initializes the rcache module.
|
2012-02-22 23:32:36 +00:00
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
void mca_rcache_rgpusm_module_init(mca_rcache_rgpusm_module_t *rcache);
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* register block of memory
|
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
int mca_rcache_rgpusm_register(mca_rcache_base_module_t* rcache, void *addr,
|
|
|
|
size_t size, uint32_t flags, int32_t access_flags, mca_rcache_base_registration_t **reg);
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* deregister memory
|
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
int mca_rcache_rgpusm_deregister(mca_rcache_base_module_t *rcache,
|
|
|
|
mca_rcache_base_registration_t *reg);
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* free memory allocated by alloc function
|
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
void mca_rcache_rgpusm_free(mca_rcache_base_module_t *rcache, void * addr,
|
|
|
|
mca_rcache_base_registration_t *reg);
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* find registration for a given block of memory
|
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
int mca_rcache_rgpusm_find(struct mca_rcache_base_module_t* rcache, void* addr,
|
|
|
|
size_t size, mca_rcache_base_registration_t **reg);
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* unregister all registration covering the block of memory
|
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
int mca_rcache_rgpusm_release_memory(mca_rcache_base_module_t* rcache, void *base,
|
2012-02-22 23:32:36 +00:00
|
|
|
size_t size);
|
|
|
|
|
|
|
|
/**
|
2015-11-02 12:07:08 -07:00
|
|
|
* finalize rcache
|
2012-02-22 23:32:36 +00:00
|
|
|
*/
|
2015-11-02 12:07:08 -07:00
|
|
|
void mca_rcache_rgpusm_finalize(struct mca_rcache_base_module_t *rcache);
|
2012-02-22 23:32:36 +00:00
|
|
|
|
|
|
|
END_C_DECLS
|
|
|
|
#endif
|