1
1

Second cut of bug 663: split lam_init() into two functions -- lam_init()

and lam_rte_init().  The former is for all LAM processes (including,
for example, LAM wrapper compilers); the latter is only for those who
need to join the LAM RTE.

This commit was SVN r408.
Этот коммит содержится в:
Jeff Squyres 2004-01-15 05:02:41 +00:00
родитель bf4ae8b8a6
Коммит 456337ed57
4 изменённых файлов: 104 добавлений и 63 удалений

Просмотреть файл

@ -16,7 +16,8 @@ libruntime_la_SOURCES = \
$(headers) \
lam_abort.c \
lam_init.c \
lam_finalize.c
lam_finalize.c \
lam_rte_init.c
# Conditionally install the header files

Просмотреть файл

@ -23,10 +23,15 @@
* This is the first function that must be called for a LAM process.
* It sets up the following:
*
* - calls lam_output_init()
* - calls lam_set_using_threads() (sets value to false)
* - calls lam_output_init(): sets up default verbose/0 stream
*
* More will likely be filled in here in the future.
* - calls lam_set_using_threads(): sets value to false (someone else,
* such as MPI_INIT, may reset this value later)
*
* More will likely be filled in here in the future. Note that LAM
* RTE MCA module setup is distinctly \em not covered in this function
* -- not all LAM processes need LAM RTE MCA modules (e.g., wrapper
* compilers). LAM RTE MCA modules are initialized in lam_rte_init().
*/
int lam_init(int argc, char *argv[])
{
@ -41,66 +46,11 @@ int lam_init(int argc, char *argv[])
lam_set_using_threads(false);
#if 0
/*
* BWB - this comment should be removed at some point in the very
* near future
*
* JMS - will need more #include files to make this work. Not
* filling them in at the moment. :-)
*
* This #if 0'ed out block of code is a rough approximation of what
* should happen to get this parallel job bootstrapped and ready to
* run. There are probably some bugs in the OOB and PCM interfaces
* that are going to make this really interesting (sorry :( ), but I
* think it should work once the MPI modules are written...
*/
/* Other things that we'll probably need:
/* Do the "right" MCA query and init functions to fire up the
* run-time environment interfaces. I'm not exactly sure what these
* calls will be (since they are in the base functions, right?), but
* do them here
*
* Order is:
* 1) PCM
* 2) OOB
* 3) Registery
*
* Don't forget to close down in the reverse order at end of the day
* - even the silly COFS implementations are going to leak resources
* like crazy if you don't.
*
* The OOB system may not actually be usable until the end of
* pcm_proc_startup, but must be initialized here.
*/
/* Do the client side of the rendezvous with our launcher (or
* whatever is needed for our RTE to figure out how to talk with our
* peers and all that.
*/
ret = mca_pcm.pcm_proc_startup();
if (ret != MPI_SUCCESS) printf("oops!\n");
/* at this point, we can use the OOB interface directly if we really
need to, but is a bit tricky since we don't have a peers list
yet. */
mca_pcm.get_peers(&procs, &nprocs);
/* get a pointer to me */
my_proc = mca_pcm.get_me();
/* get my parents. need to think about how to do this - i don't
* think this is what we want at all... We can probably ignore
* this for a little while since we don't have a run time
* environment tha supports spawn just yet, but something to
* remember...
*/
mca_pcm.get_parent(&pprocs, &npprocs);
/* we should have enough information by now to start running the PML
* and PTL interfaces, right?
*/
#endif
- session directory setup
- ...?
*/
/* All done */

88
src/lam/runtime/lam_rte_init.c Обычный файл
Просмотреть файл

@ -0,0 +1,88 @@
/*
* $HEADER$
*/
/** @file **/
#include "lam_config.h"
#include "lam/constants.h"
#include "lam/runtime/runtime.h"
#include "lam/util/output.h"
#include "lam/threads/mutex.h"
/**
* Initialze and setup a process in the LAM RTE.
*
* @retval LAM_SUCCESS Upon success.
* @retval LAM_ERROR Upon failure.
*
* This function performs
*/
int lam_rte_init(void)
{
#if 0
/*
* BWB - this comment should be removed at some point in the very
* near future
*
* JMS - will need more #include files to make this work. Not
* filling them in at the moment. :-)
*
* This #if 0'ed out block of code is a rough approximation of what
* should happen to get this parallel job bootstrapped and ready to
* run. There are probably some bugs in the OOB and PCM interfaces
* that are going to make this really interesting (sorry :( ), but I
* think it should work once the MPI modules are written...
*/
/* Do the "right" MCA query and init functions to fire up the
* run-time environment interfaces. I'm not exactly sure what these
* calls will be (since they are in the base functions, right?), but
* do them here
*
* Order is:
* 1) PCM
* 2) OOB
* 3) Registery
*
* Don't forget to close down in the reverse order at end of the day
* - even the silly COFS implementations are going to leak resources
* like crazy if you don't.
*
* The OOB system may not actually be usable until the end of
* pcm_proc_startup, but must be initialized here.
*/
/* Do the client side of the rendezvous with our launcher (or
* whatever is needed for our RTE to figure out how to talk with our
* peers and all that.
*/
ret = mca_pcm.pcm_proc_startup();
if (ret != MPI_SUCCESS) printf("oops!\n");
/* at this point, we can use the OOB interface directly if we really
need to, but is a bit tricky since we don't have a peers list
yet. */
mca_pcm.get_peers(&procs, &nprocs);
/* get a pointer to me */
my_proc = mca_pcm.get_me();
/* get my parents. need to think about how to do this - i don't
* think this is what we want at all... We can probably ignore
* this for a little while since we don't have a run time
* environment tha supports spawn just yet, but something to
* remember...
*/
mca_pcm.get_parent(&pprocs, &npprocs);
/* we should have enough information by now to start running the PML
* and PTL interfaces, right?
*/
#endif
/* All done */
return LAM_SUCCESS;
}

Просмотреть файл

@ -9,8 +9,10 @@
extern "C" {
#endif
int lam_abort(int status, char *message);
int lam_init(int argc, char* argv[]);
int lam_finalize(void);
int lam_rte_init(void);
#ifdef __cplusplus
}