This source file includes following definitions.
- ompi_pml_v_output_open
- ompi_pml_v_output_close
1
2
3
4
5
6
7
8
9
10
11
12
13 #include "ompi_config.h"
14
15 #include "opal/util/output.h"
16 #include "opal/util/printf.h"
17
18 #include "pml_v_output.h"
19
20 #if defined(HAVE_UNISTD_H)
21 #include <unistd.h>
22 #endif
23 #include <string.h>
24
25 int ompi_pml_v_output_open(char *output, int verbosity) {
26 opal_output_stream_t lds;
27 char hostname[OPAL_MAXHOSTNAMELEN] = "NA";
28
29 OBJ_CONSTRUCT(&lds, opal_output_stream_t);
30 if(!output) {
31 mca_pml_v.output = 0;
32 }
33 else {
34 if(!strcmp(output, "stdout")) {
35 lds.lds_want_stdout = true;
36 }
37 else if(!strcmp(output, "stderr")) {
38 lds.lds_want_stderr = true;
39 }
40 else
41 {
42 lds.lds_want_file = true;
43 lds.lds_file_suffix = output;
44 }
45 lds.lds_is_debugging = true;
46 gethostname(hostname, sizeof(hostname));
47 opal_asprintf(&lds.lds_prefix, "[%s:%05d] pml_v: ", hostname, getpid());
48 lds.lds_verbose_level = verbosity;
49 mca_pml_v.output = opal_output_open(&lds);
50 free(lds.lds_prefix);
51 }
52 return mca_pml_v.output;
53 }
54
55 void ompi_pml_v_output_close(void) {
56 opal_output_close(mca_pml_v.output);
57 mca_pml_v.output = -1;
58 }