2005-05-19 17:33:55 +04:00
|
|
|
/*
|
|
|
|
* 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 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$
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file **/
|
|
|
|
|
2005-05-22 22:40:03 +04:00
|
|
|
#include "orte_config.h"
|
|
|
|
|
2005-07-04 05:36:20 +04:00
|
|
|
#include "opal/util/malloc.h"
|
2005-07-04 03:31:27 +04:00
|
|
|
#include "opal/util/output.h"
|
2005-08-10 02:40:42 +04:00
|
|
|
#include "opal/memory/memory.h"
|
2005-08-13 00:46:25 +04:00
|
|
|
#include "opal/mca/base/base.h"
|
|
|
|
#include "opal/runtime/opal.h"
|
2005-08-14 21:23:34 +04:00
|
|
|
#include "opal/mca/memory/base/base.h"
|
2005-08-16 20:15:53 +04:00
|
|
|
#include "opal/mca/paffinity/base/base.h"
|
2005-08-18 09:34:22 +04:00
|
|
|
#include "opal/mca/timer/base/base.h"
|
2005-08-22 07:05:39 +04:00
|
|
|
#include "opal/include/constants.h"
|
|
|
|
#include "opal/util/error.h"
|
|
|
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
opal_err2str(int errnum)
|
|
|
|
{
|
|
|
|
const char *retval;
|
|
|
|
|
|
|
|
switch (errnum) {
|
|
|
|
case OPAL_SUCCESS:
|
|
|
|
retval = "Success";
|
|
|
|
break;
|
|
|
|
case OPAL_ERROR:
|
|
|
|
retval = "Error";
|
|
|
|
break;
|
|
|
|
case OPAL_ERR_OUT_OF_RESOURCE:
|
|
|
|
retval = "Out of resource";
|
|
|
|
break;
|
|
|
|
case OPAL_ERR_NOT_FOUND:
|
|
|
|
retval = "Not found";
|
|
|
|
break;
|
|
|
|
case OPAL_ERR_BAD_PARAM:
|
|
|
|
retval = "Bad parameter";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
retval = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
2005-08-18 09:34:22 +04:00
|
|
|
|
2005-05-19 17:33:55 +04:00
|
|
|
|
|
|
|
/**
|
2005-05-22 22:40:03 +04:00
|
|
|
* Initialize the OPAL utilities
|
2005-05-19 17:33:55 +04:00
|
|
|
*
|
2005-08-22 07:05:39 +04:00
|
|
|
* @retval OPAL_SUCCESS Upon success.
|
|
|
|
* @retval OPAL_ERROR Upon failure.
|
2005-05-19 17:33:55 +04:00
|
|
|
*
|
|
|
|
* This function performs
|
|
|
|
*/
|
2005-05-22 22:40:03 +04:00
|
|
|
int opal_init(void)
|
|
|
|
{
|
|
|
|
/* initialize the memory allocator */
|
2005-07-04 05:36:20 +04:00
|
|
|
opal_malloc_init();
|
2005-05-22 22:40:03 +04:00
|
|
|
|
|
|
|
/* initialize the output system */
|
2005-07-04 03:31:27 +04:00
|
|
|
opal_output_init();
|
2005-08-22 07:05:39 +04:00
|
|
|
|
2005-08-25 00:19:36 +04:00
|
|
|
/* initialize the memory manager / tracker */
|
|
|
|
opal_mem_free_init();
|
|
|
|
|
2005-08-22 07:05:39 +04:00
|
|
|
/* register handler for errnum -> string converstion */
|
2005-08-30 03:36:53 +04:00
|
|
|
opal_error_register("OPAL", OPAL_ERR_BASE, OPAL_ERR_MAX, opal_err2str);
|
2005-08-25 00:19:36 +04:00
|
|
|
|
2005-05-22 22:40:03 +04:00
|
|
|
/* initialize the mca */
|
|
|
|
mca_base_open();
|
2005-05-19 17:33:55 +04:00
|
|
|
|
2005-08-16 20:15:53 +04:00
|
|
|
/* open the processor affinity base */
|
|
|
|
opal_paffinity_base_open();
|
|
|
|
opal_paffinity_base_select();
|
|
|
|
|
2005-08-14 21:23:34 +04:00
|
|
|
/* open the memory manager components. Memory hooks may be
|
|
|
|
triggered before this (any time after mem_free_init(),
|
|
|
|
actually). This is a hook available for memory manager hooks
|
|
|
|
without good initialization routine support */
|
|
|
|
opal_memory_base_open();
|
|
|
|
|
2005-08-18 09:34:22 +04:00
|
|
|
opal_timer_base_open();
|
|
|
|
|
2005-08-22 07:05:39 +04:00
|
|
|
return OPAL_SUCCESS;
|
2005-05-22 22:40:03 +04:00
|
|
|
}
|
2005-06-08 23:03:29 +04:00
|
|
|
|