diff --git a/orte/class/orte_bitmap.h b/orte/class/orte_bitmap.h index e932d6e437..bf6bca9818 100644 --- a/orte/class/orte_bitmap.h +++ b/orte/class/orte_bitmap.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -47,6 +47,7 @@ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif + struct orte_bitmap_t { opal_object_t super; /**< Subclass of opal_object_t */ unsigned char *bitmap; /**< The actual bitmap array of characters */ @@ -155,7 +156,7 @@ ORTE_DECLSPEC int orte_bitmap_set_all_bits(orte_bitmap_t *bm); */ static inline int orte_bitmap_size(orte_bitmap_t *bm) { - return (NULL == bm) ? 0 : bm->legal_numbits; + return (NULL == bm) ? 0 : (int)bm->legal_numbits; } #if defined(c_plusplus) || defined(__cplusplus) diff --git a/orte/class/orte_pointer_array.c b/orte/class/orte_pointer_array.c index 738e341936..192540bc68 100644 --- a/orte/class/orte_pointer_array.c +++ b/orte/class/orte_pointer_array.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -94,7 +94,7 @@ int orte_pointer_array_init(orte_pointer_array_t **array, (*array)->size = block_size; } - (*array)->addr = (void *)malloc(num_bytes); + (*array)->addr = (void **)malloc(num_bytes); if (NULL == (*array)->addr) { /* out of memory */ OBJ_RELEASE(*array); return ORTE_ERR_OUT_OF_RESOURCE; @@ -396,7 +396,7 @@ static bool grow_table(orte_pointer_array_t *table) /* Adjust structure counters and pointers */ table->number_free += new_size - table->size; - table->addr = p; + table->addr = (void**)p; for (i = table->size; i < new_size; ++i) { table->addr[i] = NULL; } diff --git a/orte/class/orte_value_array.h b/orte/class/orte_value_array.h index fdb7da1b2e..f797a71274 100644 --- a/orte/class/orte_value_array.h +++ b/orte/class/orte_value_array.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -39,9 +39,6 @@ extern "C" { #endif -ORTE_DECLSPEC extern opal_class_t orte_value_array_t_class; - - struct orte_value_array_t { opal_object_t super; @@ -52,7 +49,7 @@ struct orte_value_array_t }; typedef struct orte_value_array_t orte_value_array_t; - +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_value_array_t); /** * Initialize the array to hold items by value. This routine must diff --git a/orte/dss/dss_arith.c b/orte/dss/dss_arith.c index f32b2b44a4..faa3c2e9b5 100755 --- a/orte/dss/dss_arith.c +++ b/orte/dss/dss_arith.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -61,56 +63,56 @@ int orte_dss_arith(orte_data_value_t *value, orte_data_value_t *operand, orte_ds switch(operand->type) { case ORTE_INT: - orte_dss_arith_int(value->data, operand->data, operation); + orte_dss_arith_int((int*)value->data, (int*)operand->data, operation); break; case ORTE_UINT: - orte_dss_arith_uint(value->data, operand->data, operation); + orte_dss_arith_uint((uint*)value->data, (uint*)operand->data, operation); break; case ORTE_SIZE: - orte_dss_arith_size(value->data, operand->data, operation); + orte_dss_arith_size((size_t*)value->data, (size_t*)operand->data, operation); break; case ORTE_PID: - orte_dss_arith_pid(value->data, operand->data, operation); + orte_dss_arith_pid((pid_t*)value->data, (pid_t*)operand->data, operation); break; case ORTE_BYTE: case ORTE_UINT8: - orte_dss_arith_byte(value->data, operand->data, operation); + orte_dss_arith_byte((uint8_t*)value->data, (uint8_t*)operand->data, operation); break; case ORTE_INT8: - orte_dss_arith_int8(value->data, operand->data, operation); + orte_dss_arith_int8((int8_t*)value->data, (int8_t*)operand->data, operation); break; case ORTE_INT16: - orte_dss_arith_int16(value->data, operand->data, operation); + orte_dss_arith_int16((int16_t*)value->data, (int16_t*)operand->data, operation); break; case ORTE_UINT16: - orte_dss_arith_uint16(value->data, operand->data, operation); + orte_dss_arith_uint16((uint16_t*)value->data, (uint16_t*)operand->data, operation); break; case ORTE_INT32: - orte_dss_arith_int32(value->data, operand->data, operation); + orte_dss_arith_int32((int32_t*)value->data, (int32_t*)operand->data, operation); break; case ORTE_UINT32: - orte_dss_arith_uint32(value->data, operand->data, operation); + orte_dss_arith_uint32((uint32_t*)value->data, (uint32_t*)operand->data, operation); break; case ORTE_INT64: - orte_dss_arith_int64(value->data, operand->data, operation); + orte_dss_arith_int64((int64_t*)value->data, (int64_t*)operand->data, operation); break; case ORTE_UINT64: - orte_dss_arith_uint64(value->data, operand->data, operation); + orte_dss_arith_uint64((uint64_t*)value->data, (uint64_t*)operand->data, operation); break; case ORTE_STD_CNTR: - orte_dss_arith_std_cntr(value->data, operand->data, operation); + orte_dss_arith_std_cntr((orte_std_cntr_t*)value->data, (orte_std_cntr_t*)operand->data, operation); break; default: @@ -149,78 +151,78 @@ int orte_dss_increment(orte_data_value_t *value) switch(value->type) { case ORTE_INT: one = 1; - orte_dss_arith_int(value->data, &one, ORTE_DSS_ADD); + orte_dss_arith_int((int*)value->data, &one, ORTE_DSS_ADD); break; case ORTE_UINT: uone = 1; - orte_dss_arith_uint(value->data, &uone, ORTE_DSS_ADD); + orte_dss_arith_uint((uint*)value->data, &uone, ORTE_DSS_ADD); break; case ORTE_SIZE: sone = 1; - orte_dss_arith_size(value->data, &sone, ORTE_DSS_ADD); + orte_dss_arith_size((size_t*)value->data, &sone, ORTE_DSS_ADD); break; case ORTE_PID: pone = 1; - orte_dss_arith_pid(value->data, &pone, ORTE_DSS_ADD); + orte_dss_arith_pid((pid_t*)value->data, &pone, ORTE_DSS_ADD); break; case ORTE_BYTE: case ORTE_UINT8: u8one = 1; - orte_dss_arith_byte(value->data, &u8one, ORTE_DSS_ADD); + orte_dss_arith_byte((uint8_t*)value->data, &u8one, ORTE_DSS_ADD); break; case ORTE_INT8: i8one = 1; - orte_dss_arith_int8(value->data, &i8one, ORTE_DSS_ADD); + orte_dss_arith_int8((int8_t*)value->data, &i8one, ORTE_DSS_ADD); break; case ORTE_INT16: i16one = 1; - orte_dss_arith_int16(value->data, &i16one, ORTE_DSS_ADD); + orte_dss_arith_int16((int16_t*)value->data, &i16one, ORTE_DSS_ADD); break; case ORTE_UINT16: u16one = 1; - orte_dss_arith_uint16(value->data, &u16one, ORTE_DSS_ADD); + orte_dss_arith_uint16((uint16_t*)value->data, &u16one, ORTE_DSS_ADD); break; case ORTE_INT32: i32one = 1; - orte_dss_arith_int32(value->data, &i32one, ORTE_DSS_ADD); + orte_dss_arith_int32((int32_t*)value->data, &i32one, ORTE_DSS_ADD); break; case ORTE_UINT32: u32one = 1; - orte_dss_arith_uint32(value->data, &u32one, ORTE_DSS_ADD); + orte_dss_arith_uint32((uint32_t*)value->data, &u32one, ORTE_DSS_ADD); break; case ORTE_INT64: i64one = 1; - orte_dss_arith_int64(value->data, &i64one, ORTE_DSS_ADD); + orte_dss_arith_int64((int64_t*)value->data, &i64one, ORTE_DSS_ADD); break; case ORTE_UINT64: u64one = 1; - orte_dss_arith_uint64(value->data, &u64one, ORTE_DSS_ADD); + orte_dss_arith_uint64((uint64_t*)value->data, &u64one, ORTE_DSS_ADD); break; case ORTE_DAEMON_CMD: daemoncmdone = 1; - orte_dss_arith_daemon_cmd(value->data, &daemoncmdone, ORTE_DSS_ADD); + orte_dss_arith_daemon_cmd((orte_daemon_cmd_flag_t*)value->data, &daemoncmdone, ORTE_DSS_ADD); break; case ORTE_DATA_TYPE: datatypeone = 1; - orte_dss_arith_data_type(value->data, &datatypeone, ORTE_DSS_ADD); + orte_dss_arith_data_type((orte_data_type_t*)value->data, &datatypeone, ORTE_DSS_ADD); break; case ORTE_STD_CNTR: stdcntrone = 1; - orte_dss_arith_std_cntr(value->data, &stdcntrone, ORTE_DSS_ADD); + orte_dss_arith_std_cntr((orte_std_cntr_t*)value->data, &stdcntrone, ORTE_DSS_ADD); break; default: @@ -259,78 +261,78 @@ int orte_dss_decrement(orte_data_value_t *value) switch(value->type) { case ORTE_INT: one = 1; - orte_dss_arith_int(value->data, &one, ORTE_DSS_SUB); + orte_dss_arith_int((int*)value->data, &one, ORTE_DSS_SUB); break; case ORTE_UINT: uone = 1; - orte_dss_arith_uint(value->data, &uone, ORTE_DSS_SUB); + orte_dss_arith_uint((uint*)value->data, &uone, ORTE_DSS_SUB); break; case ORTE_SIZE: sone = 1; - orte_dss_arith_size(value->data, &sone, ORTE_DSS_SUB); + orte_dss_arith_size((size_t*)value->data, &sone, ORTE_DSS_SUB); break; case ORTE_PID: pone = 1; - orte_dss_arith_pid(value->data, &pone, ORTE_DSS_SUB); + orte_dss_arith_pid((pid_t*)value->data, &pone, ORTE_DSS_SUB); break; case ORTE_BYTE: case ORTE_UINT8: u8one = 1; - orte_dss_arith_byte(value->data, &u8one, ORTE_DSS_SUB); + orte_dss_arith_byte((uint8_t*)value->data, &u8one, ORTE_DSS_SUB); break; case ORTE_INT8: i8one = 1; - orte_dss_arith_int8(value->data, &i8one, ORTE_DSS_SUB); + orte_dss_arith_int8((int8_t*)value->data, &i8one, ORTE_DSS_SUB); break; case ORTE_INT16: i16one = 1; - orte_dss_arith_int16(value->data, &i16one, ORTE_DSS_SUB); + orte_dss_arith_int16((int16_t*)value->data, &i16one, ORTE_DSS_SUB); break; case ORTE_UINT16: u16one = 1; - orte_dss_arith_uint16(value->data, &u16one, ORTE_DSS_SUB); + orte_dss_arith_uint16((uint16_t*)value->data, &u16one, ORTE_DSS_SUB); break; case ORTE_INT32: i32one = 1; - orte_dss_arith_int32(value->data, &i32one, ORTE_DSS_SUB); + orte_dss_arith_int32((int32_t*)value->data, &i32one, ORTE_DSS_SUB); break; case ORTE_UINT32: u32one = 1; - orte_dss_arith_uint32(value->data, &u32one, ORTE_DSS_SUB); + orte_dss_arith_uint32((uint32_t*)value->data, &u32one, ORTE_DSS_SUB); break; case ORTE_INT64: i64one = 1; - orte_dss_arith_int64(value->data, &i64one, ORTE_DSS_SUB); + orte_dss_arith_int64((int64_t*)value->data, &i64one, ORTE_DSS_SUB); break; case ORTE_UINT64: u64one = 1; - orte_dss_arith_uint64(value->data, &u64one, ORTE_DSS_SUB); + orte_dss_arith_uint64((uint64_t*)value->data, &u64one, ORTE_DSS_SUB); break; case ORTE_DAEMON_CMD: daemoncmdone = 1; - orte_dss_arith_daemon_cmd(value->data, &daemoncmdone, ORTE_DSS_SUB); + orte_dss_arith_daemon_cmd((orte_daemon_cmd_flag_t*)value->data, &daemoncmdone, ORTE_DSS_SUB); break; case ORTE_DATA_TYPE: datatypeone = 1; - orte_dss_arith_data_type(value->data, &datatypeone, ORTE_DSS_SUB); + orte_dss_arith_data_type((orte_data_type_t*)value->data, &datatypeone, ORTE_DSS_SUB); break; case ORTE_STD_CNTR: stdcntrone = 1; - orte_dss_arith_std_cntr(value->data, &stdcntrone, ORTE_DSS_SUB); + orte_dss_arith_std_cntr((orte_std_cntr_t*)value->data, &stdcntrone, ORTE_DSS_SUB); break; default: diff --git a/orte/dss/dss_compare.c b/orte/dss/dss_compare.c index 2223666a1c..1238112b68 100755 --- a/orte/dss/dss_compare.c +++ b/orte/dss/dss_compare.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -40,7 +42,7 @@ int orte_dss_compare(void *value1, void *value2, orte_data_type_t type) /* Lookup the compare function for this type and call it */ if (!(type < orte_dss_types->size) || - (NULL == (info = orte_pointer_array_get_item(orte_dss_types, type)))) { + (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type)))) { ORTE_ERROR_LOG(ORTE_ERR_UNKNOWN_DATA_TYPE); return ORTE_ERR_UNKNOWN_DATA_TYPE; } diff --git a/orte/dss/dss_copy.c b/orte/dss/dss_copy.c index 20e60185f9..609756a1f1 100755 --- a/orte/dss/dss_copy.c +++ b/orte/dss/dss_copy.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -44,7 +46,7 @@ int orte_dss_copy(void **dest, void *src, orte_data_type_t type) /* Lookup the copy function for this type and call it */ if (!(type < orte_dss_types->size) || - (NULL == (info = orte_pointer_array_get_item(orte_dss_types, type)))) { + (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type)))) { ORTE_ERROR_LOG(ORTE_ERR_UNKNOWN_DATA_TYPE); return ORTE_ERR_UNKNOWN_DATA_TYPE; } diff --git a/orte/dss/dss_internal.h b/orte/dss/dss_internal.h index 731f063e70..43f859024c 100644 --- a/orte/dss/dss_internal.h +++ b/orte/dss/dss_internal.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -142,7 +142,7 @@ struct orte_dss_type_info_t { * Convenience typedef */ typedef struct orte_dss_type_info_t orte_dss_type_info_t; -OBJ_CLASS_DECLARATION(orte_dss_type_info_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_dss_type_info_t); /* * globals needed within dss diff --git a/orte/dss/dss_internal_functions.c b/orte/dss/dss_internal_functions.c index 84e3816fdd..e5fb22122c 100644 --- a/orte/dss/dss_internal_functions.c +++ b/orte/dss/dss_internal_functions.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -60,13 +60,13 @@ char* orte_dss_buffer_extend(orte_buffer_t *buffer, size_t bytes_to_add) pack_offset = ((char*) buffer->pack_ptr) - ((char*) buffer->base_ptr); unpack_offset = ((char*) buffer->unpack_ptr) - ((char*) buffer->base_ptr); - buffer->base_ptr = realloc(buffer->base_ptr, - num_pages * orte_dss_page_size); + buffer->base_ptr = (char*)realloc(buffer->base_ptr, + num_pages * orte_dss_page_size); } else { pack_offset = 0; unpack_offset = 0; buffer->bytes_used = 0; - buffer->base_ptr = malloc(num_pages * orte_dss_page_size); + buffer->base_ptr = (char*)malloc(num_pages * orte_dss_page_size); } if (NULL == buffer->base_ptr) { @@ -113,7 +113,7 @@ int orte_dss_store_data_type(orte_buffer_t *buffer, orte_data_type_t type) /* Lookup the pack function for the actual orte_data_type type and call it */ - if (NULL == (info = orte_pointer_array_get_item(orte_dss_types, ORTE_DATA_TYPE_T))) { + if (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, ORTE_DATA_TYPE_T))) { ORTE_ERROR_LOG(ORTE_ERR_PACK_FAILURE); return ORTE_ERR_PACK_FAILURE; } @@ -133,7 +133,7 @@ int orte_dss_get_data_type(orte_buffer_t *buffer, orte_data_type_t *type) /* Lookup the unpack function for the actual orte_data_type type and call it */ - if (NULL == (info = orte_pointer_array_get_item(orte_dss_types, ORTE_DATA_TYPE_T))) { + if (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, ORTE_DATA_TYPE_T))) { ORTE_ERROR_LOG(ORTE_ERR_PACK_FAILURE); return ORTE_ERR_PACK_FAILURE; } diff --git a/orte/dss/dss_load_unload.c b/orte/dss/dss_load_unload.c index d8ec4e2646..dcf5d56e38 100644 --- a/orte/dss/dss_load_unload.c +++ b/orte/dss/dss_load_unload.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -90,7 +90,7 @@ int orte_dss_load(orte_buffer_t *buffer, void *payload, } /* populate the buffer */ - buffer->base_ptr = payload; + buffer->base_ptr = (char*)payload; /* set pack/unpack pointers */ buffer->pack_ptr = ((char*)buffer->base_ptr) + bytes_used; diff --git a/orte/dss/dss_lookup.c b/orte/dss/dss_lookup.c index c46f433d70..a2fe8bcfa0 100644 --- a/orte/dss/dss_lookup.c +++ b/orte/dss/dss_lookup.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -34,7 +34,7 @@ char *orte_dss_lookup_data_type(orte_data_type_t type) return NULL; } - info = orte_pointer_array_get_item(orte_dss_types, type); + info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type); if (NULL != info) { /* type found on list */ name = strdup(info->odti_name); return name; diff --git a/orte/dss/dss_open_close.c b/orte/dss/dss_open_close.c index ad06d5a7fc..0a5f10c5d5 100644 --- a/orte/dss/dss_open_close.c +++ b/orte/dss/dss_open_close.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -466,7 +466,7 @@ int orte_dss_close(void) orte_dss_initialized = false; for (i = 0 ; i < orte_pointer_array_get_size(orte_dss_types) ; ++i) { - orte_dss_type_info_t *info = orte_pointer_array_get_item(orte_dss_types, i); + orte_dss_type_info_t *info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, i); if (NULL != info) { OBJ_RELEASE(info); } diff --git a/orte/dss/dss_pack.c b/orte/dss/dss_pack.c index d8b1f22af1..e64d3271b2 100644 --- a/orte/dss/dss_pack.c +++ b/orte/dss/dss_pack.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -79,7 +79,7 @@ int orte_dss_pack_buffer(orte_buffer_t *buffer, void *src, orte_std_cntr_t num_v /* Lookup the pack function for this type and call it */ - if (NULL == (info = orte_pointer_array_get_item(orte_dss_types, type))) { + if (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type))) { ORTE_ERROR_LOG(ORTE_ERR_PACK_FAILURE); return ORTE_ERR_PACK_FAILURE; } @@ -396,7 +396,7 @@ int orte_dss_pack_data_value(orte_buffer_t *buffer, void *src, orte_std_cntr_t n /* Lookup the pack function for this type and call it */ - if (NULL == (info = orte_pointer_array_get_item(orte_dss_types, sdv[i]->type))) { + if (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, sdv[i]->type))) { ORTE_ERROR_LOG(ORTE_ERR_PACK_FAILURE); return ORTE_ERR_PACK_FAILURE; } diff --git a/orte/dss/dss_print.c b/orte/dss/dss_print.c index c977e007a4..7fd2161efd 100755 --- a/orte/dss/dss_print.c +++ b/orte/dss/dss_print.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -41,7 +43,7 @@ int orte_dss_print(char **output, char *prefix, void *src, orte_data_type_t type /* Lookup the print function for this type and call it */ if (!(type < orte_dss_types->size) || - (NULL == (info = orte_pointer_array_get_item(orte_dss_types, type)))) { + (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type)))) { ORTE_ERROR_LOG(ORTE_ERR_UNKNOWN_DATA_TYPE); return ORTE_ERR_UNKNOWN_DATA_TYPE; } @@ -303,8 +305,13 @@ int orte_dss_print_int32(char **output, char *prefix, int32_t *src, orte_data_ty return ORTE_SUCCESS; } - -int orte_dss_print_uint64(char **output, char *prefix, uint64_t *src, orte_data_type_t type) +int orte_dss_print_uint64(char **output, char *prefix, +#ifdef HAVE_INT64_T + uint64_t *src, +#else + void *src, +#endif /* HAVE_INT64_T */ + orte_data_type_t type) { char *prefx; @@ -318,12 +325,22 @@ int orte_dss_print_uint64(char **output, char *prefix, uint64_t *src, orte_data_ return ORTE_SUCCESS; } +#ifdef HAVE_INT64_T asprintf(output, "%sData type: ORTE_UINT64\tValue: %lu", prefx, (unsigned long) *src); +#else + asprintf(output, "%sData type: ORTE_UINT64\tValue: unsupported", prefx); +#endif /* HAVE_INT64_T */ return ORTE_SUCCESS; } -int orte_dss_print_int64(char **output, char *prefix, int64_t *src, orte_data_type_t type) +int orte_dss_print_int64(char **output, char *prefix, +#ifdef HAVE_INT64_T + int64_t *src, +#else + void *src, +#endif /* HAVE_INT64_T */ + orte_data_type_t type) { char *prefx; @@ -337,7 +354,11 @@ int orte_dss_print_int64(char **output, char *prefix, int64_t *src, orte_data_ty return ORTE_SUCCESS; } +#ifdef HAVE_INT64_T asprintf(output, "%sData type: ORTE_INT64\tValue: %ld", prefx, (long) *src); +#else + asprintf(output, "%sData type: ORTE_INT64\tValue: unsupported", prefx); +#endif /* HAVE_INT64_T */ return ORTE_SUCCESS; } diff --git a/orte/dss/dss_release.c b/orte/dss/dss_release.c index ec944d8672..1c118c44f0 100644 --- a/orte/dss/dss_release.c +++ b/orte/dss/dss_release.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -39,7 +41,7 @@ void orte_dss_release(orte_data_value_t *value) /* Lookup the release function for this type and call it */ if (!(value->type < orte_dss_types->size) || - (NULL == (info = orte_pointer_array_get_item(orte_dss_types, value->type)))) { + (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, value->type)))) { ORTE_ERROR_LOG(ORTE_ERR_UNKNOWN_DATA_TYPE); return; } @@ -72,7 +74,7 @@ void orte_dss_release_byte_object(orte_data_value_t *value) { orte_byte_object_t *bo; - bo = value->data; + bo = (orte_byte_object_t*)value->data; free(bo->bytes); free(value->data); diff --git a/orte/dss/dss_size.c b/orte/dss/dss_size.c index 6ad7ccd06b..29ee9f1b87 100755 --- a/orte/dss/dss_size.c +++ b/orte/dss/dss_size.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -41,7 +43,7 @@ int orte_dss_size(size_t *size, void *src, orte_data_type_t type) /* Lookup the size function for this type and call it */ if (!(type < orte_dss_types->size) || - (NULL == (info = orte_pointer_array_get_item(orte_dss_types, type)))) { + (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type)))) { ORTE_ERROR_LOG(ORTE_ERR_UNKNOWN_DATA_TYPE); return ORTE_ERR_UNKNOWN_DATA_TYPE; } diff --git a/orte/dss/dss_types.h b/orte/dss/dss_types.h index b2b57eafa1..f8a2344f79 100644 --- a/orte/dss/dss_types.h +++ b/orte/dss/dss_types.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -49,7 +49,7 @@ typedef struct { orte_data_type_t type; /* the type of value stored */ void *data; } orte_data_value_t; -OBJ_CLASS_DECLARATION(orte_data_value_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_data_value_t); #define ORTE_DATA_VALUE_EMPTY {{OBJ_CLASS(orte_data_value_t),0}, ORTE_UNDEF, NULL} diff --git a/orte/dss/dss_unpack.c b/orte/dss/dss_unpack.c index bb89719349..1e8f125836 100644 --- a/orte/dss/dss_unpack.c +++ b/orte/dss/dss_unpack.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -67,15 +67,15 @@ /* NOTE: do not need to deal with endianness here, as the unpacking of the underling sender-side type will do that for us. Repeat: the data in tmpbuf[] is already in host byte order. */ -#define UNPACK_SIZE_MISMATCH_FOUND(unpack_type, tmptype, tmpdsstype) \ - do { \ - orte_std_cntr_t i; \ - tmptype *tmpbuf = malloc(sizeof(tmptype) * *num_vals); \ +#define UNPACK_SIZE_MISMATCH_FOUND(unpack_type, tmptype, tmpdsstype) \ + do { \ + orte_std_cntr_t i; \ + tmptype *tmpbuf = (tmptype*)malloc(sizeof(tmptype) * (*num_vals)); \ ret = orte_dss_unpack_buffer(buffer, tmpbuf, num_vals, tmpdsstype); \ - for (i = 0 ; i < *num_vals ; ++i) { \ - ((unpack_type*) dest)[i] = tmpbuf[i]; \ - } \ - free(tmpbuf); \ + for (i = 0 ; i < *num_vals ; ++i) { \ + ((unpack_type*) dest)[i] = (unpack_type)(tmpbuf[i]); \ + } \ + free(tmpbuf); \ } while (0) @@ -181,7 +181,7 @@ int orte_dss_unpack_buffer(orte_buffer_t *buffer, void *dst, orte_std_cntr_t *nu /* Lookup the unpack function for this type and call it */ - if (NULL == (info = orte_pointer_array_get_item(orte_dss_types, type))) { + if (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, type))) { ORTE_ERROR_LOG(ORTE_ERR_UNPACK_FAILURE); return ORTE_ERR_UNPACK_FAILURE; } @@ -499,7 +499,7 @@ int orte_dss_unpack_string(orte_buffer_t *buffer, void *dest, if (0 == len) { /* zero-length string - unpack the NULL */ sdest[i] = NULL; } else { - sdest[i] = malloc(len); + sdest[i] = (char*)malloc(len); if (NULL == sdest[i]) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); return ORTE_ERR_OUT_OF_RESOURCE; @@ -687,7 +687,7 @@ int orte_dss_unpack_data_value(orte_buffer_t *buffer, void *dest, orte_std_cntr_ /* Lookup the unpack function for this type and call it */ - if (NULL == (info = orte_pointer_array_get_item(orte_dss_types, ddv[i]->type))) { + if (NULL == (info = (orte_dss_type_info_t*)orte_pointer_array_get_item(orte_dss_types, ddv[i]->type))) { ORTE_ERROR_LOG(ORTE_ERR_PACK_FAILURE); return ORTE_ERR_PACK_FAILURE; } diff --git a/orte/include/orte/orte_constants.h b/orte/include/orte/orte_constants.h index 21224edc48..4c5e1fd6b8 100644 --- a/orte/include/orte/orte_constants.h +++ b/orte/include/orte/orte_constants.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -20,6 +20,11 @@ #define ORTE_CONSTANTS_H #include "opal/constants.h" +#include "orte_config.h" + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif #define ORTE_ERR_BASE OPAL_ERR_MAX @@ -93,7 +98,11 @@ enum { #define ORTE_ERR_MAX (ORTE_ERR_BASE - 100) /* include the prototype for the error-to-string converter */ -const char * orte_err2str(int errnum); +ORTE_DECLSPEC const char* orte_err2str(int errnum); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif #endif /* ORTE_CONSTANTS_H */ diff --git a/orte/mca/gpr/base/base.h b/orte/mca/gpr/base/base.h index 062f64dee9..2f709c6cad 100644 --- a/orte/mca/gpr/base/base.h +++ b/orte/mca/gpr/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -64,9 +64,6 @@ #include "orte/orte_constants.h" #include "orte/orte_types.h" -#include "opal/threads/mutex.h" -#include "opal/threads/condition.h" - #include "opal/class/opal_list.h" #include "orte/dss/dss_types.h" @@ -120,16 +117,16 @@ typedef uint8_t orte_gpr_cmd_flag_t; ORTE_DECLSPEC int orte_gpr_base_select(void); ORTE_DECLSPEC int orte_gpr_base_close(void); -int orte_gpr_base_create_value(orte_gpr_value_t **value, - orte_gpr_addr_mode_t addr_mode, - char *segment, - orte_std_cntr_t cnt, /**< Number of keyval objects */ - orte_std_cntr_t num_tokens); + ORTE_DECLSPEC int orte_gpr_base_create_value(orte_gpr_value_t **value, + orte_gpr_addr_mode_t addr_mode, + char *segment, + orte_std_cntr_t cnt, /**< Number of keyval objects */ + orte_std_cntr_t num_tokens); -int orte_gpr_base_create_keyval(orte_gpr_keyval_t **keyval, - char *key, - orte_data_type_t type, - void *data); + ORTE_DECLSPEC int orte_gpr_base_create_keyval(orte_gpr_keyval_t **keyval, + char *key, + orte_data_type_t type, + void *data); ORTE_DECLSPEC int orte_gpr_base_put_1(orte_gpr_addr_mode_t addr_mode, char *segment, char **tokens, diff --git a/orte/mca/gpr/base/data_type_support/gpr_data_type_print_fns.c b/orte/mca/gpr/base/data_type_support/gpr_data_type_print_fns.c index 07a4c78da6..b6a18742ce 100755 --- a/orte/mca/gpr/base/data_type_support/gpr_data_type_print_fns.c +++ b/orte/mca/gpr/base/data_type_support/gpr_data_type_print_fns.c @@ -1,8 +1,10 @@ /* - * Copyright (c) 2004-2005 The Trustees of Indiana University. - * All rights reserved. - * Copyright (c) 2004-2005 The Trustees of the University of Tennessee. - * All rights reserved. + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. @@ -227,7 +229,7 @@ int orte_gpr_base_print_gpr_value(char **output, char *prefix, orte_gpr_value_t asprintf(&pfx, "%s\t", prefx); for (j=0; j < value->cnt; j++) { if (ORTE_SUCCESS != (rc = orte_gpr_base_print_keyval(&tmp2, pfx, - (void*)(value->keyvals[j]), ORTE_GPR_KEYVAL))) { + (orte_gpr_keyval_t*)(value->keyvals[j]), ORTE_GPR_KEYVAL))) { ORTE_ERROR_LOG(rc); free(tmp); free(pfx); @@ -315,7 +317,7 @@ int orte_gpr_base_print_subscription(char **output, char *prefix, orte_gpr_subsc /* indent another level for values */ asprintf(&pfx, "%s\t", prefx); for (j=0; j < sub->cnt; j++) { - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_gpr_value(&tmp2, pfx, (void*)(sub->values[j]), ORTE_GPR_VALUE))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_gpr_value(&tmp2, pfx, (orte_gpr_value_t*)(sub->values[j]), ORTE_GPR_VALUE))) { ORTE_ERROR_LOG(rc); free(tmp); free(pfx); @@ -392,7 +394,7 @@ int orte_gpr_base_print_trigger(char **output, char *prefix, orte_gpr_trigger_t /* indent another level for values */ asprintf(&pfx, "%s\t", prefx); for (j=0; j < trig->cnt; j++) { - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_gpr_value(&tmp2, pfx, (void*)(trig->values[j]), ORTE_GPR_VALUE))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_gpr_value(&tmp2, pfx, (orte_gpr_value_t*)(trig->values[j]), ORTE_GPR_VALUE))) { ORTE_ERROR_LOG(rc); free(tmp); free(pfx); @@ -442,7 +444,7 @@ int orte_gpr_base_print_notify_data(char **output, char *prefix, orte_gpr_notify i < (data->values)->size; i++) { if (NULL != values[i]) { j++; - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_gpr_value(&tmp2, pfx, (void*)values[i], ORTE_GPR_VALUE))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_gpr_value(&tmp2, pfx, (orte_gpr_value_t*)values[i], ORTE_GPR_VALUE))) { ORTE_ERROR_LOG(rc); free(tmp); return rc; @@ -505,7 +507,7 @@ int orte_gpr_base_print_notify_msg(char **output, char *prefix, orte_gpr_notify_ i < (msg->data)->size; i++) { if (NULL != data[i]) { j++; - if (ORTE_SUCCESS != (rc = orte_gpr_base_print_notify_data(&tmp2, pfx, (void*)data[i], ORTE_GPR_NOTIFY_DATA))) { + if (ORTE_SUCCESS != (rc = orte_gpr_base_print_notify_data(&tmp2, pfx, (orte_gpr_notify_data_t*)data[i], ORTE_GPR_NOTIFY_DATA))) { ORTE_ERROR_LOG(rc); free(tmp); return rc; diff --git a/orte/mca/gpr/base/gpr_base_open.c b/orte/mca/gpr/base/gpr_base_open.c index 483dfd5bb7..6031ff698f 100644 --- a/orte/mca/gpr/base/gpr_base_open.c +++ b/orte/mca/gpr/base/gpr_base_open.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -318,7 +318,8 @@ int orte_gpr_base_open(void) kill_prefix.lds_verbose_level = value; } orte_gpr_base_output = opal_output_open(&kill_prefix); - + OBJ_DESTRUCT(&kill_prefix); + id = mca_base_param_register_int("gpr", "base", "maxsize", NULL, ORTE_GPR_ARRAY_MAX_SIZE); mca_base_param_lookup_int(id, ¶m); @@ -513,7 +514,6 @@ int orte_gpr_base_open(void) } /* Open up all available components */ - if (ORTE_SUCCESS != mca_base_components_open("gpr", orte_gpr_base_output, diff --git a/orte/mca/gpr/gpr_types.h b/orte/mca/gpr/gpr_types.h index 218d8d6349..fb2efbc664 100644 --- a/orte/mca/gpr/gpr_types.h +++ b/orte/mca/gpr/gpr_types.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -159,7 +159,7 @@ ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_gpr_value_t); * Each block of data is associated with a specified callback function and contains * data from a single segment, one or more containers with one or more keyvals/container. */ -typedef struct { +typedef struct orte_gpr_notify_data_t { opal_object_t super; /**< Makes this an object */ char *target; /**< Name of the associated subscripton, if provided */ orte_gpr_subscription_id_t id; /**< Number of the associated subscription */ diff --git a/orte/mca/gpr/null/gpr_null_component.c b/orte/mca/gpr/null/gpr_null_component.c index 1d63c4d4c6..172638fa40 100644 --- a/orte/mca/gpr/null/gpr_null_component.c +++ b/orte/mca/gpr/null/gpr_null_component.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -21,7 +21,7 @@ #include "orte/mca/gpr/gpr.h" #include "orte/orte_constants.h" - +#include "orte/mca/gpr/null/gpr_null.h" extern orte_gpr_base_module_t orte_gpr_null_module; diff --git a/orte/mca/gpr/proxy/gpr_proxy.h b/orte/mca/gpr/proxy/gpr_proxy.h index 14ab57f3fb..a92c962ca4 100644 --- a/orte/mca/gpr/proxy/gpr_proxy.h +++ b/orte/mca/gpr/proxy/gpr_proxy.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -25,6 +25,8 @@ #include "orte/orte_types.h" #include "opal/class/opal_object.h" +#include "opal/threads/mutex.h" +#include "opal/threads/condition.h" #include "orte/class/orte_pointer_array.h" #include "orte/dss/dss_types.h" #include "orte/util/proc_info.h" @@ -95,7 +97,6 @@ typedef struct { int compound_cmd_waiting; } orte_gpr_proxy_globals_t; - extern orte_gpr_proxy_globals_t orte_gpr_proxy_globals; /* @@ -242,6 +243,11 @@ orte_gpr_proxy_enter_trigger(orte_std_cntr_t cnt, orte_gpr_trigger_t **triggers) int orte_gpr_proxy_remove_trigger(orte_gpr_proxy_trigger_t *trig); +/* + * + */ +ORTE_MODULE_DECLSPEC extern mca_gpr_base_component_t mca_gpr_proxy_component; + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/gpr/replica/functional_layer/gpr_replica_put_get_fn.c b/orte/mca/gpr/replica/functional_layer/gpr_replica_put_get_fn.c index 3f0ee80697..a4f126721b 100644 --- a/orte/mca/gpr/replica/functional_layer/gpr_replica_put_get_fn.c +++ b/orte/mca/gpr/replica/functional_layer/gpr_replica_put_get_fn.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -50,8 +50,6 @@ typedef struct { orte_data_value_t value; } orte_gpr_replica_ival_list_t; -OBJ_CLASS_DECLARATION(orte_gpr_replica_ival_list_t); - /* constructor */ static void orte_gpr_replica_ival_list_constructor(orte_gpr_replica_ival_list_t* ptr) { @@ -82,8 +80,6 @@ typedef struct { opal_list_t *ival_list; /* list of ival_list_t of values found by get */ } orte_gpr_replica_get_list_t; -OBJ_CLASS_DECLARATION(orte_gpr_replica_get_list_t); - /* constructor */ static void orte_gpr_replica_get_list_constructor(orte_gpr_replica_get_list_t* ptr) { diff --git a/orte/mca/gpr/replica/gpr_replica.h b/orte/mca/gpr/replica/gpr_replica.h index 9dce0ac76b..e05c6060ac 100644 --- a/orte/mca/gpr/replica/gpr_replica.h +++ b/orte/mca/gpr/replica/gpr_replica.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -441,6 +441,8 @@ orte_gpr_base_module_t *orte_gpr_replica_init(bool *allow_multi_user_threads, bo int orte_gpr_replica_finalize(void); int orte_gpr_replica_module_init(void); +ORTE_MODULE_DECLSPEC extern mca_gpr_base_component_t mca_gpr_replica_component; + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/iof/base/base.h b/orte/mca/iof/base/base.h index c0f2cb7e01..97054fb95a 100644 --- a/orte/mca/iof/base/base.h +++ b/orte/mca/iof/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -66,7 +66,6 @@ ORTE_DECLSPEC int orte_iof_base_close(void); ORTE_DECLSPEC int orte_iof_base_select(void); ORTE_DECLSPEC int orte_iof_base_flush(void); - ORTE_DECLSPEC extern orte_iof_base_t orte_iof_base; #if defined(c_plusplus) || defined(__cplusplus) diff --git a/orte/mca/iof/base/iof_base_endpoint.c b/orte/mca/iof/base/iof_base_endpoint.c index 76011719b3..f3659408ea 100644 --- a/orte/mca/iof/base/iof_base_endpoint.c +++ b/orte/mca/iof/base/iof_base_endpoint.c @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #include "orte_config.h" #include #include @@ -120,7 +138,16 @@ static void orte_iof_base_endpoint_read_handler(int fd, short flags, void *cbdat OPAL_THREAD_LOCK(&orte_iof_base.iof_lock); /* read up to the fragment size */ +#if !defined(__WINDOWS__) rc = read(fd, frag->frag_data, sizeof(frag->frag_data)); +#else + { + DWORD readed; + HANDLE handle = (HANDLE)_get_osfhandle(fd); + ReadFile(handle, frag->frag_data, sizeof(frag->frag_data), &readed, NULL); + rc = (int)readed; + } +#endif /* !defined(__WINDOWS__) */ if(rc < 0) { /* non-blocking, retry */ if(errno == EAGAIN || errno == EINTR) { diff --git a/orte/mca/iof/base/iof_base_endpoint.h b/orte/mca/iof/base/iof_base_endpoint.h index e0c82b52cb..d3b13b2274 100644 --- a/orte/mca/iof/base/iof_base_endpoint.h +++ b/orte/mca/iof/base/iof_base_endpoint.h @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #ifndef _IOF_BASE_ENDPOINT_ #define _IOF_BASE_ENDPOINT_ @@ -7,6 +25,9 @@ #include "orte/mca/iof/iof.h" #include "orte/mca/iof/base/iof_base_header.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /** * Structure store callbacks @@ -19,7 +40,7 @@ struct orte_iof_base_callback_t { }; typedef struct orte_iof_base_callback_t orte_iof_base_callback_t; -OBJ_CLASS_DECLARATION(orte_iof_base_callback_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_base_callback_t); /** * Structure that represents a published endpoint. @@ -40,7 +61,7 @@ struct orte_iof_base_endpoint_t { }; typedef struct orte_iof_base_endpoint_t orte_iof_base_endpoint_t; -OBJ_CLASS_DECLARATION(orte_iof_base_endpoint_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_base_endpoint_t); /* * Diff between two sequence numbers allowing for rollover @@ -59,7 +80,7 @@ OBJ_CLASS_DECLARATION(orte_iof_base_endpoint_t); * @aram fd Local file descriptor corresponding to endpoint. */ -int orte_iof_base_endpoint_create( +ORTE_DECLSPEC int orte_iof_base_endpoint_create( const orte_process_name_t* name, orte_iof_base_mode_t mode, int tag, @@ -73,13 +94,13 @@ int orte_iof_base_endpoint_create( * @aram cbdata Local file descriptor corresponding to endpoint. */ -int orte_iof_base_callback_create( +ORTE_DECLSPEC int orte_iof_base_callback_create( const orte_process_name_t *name, int tag, orte_iof_base_callback_fn_t cbfunc, void* cbdata); -int orte_iof_base_callback_delete( +ORTE_DECLSPEC int orte_iof_base_callback_delete( const orte_process_name_t *name, int tag); @@ -93,7 +114,7 @@ int orte_iof_base_callback_delete( * @param tag Tag for matching endpoints. */ -int orte_iof_base_endpoint_delete( +ORTE_DECLSPEC int orte_iof_base_endpoint_delete( const orte_process_name_t* name, orte_ns_cmp_bitmask_t mask, int tag); @@ -102,7 +123,7 @@ int orte_iof_base_endpoint_delete( * Disable forwarding through the specified endpoint. */ -int orte_iof_base_endpoint_close( +ORTE_DECLSPEC int orte_iof_base_endpoint_close( orte_iof_base_endpoint_t* endpoint); /** @@ -110,7 +131,7 @@ int orte_iof_base_endpoint_close( * process name/mask/tag. */ -orte_iof_base_endpoint_t* orte_iof_base_endpoint_match( +ORTE_DECLSPEC orte_iof_base_endpoint_t* orte_iof_base_endpoint_match( const orte_process_name_t* dst_name, orte_ns_cmp_bitmask_t dst_mask, int dst_tag); @@ -119,7 +140,7 @@ orte_iof_base_endpoint_t* orte_iof_base_endpoint_match( * Forward the specified message out the endpoint. */ -int orte_iof_base_endpoint_forward( +ORTE_DECLSPEC int orte_iof_base_endpoint_forward( orte_iof_base_endpoint_t* endpoint, const orte_process_name_t* src, orte_iof_base_msg_header_t* hdr, @@ -129,7 +150,7 @@ int orte_iof_base_endpoint_forward( * Callback when peer has closed endpoint. */ -void orte_iof_base_endpoint_closed( +ORTE_DECLSPEC void orte_iof_base_endpoint_closed( orte_iof_base_endpoint_t* endpoint); /** @@ -137,7 +158,7 @@ void orte_iof_base_endpoint_closed( * acknowledged. */ -int orte_iof_base_endpoint_ack( +ORTE_DECLSPEC int orte_iof_base_endpoint_ack( orte_iof_base_endpoint_t* endpoint, uint32_t seq); @@ -151,5 +172,9 @@ static inline bool orte_iof_base_endpoint_pending( return opal_list_get_size(&endpoint->ep_frags) || (endpoint->ep_seq != endpoint->ep_ack); } +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif diff --git a/orte/mca/iof/base/iof_base_fragment.c b/orte/mca/iof/base/iof_base_fragment.c index 4df22d6b3a..59259fc951 100644 --- a/orte/mca/iof/base/iof_base_fragment.c +++ b/orte/mca/iof/base/iof_base_fragment.c @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #include "orte_config.h" #include #include @@ -31,18 +49,18 @@ static void orte_iof_base_frag_construct(orte_iof_base_frag_t* frag) OMPI_DEBUG_ZERO(*frag); frag->frag_owner = NULL; frag->frag_len = 0; - frag->frag_iov[0].iov_base = (void*)&frag->frag_hdr; + frag->frag_iov[0].iov_base = (IOVBASE_TYPE*)&frag->frag_hdr; frag->frag_iov[0].iov_len = sizeof(frag->frag_hdr); - frag->frag_iov[1].iov_base = (void*)frag->frag_data; + frag->frag_iov[1].iov_base = (IOVBASE_TYPE*)frag->frag_data; frag->frag_iov[1].iov_len = sizeof(frag->frag_data); } static void orte_iof_base_frag_destruct(orte_iof_base_frag_t* frag) { - frag->frag_iov[0].iov_base = (void*)&frag->frag_hdr; + frag->frag_iov[0].iov_base = (IOVBASE_TYPE*)&frag->frag_hdr; frag->frag_iov[0].iov_len = sizeof(frag->frag_hdr); - frag->frag_iov[1].iov_base = (void*)frag->frag_data; + frag->frag_iov[1].iov_base = (IOVBASE_TYPE*)frag->frag_data; frag->frag_iov[1].iov_len = sizeof(frag->frag_data); } diff --git a/orte/mca/iof/base/iof_base_fragment.h b/orte/mca/iof/base/iof_base_fragment.h index af15421ff3..3d9568e053 100644 --- a/orte/mca/iof/base/iof_base_fragment.h +++ b/orte/mca/iof/base/iof_base_fragment.h @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #ifndef _IOF_BASE_FRAGMENT_ #define _IOF_BASE_FRAGMENT_ @@ -9,6 +27,9 @@ #include "orte/mca/iof/base/base.h" #include "orte/mca/iof/base/iof_base_header.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /** * Fragment used to hold message header/data. @@ -26,7 +47,7 @@ struct orte_iof_base_frag_t { }; typedef struct orte_iof_base_frag_t orte_iof_base_frag_t; -OBJ_CLASS_DECLARATION(orte_iof_base_frag_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_iof_base_frag_t); /** @@ -56,6 +77,9 @@ OBJ_CLASS_DECLARATION(orte_iof_base_frag_t); #define orte_iof_base_frag_ack(frag) _orte_iof_base_frag_ack(frag,__FILE__,__LINE__) int _orte_iof_base_frag_ack(orte_iof_base_frag_t*, const char*, int); +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif #endif diff --git a/orte/mca/iof/base/iof_base_setup.c b/orte/mca/iof/base/iof_base_setup.c index a5c7517677..fa590e1a21 100644 --- a/orte/mca/iof/base/iof_base_setup.c +++ b/orte/mca/iof/base/iof_base_setup.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -77,7 +77,7 @@ orte_iof_base_setup_prefork(orte_iof_base_io_conf_t *opts) #if OMPI_ENABLE_PTY_SUPPORT if (opts->usepty) { ret = opal_openpty(&(opts->p_stdout[0]), &(opts->p_stdout[1]), - NULL, NULL, NULL); + (char*)NULL, (struct termios*)NULL, (struct winsize*)NULL); } else { ret = -1; } @@ -165,7 +165,7 @@ orte_iof_base_setup_child(orte_iof_base_io_conf_t *opts) close(opts->p_stdin[0]); /* connect input to /dev/null */ - fd = open("/dev/null", O_RDONLY); + fd = open("/dev/null", O_RDONLY, 0); if(fd > fileno(stdin)) { dup2(fd, fileno(stdin)); close(fd); @@ -190,7 +190,7 @@ orte_iof_base_setup_parent(const orte_process_name_t* name, if (! opts->usepty) { close(opts->p_stdout[1]); } - close(opts->p_stdin[0]); + close(opts->p_stdin[0]); close(opts->p_stderr[1]); /* connect stdin endpoint */ @@ -203,7 +203,7 @@ orte_iof_base_setup_parent(const orte_process_name_t* name, return ret; } } else { - close(opts->p_stdin[0]); + close(opts->p_stdin[1]); } /* connect read end to IOF */ diff --git a/orte/mca/iof/null/iof_null.h b/orte/mca/iof/null/iof_null.h index 6aa4b4aaf5..a81ff605e8 100644 --- a/orte/mca/iof/null/iof_null.h +++ b/orte/mca/iof/null/iof_null.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -136,9 +136,8 @@ struct orte_iof_null_component_t { }; typedef struct orte_iof_null_component_t orte_iof_null_component_t; -ORTE_DECLSPEC extern orte_iof_null_component_t mca_iof_null_component; -ORTE_DECLSPEC extern orte_iof_base_module_t orte_iof_null_module; - +ORTE_MODULE_DECLSPEC extern orte_iof_null_component_t mca_iof_null_component; +extern orte_iof_base_module_t orte_iof_null_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/iof/null/iof_null_component.c b/orte/mca/iof/null/iof_null_component.c index f2649fd6c2..a9b54c7058 100644 --- a/orte/mca/iof/null/iof_null_component.c +++ b/orte/mca/iof/null/iof_null_component.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -66,7 +66,7 @@ orte_iof_null_component_t mca_iof_null_component = { orte_iof_null_init }, false, - {{NULL, 0}} + /*{{NULL, 0}}*/ }; static int orte_iof_null_param_register_int( diff --git a/orte/mca/iof/null/iof_null_module.c b/orte/mca/iof/null/iof_null_module.c index 1a2b459f29..e30919096d 100644 --- a/orte/mca/iof/null/iof_null_module.c +++ b/orte/mca/iof/null/iof_null_module.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -15,9 +15,12 @@ * * $HEADER$ */ + #include "orte_config.h" #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ #include #include "orte/orte_constants.h" diff --git a/orte/mca/iof/proxy/iof_proxy.h b/orte/mca/iof/proxy/iof_proxy.h index 71188f7ada..de629ef004 100644 --- a/orte/mca/iof/proxy/iof_proxy.h +++ b/orte/mca/iof/proxy/iof_proxy.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -22,11 +22,11 @@ #define ORTE_IOF_PROXY_H #include "orte/mca/iof/iof.h" + #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - /** * Publish a local file descriptor as an endpoint that is logically * associated with the specified process name (e.g. master side of a @@ -136,9 +136,8 @@ struct orte_iof_proxy_component_t { }; typedef struct orte_iof_proxy_component_t orte_iof_proxy_component_t; -ORTE_DECLSPEC extern orte_iof_proxy_component_t mca_iof_proxy_component; -ORTE_DECLSPEC extern orte_iof_base_module_t orte_iof_proxy_module; - +ORTE_MODULE_DECLSPEC extern orte_iof_proxy_component_t mca_iof_proxy_component; +extern orte_iof_base_module_t orte_iof_proxy_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/iof/proxy/iof_proxy_component.c b/orte/mca/iof/proxy/iof_proxy_component.c index d4fa7f5bc9..da43b1273c 100644 --- a/orte/mca/iof/proxy/iof_proxy_component.c +++ b/orte/mca/iof/proxy/iof_proxy_component.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -73,7 +73,9 @@ orte_iof_proxy_component_t mca_iof_proxy_component = { orte_iof_proxy_init }, false, - {{NULL, 0}} + /* {{NULL, 0}} - Let the compiler initialize it so it won't complain on Windows + * where the order of the length and the pointer is different. + */ }; #if 0 diff --git a/orte/mca/iof/proxy/iof_proxy_svc.c b/orte/mca/iof/proxy/iof_proxy_svc.c index c80bf22eb4..00e543cc82 100644 --- a/orte/mca/iof/proxy/iof_proxy_svc.c +++ b/orte/mca/iof/proxy/iof_proxy_svc.c @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #include "orte_config.h" #include "opal/util/output.h" #include "orte/mca/rml/rml.h" @@ -45,7 +63,7 @@ int orte_iof_proxy_svc_publish( hdr.hdr_pub.pub_tag = tag; ORTE_IOF_BASE_HDR_PUB_NTOH(hdr.hdr_pub); - iov.iov_base = (void*)&hdr; + iov.iov_base = (IOVBASE_TYPE*)&hdr; iov.iov_len = sizeof(hdr); rc = orte_rml.send( @@ -83,7 +101,7 @@ int orte_iof_proxy_svc_unpublish( hdr.hdr_pub.pub_tag = tag; ORTE_IOF_BASE_HDR_PUB_NTOH(hdr.hdr_pub); - iov.iov_base = (void*)&hdr; + iov.iov_base = (IOVBASE_TYPE*)&hdr; iov.iov_len = sizeof(hdr); rc = orte_rml.send( @@ -128,7 +146,7 @@ int orte_iof_proxy_svc_subscribe( hdr.hdr_sub.dst_tag = dst_tag; ORTE_IOF_BASE_HDR_SUB_NTOH(hdr.hdr_sub); - iov.iov_base = (void*)&hdr; + iov.iov_base = (IOVBASE_TYPE*)&hdr; iov.iov_len = sizeof(hdr); rc = orte_rml.send( @@ -163,6 +181,8 @@ int orte_iof_proxy_svc_unsubscribe( int rc; hdr.hdr_common.hdr_type = ORTE_IOF_BASE_HDR_UNSUB; + hdr.hdr_common.hdr_reserve = (uint8_t)0; + hdr.hdr_common.hdr_status = (int16_t)0; hdr.hdr_sub.src_name = *src_name; hdr.hdr_sub.src_mask = src_mask; hdr.hdr_sub.src_tag = src_tag; @@ -171,7 +191,7 @@ int orte_iof_proxy_svc_unsubscribe( hdr.hdr_sub.dst_tag = dst_tag; ORTE_IOF_BASE_HDR_SUB_NTOH(hdr.hdr_sub); - iov.iov_base = (void*)&hdr; + iov.iov_base = (IOVBASE_TYPE*)&hdr; iov.iov_len = sizeof(hdr); rc = orte_rml.send( diff --git a/orte/mca/iof/svc/iof_svc.h b/orte/mca/iof/svc/iof_svc.h index 333b0002f1..f0c4c8516f 100644 --- a/orte/mca/iof/svc/iof_svc.h +++ b/orte/mca/iof/svc/iof_svc.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -148,10 +148,9 @@ struct orte_iof_svc_component_t { }; typedef struct orte_iof_svc_component_t orte_iof_svc_component_t; -extern orte_iof_svc_component_t mca_iof_svc_component; +ORTE_MODULE_DECLSPEC extern orte_iof_svc_component_t mca_iof_svc_component; extern orte_iof_base_module_t orte_iof_svc_module; - #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/iof/svc/iof_svc_proxy.c b/orte/mca/iof/svc/iof_svc_proxy.c index 87a555d4ef..37c2003522 100644 --- a/orte/mca/iof/svc/iof_svc_proxy.c +++ b/orte/mca/iof/svc/iof_svc_proxy.c @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #include "orte_config.h" #include "opal/util/output.h" #include "orte/mca/rml/rml.h" @@ -6,6 +24,7 @@ #include "orte/mca/iof/base/iof_base_endpoint.h" #include "orte/mca/iof/base/iof_base_fragment.h" #include "orte/mca/errmgr/errmgr.h" +#include "orte/class/orte_proc_table.h" #include "iof_svc.h" #include "iof_svc_proxy.h" #include "iof_svc_pub.h" @@ -155,7 +174,7 @@ static void orte_iof_svc_proxy_msg( frag->frag_hdr.hdr_msg = *hdr; frag->frag_hdr.hdr_common.hdr_type = ORTE_IOF_BASE_HDR_ACK; - frag->frag_iov[0].iov_base = (void*)&frag->frag_hdr; + frag->frag_iov[0].iov_base = (IOVBASE_TYPE*)&frag->frag_hdr; frag->frag_iov[0].iov_len = sizeof(frag->frag_hdr); ORTE_IOF_BASE_HDR_MSG_HTON(frag->frag_hdr.hdr_msg); @@ -266,7 +285,7 @@ static void orte_iof_svc_proxy_ack( } frag->frag_hdr.hdr_msg = *hdr; - frag->frag_iov[0].iov_base = (void*)&frag->frag_hdr; + frag->frag_iov[0].iov_base = (IOVBASE_TYPE*)&frag->frag_hdr; frag->frag_iov[0].iov_len = sizeof(frag->frag_hdr); ORTE_IOF_BASE_HDR_MSG_HTON(frag->frag_hdr.hdr_msg); diff --git a/orte/mca/iof/svc/iof_svc_pub.h b/orte/mca/iof/svc/iof_svc_pub.h index ac3c9d0e1e..c2659416a1 100644 --- a/orte/mca/iof/svc/iof_svc_pub.h +++ b/orte/mca/iof/svc/iof_svc_pub.h @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #ifndef ORTE_IOF_SVC_PUBLISH_H #define ORTE_IOF_SVC_PUBLISH_H @@ -7,7 +25,9 @@ #include "orte/mca/iof/base/iof_base_endpoint.h" #include "iof_svc.h" - +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /** * Endpoints that are sinks of data are published by the @@ -67,5 +87,9 @@ int orte_iof_svc_pub_delete( void orte_iof_svc_pub_delete_all( const orte_process_name_t* name); +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif diff --git a/orte/mca/iof/svc/iof_svc_sub.c b/orte/mca/iof/svc/iof_svc_sub.c index 3e7d7bde87..103da39460 100644 --- a/orte/mca/iof/svc/iof_svc_sub.c +++ b/orte/mca/iof/svc/iof_svc_sub.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -220,9 +220,9 @@ int orte_iof_svc_sub_forward( ORTE_IOF_BASE_FRAG_ALLOC(frag,rc); frag->frag_hdr.hdr_msg = *hdr; frag->frag_len = frag->frag_hdr.hdr_msg.msg_len; - frag->frag_iov[0].iov_base = (void*)&frag->frag_hdr; + frag->frag_iov[0].iov_base = (IOVBASE_TYPE*)&frag->frag_hdr; frag->frag_iov[0].iov_len = sizeof(frag->frag_hdr); - frag->frag_iov[1].iov_base = (void*)frag->frag_data; + frag->frag_iov[1].iov_base = (IOVBASE_TYPE*)frag->frag_data; frag->frag_iov[1].iov_len = frag->frag_len; memcpy(frag->frag_data, data, frag->frag_len); ORTE_IOF_BASE_HDR_MSG_NTOH(frag->frag_hdr.hdr_msg); diff --git a/orte/mca/iof/svc/iof_svc_sub.h b/orte/mca/iof/svc/iof_svc_sub.h index 8e180eb9a1..cb07e27f3c 100644 --- a/orte/mca/iof/svc/iof_svc_sub.h +++ b/orte/mca/iof/svc/iof_svc_sub.h @@ -1,15 +1,35 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2006 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + #ifndef MCA_IOF_SVC_SUBSCRIPT_H #define MCA_IOF_SVC_SUBSCRIPT_H -#include "orte/class/orte_pointer_array.h" -#include "orte/class/orte_proc_table.h" - /** * A subscription routes data from a specified set * of source endpoints to one or more destination * endpoints. */ +#include "opal/class/opal_hash_table.h" + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif struct orte_iof_svc_fwd_t { opal_list_item_t super; @@ -106,5 +126,9 @@ int orte_iof_svc_fwd_delete( orte_iof_svc_sub_t* sub, orte_iof_svc_pub_t* pub); +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif diff --git a/orte/mca/ns/ns_types.h b/orte/mca/ns/ns_types.h index 70e4733fcd..22b6fd6ac8 100644 --- a/orte/mca/ns/ns_types.h +++ b/orte/mca/ns/ns_types.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -43,6 +43,10 @@ #include "opal/types.h" #include "opal/class/opal_list.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + #define ORTE_NAME_ARGS(n) \ (unsigned long) ((NULL == n) ? -1 : (int32_t)(n)->cellid), \ (unsigned long) ((NULL == n) ? -1 : (int32_t)(n)->jobid), \ @@ -87,7 +91,7 @@ typedef struct orte_process_name_t orte_process_name_t; #define ORTE_JOBID_MAX ORTE_STD_CNTR_MAX #define ORTE_VPID_MAX ORTE_STD_CNTR_MAX -extern orte_process_name_t orte_name_all; +ORTE_DECLSPEC extern orte_process_name_t orte_name_all; #define ORTE_NAME_ALL &orte_name_all /** @@ -119,6 +123,10 @@ struct orte_name_services_namelist_t { }; typedef struct orte_name_services_namelist_t orte_name_services_namelist_t; -ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_name_services_namelist_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_name_services_namelist_t); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif #endif diff --git a/orte/mca/ns/proxy/src/ns_proxy.c b/orte/mca/ns/proxy/src/ns_proxy.c index 8872572f46..04b945fa33 100644 --- a/orte/mca/ns/proxy/src/ns_proxy.c +++ b/orte/mca/ns/proxy/src/ns_proxy.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -701,7 +701,7 @@ int orte_ns_proxy_define_data_type(const char *name, return rc; } - if (ORTE_SUCCESS != (rc = orte_dss.pack(cmd, &name, 1, ORTE_STRING))) { + if (ORTE_SUCCESS != (rc = orte_dss.pack(cmd, (void*)&name, 1, ORTE_STRING))) { ORTE_ERROR_LOG(rc); OBJ_RELEASE(cmd); OPAL_THREAD_UNLOCK(&orte_ns_proxy.mutex); diff --git a/orte/mca/ns/proxy/src/ns_proxy.h b/orte/mca/ns/proxy/src/ns_proxy.h index ee38b69d99..f7c4375ac7 100644 --- a/orte/mca/ns/proxy/src/ns_proxy.h +++ b/orte/mca/ns/proxy/src/ns_proxy.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -127,7 +127,10 @@ int orte_ns_proxy_dump_tags(void); int orte_ns_proxy_dump_datatypes(void); - +/* + * + */ +ORTE_MODULE_DECLSPEC extern mca_ns_base_component_t mca_ns_proxy_component; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/ns/replica/src/ns_replica.h b/orte/mca/ns/replica/src/ns_replica.h index d9e492515a..212ca9f618 100644 --- a/orte/mca/ns/replica/src/ns_replica.h +++ b/orte/mca/ns/replica/src/ns_replica.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -46,7 +46,6 @@ typedef struct orte_ns_replica_cell_tracker_t orte_ns_replica_cell_tracker_t; OBJ_CLASS_DECLARATION(orte_ns_replica_cell_tracker_t); - /* * object for tracking vpids/jobids * This structure is used to track jobid-max vpid pairs. Basically, we @@ -183,6 +182,11 @@ int orte_ns_replica_define_data_type(const char *name, int orte_ns_replica_create_my_name(void); +/* + * + */ +ORTE_MODULE_DECLSPEC extern mca_ns_base_component_t mca_ns_replica_component; + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/oob/base/oob_base_init.c b/orte/mca/oob/base/oob_base_init.c index f668349b9c..c48db9d3ab 100644 --- a/orte/mca/oob/base/oob_base_init.c +++ b/orte/mca/oob/base/oob_base_init.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -102,7 +102,6 @@ int mca_oob_base_init(void) mca_base_component_list_item_t *cli; mca_oob_base_component_t *component; mca_oob_t *module; - extern opal_list_t mca_oob_base_components; mca_oob_t *s_module = NULL; int s_priority = -1; diff --git a/orte/mca/oob/base/oob_base_recv_nb.c b/orte/mca/oob/base/oob_base_recv_nb.c index d35d54fc2c..3fa5456218 100644 --- a/orte/mca/oob/base/oob_base_recv_nb.c +++ b/orte/mca/oob/base/oob_base_recv_nb.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -104,7 +104,7 @@ int mca_oob_recv_packed_nb( mca_oob_callback_packed_fn_t cbfunc, void* cbdata) { - mca_oob_recv_cbdata_t *oob_cbdata = malloc(sizeof(mca_oob_recv_cbdata_t)); + mca_oob_recv_cbdata_t *oob_cbdata = (mca_oob_recv_cbdata_t*)malloc(sizeof(mca_oob_recv_cbdata_t)); int rc; if(NULL == oob_cbdata) { @@ -141,7 +141,7 @@ static void mca_oob_recv_callback( int tag, void* cbdata) { - mca_oob_recv_cbdata_t *oob_cbdata = cbdata; + mca_oob_recv_cbdata_t *oob_cbdata = (mca_oob_recv_cbdata_t*)cbdata; orte_buffer_t buffer; /* validate status */ diff --git a/orte/mca/oob/base/oob_base_send.c b/orte/mca/oob/base/oob_base_send.c index d609f5c64c..b947b8d699 100644 --- a/orte/mca/oob/base/oob_base_send.c +++ b/orte/mca/oob/base/oob_base_send.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -72,7 +72,7 @@ int mca_oob_send_packed (orte_process_name_t* peer, orte_buffer_t* buffer, int t } orte_dss.load(buffer, dataptr, datalen); - msg[0].iov_base = dataptr; + msg[0].iov_base = (IOVBASE_TYPE*)dataptr; msg[0].iov_len = datalen; return(mca_oob.oob_send(peer, msg, 1, tag, flags)); diff --git a/orte/mca/oob/base/oob_base_send_nb.c b/orte/mca/oob/base/oob_base_send_nb.c index bb3470b9e0..e381e1e88c 100644 --- a/orte/mca/oob/base/oob_base_send_nb.c +++ b/orte/mca/oob/base/oob_base_send_nb.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -109,13 +109,13 @@ int mca_oob_send_packed_nb( orte_dss.load(buffer, dataptr, datalen); /* allocate a struct to pass into callback */ - if(NULL == (oob_cbdata = malloc(sizeof(mca_oob_send_cbdata_t)))) { + if(NULL == (oob_cbdata = (mca_oob_send_cbdata_t*)malloc(sizeof(mca_oob_send_cbdata_t)))) { return ORTE_ERR_OUT_OF_RESOURCE; } oob_cbdata->cbbuf = buffer; oob_cbdata->cbfunc = cbfunc; oob_cbdata->cbdata = cbdata; - oob_cbdata->cbiov.iov_base = dataptr; + oob_cbdata->cbiov.iov_base = (IOVBASE_TYPE*)dataptr; oob_cbdata->cbiov.iov_len = datalen; /* queue up the request */ @@ -147,7 +147,7 @@ static void mca_oob_send_callback( void* cbdata) { /* validate status */ - mca_oob_send_cbdata_t *oob_cbdata = cbdata; + mca_oob_send_cbdata_t *oob_cbdata = (mca_oob_send_cbdata_t*)cbdata; if(status < 0) { oob_cbdata->cbfunc(status, peer, NULL, tag, oob_cbdata->cbdata); free(oob_cbdata); diff --git a/orte/mca/oob/oob.h b/orte/mca/oob/oob.h index bd55e841c3..f3abd671b5 100644 --- a/orte/mca/oob/oob.h +++ b/orte/mca/oob/oob.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -275,7 +275,7 @@ typedef struct mca_oob_base_info_t mca_oob_base_info_t; /** * declare the association structure as a class */ -OBJ_CLASS_DECLARATION(mca_oob_base_info_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(mca_oob_base_info_t); /** * List of registrations of exception callbacks @@ -293,7 +293,7 @@ typedef struct mca_oob_base_exception_handler_t mca_oob_base_exception_handler_t /** * declare the association structure as a class */ -OBJ_CLASS_DECLARATION(mca_oob_base_exception_handler_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(mca_oob_base_exception_handler_t); /* diff --git a/orte/mca/oob/tcp/oob_tcp.c b/orte/mca/oob/tcp/oob_tcp.c index fd2edc7d98..ea14b13a68 100644 --- a/orte/mca/oob/tcp/oob_tcp.c +++ b/orte/mca/oob/tcp/oob_tcp.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -260,7 +260,7 @@ static void mca_oob_tcp_accept(void) if(sd < 0) { if(opal_socket_errno == EINTR) continue; - if(opal_socket_errno != EAGAIN || opal_socket_errno != EWOULDBLOCK) + if(opal_socket_errno != EAGAIN && opal_socket_errno != EWOULDBLOCK) opal_output(0, "mca_oob_tcp_accept: accept() failed with errno %d.", opal_socket_errno); return; } @@ -373,14 +373,14 @@ static void mca_oob_tcp_recv_probe(int sd, mca_oob_tcp_hdr_t* hdr) ORTE_NAME_ARGS(orte_process_info.my_name), ORTE_NAME_ARGS(&(hdr->msg_src)), opal_socket_errno); - close(sd); + CLOSE_THE_SOCKET(sd); return; } continue; } cnt += retval; } - close(sd); + CLOSE_THE_SOCKET(sd); } /* @@ -425,7 +425,7 @@ static void mca_oob_tcp_recv_connect(int sd, mca_oob_tcp_hdr_t* hdr) if(NULL == peer) { opal_output(0, "[%lu,%lu,%lu] mca_oob_tcp_recv_handler: unable to locate peer", ORTE_NAME_ARGS(orte_process_info.my_name)); - close(sd); + CLOSE_THE_SOCKET(sd); return; } /* is the peer instance willing to accept this connection */ @@ -438,7 +438,7 @@ static void mca_oob_tcp_recv_connect(int sd, mca_oob_tcp_hdr_t* hdr) ORTE_NAME_ARGS(&(hdr->msg_src)), peer->peer_state); } - close(sd); + CLOSE_THE_SOCKET(sd); return; } } @@ -472,13 +472,13 @@ static void mca_oob_tcp_recv_handler(int sd, short flags, void* user) opal_output(0, "[%lu,%lu,%lu] mca_oob_tcp_recv_handler: peer closed connection", ORTE_NAME_ARGS(orte_process_info.my_name)); } - close(sd); + CLOSE_THE_SOCKET(sd); return; } if(opal_socket_errno != EINTR) { opal_output(0, "[%lu,%lu,%lu] mca_oob_tcp_recv_handler: recv() failed with errno=%d\n", ORTE_NAME_ARGS(orte_process_info.my_name), opal_socket_errno); - close(sd); + CLOSE_THE_SOCKET(sd); return; } } @@ -495,7 +495,7 @@ static void mca_oob_tcp_recv_handler(int sd, short flags, void* user) default: opal_output(0, "[%lu,%lu,%lu] mca_oob_tcp_recv_handler: invalid message type: %d\n", ORTE_NAME_ARGS(orte_process_info.my_name), hdr.msg_type); - close(sd); + CLOSE_THE_SOCKET(sd); break; } } @@ -755,7 +755,7 @@ int mca_oob_tcp_init(void) /* random delay to stagger connections back to seed */ #if defined(__WINDOWS__) - sleep((orte_process_info.my_name->vpid % orte_process_info.num_procs % 1000) * 1000); + Sleep((orte_process_info.my_name->vpid % orte_process_info.num_procs % 1000) * 100); #else usleep((orte_process_info.my_name->vpid % orte_process_info.num_procs % 1000) * 1000); #endif @@ -933,7 +933,7 @@ int mca_oob_tcp_fini(void) /* close listen socket */ if (mca_oob_tcp_component.tcp_listen_sd >= 0) { opal_event_del(&mca_oob_tcp_component.tcp_recv_event); - close(mca_oob_tcp_component.tcp_listen_sd); + CLOSE_THE_SOCKET(mca_oob_tcp_component.tcp_listen_sd); mca_oob_tcp_component.tcp_listen_sd = -1; } diff --git a/orte/mca/oob/tcp/oob_tcp.h b/orte/mca/oob/tcp/oob_tcp.h index d4ea570277..c570e4bc9a 100644 --- a/orte/mca/oob/tcp/oob_tcp.h +++ b/orte/mca/oob/tcp/oob_tcp.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,8 +40,6 @@ extern "C" { #endif - - /* * standard component functions */ @@ -225,6 +223,11 @@ void mca_oob_tcp_registry_callback( void mca_oob_tcp_set_socket_options(int sd); +typedef enum { + OOB_TCP_EVENT, + OOB_TCP_LISTEN_THREAD +} mca_oob_tcp_listen_type_t; + /** * OOB TCP Component */ @@ -262,8 +265,13 @@ struct mca_oob_tcp_component_t { */ typedef struct mca_oob_tcp_component_t mca_oob_tcp_component_t; -ORTE_DECLSPEC extern mca_oob_tcp_component_t mca_oob_tcp_component; +ORTE_MODULE_DECLSPEC extern mca_oob_tcp_component_t mca_oob_tcp_component; +#if defined(__WINDOWS__) +#define CLOSE_THE_SOCKET(socket) closesocket(socket) +#else +#define CLOSE_THE_SOCKET(socket) close(socket) +#endif /* defined(__WINDOWS__) */ #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/oob/tcp/oob_tcp_addr.h b/orte/mca/oob/tcp/oob_tcp_addr.h index 70d3ba6b4d..3c53846454 100644 --- a/orte/mca/oob/tcp/oob_tcp_addr.h +++ b/orte/mca/oob/tcp/oob_tcp_addr.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -33,6 +33,7 @@ #include "orte/dss/dss.h" #include "opal/class/opal_object.h" #include "orte/mca/ns/ns_types.h" + #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif diff --git a/orte/mca/oob/tcp/oob_tcp_peer.c b/orte/mca/oob/tcp/oob_tcp_peer.c index 0968cc8d1f..47f46a510e 100644 --- a/orte/mca/oob/tcp/oob_tcp_peer.c +++ b/orte/mca/oob/tcp/oob_tcp_peer.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -490,7 +490,7 @@ void mca_oob_tcp_peer_shutdown(mca_oob_tcp_peer_t* peer) if (peer->peer_sd >= 0) { opal_event_del(&peer->peer_recv_event); opal_event_del(&peer->peer_send_event); - close(peer->peer_sd); + CLOSE_THE_SOCKET(peer->peer_sd); peer->peer_sd = -1; } diff --git a/orte/mca/oob/tcp/oob_tcp_peer.h b/orte/mca/oob/tcp/oob_tcp_peer.h index 6cae801bad..9c1e45cd3a 100644 --- a/orte/mca/oob/tcp/oob_tcp_peer.h +++ b/orte/mca/oob/tcp/oob_tcp_peer.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -72,12 +72,6 @@ struct mca_oob_tcp_peer_t { */ typedef struct mca_oob_tcp_peer_t mca_oob_tcp_peer_t; -/* - * Class declaration. - */ - -OBJ_CLASS_DECLARATION(mca_oob_tcp_peer_t); - /** * Get a new peer data structure */ @@ -103,6 +97,12 @@ OBJ_CLASS_DECLARATION(mca_oob_tcp_peer_t); extern "C" { #endif +/* + * Class declaration. + */ + +OBJ_CLASS_DECLARATION(mca_oob_tcp_peer_t); + /** * Lookup a peer in the cache - if it doesn't exists * create one and cache it. diff --git a/orte/mca/oob/tcp/oob_tcp_ping.c b/orte/mca/oob/tcp/oob_tcp_ping.c index 152a6889f9..6a89a8d4a4 100644 --- a/orte/mca/oob/tcp/oob_tcp_ping.c +++ b/orte/mca/oob/tcp/oob_tcp_ping.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -73,6 +73,7 @@ int mca_oob_tcp_ping( fd_set fdset; mca_oob_tcp_hdr_t hdr; struct timeval tv; + struct iovec iov; #ifndef __WINDOWS__ struct opal_event sigpipe_handler; #endif @@ -119,7 +120,7 @@ int mca_oob_tcp_ping( if(connect(sd, (struct sockaddr*)&inaddr, sizeof(inaddr)) < 0) { /* connect failed? */ if(opal_socket_errno != EINPROGRESS && opal_socket_errno != EWOULDBLOCK) { - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_ERR_UNREACH; } @@ -128,7 +129,7 @@ int mca_oob_tcp_ping( tv = *timeout; rc = select(sd+1, NULL, &fdset, NULL, &tv); if(rc <= 0) { - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_ERR_UNREACH; } } @@ -160,14 +161,19 @@ int mca_oob_tcp_ping( noop, &sigpipe_handler); opal_signal_add(&sigpipe_handler, NULL); #endif - /* Do the write and see what happens */ - rc = write(sd, &hdr, sizeof(hdr)); + /* Do the write and see what happens. Use the writev version just to + * make Windows happy as there the write function is limitted to + * file operations. + */ + iov.iov_base = (IOVBASE_TYPE*)&hdr; + iov.iov_len = sizeof(hdr); + rc = writev(sd, &iov, 1 ); #ifndef __WINDOWS__ /* Now de-register the handler */ opal_signal_del(&sigpipe_handler); #endif if (rc != sizeof(hdr)) { - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_ERR_UNREACH; } @@ -176,19 +182,19 @@ int mca_oob_tcp_ping( tv = *timeout; rc = select(sd+1, &fdset, NULL, NULL, &tv); if(rc <= 0) { - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_ERR_UNREACH; } if((rc = read(sd, &hdr, sizeof(hdr))) != sizeof(hdr)) { - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_ERR_UNREACH; } MCA_OOB_TCP_HDR_NTOH(&hdr); if(hdr.msg_type != MCA_OOB_TCP_PROBE) { - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_ERR_UNREACH; } - close(sd); + CLOSE_THE_SOCKET(sd); return ORTE_SUCCESS; } diff --git a/orte/mca/pls/base/base.h b/orte/mca/pls/base/base.h index 8906f5bc9f..39864bd338 100644 --- a/orte/mca/pls/base/base.h +++ b/orte/mca/pls/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -136,8 +136,8 @@ extern "C" { * string pointing to the home directory name (owned by the * context; safe to free at destruction). */ - int orte_pls_base_check_context_cwd(orte_app_context_t *context, - bool do_chdir); + ORTE_DECLSPEC int orte_pls_base_check_context_cwd(orte_app_context_t *context, + bool do_chdir); /** * Check that the app exists and is executable. If it is not, @@ -146,7 +146,8 @@ extern "C" { * app with the string containing the absolute pathname to the * exectuable (owned by the context; safe to free at destruction). */ - int orte_pls_base_check_context_app(orte_app_context_t *context); + ORTE_DECLSPEC int orte_pls_base_check_context_app(orte_app_context_t *context); + #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/pls/base/help-pls-base.txt b/orte/mca/pls/base/help-pls-base.txt index 746a3dda94..c87046d588 100644 --- a/orte/mca/pls/base/help-pls-base.txt +++ b/orte/mca/pls/base/help-pls-base.txt @@ -3,7 +3,7 @@ # Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana # University Research and Technology # Corporation. All rights reserved. -# Copyright (c) 2004-2005 The University of Tennessee and The University +# Copyright (c) 2004-2006 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -20,8 +20,8 @@ No available launching agents were found. This is an unusual error; it means that Open RTE was unable to find -any mechanism to launch proceses, and therefore is unable start the -process(es) in your application. +any mechanism to launch proceses, and therefore is unable to start the +process(es) required by your application. [chdir-error] Failed to change to the working directory: diff --git a/orte/mca/pls/base/pls_base_context.c b/orte/mca/pls/base/pls_base_context.c index 35c7e1505a..fdc1157af9 100644 --- a/orte/mca/pls/base/pls_base_context.c +++ b/orte/mca/pls/base/pls_base_context.c @@ -42,12 +42,14 @@ #include "orte/mca/pls/base/base.h" #include "orte/mca/errmgr/errmgr.h" +#if !defined(__WINDOWS__) extern char **environ; +#endif /* !defined(__WINDOWS__) */ int orte_pls_base_check_context_cwd(orte_app_context_t *context, bool want_chdir) { - bool good; + bool good = true; char *tmp; char hostname[MAXHOSTNAMELEN]; struct stat buf; @@ -57,7 +59,6 @@ int orte_pls_base_check_context_cwd(orte_app_context_t *context, /* If the directory does not exist, or stat() otherwise fails to get info about it, then set good = false. */ - good = true; if (!(0 == stat(context->cwd, &buf) && S_ISDIR(buf.st_mode))) { good = false; } diff --git a/orte/mca/pls/bproc/pls_bproc.c b/orte/mca/pls/bproc/pls_bproc.c index f1b2919172..0be064b6e2 100644 --- a/orte/mca/pls/bproc/pls_bproc.c +++ b/orte/mca/pls/bproc/pls_bproc.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -72,7 +72,9 @@ /** * Our current evironment */ +#if !defined(__WINDOWS__) extern char **environ; +#endif /* !defined(__WINDOWS__) */ #if OMPI_HAVE_POSIX_THREADS && OMPI_THREADS_HAVE_DIFFERENT_PIDS int orte_pls_bproc_launch_threaded(orte_jobid_t); @@ -585,9 +587,8 @@ static int orte_pls_bproc_launch_daemons(orte_cellid_t cellid, char *** envp, } else { orted_path = opal_path_findv(mca_pls_bproc_component.orted, 0, environ, NULL); if(NULL == orted_path) { - asprintf(&orted_path, "%s/%s", OPAL_BINDIR, - mca_pls_bproc_component.orted); - if (0 != stat(orted_path, &buf)) { + orted_path = opal_os_path( false, OPAL_BINDIR, mca_pls_bproc_component.orted, NULL ); + if( (NULL != orted_path) || (0 != stat(orted_path, &buf)) ) { char *path = getenv("PATH"); if (NULL == path) { path = ("PATH is empty!"); diff --git a/orte/mca/pls/bproc/pls_bproc.h b/orte/mca/pls/bproc/pls_bproc.h index bf6ba03870..ae8633e7be 100644 --- a/orte/mca/pls/bproc/pls_bproc.h +++ b/orte/mca/pls/bproc/pls_bproc.h @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -114,8 +114,8 @@ struct orte_pls_bproc_component_t { */ typedef struct orte_pls_bproc_component_t orte_pls_bproc_component_t; -ORTE_DECLSPEC extern orte_pls_bproc_component_t mca_pls_bproc_component; -ORTE_DECLSPEC extern orte_pls_base_module_t orte_pls_bproc_module; +ORTE_DECLSPEC orte_pls_bproc_component_t mca_pls_bproc_component; +ORTE_DECLSPEC orte_pls_base_module_t orte_pls_bproc_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/pls/bproc_orted/pls_bproc_orted.h b/orte/mca/pls/bproc_orted/pls_bproc_orted.h index 4a48b211dd..9515badd2a 100644 --- a/orte/mca/pls/bproc_orted/pls_bproc_orted.h +++ b/orte/mca/pls/bproc_orted/pls_bproc_orted.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -77,8 +77,8 @@ struct orte_pls_bproc_orted_component_t { */ typedef struct orte_pls_bproc_orted_component_t orte_pls_bproc_orted_component_t; -ORTE_DECLSPEC extern orte_pls_bproc_orted_component_t mca_pls_bproc_orted_component; -ORTE_DECLSPEC extern orte_pls_base_module_t orte_pls_bproc_orted_module; +ORTE_DECLSPEC orte_pls_bproc_orted_component_t mca_pls_bproc_orted_component; +ORTE_DECLSPEC orte_pls_base_module_t orte_pls_bproc_orted_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/pls/fork/pls_fork.h b/orte/mca/pls/fork/pls_fork.h index 15a41bff87..147ee66b78 100644 --- a/orte/mca/pls/fork/pls_fork.h +++ b/orte/mca/pls/fork/pls_fork.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, diff --git a/orte/mca/pls/fork/pls_fork_module.c b/orte/mca/pls/fork/pls_fork_module.c index 446c37d864..a6dabc2181 100644 --- a/orte/mca/pls/fork/pls_fork_module.c +++ b/orte/mca/pls/fork/pls_fork_module.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -52,7 +52,6 @@ #include "opal/mca/paffinity/base/base.h" #include "opal/util/show_help.h" #include "opal/util/path.h" -#include "opal/util/basename.h" #include "opal/class/opal_value_array.h" #include "orte/util/sys_info.h" #include "orte/util/univ_info.h" @@ -75,7 +74,9 @@ #include "orte/mca/smr/smr.h" #include "orte/mca/pls/fork/pls_fork.h" +#if !defined(__WINDOWS__) extern char **environ; +#endif /* !defined(__WINDOWS__) */ #if OMPI_HAVE_POSIX_THREADS && OMPI_THREADS_HAVE_DIFFERENT_PIDS && OMPI_ENABLE_PROGRESS_THREADS static int orte_pls_fork_launch_threaded(orte_jobid_t); @@ -256,36 +257,6 @@ static int orte_pls_fork_proc( return ORTE_ERR_OUT_OF_RESOURCE; } -#if 0 - { - /* Do fork the windows way: see opal_few() for example */ - HANDLE new_process; - STARTUPINFO si; - PROCESS_INFORMATION pi; - DWORD process_id; - - ZeroMemory (&si, sizeof(si)); - ZeroMemory (&pi, sizeof(pi)); - - GetStartupInfo (&si); - if (!CreateProcess (NULL, - "new process", - NULL, - NULL, - TRUE, - 0, - NULL, - NULL, - &si, - &pi)){ - /* actual error can be got by simply calling GetLastError() */ - return ORTE_ERROR; - } - /* get child pid */ - process_id = GetProcessId(&pi); - pid = (int) process_id; - } -#endif /* A pipe is used to communicate between the parent and child to indicate whether the exec ultiimately succeeded or failed. The child sets the pipe to be close-on-exec; the child only ever diff --git a/orte/mca/pls/poe/pls_poe.h b/orte/mca/pls/poe/pls_poe.h index f188fff046..d77db647c1 100644 --- a/orte/mca/pls/poe/pls_poe.h +++ b/orte/mca/pls/poe/pls_poe.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -62,10 +62,8 @@ struct orte_pls_poe_component_t { typedef struct orte_pls_poe_component_t orte_pls_poe_component_t; -ORTE_DECLSPEC extern orte_pls_poe_component_t mca_pls_poe_component; -ORTE_DECLSPEC extern orte_pls_base_module_t orte_pls_poe_module; - - +ORTE_DECLSPEC orte_pls_poe_component_t mca_pls_poe_component; +ORTE_DECLSPEC orte_pls_base_module_t orte_pls_poe_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/pls/poe/pls_poe_component.c b/orte/mca/pls/poe/pls_poe_component.c index a1965f94dc..aa026f7fce 100644 --- a/orte/mca/pls/poe/pls_poe_component.c +++ b/orte/mca/pls/poe/pls_poe_component.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -150,13 +150,16 @@ int orte_pls_poe_component_open(void) return ORTE_SUCCESS; } +#if !defined(__WINDOWS__) +extern char **environ; +#endif /* !defined(__WINDOWS__) */ + /** orte_pls_poe_component_init - initialize component, check if we can run on this machine. @return error number */ orte_pls_base_module_t *orte_pls_poe_component_init(int *priority) { - extern char **environ; mca_pls_poe_component.path = opal_path_findv(mca_pls_poe_component.argv[0], 0, environ, NULL); if (NULL == mca_pls_poe_component.path) { return NULL; diff --git a/orte/mca/pls/poe/pls_poe_module.c b/orte/mca/pls/poe/pls_poe_module.c index 74cea385c7..8911d62ef0 100644 --- a/orte/mca/pls/poe/pls_poe_module.c +++ b/orte/mca/pls/poe/pls_poe_module.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -48,7 +48,9 @@ #include "orte/util/session_dir.h" #include "orte/runtime/orte_wait.h" +#if !defined(__WINDOWS__) extern char **environ; +#endif /* !defined(__WINDOWS__) */ /* * Local functions diff --git a/orte/mca/pls/rsh/pls_rsh.h b/orte/mca/pls/rsh/pls_rsh.h index 7df7cd7222..e52dcf24fd 100644 --- a/orte/mca/pls/rsh/pls_rsh.h +++ b/orte/mca/pls/rsh/pls_rsh.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -76,8 +76,8 @@ struct orte_pls_rsh_component_t { }; typedef struct orte_pls_rsh_component_t orte_pls_rsh_component_t; -ORTE_DECLSPEC extern orte_pls_rsh_component_t mca_pls_rsh_component; -ORTE_DECLSPEC extern orte_pls_base_module_t orte_pls_rsh_module; +ORTE_MODULE_DECLSPEC extern orte_pls_rsh_component_t mca_pls_rsh_component; +extern orte_pls_base_module_t orte_pls_rsh_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/pls/rsh/pls_rsh_component.c b/orte/mca/pls/rsh/pls_rsh_component.c index df0aace50e..dfe0d17b65 100644 --- a/orte/mca/pls/rsh/pls_rsh_component.c +++ b/orte/mca/pls/rsh/pls_rsh_component.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,8 +40,9 @@ #include "opal/mca/base/mca_base_param.h" #include "orte/mca/rml/rml.h" +#if !defined(__WINDOWS__) extern char **environ; - +#endif /* !defined(__WINDOWS__) */ /* * Local function @@ -118,7 +119,7 @@ int orte_pls_rsh_component_open(void) mca_base_param_reg_int(c, "debug", "Whether or not to enable debugging output for the rsh pls component (0 or 1)", false, false, false, &tmp); - mca_pls_rsh_component.debug = tmp; + mca_pls_rsh_component.debug = (tmp != 0 ? true : false); mca_base_param_reg_int(c, "num_concurrent", "How many pls_rsh_agent instances to invoke concurrently (must be > 0)", false, false, 128, &tmp); @@ -127,12 +128,12 @@ int orte_pls_rsh_component_open(void) true, tmp); tmp = 1; } - mca_pls_rsh_component.num_concurrent = tmp; + mca_pls_rsh_component.num_concurrent = (tmp != 0 ? true : false); if (mca_pls_rsh_component.debug == 0) { mca_base_param_reg_int_name("orte", "debug", "Whether or not to enable debugging output for all ORTE components (0 or 1)", false, false, false, &tmp); - mca_pls_rsh_component.debug = tmp; + mca_pls_rsh_component.debug = (tmp != 0 ? true : false); } mca_base_param_reg_string(c, "orted", @@ -150,11 +151,11 @@ int orte_pls_rsh_component_open(void) mca_base_param_reg_int(c, "reap", "If set to 1, wait for all the processes to complete before exiting. Otherwise, quit immediately -- without waiting for confirmation that all other processes in the job have completed.", false, false, 1, &tmp); - mca_pls_rsh_component.reap = tmp; + mca_pls_rsh_component.reap = (tmp != 0 ? true : false); mca_base_param_reg_int(c, "assume_same_shell", "If set to 1, assume that the shell on the remote node is the same as the shell on the local node. Otherwise, probe for what the remote shell.", false, false, 1, &tmp); - mca_pls_rsh_component.assume_same_shell = tmp; + mca_pls_rsh_component.assume_same_shell = (tmp != 0 ? true : false); mca_base_param_reg_string(c, "agent", "The command used to launch executables on remote nodes (typically either \"ssh\" or \"rsh\")", @@ -165,11 +166,14 @@ int orte_pls_rsh_component_open(void) } +#if !defined(__WINDOWS__) +extern char **environ; +#endif /* !defined(__WINDOWS__) */ + orte_pls_base_module_t *orte_pls_rsh_component_init(int *priority) { char *bname; size_t i; - extern char **environ; /* Take the string that was given to us by the pla_rsh_agent MCA param and search for it */ diff --git a/orte/mca/pls/rsh/pls_rsh_module.c b/orte/mca/pls/rsh/pls_rsh_module.c index 08b55bd82b..808224b24a 100644 --- a/orte/mca/pls/rsh/pls_rsh_module.c +++ b/orte/mca/pls/rsh/pls_rsh_module.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -58,7 +58,7 @@ #include "opal/install_dirs.h" #include "opal/mca/base/mca_base_param.h" #include "opal/util/if.h" -#include "opal/util/if.h" +#include "opal/util/os_path.h" #include "opal/util/path.h" #include "opal/event/event.h" #include "opal/util/show_help.h" @@ -83,8 +83,9 @@ #include "orte/mca/pls/rsh/pls_rsh.h" #include "orte/util/sys_info.h" +#if !defined(__WINDOWS__) extern char **environ; - +#endif /* !defined(__WINDOWS__) */ #if OMPI_HAVE_POSIX_THREADS && OMPI_THREADS_HAVE_DIFFERENT_PIDS && OMPI_ENABLE_PROGRESS_THREADS static int orte_pls_rsh_launch_threaded(orte_jobid_t jobid); @@ -764,8 +765,7 @@ int orte_pls_rsh_launch(orte_jobid_t jobid) } } else { if (NULL != prefix_dir) { - asprintf(&exec_path, "%s/%s/orted", - prefix_dir, bin_base); + exec_path = opal_os_path( false, prefix_dir, bin_base, "orted", NULL ); } /* If we yet did not fill up the execpath, do so now */ if (NULL == exec_path) { @@ -784,12 +784,13 @@ int orte_pls_rsh_launch(orte_jobid_t jobid) char *oldenv, *newenv; /* Reset PATH */ + newenv = opal_os_path( false, prefix_dir, bin_base, NULL ); oldenv = getenv("PATH"); if (NULL != oldenv) { - asprintf(&newenv, "%s/%s:%s", prefix_dir, - bin_base, oldenv); - } else { - asprintf(&newenv, "%s/%s", prefix_dir, bin_base); + char *temp; + asprintf(&temp, "%s:%s", newenv, oldenv ); + free( newenv ); + newenv = temp; } opal_setenv("PATH", newenv, true, &environ); if (mca_pls_rsh_component.debug) { @@ -798,12 +799,13 @@ int orte_pls_rsh_launch(orte_jobid_t jobid) free(newenv); /* Reset LD_LIBRARY_PATH */ + newenv = opal_os_path( false, prefix_dir, lib_base, NULL ); oldenv = getenv("LD_LIBRARY_PATH"); if (NULL != oldenv) { - asprintf(&newenv, "%s/%s:%s", prefix_dir, - lib_base, oldenv); - } else { - asprintf(&newenv, "%s/%s", prefix_dir, lib_base); + char* temp; + asprintf(&temp, "%s:%s", newenv, lib_base, oldenv, NULL); + free(newenv); + newenv = temp; } opal_setenv("LD_LIBRARY_PATH", newenv, true, &environ); if (mca_pls_rsh_component.debug) { diff --git a/orte/mca/pls/slurm/pls_slurm_module.c b/orte/mca/pls/slurm/pls_slurm_module.c index 439942c131..8a1f34c7a8 100644 --- a/orte/mca/pls/slurm/pls_slurm_module.c +++ b/orte/mca/pls/slurm/pls_slurm_module.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -99,8 +99,9 @@ static pid_t srun_pid = 0; /* * External */ +#if !defined(__WINDOWS__) extern char **environ; - +#endif /* !defined(__WINDOWS__) */ static int pls_slurm_launch(orte_jobid_t jobid) { diff --git a/orte/mca/pls/tm/pls_tm.h b/orte/mca/pls/tm/pls_tm.h index b06532a675..6ce3a835c5 100644 --- a/orte/mca/pls/tm/pls_tm.h +++ b/orte/mca/pls/tm/pls_tm.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -44,9 +44,8 @@ extern "C" { ORTE_DECLSPEC extern orte_pls_tm_component_t mca_pls_tm_component; extern orte_pls_base_module_1_0_0_t orte_pls_tm_module; - - #if defined(c_plusplus) || defined(__cplusplus) } #endif + #endif /* ORTE_PLS_TM_EXPORT_H */ diff --git a/orte/mca/pls/tm/pls_tm_module.c b/orte/mca/pls/tm/pls_tm_module.c index 7089ed93fc..49e77df52d 100644 --- a/orte/mca/pls/tm/pls_tm_module.c +++ b/orte/mca/pls/tm/pls_tm_module.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -93,9 +93,9 @@ orte_pls_base_module_1_0_0_t orte_pls_tm_module = { pls_tm_finalize }; - +#if !defined(__WINDOWS__) extern char **environ; - +#endif /* !defined(__WINDOWS__) */ static int pls_tm_launch(orte_jobid_t jobid) diff --git a/orte/mca/ras/base/ras_base_node.h b/orte/mca/ras/base/ras_base_node.h index af7fa604fe..328fceb407 100644 --- a/orte/mca/ras/base/ras_base_node.h +++ b/orte/mca/ras/base/ras_base_node.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -32,38 +32,38 @@ extern "C" { /* * Query the registry for all available nodes */ -int orte_ras_base_node_query(opal_list_t*); +ORTE_DECLSPEC int orte_ras_base_node_query(opal_list_t*); /* * Query the registry for a specific node */ -orte_ras_node_t* orte_ras_base_node_lookup(orte_cellid_t, const char* nodename); +ORTE_DECLSPEC orte_ras_node_t* orte_ras_base_node_lookup(orte_cellid_t, const char* nodename); /** * Query the registry for all nodes allocated to a specific job */ -int orte_ras_base_node_query_alloc(opal_list_t*, orte_jobid_t); +ORTE_DECLSPEC int orte_ras_base_node_query_alloc(opal_list_t*, orte_jobid_t); /** * Add the specified node definitions to the registry */ -int orte_ras_base_node_insert(opal_list_t*); +ORTE_DECLSPEC int orte_ras_base_node_insert(opal_list_t*); /** * Delete the specified nodes from the registry */ -int orte_ras_base_node_delete(opal_list_t*); +ORTE_DECLSPEC int orte_ras_base_node_delete(opal_list_t*); /** * Assign the allocated slots on the specified nodes to the * indicated jobid. */ -int orte_ras_base_node_assign(opal_list_t*, orte_jobid_t); +ORTE_DECLSPEC int orte_ras_base_node_assign(opal_list_t*, orte_jobid_t); /** * Check to see if the node segment is empty */ -int orte_ras_base_node_segment_empty(bool *empty); +ORTE_DECLSPEC int orte_ras_base_node_segment_empty(bool *empty); #if defined(c_plusplus) || defined(__cplusplus) diff --git a/orte/mca/ras/bjs/ras_bjs.h b/orte/mca/ras/bjs/ras_bjs.h index 6dc1d2bf2a..ea232abbf0 100644 --- a/orte/mca/ras/bjs/ras_bjs.h +++ b/orte/mca/ras/bjs/ras_bjs.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -43,7 +43,6 @@ typedef struct orte_ras_bjs_component_t orte_ras_bjs_component_t; ORTE_DECLSPEC extern orte_ras_bjs_component_t mca_ras_bjs_component; ORTE_DECLSPEC extern orte_ras_base_module_t orte_ras_bjs_module; - #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/ras/dash_host/ras_dash_host.h b/orte/mca/ras/dash_host/ras_dash_host.h index b458ec3b48..3ea4673846 100644 --- a/orte/mca/ras/dash_host/ras_dash_host.h +++ b/orte/mca/ras/dash_host/ras_dash_host.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -45,7 +45,7 @@ extern "C" { /** * Component export structure */ - ORTE_DECLSPEC extern orte_ras_dash_host_component_t mca_ras_dash_host_component; + ORTE_MODULE_DECLSPEC extern orte_ras_dash_host_component_t mca_ras_dash_host_component; /** * Module init function diff --git a/orte/mca/ras/hostfile/ras_hostfile.h b/orte/mca/ras/hostfile/ras_hostfile.h index 9a5e9438d9..d563febc5f 100644 --- a/orte/mca/ras/hostfile/ras_hostfile.h +++ b/orte/mca/ras/hostfile/ras_hostfile.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -45,7 +45,7 @@ extern "C" { /** * Component export structure */ - ORTE_DECLSPEC extern orte_ras_hostfile_component_t mca_ras_hostfile_component; + ORTE_MODULE_DECLSPEC extern orte_ras_hostfile_component_t mca_ras_hostfile_component; /** * Module init function diff --git a/orte/mca/ras/localhost/ras_localhost.h b/orte/mca/ras/localhost/ras_localhost.h index 0b3c138074..6dc22bd8c7 100644 --- a/orte/mca/ras/localhost/ras_localhost.h +++ b/orte/mca/ras/localhost/ras_localhost.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -45,7 +45,7 @@ extern "C" { /** * Component export structure */ - ORTE_DECLSPEC extern orte_ras_localhost_component_t mca_ras_localhost_component; + ORTE_MODULE_DECLSPEC extern orte_ras_localhost_component_t mca_ras_localhost_component; /** * Module init function diff --git a/orte/mca/ras/lsf_bproc/ras_lsf_bproc.h b/orte/mca/ras/lsf_bproc/ras_lsf_bproc.h index 631098c911..74c8bba393 100644 --- a/orte/mca/ras/lsf_bproc/ras_lsf_bproc.h +++ b/orte/mca/ras/lsf_bproc/ras_lsf_bproc.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -42,7 +42,6 @@ typedef struct orte_ras_lsf_bproc_component_t orte_ras_lsf_bproc_component_t; ORTE_DECLSPEC extern orte_ras_lsf_bproc_component_t mca_ras_lsf_bproc_component; ORTE_DECLSPEC extern orte_ras_base_module_t orte_ras_lsf_bproc_module; - #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/ras/poe/ras_poe.h b/orte/mca/ras/poe/ras_poe.h index ceee9bac44..231131a379 100644 --- a/orte/mca/ras/poe/ras_poe.h +++ b/orte/mca/ras/poe/ras_poe.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -42,7 +42,6 @@ typedef struct orte_ras_poe_component_t orte_ras_poe_component_t; ORTE_DECLSPEC extern orte_ras_poe_component_t mca_ras_poe_component; ORTE_DECLSPEC extern orte_ras_base_module_t orte_ras_poe_module; - #if defined(c_plusplus) || defined(__cplusplus) } #endif diff --git a/orte/mca/ras/ras_types.h b/orte/mca/ras/ras_types.h index 766cb202bf..f71eabcd3d 100644 --- a/orte/mca/ras/ras_types.h +++ b/orte/mca/ras/ras_types.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -16,13 +16,18 @@ * $HEADER$ */ +#ifndef ORTE_MCA_RAS_TYPES_H +#define ORTE_MCA_RAS_TYPES_H + #include "orte_config.h" #include "opal/class/opal_list.h" #include "orte/mca/smr/smr_types.h" -#ifndef ORTE_MCA_RAS_TYPES_H -#define ORTE_MCA_RAS_TYPES_H + +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /** * Struct for holding information about a node (a local copy of what @@ -75,8 +80,10 @@ struct orte_ras_node_t { */ typedef struct orte_ras_node_t orte_ras_node_t; - ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_ras_node_t); +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif #endif diff --git a/orte/mca/rds/base/base.h b/orte/mca/rds/base/base.h index a79f5320f0..1ac5fb0aa6 100644 --- a/orte/mca/rds/base/base.h +++ b/orte/mca/rds/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -79,7 +79,7 @@ ORTE_DECLSPEC extern orte_rds_base_t orte_rds_base; /* * utility functions for use within the RDS */ -int orte_rds_base_store_resource(opal_list_t *resource_list); +ORTE_DECLSPEC int orte_rds_base_store_resource(opal_list_t *resource_list); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/rds/hostfile/rds_hostfile.h b/orte/mca/rds/hostfile/rds_hostfile.h index f9d9278219..532d359249 100644 --- a/orte/mca/rds/hostfile/rds_hostfile.h +++ b/orte/mca/rds/hostfile/rds_hostfile.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -43,8 +43,8 @@ struct orte_rds_hostfile_component_t { }; typedef struct orte_rds_hostfile_component_t orte_rds_hostfile_component_t; -ORTE_DECLSPEC extern orte_rds_hostfile_component_t mca_rds_hostfile_component; -ORTE_DECLSPEC extern orte_rds_base_module_t orte_rds_hostfile_module; +ORTE_MODULE_DECLSPEC extern orte_rds_hostfile_component_t mca_rds_hostfile_component; +extern orte_rds_base_module_t orte_rds_hostfile_module; #if defined(c_plusplus) || defined(__cplusplus) diff --git a/orte/mca/rds/hostfile/rds_hostfile_lex.l b/orte/mca/rds/hostfile/rds_hostfile_lex.l index b9c6c1fc7a..2cbec2327c 100644 --- a/orte/mca/rds/hostfile/rds_hostfile_lex.l +++ b/orte/mca/rds/hostfile/rds_hostfile_lex.l @@ -3,7 +3,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -28,7 +28,23 @@ /* * local functions */ -static int orte_rds_hostfile_wrap(void); +#ifndef YY_SKIP_YYWRAP +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /* defined(c_plusplus) || defined(__cplusplus) */ + +int orte_rds_hostfile_wrap(void); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif /* defined(c_plusplus) || defined(__cplusplus) */ +#endif /* !defined(YY_SKIP_YYWRAP) */ + +int orte_rds_hostfile_wrap(void) +{ + orte_rds_hostfile_done = true; + return 1; +} /* * global variables @@ -129,11 +145,3 @@ username { orte_rds_hostfile_value.sval = yytext; return ORTE_RDS_HOSTFILE_ERROR; } %% - - -static int orte_rds_hostfile_wrap(void) -{ - orte_rds_hostfile_done = true; - return 1; -} - diff --git a/orte/mca/rds/rds_types.h b/orte/mca/rds/rds_types.h index 15fd1c314f..23b0fea4ec 100644 --- a/orte/mca/rds/rds_types.h +++ b/orte/mca/rds/rds_types.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -16,14 +16,18 @@ * $HEADER$ */ +#ifndef ORTE_MCA_RDS_TYPES_H +#define ORTE_MCA_RDS_TYPES_H + #include "orte_config.h" #include "opal/class/opal_list.h" #include "orte/mca/gpr/gpr_types.h" #include "orte/mca/ns/ns_types.h" -#ifndef ORTE_MCA_RDS_TYPES_H -#define ORTE_MCA_RDS_TYPES_H +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif /* resource descriptor object */ typedef struct { @@ -41,7 +45,7 @@ typedef struct { opal_list_t attributes; } orte_rds_cell_desc_t; -OBJ_CLASS_DECLARATION(orte_rds_cell_desc_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rds_cell_desc_t); /* resource attribute object */ typedef struct { @@ -51,7 +55,7 @@ typedef struct { orte_gpr_keyval_t keyval; } orte_rds_cell_attr_t; -OBJ_CLASS_DECLARATION(orte_rds_cell_attr_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rds_cell_attr_t); /* name of resource */ @@ -147,4 +151,8 @@ OBJ_CLASS_DECLARATION(orte_rds_cell_attr_t); #define ORTE_RDS_INTERCONNECT "orte-rds-arch-interconnect*" #define ORTE_RDS_CPU "orte-rds-arch-cpu*" +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif diff --git a/orte/mca/rds/resfile/rds_resfile.h b/orte/mca/rds/resfile/rds_resfile.h index 6d610b147f..9082bfee52 100644 --- a/orte/mca/rds/resfile/rds_resfile.h +++ b/orte/mca/rds/resfile/rds_resfile.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -33,9 +33,6 @@ extern "C" { #endif -/* resfile internal globals */ -extern opal_list_t resource_list; - /* * RDS Resource file functions */ @@ -72,8 +69,8 @@ struct orte_rds_resfile_component_t { }; typedef struct orte_rds_resfile_component_t orte_rds_resfile_component_t; -ORTE_DECLSPEC extern orte_rds_resfile_component_t mca_rds_resfile_component; -ORTE_DECLSPEC extern orte_rds_base_module_t orte_rds_resfile_module; +ORTE_MODULE_DECLSPEC extern orte_rds_resfile_component_t mca_rds_resfile_component; +extern orte_rds_base_module_t orte_rds_resfile_module; extern bool orte_rds_resfile_queried; diff --git a/orte/mca/rmaps/base/rmaps_base_map.c b/orte/mca/rmaps/base/rmaps_base_map.c index 60d3c15c2d..f90d02b49e 100644 --- a/orte/mca/rmaps/base/rmaps_base_map.c +++ b/orte/mca/rmaps/base/rmaps_base_map.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -337,7 +337,7 @@ int orte_rmaps_base_get_map(orte_jobid_t jobid, opal_list_t* mapping_list) } /* build the mapping */ - if(NULL == (mapping = malloc(sizeof(orte_rmaps_base_map_t*) * num_context))) { + if(NULL == (mapping = (orte_rmaps_base_map_t**)malloc(sizeof(orte_rmaps_base_map_t*) * num_context))) { rc = ORTE_ERR_OUT_OF_RESOURCE; ORTE_ERROR_LOG(rc); goto cleanup; @@ -348,7 +348,7 @@ int orte_rmaps_base_get_map(orte_jobid_t jobid, opal_list_t* mapping_list) orte_app_context_t* app = app_context[i]; map->app = app; if (0 < app->num_procs) { - map->procs = malloc(sizeof(orte_rmaps_base_proc_t*) * app->num_procs); + map->procs = (orte_rmaps_base_proc_t**)malloc(sizeof(orte_rmaps_base_proc_t*) * app->num_procs); if(NULL == map->procs) { OBJ_RELEASE(map); rc = ORTE_ERR_OUT_OF_RESOURCE; @@ -563,7 +563,7 @@ int orte_rmaps_base_get_node_map( ORTE_ERROR_LOG(rc); return rc; } - if(NULL == (mapping = malloc(sizeof(orte_rmaps_base_map_t*) * num_context))) { + if(NULL == (mapping = (orte_rmaps_base_map_t**)malloc(sizeof(orte_rmaps_base_map_t*) * num_context))) { rc = ORTE_ERR_OUT_OF_RESOURCE; ORTE_ERROR_LOG(rc); goto cleanup; @@ -574,7 +574,7 @@ int orte_rmaps_base_get_node_map( orte_app_context_t* app = app_context[i]; OBJ_RETAIN(app); map->app = app; - map->procs = malloc(sizeof(orte_rmaps_base_proc_t*) * app->num_procs); + map->procs = (orte_rmaps_base_proc_t**)malloc(sizeof(orte_rmaps_base_proc_t*) * app->num_procs); if(NULL == map->procs) { OBJ_RELEASE(map); rc = ORTE_ERR_OUT_OF_RESOURCE; diff --git a/orte/mca/rmaps/base/rmaps_base_map.h b/orte/mca/rmaps/base/rmaps_base_map.h index 7466657892..c5a75c1fa6 100644 --- a/orte/mca/rmaps/base/rmaps_base_map.h +++ b/orte/mca/rmaps/base/rmaps_base_map.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -62,7 +62,7 @@ struct orte_rmaps_base_node_t { }; typedef struct orte_rmaps_base_node_t orte_rmaps_base_node_t; -OBJ_CLASS_DECLARATION(orte_rmaps_base_node_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rmaps_base_node_t); /* @@ -80,7 +80,7 @@ struct orte_rmaps_base_proc_t { }; typedef struct orte_rmaps_base_proc_t orte_rmaps_base_proc_t; -OBJ_CLASS_DECLARATION(orte_rmaps_base_proc_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rmaps_base_proc_t); /* @@ -97,12 +97,12 @@ struct orte_rmaps_base_map_t { }; typedef struct orte_rmaps_base_map_t orte_rmaps_base_map_t; -OBJ_CLASS_DECLARATION(orte_rmaps_base_map_t); +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_rmaps_base_map_t); -int orte_rmaps_base_mapped_node_query(opal_list_t* mapping_list, opal_list_t* nodes_alloc, orte_jobid_t jobid); -int orte_rmaps_base_get_map(orte_jobid_t, opal_list_t* mapping); -int orte_rmaps_base_set_map(orte_jobid_t, opal_list_t* mapping); -int orte_rmaps_base_get_node_map(orte_cellid_t, orte_jobid_t, const char*, opal_list_t* mapping); +ORTE_DECLSPEC int orte_rmaps_base_mapped_node_query(opal_list_t* mapping_list, opal_list_t* nodes_alloc, orte_jobid_t jobid); +ORTE_DECLSPEC int orte_rmaps_base_get_map(orte_jobid_t, opal_list_t* mapping); +ORTE_DECLSPEC int orte_rmaps_base_set_map(orte_jobid_t, opal_list_t* mapping); +ORTE_DECLSPEC int orte_rmaps_base_get_node_map(orte_cellid_t, orte_jobid_t, const char*, opal_list_t* mapping); #if defined(c_plusplus) || defined(__cplusplus) diff --git a/orte/mca/rmaps/base/rmaps_base_node.h b/orte/mca/rmaps/base/rmaps_base_node.h index 5e6bf778c0..9083599767 100644 --- a/orte/mca/rmaps/base/rmaps_base_node.h +++ b/orte/mca/rmaps/base/rmaps_base_node.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -45,18 +45,18 @@ extern "C" { * RMAPS */ -int orte_rmaps_base_get_target_nodes(opal_list_t* node_list, orte_jobid_t jobid, orte_std_cntr_t *total_num_slots); -int orte_rmaps_base_update_node_usage(opal_list_t *nodes); -int orte_rmaps_base_get_mapped_targets(opal_list_t *mapped_node_list, - orte_app_context_t *app, - opal_list_t *master_node_list, - orte_std_cntr_t *total_num_slots); -int orte_rmaps_base_claim_slot(orte_rmaps_base_map_t *map, - orte_ras_node_t *current_node, - orte_jobid_t jobid, orte_vpid_t vpid, - int proc_index, - opal_list_t *nodes, - opal_list_t *fully_used_nodes); +ORTE_DECLSPEC int orte_rmaps_base_get_target_nodes(opal_list_t* node_list, orte_jobid_t jobid, orte_std_cntr_t *total_num_slots); +ORTE_DECLSPEC int orte_rmaps_base_update_node_usage(opal_list_t *nodes); +ORTE_DECLSPEC int orte_rmaps_base_get_mapped_targets(opal_list_t *mapped_node_list, + orte_app_context_t *app, + opal_list_t *master_node_list, + orte_std_cntr_t *total_num_slots); +ORTE_DECLSPEC int orte_rmaps_base_claim_slot(orte_rmaps_base_map_t *map, + orte_ras_node_t *current_node, + orte_jobid_t jobid, orte_vpid_t vpid, + int proc_index, + opal_list_t *nodes, + opal_list_t *fully_used_nodes); #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/rmaps/base/rmaps_base_select.c b/orte/mca/rmaps/base/rmaps_base_select.c index d102fa85a9..da861d037d 100644 --- a/orte/mca/rmaps/base/rmaps_base_select.c +++ b/orte/mca/rmaps/base/rmaps_base_select.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -85,7 +85,7 @@ static orte_rmaps_base_module_t *select_any(void) /* If the list is empty, return NULL */ - if (opal_list_is_empty(&orte_rmaps_base.rmaps_available) > 0) { + if (true == opal_list_is_empty(&orte_rmaps_base.rmaps_available)) { opal_output(orte_rmaps_base.rmaps_output, "orte:base:select: no components available!"); return NULL; diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.c b/orte/mca/rmaps/round_robin/rmaps_rr.c index 45304d1b8d..2a70bc66bc 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.c +++ b/orte/mca/rmaps/round_robin/rmaps_rr.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -358,7 +358,7 @@ static int orte_rmaps_rr_map(orte_jobid_t jobid) map->app = app; - map->procs = malloc(sizeof(orte_rmaps_base_proc_t*) * app->num_procs); + map->procs = (orte_rmaps_base_proc_t**)malloc(sizeof(orte_rmaps_base_proc_t*) * app->num_procs); if(NULL == map->procs) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); rc = ORTE_ERR_OUT_OF_RESOURCE; diff --git a/orte/mca/rmaps/round_robin/rmaps_rr.h b/orte/mca/rmaps/round_robin/rmaps_rr.h index 65a40a6c2e..c2298f5a41 100644 --- a/orte/mca/rmaps/round_robin/rmaps_rr.h +++ b/orte/mca/rmaps/round_robin/rmaps_rr.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,8 +40,8 @@ struct orte_rmaps_round_robin_component_t { }; typedef struct orte_rmaps_round_robin_component_t orte_rmaps_round_robin_component_t; -ORTE_DECLSPEC extern orte_rmaps_round_robin_component_t mca_rmaps_round_robin_component; -ORTE_DECLSPEC extern orte_rmaps_base_module_t orte_rmaps_round_robin_module; +ORTE_MODULE_DECLSPEC extern orte_rmaps_round_robin_component_t mca_rmaps_round_robin_component; +extern orte_rmaps_base_module_t orte_rmaps_round_robin_module; #if defined(c_plusplus) || defined(__cplusplus) diff --git a/orte/mca/rmgr/base/base.h b/orte/mca/rmgr/base/base.h index a3e5665852..071ed10e8a 100644 --- a/orte/mca/rmgr/base/base.h +++ b/orte/mca/rmgr/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -127,11 +127,11 @@ int orte_rmgr_base_terminate_job_not_available(orte_jobid_t); int orte_rmgr_base_terminate_proc_not_available(const orte_process_name_t*); int orte_rmgr_base_signal_job_not_available(orte_jobid_t, int32_t); int orte_rmgr_base_signal_proc_not_available(const orte_process_name_t*, int32_t); -int orte_rmgr_base_proc_stage_gate_init(orte_jobid_t job); -int orte_rmgr_base_proc_stage_gate_subscribe(orte_jobid_t job, orte_gpr_notify_cb_fn_t, void*, orte_proc_state_t); -int orte_rmgr_base_proc_stage_gate_mgr( +ORTE_DECLSPEC int orte_rmgr_base_proc_stage_gate_init(orte_jobid_t job); +ORTE_DECLSPEC int orte_rmgr_base_proc_stage_gate_subscribe(orte_jobid_t job, orte_gpr_notify_cb_fn_t, void*, orte_proc_state_t); +ORTE_DECLSPEC int orte_rmgr_base_proc_stage_gate_mgr( orte_gpr_notify_message_t *msg); -int orte_rmgr_base_proc_stage_gate_mgr_abort( +ORTE_DECLSPEC int orte_rmgr_base_proc_stage_gate_mgr_abort( orte_gpr_notify_message_t *msg); int orte_rmgr_base_spawn_not_available( orte_app_context_t** app_context, diff --git a/orte/mca/rmgr/base/data_type_support/rmgr_data_type_unpacking_fns.c b/orte/mca/rmgr/base/data_type_support/rmgr_data_type_unpacking_fns.c index 958b9ac192..237b0100c6 100644 --- a/orte/mca/rmgr/base/data_type_support/rmgr_data_type_unpacking_fns.c +++ b/orte/mca/rmgr/base/data_type_support/rmgr_data_type_unpacking_fns.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -153,7 +153,7 @@ int orte_rmgr_base_unpack_app_context(orte_buffer_t *buffer, void *dest, } if (app_context[i]->num_map > 0) { - app_context[i]->map_data = malloc(sizeof(orte_app_context_map_t*) * app_context[i]->num_map); + app_context[i]->map_data = (orte_app_context_map_t**)malloc(sizeof(orte_app_context_map_t*) * app_context[i]->num_map); if (NULL == app_context[i]->map_data) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); return ORTE_ERR_OUT_OF_RESOURCE; diff --git a/orte/mca/rmgr/base/rmgr_base_unpack.c b/orte/mca/rmgr/base/rmgr_base_unpack.c index be3089dadb..eaeb5e0f6e 100644 --- a/orte/mca/rmgr/base/rmgr_base_unpack.c +++ b/orte/mca/rmgr/base/rmgr_base_unpack.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -58,7 +58,7 @@ static int orte_rmgr_base_cmd_create(orte_buffer_t* req, orte_buffer_t* rsp) return rc; } - if(NULL == (context = malloc(sizeof(orte_app_context_t*)*num_context))) { + if(NULL == (context = (orte_app_context_t**)malloc(sizeof(orte_app_context_t*)*num_context))) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); return ORTE_ERR_OUT_OF_RESOURCE; } diff --git a/orte/mca/rmgr/cnos/rmgr_cnos.h b/orte/mca/rmgr/cnos/rmgr_cnos.h index 7062de37c7..67c2d58c00 100644 --- a/orte/mca/rmgr/cnos/rmgr_cnos.h +++ b/orte/mca/rmgr/cnos/rmgr_cnos.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -30,7 +30,7 @@ extern "C" { /** Global URM component */ ORTE_DECLSPEC extern orte_rmgr_base_component_t mca_rmgr_cnos_component; /** Global URM module */ -ORTE_DECLSPEC extern orte_rmgr_base_module_t orte_rmgr_cnos_module; +extern orte_rmgr_base_module_t orte_rmgr_cnos_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/rmgr/proxy/rmgr_proxy.h b/orte/mca/rmgr/proxy/rmgr_proxy.h index 51c553d514..1e378c7e29 100644 --- a/orte/mca/rmgr/proxy/rmgr_proxy.h +++ b/orte/mca/rmgr/proxy/rmgr_proxy.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -39,9 +39,9 @@ struct orte_rmgr_proxy_component_t { typedef struct orte_rmgr_proxy_component_t orte_rmgr_proxy_component_t; /** Global URM component */ -ORTE_DECLSPEC extern orte_rmgr_proxy_component_t mca_rmgr_proxy_component; +ORTE_MODULE_DECLSPEC extern orte_rmgr_proxy_component_t mca_rmgr_proxy_component; /** Global URM module */ -ORTE_DECLSPEC extern orte_rmgr_base_module_t orte_rmgr_proxy_module; +extern orte_rmgr_base_module_t orte_rmgr_proxy_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/rmgr/rmgr.h b/orte/mca/rmgr/rmgr.h index 623914c27f..9c34464e13 100644 --- a/orte/mca/rmgr/rmgr.h +++ b/orte/mca/rmgr/rmgr.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -41,6 +41,10 @@ #include "orte/mca/smr/smr_types.h" #include "rmgr_types.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + /* * Component functions - all MUST be provided! */ @@ -252,4 +256,8 @@ typedef orte_rmgr_base_component_1_0_0_t orte_rmgr_base_component_t; */ ORTE_DECLSPEC extern orte_rmgr_base_module_t orte_rmgr; /* holds selected module's function pointers */ +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif diff --git a/orte/mca/rmgr/urm/rmgr_urm.h b/orte/mca/rmgr/urm/rmgr_urm.h index 2015e54f52..d97ac2c3e0 100644 --- a/orte/mca/rmgr/urm/rmgr_urm.h +++ b/orte/mca/rmgr/urm/rmgr_urm.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -49,9 +49,9 @@ struct orte_rmgr_urm_component_t { typedef struct orte_rmgr_urm_component_t orte_rmgr_urm_component_t; /** Global URM component */ -ORTE_DECLSPEC extern orte_rmgr_urm_component_t mca_rmgr_urm_component; +ORTE_MODULE_DECLSPEC extern orte_rmgr_urm_component_t mca_rmgr_urm_component; /** Global URM module */ -ORTE_DECLSPEC extern orte_rmgr_base_module_t orte_rmgr_urm_module; +extern orte_rmgr_base_module_t orte_rmgr_urm_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/rml/oob/rml_oob.h b/orte/mca/rml/oob/rml_oob.h index c52fd7afc4..8558dd2f1a 100644 --- a/orte/mca/rml/oob/rml_oob.h +++ b/orte/mca/rml/oob/rml_oob.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -26,8 +26,8 @@ extern "C" { #endif -ORTE_DECLSPEC extern orte_rml_component_t mca_rml_oob_component; -ORTE_DECLSPEC extern orte_rml_module_t orte_rml_oob_module; +ORTE_MODULE_DECLSPEC extern orte_rml_component_t mca_rml_oob_component; +extern orte_rml_module_t orte_rml_oob_module; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/schema/base/base.h b/orte/mca/schema/base/base.h index 9ed6442539..2f1821e261 100644 --- a/orte/mca/schema/base/base.h +++ b/orte/mca/schema/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -31,9 +31,6 @@ #include "orte/orte_constants.h" #include "orte/orte_types.h" -#include "opal/threads/mutex.h" -#include "opal/threads/condition.h" - #include "opal/class/opal_list.h" #include "opal/mca/mca.h" @@ -74,17 +71,17 @@ int orte_schema_base_get_std_subscription_name(char **name, orte_jobid_t jobid); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif - /* * globals that might be needed inside the gpr */ extern int orte_schema_base_output; extern bool orte_schema_base_selected; -extern opal_list_t orte_schema_base_components_available; -extern mca_schema_base_component_t orte_schema_base_selected_component; +ORTE_DECLSPEC extern opal_list_t orte_schema_base_components_available; +ORTE_DECLSPEC extern mca_schema_base_component_t orte_schema_base_selected_component; extern bool orte_schema_initialized; +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif diff --git a/orte/mca/schema/base/schema_base_open.c b/orte/mca/schema/base/schema_base_open.c index 3af947f8be..274bfe1638 100644 --- a/orte/mca/schema/base/schema_base_open.c +++ b/orte/mca/schema/base/schema_base_open.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -58,7 +58,6 @@ orte_schema_base_module_t orte_schema = { * Global variables for framework */ int orte_schema_base_output; -orte_schema_base_module_t orte_schema; bool orte_schema_base_selected = false; opal_list_t orte_schema_base_components_available; mca_schema_base_component_t orte_schema_base_selected_component; diff --git a/orte/mca/sds/base/base.h b/orte/mca/sds/base/base.h index 6695f76ba5..702c36488d 100644 --- a/orte/mca/sds/base/base.h +++ b/orte/mca/sds/base/base.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -83,7 +83,7 @@ extern "C" { orte_vpid_t global_vpid_start, int num_procs, char ***env); - extern opal_list_t orte_sds_base_components_available; + ORTE_DECLSPEC extern opal_list_t orte_sds_base_components_available; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/sds/env/sds_env.h b/orte/mca/sds/env/sds_env.h index b86aa45995..cb8dbcfc77 100644 --- a/orte/mca/sds/env/sds_env.h +++ b/orte/mca/sds/env/sds_env.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,6 +40,7 @@ extern "C" { */ int orte_sds_env_set_name(void); + ORTE_MODULE_DECLSPEC extern orte_sds_base_component_t mca_sds_env_component; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/sds/pipe/sds_pipe.h b/orte/mca/sds/pipe/sds_pipe.h index 3a52ade6ca..3f2dee41d4 100644 --- a/orte/mca/sds/pipe/sds_pipe.h +++ b/orte/mca/sds/pipe/sds_pipe.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,6 +40,7 @@ extern "C" { */ int orte_sds_pipe_set_name(void); + ORTE_MODULE_DECLSPEC extern orte_sds_base_component_t mca_sds_pipe_component; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/sds/seed/sds_seed.h b/orte/mca/sds/seed/sds_seed.h index 8539c69d9d..d46f336928 100644 --- a/orte/mca/sds/seed/sds_seed.h +++ b/orte/mca/sds/seed/sds_seed.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,6 +40,7 @@ extern "C" { */ int orte_sds_seed_set_name(void); + ORTE_MODULE_DECLSPEC extern orte_sds_base_component_t mca_sds_seed_component; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/sds/singleton/sds_singleton.h b/orte/mca/sds/singleton/sds_singleton.h index fac456e2a4..dbeaf41e17 100644 --- a/orte/mca/sds/singleton/sds_singleton.h +++ b/orte/mca/sds/singleton/sds_singleton.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,6 +40,7 @@ extern "C" { */ int orte_sds_singleton_set_name(void); + ORTE_MODULE_DECLSPEC extern orte_sds_base_component_t mca_sds_singleton_component; #if defined(c_plusplus) || defined(__cplusplus) } diff --git a/orte/mca/smr/smr.h b/orte/mca/smr/smr.h index 6ad298a35a..905542bd46 100644 --- a/orte/mca/smr/smr.h +++ b/orte/mca/smr/smr.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -36,6 +36,10 @@ #include "orte/mca/ns/ns_types.h" #include "orte/mca/smr/smr_types.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + /* * Component functions - all MUST be provided! */ @@ -152,4 +156,8 @@ typedef orte_smr_base_component_1_3_0_t orte_smr_base_component_t; ORTE_DECLSPEC extern orte_smr_base_module_t orte_smr; /* holds selected module's function pointers */ +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif + #endif /* ORTE_SMR_H */ diff --git a/orte/runtime/orte_setup_hnp.c b/orte/runtime/orte_setup_hnp.c index 4240228137..222d590b9c 100644 --- a/orte/runtime/orte_setup_hnp.c +++ b/orte/runtime/orte_setup_hnp.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -66,7 +66,9 @@ #include "orte/runtime/runtime.h" #include "orte/runtime/orte_setup_hnp.h" +#if !defined(__WINDOWS__) extern char **environ; +#endif /* !defined(__WINDOWS__) */ /* Local condition variables and mutex */ @@ -97,7 +99,6 @@ static void orte_setup_hnp_wait(pid_t wpid, int status, void *data); */ int orte_setup_hnp(char *target_cluster, char *headnode, char *username) { -#ifndef __WINDOWS__ char **argv, *param, *uri, *uid, *hn=NULL; char *path, *name_string, *orteprobe; int argc, rc=ORTE_SUCCESS, id, intparam; @@ -139,7 +140,7 @@ int orte_setup_hnp(char *target_cluster, char *headnode, char *username) keyvals = values[0]->keyvals; for (i=0; i < values[0]->cnt; i++) { if (0 == strcmp(keyvals[i]->key, ORTE_RDS_FE_NAME)) { - hn = strdup(keyvals[i]->value->data); + hn = strdup((const char*)keyvals[i]->value->data); continue; } if (0 == strcmp(keyvals[i]->key, ORTE_RDS_FE_SSH)) { @@ -185,7 +186,7 @@ int orte_setup_hnp(char *target_cluster, char *headnode, char *username) keyvals = values[i]->keyvals; for (j=0; j < values[i]->cnt; j++) { if ((0 == strcmp(keyvals[j]->key, ORTE_RDS_FE_NAME)) && - 0 == strcmp(keyvals[j]->value->data, headnode)) { + 0 == strcmp((const char*)keyvals[j]->value->data, headnode)) { /* okay, this is the right cell - now need to find * the ssh flag (if provided) and cellid */ @@ -457,6 +458,7 @@ MOVEON: goto CLEANUP; } +#ifndef __WINDOWS__ /* fork a child to exec the rsh/ssh session */ orte_setup_hnp_rc = ORTE_SUCCESS; pid = fork(); @@ -511,15 +513,14 @@ MOVEON: return orte_setup_hnp_rc; } - -CLEANUP: - return rc; - #else - printf ("This function has not been implemented in windows yet, file %s line %d\n", __FILE__, __LINE__); + ORTE_ERROR_LOG(ORTE_ERROR); + opal_output(0, "This function has not been implemented in windows yet, file %s line %d\n", __FILE__, __LINE__); abort(); #endif +CLEANUP: + return rc; } static void orte_setup_hnp_recv(int status, orte_process_name_t* sender, diff --git a/orte/runtime/orte_setup_hnp.h b/orte/runtime/orte_setup_hnp.h index 17cea82a3c..6018911c8f 100644 --- a/orte/runtime/orte_setup_hnp.h +++ b/orte/runtime/orte_setup_hnp.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -36,6 +36,9 @@ typedef struct { } orte_setup_hnp_cb_data_t; -int orte_setup_hnp(char *target_cluster, char *headnode, char *username); + /** + * Establish a Head Node Process on a cluster's front end + */ +ORTE_DECLSPEC int orte_setup_hnp(char *target_cluster, char *headnode, char *username); #endif diff --git a/orte/runtime/orte_system_finalize.c b/orte/runtime/orte_system_finalize.c index 6d8dc10c50..41ec41c60b 100644 --- a/orte/runtime/orte_system_finalize.c +++ b/orte/runtime/orte_system_finalize.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -77,9 +77,7 @@ int orte_system_finalize(void) opal_event_fini(); -#ifndef __WINDOWS__ orte_session_dir_finalize(orte_process_info.my_name); -#endif /* clean out the global structures */ orte_sys_info_finalize(); diff --git a/orte/runtime/orte_universe_exists.c b/orte/runtime/orte_universe_exists.c index 15f6c24a67..90cf3799ad 100644 --- a/orte/runtime/orte_universe_exists.c +++ b/orte/runtime/orte_universe_exists.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -52,13 +52,11 @@ #include "orte/mca/errmgr/errmgr.h" #include "orte/runtime/runtime.h" -#ifdef _WINDOWS_ -#include "opal/win32/ompi_util.h" -#endif /* _WINDOWS_ */ static struct timeval ompi_rte_ping_wait = {2, 0}; -int orte_universe_search(opal_list_t *universe_list) { +int orte_universe_search(opal_list_t *universe_list) +{ int ret, exit_status = ORTE_SUCCESS; #ifndef __WINDOWS__ DIR *cur_dirp = NULL; @@ -90,7 +88,8 @@ int orte_universe_search(opal_list_t *universe_list) { goto cleanup; } - asprintf(&frontend_abs, "%s/%s", prefix, frontend); +#if !defined(__WINDOWS__) + frontend_abs = opal_os_path(false, prefix, frontend, NULL); /* * Check to make sure we have access to this directory @@ -103,22 +102,15 @@ int orte_universe_search(opal_list_t *universe_list) { /* * Open up the base directory so we can get a listing */ -#ifndef __WINDOWS__ if( NULL == (cur_dirp = opendir(frontend_abs)) ) { exit_status = ORTE_ERROR; goto cleanup; } -#else - hFind = FindFirstFile( frontend_abs, &file_data ); -#endif /* __WINDOWS__ */ - /* * For each directory/universe */ -#ifndef __WINDOWS__ while( NULL != (dir_entry = readdir(cur_dirp)) ) { orte_universe_t *univ = NULL; - char * tmp_str = NULL; /* * Skip non-universe directories @@ -131,29 +123,39 @@ int orte_universe_search(opal_list_t *universe_list) { /* * Read the setup file */ - tmp_str = strdup(dir_entry->d_name); - asprintf(&univ_setup_filename, "%s/%s/%s", - frontend_abs, - tmp_str, - "universe-setup.txt"); + univ_setup_filename = opal_os_path( false, frontend_abs, + dir_entry->d_name, "universe-setup.txt", NULL ); univ = OBJ_NEW(orte_universe_t); - OBJ_RETAIN(univ); if(ORTE_SUCCESS != (ret = orte_read_universe_setup_file(univ_setup_filename, univ) ) ){ printf("orte_ps: Unable to read the file (%s)\n", univ_setup_filename); exit_status = ret; - goto cleanup; + OBJ_RELEASE(univ); + } else { + OBJ_RETAIN(univ); + opal_list_append(universe_list, &(univ->super)); } - - opal_list_append(universe_list, &(univ->super)); - - if( NULL != tmp_str) - free(tmp_str); } #else + /* + * Open up the base directory so we can get a listing. + * + * On Windows if we want to parse the content of a directory the filename + * should end with the "*". Otherwise we will only open the directory + * structure (and not the content). + */ + frontend_abs = opal_os_path(false, prefix, frontend, "*", NULL); + hFind = FindFirstFile( frontend_abs, &file_data ); + if( INVALID_HANDLE_VALUE == hFind ) { + exit_status = GetLastError(); + goto cleanup; + } + + /* + * For each directory/universe + */ do { orte_universe_t *univ = NULL; - char * tmp_str = NULL; /* * Skip non-universe directories @@ -166,26 +168,20 @@ int orte_universe_search(opal_list_t *universe_list) { /* * Read the setup file */ - tmp_str = strdup(file_data.cFileName); - asprintf(&univ_setup_filename, "%s/%s/%s", - frontend_abs, - tmp_str, - "universe-setup.txt"); - + univ_setup_filename = opal_os_path( false, prefix, frontend, + file_data.cFileName, "universe-setup.txt", NULL); + univ = OBJ_NEW(orte_universe_t); - OBJ_RETAIN(univ); if(ORTE_SUCCESS != (ret = orte_read_universe_setup_file(univ_setup_filename, univ) ) ){ printf("orte_ps: Unable to read the file (%s)\n", univ_setup_filename); exit_status = ret; - goto cleanup; + OBJ_RELEASE(univ); + } else { + OBJ_RETAIN(univ); + opal_list_append(universe_list, &(univ->super)); } - - opal_list_append(universe_list, &(univ->super)); - - if( NULL != tmp_str) - free(tmp_str); } while( 0 != FindNextFile( hFind, &file_data ) ); -#endif /* __WINDOWS__ */ +#endif /* !defined(__WINDOWS__) */ cleanup: #ifndef __WINDOWS__ @@ -205,7 +201,7 @@ int orte_universe_search(opal_list_t *universe_list) { if( NULL != frontend_abs) free(frontend_abs); - return exit_status; + return (opal_list_is_empty(universe_list) ? exit_status : ORTE_SUCCESS); } int orte_universe_exists(orte_universe_t *univ) diff --git a/orte/runtime/orte_wait.c b/orte/runtime/orte_wait.c index c82019eb90..6a3bb4aebe 100644 --- a/orte/runtime/orte_wait.c +++ b/orte/runtime/orte_wait.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -40,6 +40,11 @@ #include "orte/orte_constants.h" #include "orte/runtime/orte_wait.h" +static volatile int cb_enabled = true; +static opal_mutex_t mutex; +static opal_list_t pending_pids; +static opal_list_t registered_cb; + #ifdef HAVE_WAITPID /********************************************************************* @@ -123,10 +128,6 @@ static OBJ_CLASS_INSTANCE(registered_cb_item_t, opal_list_item_t, NULL, NULL); * Local Variables * ********************************************************************/ -static volatile int cb_enabled = true; -static opal_mutex_t mutex; -static opal_list_t pending_pids; -static opal_list_t registered_cb; static struct opal_event handler; @@ -198,10 +199,8 @@ orte_wait_finalize(void) int orte_wait_kill(int sig) { - opal_list_t children; opal_list_item_t* item; - OBJ_CONSTRUCT(&children, opal_list_t); OPAL_THREAD_LOCK(&mutex); do_waitall(0); while (NULL != (item = opal_list_remove_first(®istered_cb))) { @@ -616,51 +615,284 @@ internal_waitpid_callback(int fd, short event, void *arg) #else /* HAVE_WAITPID */ +typedef struct { + opal_list_item_t super; + pid_t pid; + HANDLE registered_handle; + orte_wait_fn_t callback; + void *data; + int status; +} opal_process_handle_t; + +static void opal_process_handle_construct( opal_object_t* obj ) +{ + opal_process_handle_t* handle = (opal_process_handle_t*)obj; + + handle->registered_handle = INVALID_HANDLE_VALUE; + handle->pid = 0; + handle->callback = NULL; + handle->data = NULL; +} +static void opal_process_handle_destruct( opal_object_t* obj ) +{ + opal_process_handle_t* handle = (opal_process_handle_t*)obj; + + if( INVALID_HANDLE_VALUE != handle->registered_handle ) { + if( 0 == UnregisterWait( handle->registered_handle ) ) { + int error = GetLastError(); + } + if( 0 == CloseHandle( handle->registered_handle ) ) { + int error = GetLastError(); + } + handle->registered_handle = INVALID_HANDLE_VALUE; + } +} + +static OBJ_CLASS_INSTANCE( opal_process_handle_t, opal_list_item_t, + opal_process_handle_construct, opal_process_handle_destruct ); + int -orte_wait_init(void) { +orte_wait_init(void) +{ + OBJ_CONSTRUCT(&mutex, opal_mutex_t); + OBJ_CONSTRUCT(®istered_cb, opal_list_t); + OBJ_CONSTRUCT(&pending_pids, opal_list_t); return ORTE_SUCCESS; } int orte_wait_finalize(void) { + opal_list_item_t* item; + + OPAL_THREAD_LOCK(&mutex); + OPAL_THREAD_UNLOCK(&mutex); + + while (NULL != (item = opal_list_remove_first(&pending_pids))) { + OBJ_RELEASE(item); + } + while (NULL != (item = opal_list_remove_first(®istered_cb))) { + OBJ_RELEASE(item); + } + + OBJ_DESTRUCT(&mutex); + OBJ_DESTRUCT(®istered_cb); + OBJ_DESTRUCT(&pending_pids); + return ORTE_SUCCESS; } +/** + * Internal function which find a corresponding process structure + * based on the pid. If create is true and the pid does not have a + * corresponding process structure, one will be automatically + * created and attached to the end of the list. + */ +static opal_process_handle_t* opal_find_pid_in_list(opal_list_t* list, pid_t pid, bool create) +{ + opal_list_item_t *item = NULL; + opal_process_handle_t *handle = NULL; + + for (item = opal_list_get_first(list) ; + item != opal_list_get_end(list) ; + item = opal_list_get_next(item)) { + handle = (opal_process_handle_t*) item; + + if (handle->pid == pid) { + return handle; + } + } + + if (create) { + handle = OBJ_NEW(opal_process_handle_t); + if (NULL == handle) return NULL; + + handle->pid = pid; + handle->callback = NULL; + handle->data = NULL; + opal_list_append(list, (opal_list_item_t*)handle); + return handle; + } + + return NULL; +} +#define find_pending_pid(PID, CREATE) opal_find_pid_in_list( &pending_pids, (PID), (CREATE) ) +#define find_pending_cb(PID, CREATE) opal_find_pid_in_list( ®istered_cb, (PID), (CREATE) ) + pid_t orte_waitpid(pid_t wpid, int *status, int options) { - return ORTE_ERR_NOT_SUPPORTED; + opal_process_handle_t* pending; + + OPAL_THREAD_LOCK(&mutex); + + /** + * Is the child already gone ? + */ + pending = find_pending_pid( wpid, false ); + if( NULL != pending ) { + *status = pending->status; + opal_list_remove_item( &pending_pids, (opal_list_item_t*)pending ); + OBJ_RELEASE(pending); + OPAL_THREAD_UNLOCK(&mutex); + return wpid; + } + + /** + * Do we have any registered callback for this particular pid ? + */ + pending = find_pending_cb( wpid, false ); + if( NULL != pending ) { + opal_list_remove_item( ®istered_cb, (opal_list_item_t*)pending ); + OBJ_RELEASE( pending ); + } + + /** + * No luck so far. Wait until the process complete ... + */ + if( WAIT_OBJECT_0 == WaitForSingleObject( (HANDLE)wpid, INFINITE ) ) { + DWORD exitCode; + /* Process completed. Grab the exit value and return. */ + if( 0 == GetExitCodeProcess( (HANDLE)wpid, &exitCode ) ) { + int error = GetLastError(); + } + *status = (int)exitCode; + } + OPAL_THREAD_UNLOCK(&mutex); + return wpid; +} + +static void CALLBACK trigger_process_detection( void* lpParameter, BOOLEAN TimerOrWaitFired ) +{ + opal_process_handle_t* handle = (opal_process_handle_t*)lpParameter; + DWORD exitCode; + + opal_list_remove_item( ®istered_cb, (opal_list_item_t*)handle ); + /** + * As this item will never be triggered again, we can safely remove the + * registered handle. + */ + if( 0 == UnregisterWait( handle->registered_handle ) ) { + int error = GetLastError(); + } + if( 0 == CloseHandle( handle->registered_handle ) ) { + int error = GetLastError(); + } + handle->registered_handle = INVALID_HANDLE_VALUE; + /** + * Get the exit code of the process. + */ + if( 0 == GetExitCodeProcess( (HANDLE)handle->pid, &exitCode ) ) { + int error = GetLastError(); + } + handle->status = (int)exitCode; + handle->callback(handle->pid, handle->status, handle->data); + OBJ_RELEASE( handle ); } int orte_wait_cb(pid_t wpid, orte_wait_fn_t callback, void *data) { - return ORTE_ERR_NOT_SUPPORTED; + opal_process_handle_t* handle; + + if (wpid <= 0) return ORTE_ERR_NOT_IMPLEMENTED; + if (NULL == callback) return ORTE_ERR_BAD_PARAM; + + OPAL_THREAD_LOCK(&mutex); + handle = find_pending_pid(wpid, false); + if( handle != NULL ) { + opal_list_remove_item( &pending_pids, (opal_list_item_t*)handle ); + OBJ_RELEASE(handle); + return ORTE_SUCCESS; + } + handle = find_pending_cb( wpid, true ); + handle->pid = wpid; + handle->callback = callback; + handle->data = data; + + RegisterWaitForSingleObject( &handle->registered_handle, (HANDLE)handle->pid, + trigger_process_detection, (void*)handle, INFINITE, WT_EXECUTEINWAITTHREAD); + + OPAL_THREAD_UNLOCK(&mutex); + + return OPAL_SUCCESS; } int orte_wait_cb_cancel(pid_t wpid) { - return ORTE_ERR_NOT_SUPPORTED; + opal_process_handle_t* pending; + + OPAL_THREAD_LOCK(&mutex); + + /** + * Do we have any registered callback for this particular pid ? + */ + pending = find_pending_cb( wpid, false ); + if( NULL != pending ) { + opal_list_remove_item( ®istered_cb, (opal_list_item_t*)pending ); + OBJ_RELEASE( pending ); + OPAL_THREAD_UNLOCK(&mutex); + return ORTE_SUCCESS; + } + OPAL_THREAD_UNLOCK(&mutex); + return ORTE_ERR_BAD_PARAM; } int orte_wait_cb_disable(void) { - return ORTE_ERR_NOT_SUPPORTED; + OPAL_THREAD_LOCK(&mutex); + cb_enabled = false; + OPAL_THREAD_UNLOCK(&mutex); + + return ORTE_SUCCESS; } int orte_wait_cb_enable(void) { - return ORTE_ERR_NOT_SUPPORTED; + OPAL_THREAD_LOCK(&mutex); + cb_enabled = true; + OPAL_THREAD_UNLOCK(&mutex); + + return ORTE_SUCCESS; } int orte_wait_kill(int sig) { - return ORTE_ERR_NOT_SUPPORTED; + opal_list_item_t* item; + + /** + * First pass. For all registered processes not yet triggered, terminate the + * process. Once this first pass is done, we will try to cleanup the ressources + */ + OPAL_THREAD_LOCK(&mutex); + + for (item = opal_list_get_first(®istered_cb) ; + item != opal_list_get_end(®istered_cb) ; + item = opal_list_get_next(item)) { + opal_process_handle_t* handle = (opal_process_handle_t*)item; + + if( 0 == TerminateProcess( (HANDLE)handle->pid, sig ) ) { + int error = GetLastError(); + } + } + + /* Give them a chance to complete the kill. */ + SleepEx( 1000, TRUE ); + + /* And now clean all ressources. */ + while (NULL != (item = opal_list_remove_first(®istered_cb))) { + OBJ_RELEASE(item); + } + while (NULL != (item = opal_list_remove_first(&pending_pids))) { + OBJ_RELEASE(item); + } + + OPAL_THREAD_UNLOCK(&mutex); + return ORTE_SUCCESS; } #endif diff --git a/orte/runtime/orte_wait.h b/orte/runtime/orte_wait.h index df8a00fc0a..a14b6b76f5 100644 --- a/orte/runtime/orte_wait.h +++ b/orte/runtime/orte_wait.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -31,6 +31,10 @@ #include #endif +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + /** typedef for callback function used in \c ompi_rte_wait_cb */ typedef void (*orte_wait_fn_t)(pid_t wpid, int status, void *data); @@ -46,7 +50,7 @@ typedef void (*orte_wait_fn_t)(pid_t wpid, int status, void *data); * \note A \c wpid value of \c -1 is not currently supported and will * return an error. */ -pid_t orte_waitpid(pid_t wpid, int *status, int options); +ORTE_DECLSPEC pid_t orte_waitpid(pid_t wpid, int *status, int options); /** @@ -64,31 +68,35 @@ pid_t orte_waitpid(pid_t wpid, int *status, int options); * \warning It is not legal for \c wpid to be -1 when registering a * callback. */ -int orte_wait_cb(pid_t wpid, orte_wait_fn_t callback, void *data); +ORTE_DECLSPEC int orte_wait_cb(pid_t wpid, orte_wait_fn_t callback, void *data); -int orte_wait_cb_cancel(pid_t wpid); +ORTE_DECLSPEC int orte_wait_cb_cancel(pid_t wpid); -int orte_wait_cb_disable(void); +ORTE_DECLSPEC int orte_wait_cb_disable(void); -int orte_wait_cb_enable(void); +ORTE_DECLSPEC int orte_wait_cb_enable(void); /** * \internal * * Initialize the wait system (allocate mutexes, etc.) */ -int orte_wait_init(void); +ORTE_DECLSPEC int orte_wait_init(void); /** * Kill all processes we are waiting on. */ -int orte_wait_kill(int sig); +ORTE_DECLSPEC int orte_wait_kill(int sig); /** * \internal * * Finalize the wait system (deallocate mutexes, etc.) */ -int orte_wait_finalize(void); +ORTE_DECLSPEC int orte_wait_finalize(void); + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif #endif /* #ifndef ORTE_WAIT_H */ diff --git a/orte/runtime/runtime.h b/orte/runtime/runtime.h index 7173980e70..b05590dcf2 100644 --- a/orte/runtime/runtime.h +++ b/orte/runtime/runtime.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -69,7 +69,7 @@ extern "C" { #endif - /* globals used by RTE - instanced in orte_init.c */ +/* globals used by RTE - instanced in orte_init.c */ ORTE_DECLSPEC extern int orte_debug_flag; @@ -123,9 +123,9 @@ ORTE_DECLSPEC int orte_restart(orte_process_name_t* name, const char* uri); ORTE_DECLSPEC int orte_finalize(void); ORTE_DECLSPEC int orte_system_finalize(void); - /* - * Change state as processes complete registration/unregistration - */ +/* + * Change state as processes complete registration/unregistration + */ ORTE_DECLSPEC void orte_all_procs_registered(orte_gpr_notify_message_t* match, void* cbdata); diff --git a/orte/util/session_dir.c b/orte/util/session_dir.c index a3376dcb45..82e28a948c 100644 --- a/orte/util/session_dir.c +++ b/orte/util/session_dir.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -52,6 +52,7 @@ #include "opal/util/output.h" #include "opal/util/os_path.h" #include "opal/util/os_dirpath.h" +#include "opal/util/basename.h" #include "orte/mca/errmgr/errmgr.h" #include "orte/runtime/runtime.h" @@ -220,11 +221,8 @@ orte_session_dir_get_name(char **fulldirpath, * openmpi-sessions-USERNAME@HOSTNAME_BATCHID/UNIVERSE/JOBID/PROC */ if( NULL != proc) { - if (0 > asprintf(&sessions, "%s%s%s%s%s%s%s", - *frontend, - orte_system_info.path_sep, universe, - orte_system_info.path_sep, job, - orte_system_info.path_sep, proc)) { + sessions = opal_os_path( false, *frontend, universe, job, proc, NULL ); + if( NULL == sessions ) { exit_status = ORTE_ERROR; goto cleanup; } @@ -233,10 +231,8 @@ orte_session_dir_get_name(char **fulldirpath, * openmpi-sessions-USERNAME@HOSTNAME_BATCHID/UNIVERSE/JOBID */ else if(NULL != job) { - if (0 > asprintf(&sessions, "%s%s%s%s%s", - *frontend, - orte_system_info.path_sep, universe, - orte_system_info.path_sep, job)) { + sessions = opal_os_path( false, *frontend, universe, job, NULL ); + if( NULL == sessions ) { exit_status = ORTE_ERROR; goto cleanup; } @@ -245,9 +241,8 @@ orte_session_dir_get_name(char **fulldirpath, * openmpi-sessions-USERNAME@HOSTNAME_BATCHID/UNIVERSE */ else if(NULL != universe) { - if (0 > asprintf(&sessions, "%s%s%s", - *frontend, - orte_system_info.path_sep, universe )) { + sessions = opal_os_path( false, *frontend, universe, NULL ); + if( NULL == sessions ) { exit_status = ORTE_ERROR; goto cleanup; } @@ -295,7 +290,7 @@ orte_session_dir_get_name(char **fulldirpath, /* * Construct the absolute final path */ - *fulldirpath = strdup(opal_os_path(false, *prefix, sessions, NULL)); + *fulldirpath = opal_os_path(false, *prefix, sessions, NULL); cleanup: @@ -442,10 +437,9 @@ int orte_session_dir(bool create, } /* Strip off last part of directory structure */ - sav = strdup(fulldirpath); + sav = opal_dirname(fulldirpath); free(fulldirpath); - fulldirpath = strdup(dirname(sav)); - free(sav); + fulldirpath = sav; sav = NULL; } @@ -464,10 +458,9 @@ int orte_session_dir(bool create, } /* Strip off last part of directory structure */ - sav = strdup(fulldirpath); + sav = opal_dirname(fulldirpath); free(fulldirpath); - fulldirpath = strdup(dirname(sav)); - free(sav); + fulldirpath = sav; sav = NULL; } @@ -529,9 +522,9 @@ orte_session_dir_cleanup(orte_jobid_t jobid) free(tmp); return rc; } - if (0 > asprintf(&job_session_dir, "%s%s%s", - orte_process_info.universe_session_dir, - orte_system_info.path_sep, job)) { + job_session_dir = opal_os_path( false, orte_process_info.universe_session_dir, + job, NULL ); + if( NULL == job_session_dir ) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); free(tmp); free(job); @@ -612,19 +605,17 @@ orte_session_dir_finalize(orte_process_name_t *proc) free(job); return rc; } - - if (0 > asprintf(&job_session_dir, "%s%s%s", - orte_process_info.universe_session_dir, - orte_system_info.path_sep, job)) { + job_session_dir = opal_os_path( false, orte_process_info.universe_session_dir, + job, NULL ); + if( NULL == job_session_dir ) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); free(tmp); free(job); free(vpid); return ORTE_ERR_OUT_OF_RESOURCE; } - if (0 > asprintf(&proc_session_dir, "%s%s%s", - job_session_dir, - orte_system_info.path_sep, vpid)) { + proc_session_dir = opal_os_path( false, job_session_dir, vpid, NULL ); + if( NULL == proc_session_dir ) { ORTE_ERROR_LOG(ORTE_ERR_OUT_OF_RESOURCE); free(tmp); free(job); diff --git a/orte/util/session_dir.h b/orte/util/session_dir.h index 15fa64a464..4ee013333c 100644 --- a/orte/util/session_dir.h +++ b/orte/util/session_dir.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -82,12 +82,19 @@ * * \par If \c create is \c true, the directory will be created and the * proc_info structure will be updated. If proc_info is false, - * */ + +#ifndef ORTE_SESSION_DIR_H_HAS_BEEN_INCLUDED +#define ORTE_SESSION_DIR_H_HAS_BEEN_INCLUDED + #include "orte_config.h" #include "orte/mca/ns/ns_types.h" +#if defined(c_plusplus) || defined(__cplusplus) +extern "C" { +#endif + /** @param create A boolean variable that indicates whether or not to * create the specified directory. If set to "false", * the function only checks to see if an existing @@ -167,3 +174,9 @@ ORTE_DECLSPEC int orte_session_dir_finalize(orte_process_name_t *proc); * properly cleaned up. */ ORTE_DECLSPEC int orte_session_dir_cleanup(orte_jobid_t jobid); + +#endif /* ORTE_SESSION_DIR_H_HAS_BEEN_INCLUDED */ + +#if defined(c_plusplus) || defined(__cplusplus) +} +#endif diff --git a/orte/util/sys_info.c b/orte/util/sys_info.c index d84ae3d4ad..d9983def44 100644 --- a/orte/util/sys_info.c +++ b/orte/util/sys_info.c @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -47,27 +47,24 @@ orte_sys_info_t orte_system_info = { /* .release = */ NULL, /* .version = */ NULL, /* .machine = */ NULL, - /* .path_sep = */ NULL, /* .user = */ NULL, /* .suffix = */ NULL}; int orte_sys_info(void) { struct utsname sys_info; - int uid; #ifndef __WINDOWS__ + int uid; struct passwd *pwdent; - char *sep = "/"; #else - #define INFO_BUF_SIZE 32768 + #define INFO_BUF_SIZE 256 TCHAR info_buf[INFO_BUF_SIZE]; DWORD info_buf_length = INFO_BUF_SIZE; - char *sep = "\\"; #endif if (orte_system_info.init) { - return ORTE_SUCCESS; + return ORTE_SUCCESS; } if (0 > uname(&sys_info)) { /* have an error - set utsname values to indicate */ @@ -105,8 +102,6 @@ int orte_sys_info(void) orte_system_info.machine = strdup(sys_info.machine); } - orte_system_info.path_sep = strdup(sep); - /* get the name of the user */ #ifndef __WINDOWS__ uid = getuid(); @@ -163,11 +158,6 @@ int orte_sys_info_finalize(void) orte_system_info.machine = NULL; } - if (NULL != orte_system_info.path_sep) { - free(orte_system_info.path_sep); - orte_system_info.path_sep = NULL; - } - if (NULL != orte_system_info.user) { free(orte_system_info.user); orte_system_info.user = NULL; diff --git a/orte/util/sys_info.h b/orte/util/sys_info.h index 4b2c612204..e58378e9ca 100644 --- a/orte/util/sys_info.h +++ b/orte/util/sys_info.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -44,7 +44,7 @@ extern "C" { * System information structure * * The orte_sys_info() function fills the sysname, nodename, release, version, machine, - * path_sep, and user fields + * and user fields * */ struct orte_sys_info_t { @@ -57,11 +57,6 @@ struct orte_sys_info_t { char *release; /**< Release level of the operating system. */ char *version; /**< Version of the operating system release. */ char *machine; /**< Type of hardware composing this node. */ - char *path_sep; /**< Path separation char, saved as string. - * The character used to separate directories in the path - - * a value that is usually either a '\' or '/', depending - * upon the operating system - */ char *user; /**< User id on this system. */ char *suffix; /**< Automatic suffix added to file names. * Some computing environments automatically "tag" files diff --git a/orte/util/univ_info.h b/orte/util/univ_info.h index f60d4a4c37..dd61d274ae 100644 --- a/orte/util/univ_info.h +++ b/orte/util/univ_info.h @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -24,6 +24,9 @@ * */ +#ifndef _ORTE_UNIV_INFO_H_ +#define _ORTE_UNIV_INFO_H_ + #include "orte_config.h" #ifdef HAVE_SYS_UTSNAME_H @@ -36,43 +39,39 @@ #include "opal/class/opal_object.h" #include "opal/class/opal_list.h" -#ifndef _ORTE_UNIV_INFO_H_ -#define _ORTE_UNIV_INFO_H_ - #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif - /* Some states for the orte_universe_t.state field */ - enum orte_universe_state_t { - ORTE_UNIVERSE_STATE_PRE_INIT, /* Before initialization */ - ORTE_UNIVERSE_STATE_INIT, /* In initalization */ - ORTE_UNIVERSE_STATE_RUNNING, /* After initalization */ - ORTE_UNIVERSE_STATE_FINALIZE /* In Finalization */ - }; - typedef enum orte_universe_state_t orte_universe_state_t; - - /* Define the info structure underlying the Open MPI universe system - * instanced in ompi_rte_init.c */ - - struct orte_universe_t { - /** This is an object, so it must have a super */ - opal_list_item_t super; +/* Some states for the orte_universe_t.state field */ +enum orte_universe_state_t { + ORTE_UNIVERSE_STATE_PRE_INIT, /* Before initialization */ + ORTE_UNIVERSE_STATE_INIT, /* In initalization */ + ORTE_UNIVERSE_STATE_RUNNING, /* After initalization */ + ORTE_UNIVERSE_STATE_FINALIZE /* In Finalization */ +}; +typedef enum orte_universe_state_t orte_universe_state_t; - orte_universe_state_t state; /**< Indicates state of the universe */ - char *name; - char *host; - char *uid; - bool persistence; - char *scope; - bool console; - char *seed_uri; /**< OOB contact info for universe seed */ - bool console_connected; /**< Indicates if console is connected */ - char *scriptfile; /**< Name of file containing commands to be executed */ - }; - typedef struct orte_universe_t orte_universe_t; +/* Define the info structure underlying the Open MPI universe system + * instanced in ompi_rte_init.c */ - ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_universe_t); +struct orte_universe_t { + /** This is an object, so it must have a super */ + opal_list_item_t super; + orte_universe_state_t state; /**< Indicates state of the universe */ + char *name; + char *host; + char *uid; + bool persistence; + char *scope; + bool console; + char *seed_uri; /**< OOB contact info for universe seed */ + bool console_connected; /**< Indicates if console is connected */ + char *scriptfile; /**< Name of file containing commands to be executed */ +}; +typedef struct orte_universe_t orte_universe_t; + +ORTE_DECLSPEC OBJ_CLASS_DECLARATION(orte_universe_t); ORTE_DECLSPEC extern orte_universe_t orte_universe_info;