Realm
Version 25.6.1-rc.4+77e872a5
A distributed, event-based tasking library
Main Page
Namespaces
Classes
Files
File List
File Members
Loading...
Searching...
No Matches
am_mpi.h
Go to the documentation of this file.
1
/*
2
* Copyright 2025 Argonne National Laboratory, Stanford University, NVIDIA Corporation
3
* SPDX-License-Identifier: Apache-2.0
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#ifndef AM_MPI_H_INCLUDED
19
#define AM_MPI_H_INCLUDED
20
21
#include <cstring>
22
#include <cstdlib>
23
#include <mpi.h>
24
#include <cstdio>
25
#include <cassert>
26
#include "
realm/atomics.h
"
27
#include "
realm/activemsg.h
"
28
29
#define AM_BUF_COUNT 128
30
31
// size of posted receives (i.e. header+payload limit that can be sent
32
// eagerly)
33
#define AM_BUF_SIZE 4096
34
35
#define CHECK_MPI(cmd) \
36
do { \
37
int ret = (cmd); \
38
if(ret != MPI_SUCCESS) { \
39
fprintf(stderr, "MPI: %s = %d\n", #cmd, ret); \
40
exit(1); \
41
} \
42
} while(0)
43
44
namespace
Realm
{
45
namespace
MPI {
46
47
extern
atomic<size_t>
messages_sent
,
messages_rcvd
;
48
49
struct
AM_msg
{
50
int
type
;
51
int
msgid
;
52
int
header_size
;
53
int
payload_size
;
54
uintptr_t
comp_ptr
;
55
char
stuff
[1];
56
};
57
58
int
AM_Init
(
int
*p_node_this,
int
*p_node_size);
59
void
AM_Finalize
();
60
void
AM_init_long_messages
(MPI_Win win,
void
*am_base,
61
Realm::IncomingMessageManager
*message_manager);
62
void
AMPoll
();
63
void
AMPoll_cancel
();
64
void
AMSend
(
int
tgt,
int
msgid
,
int
header_size,
int
payload_size,
const
char
*header,
65
const
char
*payload,
int
payload_lines,
int
payload_line_stride,
66
int
has_dest, MPI_Aint dest,
void
*
remote_comp
);
67
68
// must be defined by caller of AMSend
69
void
AMComplete
(
void
*
remote_comp
);
70
71
}
/* namespace MPI */
72
}
/* namespace Realm */
73
74
#endif
/* AM_MPI_H_INCLUDED */
activemsg.h
atomics.h
Realm::IncomingMessageManager
Definition
activemsg.h:345
Realm::atomic
Definition
atomics.h:31
Realm::MPI::messages_rcvd
atomic< size_t > messages_rcvd
Definition
am_mpi.h:47
Realm::MPI::messages_sent
atomic< size_t > messages_sent
Realm::MPI::AMComplete
void AMComplete(void *remote_comp)
Realm::MPI::AM_Init
int AM_Init(int *p_node_this, int *p_node_size)
Realm::MPI::AM_init_long_messages
void AM_init_long_messages(MPI_Win win, void *am_base, Realm::IncomingMessageManager *message_manager)
Realm::MPI::AMPoll
void AMPoll()
Realm::MPI::AM_Finalize
void AM_Finalize()
Realm::MPI::AMPoll_cancel
void AMPoll_cancel()
Realm::MPI::AMSend
void AMSend(int tgt, int msgid, int header_size, int payload_size, const char *header, const char *payload, int payload_lines, int payload_line_stride, int has_dest, MPI_Aint dest, void *remote_comp)
Realm
Definition
activemsg.h:38
Realm::MPI::AM_msg
Definition
am_mpi.h:49
Realm::MPI::AM_msg::payload_size
int payload_size
Definition
am_mpi.h:53
Realm::MPI::AM_msg::comp_ptr
uintptr_t comp_ptr
Definition
am_mpi.h:54
Realm::MPI::AM_msg::msgid
int msgid
Definition
am_mpi.h:51
Realm::MPI::AM_msg::type
int type
Definition
am_mpi.h:50
Realm::MPI::AM_msg::header_size
int header_size
Definition
am_mpi.h:52
Realm::MPI::AM_msg::stuff
char stuff[1]
Definition
am_mpi.h:55
msgid
unsigned short msgid
Definition
ucp_internal.h:2
remote_comp
RemoteComp * remote_comp
Definition
ucp_internal.h:3
src
realm
mpi
am_mpi.h
Generated by
1.9.8