1
1
openmpi/ompi/mca/pml/v/pml_v_output.c
Aurelien Bouteiller 77565d60d9 Heavy modification of the pml_v framework.
* Code cleanup and rationalization
* Fixed: mca_pml_base_send/recv_request are now allocated before recreation by the PML-V
* Fixed: pointer arithmetic bug in sender based that crashed 
* Changed: directory structure. This is one step forward using autogen.sh to build static-components.h (it needs to have the directory structure of a mca framework for this). 

This commit was SVN r15878.
2007-08-16 05:52:30 +00:00

52 строки
1.2 KiB
C

/*
* Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "pml_v_output.h"
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
int pml_v_output = -1;
int pml_v_output_open(char *output, int verbosity) {
opal_output_stream_t lds;
char hostname[32] = "NA";
OBJ_CONSTRUCT(&lds, opal_output_stream_t);
if(!output) {
pml_v_output = 0;
}
else {
if(!strcmp(output, "stdout")) {
lds.lds_want_stdout = true;
}
else if(!strcmp(output, "stderr")) {
lds.lds_want_stderr = true;
}
else
{
lds.lds_want_file = true;
lds.lds_file_suffix = output;
}
lds.lds_is_debugging = true;
gethostname(hostname, 32);
asprintf(&lds.lds_prefix, "[%s:%05d] pml_v: ", hostname, getpid());
lds.lds_verbose_level = verbosity;
pml_v_output = opal_output_open(&lds);
free(lds.lds_prefix);
}
return pml_v_output;
}
void pml_v_output_close(void) {
opal_output_close(pml_v_output);
}