openmpi  3.1.6
About: Open MPI is a high performance Message Passing Interface (MPI) library project combining technologies and resources from several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI library available. 3.x series.
  Fossies Dox: openmpi-3.1.6.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ompi_msgq_dll.c File Reference
#include "ompi_config.h"
#include <string.h>
#include <stdlib.h>
#include "ompi/group/group_dbg.h"
#include "ompi/request/request_dbg.h"
#include "ompi/mca/pml/base/pml_base_request_dbg.h"
#include "mpi.h"
#include "msgq_interface.h"
#include "ompi_msgq_dll_defs.h"
Include dependency graph for ompi_msgq_dll.c:

Go to the source code of this file.


#define NULL   ((void *)0)
 Copyright (C) 2000-2004 by Etnus, LLC. More...
#define TRUE   (0==0)
#define FALSE   (0==1)
#define concat(a, b)   a##b
#define stringize(a)   #a
#define OPAL_ALIGN(x, a, t)   (((x)+((t)(a)-1)) & ~(((t)(a)-1)))
#define VERBOSE_GENERAL   0x00000001
 The internal debugging interface. More...
#define VERBOSE_GROUP   0x00000002
#define VERBOSE_COMM   0x00000004
#define VERBOSE_LISTS   0x00000008
#define VERBOSE_REQ   0x00000010
#define VERBOSE_REQ_DUMP   0x00000020
#define VERBOSE   0x00000000


void mqs_setup_basic_callbacks (const mqs_basic_callbacks *cb)
 Calls from the debugger into the DLL. More...
int mqs_version_compatibility (void)
char * mqs_version_string (void)
int mqs_dll_taddr_width (void)
static int translate (group_t *this, int index)
static group_tfind_or_create_group (mqs_process *proc, mqs_taddr_t group_base)
static void group_decref (group_t *group)
int mqs_setup_image (mqs_image *image, const mqs_image_callbacks *icb)
 Perform basic setup for the image, we just allocate and clear our info. More...
int mqs_image_has_queues (mqs_image *image, char **message)
 Check for all the information we require to access the Open MPI message queues. More...
int mqs_setup_process (mqs_process *process, const mqs_process_callbacks *pcb)
 Setup information needed for a specific process. More...
int mqs_process_has_queues (mqs_process *proc, char **msg)
 Check the process for message queues. More...
static int communicators_changed (mqs_process *proc)
 Check if the communicators have changed by looking at the pointer array values for lowest_free and number_free. More...
static communicator_tfind_communicator (mpi_process_info *p_info, int recv_ctx)
 Find a matching communicator on our list. More...
static int compare_comms (const void *a, const void *b)
 Comparison function for sorting communicators. More...
static int rebuild_communicator_list (mqs_process *proc)
 Rebuild our list of communicators because something has changed. More...
int mqs_update_communicator_list (mqs_process *proc)
 Update the list of communicators in the process if it has changed. More...
int mqs_setup_communicator_iterator (mqs_process *proc)
 Setup to iterate over communicators. More...
int mqs_get_communicator (mqs_process *proc, mqs_communicator *comm)
 Fetch information about the current communicator. More...
int mqs_get_comm_group (mqs_process *proc, int *group_members)
 Get the group information about the current communicator. More...
int mqs_next_communicator (mqs_process *proc)
 Step to the next communicator. More...
static int opal_list_t_init_parser (mqs_process *proc, mpi_process_info *p_info, mqs_opal_list_t_pos *position, mqs_taddr_t list)
 Parsing the opal_list_t. More...
static int next_item_opal_list_t (mqs_process *proc, mpi_process_info *p_info, mqs_opal_list_t_pos *position, mqs_taddr_t *active_item)
static int opal_free_list_t_init_parser (mqs_process *proc, mpi_process_info *p_info, mqs_opal_free_list_t_pos *position, mqs_taddr_t free_list)
static int opal_free_list_t_next_item (mqs_process *proc, mpi_process_info *p_info, mqs_opal_free_list_t_pos *position, mqs_taddr_t *active_item)
 Return the current position and move the internal counter to the next element. More...
static void dump_request (mqs_taddr_t current_item, mqs_pending_operation *res)
static int fetch_request (mqs_process *proc, mpi_process_info *p_info, mqs_pending_operation *res, int look_for_user_buffer)
 Handle the send queue as well as the receive queue. More...
int mqs_setup_operation_iterator (mqs_process *proc, int op)
 Setup to iterate over pending operations. More...
int mqs_next_operation (mqs_process *proc, mqs_pending_operation *op)
 Fetch the next valid operation. More...
void mqs_destroy_process_info (mqs_process_info *mp_info)
 Destroy the info. More...
void mqs_destroy_image_info (mqs_image_info *info)
 Free off the data we associated with an image. More...
char * mqs_dll_error_string (int errcode)


static char mqs_version_str [256]

Macro Definition Documentation

◆ concat

#define concat (   a,
)    a##b

Definition at line 150 of file ompi_msgq_dll.c.


#define DEBUG (   LEVEL,

Definition at line 171 of file ompi_msgq_dll.c.


#define FALSE   (0==1)

Definition at line 143 of file ompi_msgq_dll.c.


#define NULL   ((void *)0)

Copyright (C) 2000-2004 by Etnus, LLC.

Copyright (C) 1999 by Etnus, Inc. Copyright (C) 1997-1998 Dolphin Interconnect Solutions Inc.

Permission is hereby granted to use, reproduce, prepare derivative works, and to redistribute to others.


Neither Dolphin Interconnect Solutions, Etnus LLC, nor any of their employees, makes any warranty express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights.

This code was written by James Cownie: Dolphin Interconnect Solutions. Etnus LLC

Definition at line 137 of file ompi_msgq_dll.c.


#define OPAL_ALIGN (   x,
)    (((x)+((t)(a)-1)) & ~(((t)(a)-1)))

Definition at line 154 of file ompi_msgq_dll.c.

◆ stringize

#define stringize (   a)    #a

Definition at line 151 of file ompi_msgq_dll.c.


#define TRUE   (0==0)

Definition at line 140 of file ompi_msgq_dll.c.


#define VERBOSE   0x00000000

Definition at line 166 of file ompi_msgq_dll.c.


#define VERBOSE_COMM   0x00000004

Definition at line 161 of file ompi_msgq_dll.c.


#define VERBOSE_GENERAL   0x00000001

The internal debugging interface.

Definition at line 159 of file ompi_msgq_dll.c.


#define VERBOSE_GROUP   0x00000002

Definition at line 160 of file ompi_msgq_dll.c.


#define VERBOSE_LISTS   0x00000008

Definition at line 162 of file ompi_msgq_dll.c.


#define VERBOSE_REQ   0x00000010

Definition at line 163 of file ompi_msgq_dll.c.


#define VERBOSE_REQ_DUMP   0x00000020

Definition at line 164 of file ompi_msgq_dll.c.

Function Documentation

◆ communicators_changed()

static int communicators_changed ( mqs_process proc)

◆ compare_comms()

static int compare_comms ( const void *  a,
const void *  b 

Comparison function for sorting communicators.

Definition at line 579 of file ompi_msgq_dll.c.

References communicator_t::comm_info, and mqs_communicator::unique_id.

Referenced by rebuild_communicator_list().

◆ dump_request()

◆ fetch_request()

static int fetch_request ( mqs_process proc,
mpi_process_info p_info,
mqs_pending_operation res,
int  look_for_user_buffer 

Handle the send queue as well as the receive queue.

The unexpected queue is a whole different story ...

First retrieve the tag. If the tag is negative and the user didn't request the internal requests information then move along.

There is a trick with the MPI_TAG. All receive requests set it to MPI_ANY_TAG when the request get initialized, and to the real tag once the request is matched.

Definition at line 1073 of file ompi_msgq_dll.c.

References mqs_pending_operation::actual_global_rank, mqs_pending_operation::actual_length, mqs_pending_operation::actual_local_rank, mqs_pending_operation::actual_tag, mqs_pending_operation::buffer, communicator_t::comm_ptr, mpi_process_info_extra::current_communicator, DEBUG, mqs_pending_operation::desired_global_rank, mqs_pending_operation::desired_length, mqs_pending_operation::desired_local_rank, mqs_pending_operation::desired_tag, dump_request(), mpi_process_info::extra, mqs_pending_operation::extra_text, FALSE, communicator_t::group, mpi_image_info::mca_pml_base_recv_request_t, mpi_image_info::mca_pml_base_request_t, mpi_image_info::mca_pml_base_send_request_t, MCA_PML_REQUEST_RECV, MCA_PML_REQUEST_SEND, mqs_end_of_list, mqs_fetch_data, mqs_get_image, mqs_get_image_info, mqs_ok, mqs_st_complete, mqs_st_matched, mqs_st_pending, mpi_process_info_extra::next_msg, mpi_image_info::offset, mpi_image_info::ompi_datatype_t, ompi_fetch_bool(), ompi_fetch_int(), ompi_fetch_pointer(), ompi_fetch_size_t(), OMPI_REQUEST_INVALID, OMPI_REQUEST_PML, mpi_image_info::ompi_request_t, mpi_image_info::ompi_status_public_t, opal_free_list_t_next_item(), mpi_process_info_extra::show_internal_requests, snprintf, mqs_pending_operation::status, mqs_pending_operation::system_buffer, mqs_pending_operation::tag_wild, translate(), TRUE, and VERBOSE_REQ.

Referenced by mqs_next_operation().

◆ find_communicator()

static communicator_t* find_communicator ( mpi_process_info p_info,
int  recv_ctx 

Find a matching communicator on our list.

We check the recv context as well as the address since the communicator structures may be being re-allocated from a free list, in which case the same address will be re-used a lot, which could confuse us.

Definition at line 562 of file ompi_msgq_dll.c.

References mpi_process_info_extra::communicator_list, mpi_process_info::extra, and NULL.

Referenced by rebuild_communicator_list().

◆ find_or_create_group()

static group_t* find_or_create_group ( mqs_process proc,
mqs_taddr_t  group_base 

Now convert the process representation into the local representation. We will endup with an array of Open MPI internal pointers to proc structure. By comparing this pointers to the MPI_COMM_WORLD group we can figure out the global rank in the MPI_COMM_WORLD of the process.

Note that this only works for dense groups. Someday we may support more than dense groups, but that's what we've got for today.

Definition at line 227 of file ompi_msgq_dll.c.

References mpi_process_info_extra::communicator_list, DEBUG, mpi_process_info::extra, communicator_t::group, group(), mqs_fetch_data, mqs_free, mqs_get_image, mqs_get_image_info, mqs_get_process_info, mqs_malloc, mqs_ok, mqs_target_to_host, communicator_t::next, NULL, mpi_image_info::offset, ompi_fetch_int(), ompi_fetch_pointer(), OMPI_GROUP_DENSE, mpi_image_info::ompi_group_t, mqs_target_type_sizes::pointer_size, mpi_process_info::sizes, value, VERBOSE_COMM, VERBOSE_GROUP, mpi_process_info_extra::world_proc_array, and mpi_process_info_extra::world_proc_array_entries.

Referenced by rebuild_communicator_list().

◆ group_decref()

static void group_decref ( group_t group)

Definition at line 337 of file ompi_msgq_dll.c.

References DEBUG, group(), mqs_free, and VERBOSE_GROUP.

Referenced by mqs_destroy_process_info(), and rebuild_communicator_list().

◆ mqs_destroy_image_info()

void mqs_destroy_image_info ( mqs_image_info info)

Free off the data we associated with an image.

Since we malloced it we just free it.

Definition at line 1319 of file ompi_msgq_dll.c.

References info, and mqs_free.

◆ mqs_destroy_process_info()

void mqs_destroy_process_info ( mqs_process_info mp_info)

◆ mqs_dll_error_string()

◆ mqs_dll_taddr_width()

int mqs_dll_taddr_width ( void  )

Definition at line 204 of file ompi_msgq_dll.c.

◆ mqs_get_comm_group()

int mqs_get_comm_group ( mqs_process proc,
int *  group_members 

◆ mqs_get_communicator()

◆ mqs_image_has_queues()

int mqs_image_has_queues ( mqs_image image,
char **  message 

Check for all the information we require to access the Open MPI message queues.

Stash it into our structure on the image if we're successful.

Definition at line 374 of file ompi_msgq_dll.c.

References err_silent_failure, mpi_image_info::extra, mqs_find_function, mqs_find_symbol, mqs_get_image_info, mqs_lang_c, mqs_ok, NULL, and ompi_fill_in_type_info().

◆ mqs_next_communicator()

int mqs_next_communicator ( mqs_process proc)

◆ mqs_next_operation()

int mqs_next_operation ( mqs_process proc,
mqs_pending_operation op 

Fetch the next valid operation.

Since Open MPI only maintains a single queue of each type of operation, we have to run over it and filter out the operations which match the active communicator.

Definition at line 1268 of file ompi_msgq_dll.c.

References DEBUG, err_bad_request, mpi_process_info::extra, FALSE, fetch_request(), mqs_get_process_info, mqs_pending_receives, mqs_pending_sends, mqs_unexpected_messages, TRUE, VERBOSE_REQ, and mpi_process_info_extra::what.

◆ mqs_process_has_queues()

◆ mqs_setup_basic_callbacks()

void mqs_setup_basic_callbacks ( const mqs_basic_callbacks cb)

Calls from the debugger into the DLL.

Definition at line 176 of file ompi_msgq_dll.c.

References mqs_basic_entrypoints.

◆ mqs_setup_communicator_iterator()

int mqs_setup_communicator_iterator ( mqs_process proc)

◆ mqs_setup_image()

int mqs_setup_image ( mqs_image image,
const mqs_image_callbacks icb 

Perform basic setup for the image, we just allocate and clear our info.

Calls related to an executable image.

Definition at line 352 of file ompi_msgq_dll.c.

References err_no_store, mqs_malloc, mqs_ok, mqs_put_image_info, and NULL.

◆ mqs_setup_operation_iterator()

◆ mqs_setup_process()

◆ mqs_update_communicator_list()

int mqs_update_communicator_list ( mqs_process proc)

Update the list of communicators in the process if it has changed.

The functions which actually extract the information we need !

Definition at line 748 of file ompi_msgq_dll.c.

References communicators_changed(), mqs_ok, and rebuild_communicator_list().

◆ mqs_version_compatibility()

int mqs_version_compatibility ( void  )

Definition at line 186 of file ompi_msgq_dll.c.


◆ mqs_version_string()

char* mqs_version_string ( void  )

Definition at line 194 of file ompi_msgq_dll.c.

References mqs_version_str, ompi_get_lib_version(), OMPI_MAX_VER_SIZE, and snprintf.

◆ next_item_opal_list_t()

◆ opal_free_list_t_init_parser()

◆ opal_free_list_t_next_item()

static int opal_free_list_t_next_item ( mqs_process proc,
mpi_process_info p_info,
mqs_opal_free_list_t_pos position,
mqs_taddr_t active_item 

◆ opal_list_t_init_parser()

◆ rebuild_communicator_list()

◆ translate()

static int translate ( group_t this,
int  index 

Definition at line 216 of file ompi_msgq_dll.c.


Referenced by fetch_request().

Variable Documentation

◆ mqs_version_str

char mqs_version_str[256]

Definition at line 191 of file ompi_msgq_dll.c.

Referenced by mqs_version_string().