1 /* 2 * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2004-2007 The University of Tennessee and The University 4 * of Tennessee Research Foundation. All rights 5 * reserved. 6 * $COPYRIGHT$ 7 * 8 * Additional copyrights may follow 9 * 10 * $HEADER$ 11 */ 12 13 /* $Header: /home/tv/src/mpi/src/mpi_interface.h,v 1.13 2003/03/12 14:03:42 jcownie Exp $ */ 14 /* $Locker: $ */ 15 16 /********************************************************************** 17 * Copyright (C) 2000-2004 by Etnus, LLC 18 * 19 * Permission is hereby granted to use, reproduce, prepare derivative 20 * works, and to redistribute to others. 21 * 22 * DISCLAIMER 23 * 24 * Neither Etnus, nor any of their employees, makes any warranty 25 * express or implied, or assumes any legal liability or 26 * responsibility for the accuracy, completeness, or usefulness of any 27 * information, apparatus, product, or process disclosed, or 28 * represents that its use would not infringe privately owned rights. 29 * 30 * This code was written by 31 * James Cownie: Etnus, LLC. <jcownie@etnus.com> 32 **********************************************************************/ 33 34 /********************************************************************** 35 * Copyright (C) 1999 by Etnus, Inc. 36 * Copyright (C) 1997-1998 Dolphin Interconnect Solutions Inc. 37 * 38 * Permission is hereby granted to use, reproduce, prepare derivative 39 * works, and to redistribute to others. 40 * 41 * DISCLAIMER 42 * 43 * Neither Dolphin Interconnect Solutions, nor any of their employees, 44 * makes any warranty express or implied, or assumes any legal 45 * liability or responsibility for the accuracy, completeness, or 46 * usefulness of any information, apparatus, product, or process 47 * disclosed, or represents that its use would not infringe privately 48 * owned rights. 49 * 50 * This code was written by 51 * James Cownie: Dolphin Interconnect Solutions. <jcownie@dolphinics.com> 52 * And now we're Etnus :- 53 * James Cownie: Etnus LLC <jcownie@etnus.com> 54 **********************************************************************/ 55 56 57 /* Update log 58 * 59 * Aug 5 2002 CLG: Tiny fix to 64 bit taddr_t definition on sun. 60 * Oct 6 2000 JHC: Add all of the MPI-2 relevant types and functions. 61 * This does need a compatibility number change to 62 * ensure new libraries can't get loaded into old debuggers. 63 * New debuggers can continue to use old libraries, though. 64 * New functions under control of FOR_MPI2 65 * Oct 2 2000 JHC: Add the mqs_get_comm_group function to support 66 * partial acquisition. 67 * Mar 21 2000 JHC: Lower the version compatibility again, but add 68 * a new DLL provided call to tell us the width it 69 * believes mqs_taddr_t is. If the DLL doesn't provide this 70 * call, we assume it's old and use the appropriate old width. 71 * This lets us gracefully handle widening the interface on AIX. 72 * Mar 17 2000 JHC: Add FORCE_32BIT_MPI conditional compilation flag. 73 * Mar 3 2000 JHC: Widen the tword_t and taddr_t on AIX, now that IBM 74 * has 64 bit machines. Increment the version compatibility 75 * number on AIX (only) since this is an incompatible change in 76 * the interface. 77 * Oct 1 1998 JHC: Change MQS_INVALID_PROCESS to -1, TV would never generate 78 * the old value anyway. 79 * May 26 1998 JHC: Change interface compatibility, add extra strings in the 80 * mqs_pending_operation. 81 * Apr 23 1998 JHC: Make mqs_tword_t and mqs_taddr_t into 64 bit entities on 82 * SGI. Expand the comment above their definition. 83 * Mar 9 1998 JHC: Added mqs_sizeof_ft. Of course we always needed this ! 84 * Nov 6 1997 JHC: Worked over somewhat to keep John happy :-) 85 * Oct 27 1997 James Cownie <jcownie@dolphinics.com>: Created. 86 */ 87 88 /*********************************************************************** 89 * This header file defines the interface between a debugger and a 90 * dynamically loaded library use to implement access to MPI message 91 * queues. 92 * 93 * The interface is specified at the C level, to avoid C++ compiler issues. 94 * 95 * The interface allows code in the DLL to 96 * 1) find named types from the debugger's type system and look up fields in them 97 * 2) find the address of named external variables 98 * 3) access objects at absolute addresses in the target process. 99 * 4) convert objects from target format to host format. 100 * 101 * A number of different objects are passed backwards and forwards 102 * between the debugger and the DLL :- 103 * 104 * executable images 105 * processes 106 * communicators 107 * 108 * Many of these are opaque to the DLL, in such cases they will be 109 * defined in the interface as pointers to opaque structures, since 110 * this provides type checking while maintaining information hiding. 111 * 112 * All named entities in here start with the prefix "mqs_" (for 113 * Message Queue Support), all the debugger callbacks are made via 114 * callback tables, so the real (linkage) names of the functions are 115 * not visible to the DLL. 116 */ 117 118 #ifndef _MPI_INTERFACE_INCLUDED 119 #define _MPI_INTERFACE_INCLUDED 120 121 #include "ompi_config.h" 122 #include <stdio.h> /* For FILENAME_MAX */ 123 124 /* No MPI2 support yet */ 125 #define FOR_MPI2 0 126 127 BEGIN_C_DECLS 128 129 /*********************************************************************** 130 * Version of the interface this header represents 131 */ 132 enum 133 { 134 #if (FOR_MPI2) 135 MQS_INTERFACE_COMPATIBILITY = 3 /* Has MPI-2 functions */ 136 #else 137 MQS_INTERFACE_COMPATIBILITY = 2 138 #endif 139 }; 140 141 /*********************************************************************** 142 * type definitions. 143 */ 144 145 /* Opaque types are used here to provide a degree of type checking 146 * through the prototypes of the interface functions. 147 * 148 * Only pointers to these types are ever passed across the interface. 149 * Internally to the debugger, or the DLL you should immediately cast 150 * these pointers to pointers to the concrete types that you actually 151 * want to use. 152 * 153 * (An alternative would be to use void * for all of these arguments, 154 * but that would remove a useful degree of type checking, assuming 155 * that you are thinking while typing the casts :-) 156 */ 157 158 /* Types which will be (cast to) concrete types in the DLL */ 159 typedef struct _mqs_image_info mqs_image_info; 160 typedef struct _mqs_process_info mqs_process_info; 161 #if (FOR_MPI2) 162 typedef struct _mqs_job_info mqs_job_info; 163 #endif 164 165 /* Types which will be (cast to) concrete types in the debugger */ 166 typedef struct mqs_image_ mqs_image; 167 #if (FOR_MPI2) 168 typedef struct mqs_job_ mqs_job; 169 #endif 170 typedef struct mqs_process_ mqs_process; 171 typedef struct mqs_type_ mqs_type; 172 173 /* *** BEWARE *** 174 * On machines with two pointer lengths (such as SGI -n32, -64 compilations, 175 * and AIX and Solaris soon), it is quite likely that TotalView and the DLL 176 * will have been compiled with the 32 bit model, *but* will need to debug 177 * code compiled with the 64 bit one. The mqs_taddr_t and mqs_tword_t need 178 * to be a type which even when compiled with the 32 bit model compiler can 179 * hold the longer (64 bit) pointer. 180 * 181 * You may need to add your host to this #if, if you have a machine with 182 * two compilation models. 183 * *** END BEWARE *** 184 * 185 * It would be better not to have this target dependence in the 186 * interface, but it is unreasonable to require a 64 bit interface on 187 * 32 bit machines, and we need the 64 bit interface in some places. 188 */ 189 190 #if !defined (FORCE_32BIT_MPI) && (defined (__sgi) || defined (__hpux) || defined (_AIX) || defined(__sun)) 191 typedef unsigned long long mqs_taddr_t; /* Something long enough for a target address */ 192 typedef long long mqs_tword_t; /* Something long enough for a word */ 193 #else 194 typedef unsigned long mqs_taddr_t; /* Something long enough for a target address */ 195 typedef long mqs_tword_t; /* Something long enough for a word */ 196 #endif 197 198 /*********************************************************************** 199 * Defined structures which form part of the interface. 200 */ 201 202 /* A structure for (target) architectural information */ 203 typedef struct 204 { 205 int short_size; /* sizeof (short) */ 206 int int_size; /* sizeof (int) */ 207 int long_size; /* sizeof (long) */ 208 int long_long_size; /* sizeof (long long) */ 209 int pointer_size; /* sizeof (void *) */ 210 int bool_size; /* sizeof(bool) */ 211 int size_t_size; /* sizeof(size_t) */ 212 } mqs_target_type_sizes; 213 214 /* Result codes. 215 * mqs_ok is returned for success. 216 * Anything else implies a failure of some sort. 217 * 218 * Most of the functions actually return one of these, however to avoid 219 * any potential issues with different compilers implementing enums as 220 * different sized objects, we actually use int as the result type. 221 * 222 * Note that both the DLL and the debugger will use values starting at 223 * mqs_first_user_code, since you always know which side you were calling, 224 * this shouldn't be a problem. 225 * 226 * See below for functions to convert codes to strings. 227 */ 228 enum { 229 mqs_ok = 0, 230 mqs_no_information, 231 mqs_end_of_list, 232 mqs_first_user_code = 100 /* Allow for more pre-defines */ 233 }; 234 235 #if (FOR_MPI2) 236 /* For handling attachment to new processes in MPI-2 we need to know 237 * where they are. 238 */ 239 typedef struct mqs_process_location { 240 long pid; 241 char image_name [FILENAME_MAX]; 242 char host_name [64]; 243 } mqs_process_location; 244 #endif 245 246 /* Languages */ 247 typedef enum { 248 mqs_lang_c = 'c', 249 mqs_lang_cplus = 'C', 250 mqs_lang_f77 = 'f', 251 mqs_lang_f90 = 'F' 252 } mqs_lang_code; 253 254 /* Which queue are we interested in ? */ 255 typedef enum 256 { 257 mqs_pending_sends, 258 mqs_pending_receives, 259 mqs_unexpected_messages 260 } mqs_op_class; 261 262 /* A value to represent an invalid process index. */ 263 enum 264 { 265 MQS_INVALID_PROCESS = -1 266 }; 267 268 enum mqs_status 269 { 270 mqs_st_pending, mqs_st_matched, mqs_st_complete 271 }; 272 273 /* Additional error codes and error string conversion. */ 274 enum { 275 err_silent_failure = mqs_first_user_code, 276 277 err_no_current_communicator, 278 err_bad_request, 279 err_no_store, 280 281 err_failed_qhdr, 282 err_unexpected, 283 err_posted, 284 285 err_failed_queue, 286 err_first, 287 288 err_context_id, 289 err_tag, 290 err_tagmask, 291 err_lsrc, 292 err_srcmask, 293 err_next, 294 err_ptr, 295 296 err_missing_type, 297 err_missing_symbol, 298 299 err_db_shandle, 300 err_db_comm, 301 err_db_target, 302 err_db_tag, 303 err_db_data, 304 err_db_byte_length, 305 err_db_next, 306 307 err_failed_rhandle, 308 err_is_complete, 309 err_buf, 310 err_len, 311 err_s, 312 313 err_failed_status, 314 err_count, 315 err_MPI_SOURCE, 316 err_MPI_TAG, 317 318 err_failed_commlist, 319 err_sequence_number, 320 err_comm_first, 321 322 err_failed_communicator, 323 err_lrank_to_grank, 324 err_send_context, 325 err_recv_context, 326 err_comm_next, 327 err_comm_name, 328 329 err_all_communicators, 330 err_mpid_sends, 331 err_mpid_recvs, 332 err_group_corrupt 333 }; 334 335 /* A structure to represent a communicator */ 336 typedef struct 337 { 338 mqs_taddr_t unique_id; /* A unique tag for the communicator */ 339 mqs_tword_t local_rank; /* The rank of this process Comm_rank */ 340 mqs_tword_t size; /* Comm_size */ 341 char name[64]; /* the name if it has one */ 342 } mqs_communicator; 343 344 /* 345 * We currently assume that all messages are flattened into contiguous buffers. 346 * This is potentially incorrect, but let's leave that complication for a while. 347 */ 348 349 typedef struct 350 { 351 /* Fields for all messages */ 352 int status; /* Status of the message (really enum mqs_status) */ 353 mqs_tword_t desired_local_rank; /* Rank of target/source -1 for ANY */ 354 mqs_tword_t desired_global_rank; /* As above but in COMM_WORLD */ 355 int tag_wild; /* Flag for wildcard receive */ 356 mqs_tword_t desired_tag; /* Only if !tag_wild */ 357 mqs_tword_t desired_length; /* Length of the message buffer */ 358 int system_buffer; /* Is it a system or user buffer ? */ 359 mqs_taddr_t buffer; /* Where data is */ 360 361 /* Fields valid if status >= matched or it's a send */ 362 mqs_tword_t actual_local_rank; /* Actual local rank */ 363 mqs_tword_t actual_global_rank; /* As above but in COMM_WORLD */ 364 mqs_tword_t actual_tag; 365 mqs_tword_t actual_length; 366 367 /* Additional strings which can be filled in if the DLL has more 368 * info. (Uninterpreted by the debugger, simply displayed to the 369 * user). 370 * 371 * Can be used to give the name of the function causing this request, 372 * for instance. 373 * 374 * Up to five lines each of 64 characters. 375 */ 376 char extra_text[5][64]; 377 } mqs_pending_operation; 378 379 /*********************************************************************** 380 * Callbacks from the DLL into the debugger. 381 *********************************************************************** 382 * These are all made via a table of function pointers. 383 */ 384 385 /* Hang information on the image */ 386 typedef void (*mqs_put_image_info_ft) (mqs_image *, mqs_image_info *); 387 /* Get it back */ 388 typedef mqs_image_info * (*mqs_get_image_info_ft) (mqs_image *); 389 390 #if (FOR_MPI2) 391 /* Given a job and an index return the process object */ 392 typedef mqs_process * (*mqs_get_process_ft) (mqs_job *, int); 393 394 /* Hang information on the job */ 395 typedef void (*mqs_put_job_info_ft) (mqs_job *, mqs_job_info *); 396 /* Get it back */ 397 typedef mqs_job_info * (*mqs_get_job_info_ft) (mqs_job *); 398 #endif 399 400 /* Given a process return the image it is an instance of */ 401 typedef mqs_image * (*mqs_get_image_ft) (mqs_process *); 402 403 /* Given a process return its rank in comm_world */ 404 typedef int (*mqs_get_global_rank_ft) (mqs_process *); 405 406 /* Given an image look up the specified function */ 407 typedef int (*mqs_find_function_ft) (mqs_image *, char *, mqs_lang_code, mqs_taddr_t * ); 408 409 /* Given an image look up the specified symbol */ 410 typedef int (*mqs_find_symbol_ft) (mqs_image *, char *, mqs_taddr_t * ); 411 412 /* Hang information on the process */ 413 typedef void (*mqs_put_process_info_ft) (mqs_process *, mqs_process_info *); 414 /* Get it back */ 415 typedef mqs_process_info * (*mqs_get_process_info_ft) (mqs_process *); 416 417 #if (FOR_MPI2) 418 /* Given a process, return the job it belongs to */ 419 typedef mqs_job * (*mqs_get_process_job_ft) (mqs_process *); 420 /* Given a process, return its identity (index in the job's universe of processes) */ 421 typedef int (*mqs_get_process_identity_ft) (mqs_job *); 422 #endif 423 424 /* Allocate store */ 425 typedef void * (*mqs_malloc_ft) (size_t); 426 /* Free it again */ 427 typedef void (*mqs_free_ft) (void *); 428 429 /*********************************************************************** 430 * Type access functions 431 */ 432 433 /* Given an executable image look up a named type in it. 434 * Returns a type handle, or the null pointer if the type could not be 435 * found. Since the debugger may load debug information lazily, the 436 * MPI run time library should ensure that the type definitions 437 * required occur in a file whose debug information will already have 438 * been loaded, for instance by placing them in the same file as the 439 * startup breakpoint function. 440 */ 441 typedef mqs_type * (*mqs_find_type_ft)(mqs_image *, char *, mqs_lang_code); 442 443 /* Given the handle for a type (assumed to be a structure) return the 444 * byte offset of the named field. If the field cannot be found 445 * the result will be -1. 446 */ 447 typedef int (*mqs_field_offset_ft) (mqs_type *, char *); 448 449 /* Given the handle for a type return the size of the type in bytes. 450 * (Just like sizeof ()) 451 */ 452 typedef int (*mqs_sizeof_ft) (mqs_type *); 453 454 /* Fill in the sizes of target types for this process */ 455 typedef void (*mqs_get_type_sizes_ft) (mqs_process *, mqs_target_type_sizes *); 456 457 /*********************************************************************** 458 * Target store access functions 459 */ 460 461 /* Fetch data from the process into a buffer into a specified buffer. 462 * N.B. 463 * The data is the same as that in the target process when accessed 464 * as a byte array. You *must* use mqs_target_to_host to do any 465 * necessary byte flipping if you want to look at it at larger 466 * granularity. 467 */ 468 typedef int (*mqs_fetch_data_ft) (mqs_process *, mqs_taddr_t, int, void *); 469 470 /* Convert data into host format */ 471 typedef void (*mqs_target_to_host_ft) (mqs_process *, const void *, void *, int); 472 473 /*********************************************************************** 474 * Miscellaneous functions. 475 */ 476 /* Print a message (intended for debugging use *ONLY*). */ 477 typedef void (*mqs_dprints_ft) (const char *); 478 /* Convert an error code from the debugger into an error message */ 479 typedef char * (*mqs_errorstring_ft) (int); 480 481 /*********************************************************************** 482 * Call back tables 483 */ 484 typedef struct mqs_basic_callbacks 485 { 486 mqs_malloc_ft mqs_malloc_fp; 487 mqs_free_ft mqs_free_fp; 488 mqs_dprints_ft mqs_dprints_fp; 489 mqs_errorstring_ft mqs_errorstring_fp; 490 mqs_put_image_info_ft mqs_put_image_info_fp; 491 mqs_get_image_info_ft mqs_get_image_info_fp; 492 mqs_put_process_info_ft mqs_put_process_info_fp; 493 mqs_get_process_info_ft mqs_get_process_info_fp; 494 #if (FOR_MPI2) 495 mqs_put_job_info_ft mqs_put_job_info_fp; 496 mqs_get_job_info_ft mqs_get_job_info_fp; 497 #endif 498 } mqs_basic_callbacks; 499 500 #if (FOR_MPI2) 501 typedef struct mqs_job_callbacks { 502 mqs_get_process_ft mqs_get_process_fp; 503 } mqs_job_callbacks; 504 #endif 505 506 typedef struct mqs_image_callbacks 507 { 508 mqs_get_type_sizes_ft mqs_get_type_sizes_fp; 509 mqs_find_function_ft mqs_find_function_fp; 510 mqs_find_symbol_ft mqs_find_symbol_fp; 511 mqs_find_type_ft mqs_find_type_fp; 512 mqs_field_offset_ft mqs_field_offset_fp; 513 mqs_sizeof_ft mqs_sizeof_fp; 514 } mqs_image_callbacks; 515 516 typedef struct mqs_process_callbacks 517 { 518 mqs_get_global_rank_ft mqs_get_global_rank_fp; 519 mqs_get_image_ft mqs_get_image_fp; 520 mqs_fetch_data_ft mqs_fetch_data_fp; 521 mqs_target_to_host_ft mqs_target_to_host_fp; 522 #if (FOR_MPI2) 523 mqs_get_process_job_ft mqs_get_process_job_fp; 524 mqs_get_process_identity_ft mqs_get_process_identity_fp; 525 #endif 526 } mqs_process_callbacks; 527 528 /*********************************************************************** 529 * Calls from the debugger into the DLL. 530 ***********************************************************************/ 531 532 /* Provide the library with the pointers to the the debugger functions 533 * it needs The DLL need only save the pointer, the debugger promises 534 * to maintain the table of functions valid for as long as 535 * needed. (The table remains the property of the debugger, and should 536 * not be messed with, or deallocated by the DLL). This applies to 537 * all of the callback tables. 538 */ 539 OMPI_DECLSPEC extern void mqs_setup_basic_callbacks (const mqs_basic_callbacks *); 540 541 /* Version handling */ 542 OMPI_DECLSPEC extern char *mqs_version_string (void); 543 OMPI_DECLSPEC extern int mqs_version_compatibility(void); 544 /* This gives the width which has been compiled into the DLL, it is 545 * _not_ the width of a specific process, which could be smaller than 546 * this. 547 */ 548 OMPI_DECLSPEC extern int mqs_dll_taddr_width(void); 549 550 /* Provide a text string for an error value */ 551 OMPI_DECLSPEC extern char * mqs_dll_error_string (int); 552 553 /*********************************************************************** 554 * Calls related to an executable image. 555 */ 556 557 /* Setup debug information for a specific image, this must save 558 * the callbacks (probably in the mqs_image_info), and use those 559 * functions for accessing this image. 560 * 561 * The DLL should use the mqs_put_image_info and mqs_get_image_info functions 562 * to associate whatever information it wants to keep with the image. 563 * (For instance all of the type offsets it needs could be kept here). 564 * the debugger will call mqs_destroy_image_info when it no longer wants to 565 * keep information about the given executable. 566 * 567 * This will be called once for each executable image in the parallel 568 * program. 569 */ 570 OMPI_DECLSPEC extern int mqs_setup_image (mqs_image *, const mqs_image_callbacks *); 571 572 /* Does this image have the necessary symbols to allow access to the message 573 * queues ? 574 * 575 * This function will be called once for each image, and the information 576 * cached inside the debugger. 577 * 578 * Returns an error enumeration to show whether the image has queues 579 * or not, and an error string to be used in a pop-up complaint to the 580 * user, as if in printf (error_string, name_of_image); 581 * 582 * The pop-up display is independent of the result. (So you can silently 583 * disable things, or loudly enable them). 584 */ 585 586 OMPI_DECLSPEC extern int mqs_image_has_queues (mqs_image *, char **); 587 588 /* This will be called by the debugger to let you tidy up whatever is 589 * required when the mqs_image_info is no longer needed. 590 */ 591 OMPI_DECLSPEC extern void mqs_destroy_image_info (mqs_image_info *); 592 593 #if (FOR_MPI2) 594 /*********************************************************************** 595 * Calls related to a specific job, which owns a universe of processes. 596 */ 597 extern int mqs_setup_job (mqs_job *, const mqs_job_callbacks *); 598 extern int mqs_destroy_job_info (mqs_job_info *); 599 #endif 600 601 /*********************************************************************** 602 * Calls related to a specific process. These will only be called if the 603 * image which this is an instance of passes the has_message_queues tests. 604 * 605 * If you can't tell whether the process will have valid message queues 606 * just by looking at the image, then you should return mqs_ok from 607 * mqs_image_has_queues and let mqs_process_has_queues handle it. 608 */ 609 610 /* Set up whatever process specific information we need. 611 * For instance addresses of global variables should be handled here, 612 * rather than in the image information if anything is a dynamic library 613 * which could end up mapped differently in different processes. 614 */ 615 OMPI_DECLSPEC extern int mqs_setup_process (mqs_process *, const mqs_process_callbacks *); 616 OMPI_DECLSPEC extern void mqs_destroy_process_info (mqs_process_info *); 617 618 /* Like the mqs_has_message_queues function, but will only be called 619 * if the image claims to have message queues. This lets you actually 620 * delve inside the process to look at variables before deciding if 621 * the process really can support message queue extraction. 622 */ 623 OMPI_DECLSPEC extern int mqs_process_has_queues (mqs_process *, char **); 624 625 /*********************************************************************** 626 * The functions which actually extract the information we need ! 627 * 628 * The model here is that the debugger calls down to the library to initialise 629 * an iteration over a specific class of things, and then keeps calling 630 * the "next" function until it returns mqs_false. 631 * 632 * For communicators we separate stepping from extracting information, 633 * because we want to use the state of the communicator iterator to qualify 634 * the selections of the operation iterator. 635 * 636 * Whenever mqs_true is returned the description has been updated, 637 * mqs_false means there is no more information to return, and 638 * therefore the description contains no useful information. 639 * 640 * We will only have one of each type of iteration running at once, so 641 * the library should save the iteration state in the 642 * mqs_process_info. 643 */ 644 645 646 /* Check that the DLL's model of the communicators in the process is 647 * up to date, ideally by checking the sequence number. 648 */ 649 OMPI_DECLSPEC extern int mqs_update_communicator_list (mqs_process *); 650 651 /* Prepare to iterate over all of the communicators in the process. */ 652 OMPI_DECLSPEC extern int mqs_setup_communicator_iterator (mqs_process *); 653 654 /* Extract information about the current communicator */ 655 OMPI_DECLSPEC extern int mqs_get_communicator (mqs_process *, mqs_communicator *); 656 657 /* Extract the group from the current communicator. 658 * The debugger already knows comm_size, so can allocate a 659 * suitably sized array for the result. The result is the 660 * rank in COMM_WORLD of the index'th element in the current 661 * communicator. 662 */ 663 OMPI_DECLSPEC extern int mqs_get_comm_group (mqs_process *, int *); 664 665 /* Move on to the next communicator in this process. */ 666 OMPI_DECLSPEC extern int mqs_next_communicator (mqs_process *); 667 668 /* Prepare to iterate over the pending operations in the currently 669 * active communicator in this process. 670 * 671 * The int is *really* mqs_op_class 672 */ 673 OMPI_DECLSPEC extern int mqs_setup_operation_iterator (mqs_process *, int); 674 675 /* Return information about the next appropriate pending operation in 676 * the current communicator, mqs_false when we've seen them all. 677 */ 678 OMPI_DECLSPEC extern int mqs_next_operation (mqs_process *, mqs_pending_operation *); 679 680 #if (FOR_MPI2) 681 /* Information about newly created (or connected to) processes. 682 * This is how we pick up processes created with MPI_Spawn (and friends), 683 * or attached to with MPI_Comm_connect or MPI_Comm_join. 684 */ 685 extern int mqs_setup_new_process_iterator (mqs_process *); 686 extern int mqs_next_new_process (mqs_process *, mqs_process_location *); 687 688 /* Once the debugger has attached to a newly created process it will 689 * set it up in the normal way, and then set its identity. 690 */ 691 extern int mqs_set_process_identity (mqs_process *, int); 692 #endif 693 694 END_C_DECLS 695 696 #endif /* defined (_MPI_INTERFACE_INCLUDED) */