StarPU Internal Handbook
starpu_mpi_private.h File Reference
#include <starpu.h>
#include <common/config.h>
#include <common/uthash.h>
#include <starpu_mpi.h>
#include <starpu_mpi_fxt.h>
#include <common/list.h>
#include <common/prio_list.h>
#include <common/starpu_spinlock.h>
#include <core/simgrid.h>

Go to the source code of this file.

Data Structures

struct  _starpu_simgrid_mpi_req
 
struct  _starpu_mpi_node
 
struct  _starpu_mpi_node_tag
 
struct  _starpu_mpi_coop_sends
 
struct  _starpu_mpi_data
 
struct  _starpu_mpi_req
 
struct  _starpu_mpi_argc_argv
 
struct  _starpu_mpi_backend
 

Macros

#define STARPU_MPI_ASSERT_MSG(x, msg, ...)
 
#define _STARPU_MPI_MALLOC(ptr, size)
 
#define _STARPU_MPI_CALLOC(ptr, nmemb, size)
 
#define _STARPU_MPI_REALLOC(ptr, size)
 
#define _STARPU_MPI_COMM_DEBUG(ptr, count, datatype, node, tag, utag, comm, way)
 
#define _STARPU_MPI_COMM_TO_DEBUG(ptr, count, datatype, dest, tag, utag, comm)
 
#define _STARPU_MPI_COMM_FROM_DEBUG(ptr, count, datatype, source, tag, utag, comm)
 
#define _STARPU_MPI_DEBUG(level, fmt, ...)
 
#define _STARPU_MPI_DISP(fmt, ...)
 
#define _STARPU_MPI_MSG(fmt, ...)
 
#define _STARPU_MPI_LOG_IN()
 
#define _STARPU_MPI_LOG_OUT()
 

Enumerations

enum  _starpu_mpi_request_type {
  SEND_REQ , RECV_REQ , WAIT_REQ , TEST_REQ ,
  BARRIER_REQ , PROBE_REQ , UNKNOWN_REQ
}
 

Functions

int _starpu_mpi_simgrid_mpi_test (unsigned *done, int *flag)
 
void _starpu_mpi_simgrid_wait_req (MPI_Request *request, MPI_Status *status, starpu_pthread_queue_t *queue, unsigned *done)
 
struct _starpu_mpi_req_starpu_mpi_isend_cache_aware (starpu_data_handle_t data_handle, int dest, starpu_mpi_tag_t data_tag, MPI_Comm comm, unsigned detached, unsigned sync, int prio, void(*callback)(void *), void *_arg, int sequential_consistency, int *cache_flag)
 
struct _starpu_mpi_req_starpu_mpi_irecv_cache_aware (starpu_data_handle_t data_handle, int source, starpu_mpi_tag_t data_tag, MPI_Comm comm, unsigned detached, unsigned sync, void(*callback)(void *), void *_arg, int sequential_consistency, int is_internal_req, starpu_ssize_t count, int *cache_flag)
 
char * _starpu_mpi_get_mpi_error_code (int code)
 
void _starpu_mpi_env_init (void)
 
struct _starpu_mpi_data_starpu_mpi_data_get (starpu_data_handle_t data_handle)
 
void _starpu_mpi_submit_ready_request (void *arg)
 
void _starpu_mpi_release_req_data (struct _starpu_mpi_req *req)
 
void _starpu_mpi_isend_irecv_common (struct _starpu_mpi_req *req, enum starpu_data_access_mode mode, int sequential_consistency)
 
void _starpu_mpi_coop_send (starpu_data_handle_t data_handle, struct _starpu_mpi_req *req, enum starpu_data_access_mode mode, int sequential_consistency)
 
void _starpu_mpi_submit_coop_sends (struct _starpu_mpi_coop_sends *coop_sends, int submit_control, int submit_data)
 
void _starpu_mpi_redux_fill_post_sync_jobid (const void *const redux_data_args, long *const post_sync_jobid)
 
void _starpu_mpi_request_init (struct _starpu_mpi_req **req)
 
struct _starpu_mpi_req_starpu_mpi_request_fill (starpu_data_handle_t data_handle, int srcdst, starpu_mpi_tag_t data_tag, MPI_Comm comm, unsigned detached, unsigned sync, int prio, void(*callback)(void *), void *arg, enum _starpu_mpi_request_type request_type, void(*func)(struct _starpu_mpi_req *), int sequential_consistency, int is_internal_req, starpu_ssize_t count)
 
void _starpu_mpi_request_destroy (struct _starpu_mpi_req *req)
 
char * _starpu_mpi_request_type (enum _starpu_mpi_request_type request_type)
 
struct _starpu_mpi_req_starpu_mpi_irecv_common (starpu_data_handle_t data_handle, int source, starpu_mpi_tag_t data_tag, MPI_Comm comm, unsigned detached, unsigned sync, void(*callback)(void *), void *arg, int sequential_consistency, int is_internal_req, starpu_ssize_t count, int prio)
 
int _starpu_mpi_choose_node (starpu_data_handle_t data_handle, enum starpu_data_access_mode mode)
 
void _starpu_mpi_data_flush (starpu_data_handle_t data_handle)
 
void _starpu_mpi_tags_init (void)
 

Variables

starpu_pthread_wait_t _starpu_mpi_thread_wait
 
starpu_pthread_queue_t _starpu_mpi_thread_dontsleep
 
int _starpu_debug_rank
 
int _starpu_mpi_comm_debug
 
int _starpu_mpi_fake_world_size
 
int _starpu_mpi_fake_world_rank
 
int _starpu_mpi_use_prio
 
int _starpu_mpi_nobind
 
int _starpu_mpi_thread_cpuid
 
int _starpu_mpi_use_coop_sends
 
int _starpu_mpi_mem_throttle
 
int _starpu_mpi_recv_wait_finalize
 
int _starpu_mpi_has_cuda
 
int _starpu_mpi_cuda_devid
 
PRIO_struct _starpu_mpi_req
 
struct _starpu_mpi_backend _mpi_backend
 

Data Structure Documentation

◆ _starpu_simgrid_mpi_req

struct _starpu_simgrid_mpi_req
Data Fields
MPI_Request * request
MPI_Status * status
starpu_pthread_queue_t * queue
unsigned * done

◆ _starpu_mpi_node

struct _starpu_mpi_node
Data Fields
MPI_Comm comm
int rank

◆ _starpu_mpi_node_tag

struct _starpu_mpi_node_tag
Data Fields
struct _starpu_mpi_node node
starpu_mpi_tag_t data_tag

◆ _starpu_mpi_coop_sends

struct _starpu_mpi_coop_sends

One bag of cooperative sends

Data Fields
starpu_data_handle_t data_handle
struct _starpu_mpi_req_multilist_coop_sends reqs

List of send requests

struct _starpu_mpi_data * mpi_data
struct _starpu_spinlock lock

Array of send requests, after sorting out

struct _starpu_mpi_req ** reqs_array
unsigned n
unsigned redirects_sent
long pre_sync_jobid

◆ _starpu_mpi_data

struct _starpu_mpi_data

Initialized in starpu_mpi_data_register_comm

Data Fields
int magic
struct _starpu_mpi_node_tag node_tag
char * cache_sent
unsigned int cache_received
unsigned int ft_induced_cache_received:1
unsigned int ft_induced_cache_received_count:1
unsigned int modified:1
char * redux_map

Array used to store the contributing nodes to this data when it is accessed in (MPI_)REDUX mode.

struct _starpu_spinlock coop_lock

Rendez-vous data for opportunistic cooperative sends, Needed to synchronize between submit thread and workers

struct _starpu_mpi_coop_sends * coop_sends

Current cooperative send bag

unsigned nb_future_sends

When provided, wait the given number of sends to start a coop, instead of just waiting that data are ready

◆ _starpu_mpi_argc_argv

struct _starpu_mpi_argc_argv
Data Fields
int initialize_mpi
int * argc
char *** argv
MPI_Comm comm
int fargc

Fortran argc

char ** fargv

Fortran argv

int rank
int world_size

Function Documentation

◆ _starpu_mpi_submit_ready_request()

void _starpu_mpi_submit_ready_request ( void *  arg)

To be called to actually submit the request

◆ _starpu_mpi_release_req_data()

void _starpu_mpi_release_req_data ( struct _starpu_mpi_req req)

To be called when request is completed

◆ _starpu_mpi_coop_send()

void _starpu_mpi_coop_send ( starpu_data_handle_t  data_handle,
struct _starpu_mpi_req req,
enum starpu_data_access_mode  mode,
int  sequential_consistency 
)

Try to merge with send request with other send requests

◆ _starpu_mpi_submit_coop_sends()

void _starpu_mpi_submit_coop_sends ( struct _starpu_mpi_coop_sends coop_sends,
int  submit_control,
int  submit_data 
)

Actually submit the coop_sends bag to MPI. At least one of submit_control or submit_data is true. _starpu_mpi_submit_coop_sends may be called either

  • just once with both parameters being true,
  • or once with submit_control being true (data is not available yet, but we can send control messages), and a second time with submit_data being true. Or the converse, possibly on different threads, etc.

◆ _starpu_mpi_tags_init()

void _starpu_mpi_tags_init ( void  )

To be called at initialization to set up the tags upper bound