1 /*
2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2006 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
7 * reserved.
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
12 * Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved.
13 * Copyright (c) 2010-2011 Los Alamos National Security, LLC.
14 * All rights reserved.
15 * $COPYRIGHT$
16 *
17 * Additional copyrights may follow
18 *
19 * $HEADER$
20 */
21
22 #include "opal_config.h"
23
24 #include "opal/constants.h"
25 #include "opal/mca/shmem/shmem.h"
26 #include "opal/mca/shmem/base/base.h"
27
28 /* ////////////////////////////////////////////////////////////////////////// */
29 int
30 opal_shmem_segment_create(opal_shmem_ds_t *ds_buf,
31 const char *file_name,
32 size_t size)
33 {
34 if (!opal_shmem_base_selected) {
35 return OPAL_ERROR;
36 }
37
38 return opal_shmem_base_module->segment_create(ds_buf, file_name, size);
39 }
40
41 /* ////////////////////////////////////////////////////////////////////////// */
42 int
43 opal_shmem_ds_copy(const opal_shmem_ds_t *from,
44 opal_shmem_ds_t *to)
45 {
46 if (!opal_shmem_base_selected) {
47 return OPAL_ERROR;
48 }
49
50 return opal_shmem_base_module->ds_copy(from, to);
51 }
52
53 /* ////////////////////////////////////////////////////////////////////////// */
54 void *
55 opal_shmem_segment_attach(opal_shmem_ds_t *ds_buf)
56 {
57 if (!opal_shmem_base_selected) {
58 return NULL;
59 }
60
61 return opal_shmem_base_module->segment_attach(ds_buf);
62 }
63
64 /* ////////////////////////////////////////////////////////////////////////// */
65 int
66 opal_shmem_segment_detach(opal_shmem_ds_t *ds_buf)
67 {
68 if (!opal_shmem_base_selected) {
69 return OPAL_ERROR;
70 }
71
72 return opal_shmem_base_module->segment_detach(ds_buf);
73 }
74
75 /* ////////////////////////////////////////////////////////////////////////// */
76 int
77 opal_shmem_unlink(opal_shmem_ds_t *ds_buf)
78 {
79 if (!opal_shmem_base_selected) {
80 return OPAL_ERROR;
81 }
82
83 return opal_shmem_base_module->unlink(ds_buf);
84 }
85