int ompi_fetch_opal_pointer_array_item(mqs_process *proc, mqs_taddr_t addr, mpi_process_info *p_info, int index, mqs_taddr_t *item) { mqs_image *image = mqs_get_image(proc); mpi_image_info *i_info = (mpi_image_info *) mqs_get_image_info(image); int size, lowest_free, number_free; mqs_taddr_t base; if (index < 0) { return mqs_no_information; } ompi_fetch_opal_pointer_array_info(proc, addr, p_info, &size, &lowest_free, &number_free); if (index >= size) { return mqs_no_information; } base = ompi_fetch_pointer(proc, addr + i_info->opal_pointer_array_t.offset.addr, p_info); *item = ompi_fetch_pointer(proc, base + index * p_info->sizes.pointer_size, p_info); return mqs_ok; }
int ompi_fetch_opal_pointer_array_info(mqs_process *proc, mqs_taddr_t addr, mpi_process_info *p_info, int *size, int *lowest_free, int *number_free) { mqs_image *image = mqs_get_image(proc); mpi_image_info *i_info = (mpi_image_info *) mqs_get_image_info(image); *size = ompi_fetch_int(proc, addr + i_info->opal_pointer_array_t.offset.size, p_info); *lowest_free = ompi_fetch_int(proc, addr + i_info->opal_pointer_array_t.offset.lowest_free, p_info); *number_free = ompi_fetch_int(proc, addr + i_info->opal_pointer_array_t.offset.number_free, p_info); return mqs_ok; }
/* Setup information needed for a specific process. The debugger * assumes that this will hang something onto the process, if nothing * is attached to it, then TV will believe that this process has no * message queue information. */ int mpidbg_init_per_process(mqs_process *process, const mqs_process_callbacks *pcb, struct mpidbg_handle_info_t *handle_types) { mqs_image *image; mpi_image_info *i_info; /* Extract the addresses of the global variables we need and save them away */ mpi_process_info *p_info = (mpi_process_info *) mqs_malloc(sizeof(mpi_process_info)); printf("mpidbg_init_per_process\n"); if (NULL == p_info) { return MPIDBG_ERR_NO_MEM; } /* Setup the callbacks first */ p_info->process_callbacks = pcb; /* Nothing extra (yet) */ p_info->extra = NULL; /* Now we can get the rest of the info */ image = mqs_get_image(process); i_info = (mpi_image_info *) mqs_get_image_info(image); /* Get process info sizes */ mqs_get_type_sizes (process, &p_info->sizes); /* Save the info */ mqs_put_process_info(process, (mqs_process_info *) p_info); /* Fill in pre-defined MPI handle name mappings (because OMPI uses #define's for the pre-defined names, such as "#define MPI_COMM_WORLD &ompi_mpi_comm_world"). */ /* Communicators */ mpidbg_comm_name_map = alloc_map(image, 4); if (NULL != mpidbg_comm_name_map) { int i = 0; fill_map(image, "MPI_COMM_WORLD", "ompi_mpi_comm_world", &mpidbg_comm_name_map[i++]); fill_map(image, "MPI_COMM_SELF", "ompi_mpi_comm_self", &mpidbg_comm_name_map[i++]); fill_map(image, "MPI_COMM_NULL", "ompi_mpi_comm_null", &mpidbg_comm_name_map[i++]); /* Sentinel value */ mpidbg_comm_name_map[i].map_name = NULL; } /* Error handlers */ mpidbg_errhandler_name_map = alloc_map(image, 4); if (NULL != mpidbg_errhandler_name_map) { int i = 0; fill_map(image, "MPI_ERRORS_ARE_FATAL", "ompi_mpi_errors_are_fatal", &mpidbg_errhandler_name_map[i++]); fill_map(image, "MPI_ERRORS_RETURN", "ompi_mpi_errors_return", &mpidbg_errhandler_name_map[i++]); fill_map(image, "MPI_ERRHANDLER_NULL", "ompi_mpi_errhandler_null", &mpidbg_errhandler_name_map[i++]); /* MPI::ERRORS_THROW_EXCEPTIONS exists as a symbol in OMPI; no need to alias it here */ /* Sentinel value */ mpidbg_errhandler_name_map[i].map_name = NULL; } /* Requests */ mpidbg_request_name_map = alloc_map(image, 2); if (NULL != mpidbg_request_name_map) { int i = 0; fill_map(image, "MPI_REQUEST_NULL", "ompi_request_null", &mpidbg_request_name_map[i++]); /* Sentinel value */ mpidbg_request_name_map[i].map_name = NULL; } /* Statuses */ mpidbg_status_name_map = alloc_map(image, 2); if (NULL != mpidbg_status_name_map) { int i = 0; fill_map(image, "MPI_STATUS_IGNORE", NULL, &mpidbg_status_name_map[i++]); /* Sentinel value */ mpidbg_status_name_map[i].map_name = NULL; } /* All done */ return MPIDBG_SUCCESS; }