1
1
openmpi/orte/test/system/iof_stress.c
Ralph Castain 6e5d844c36 Roll in the revamped IOF subsystem. Per the devel mailing list email, this is a complete rewrite of the iof framework designed to simplify the code for maintainability, and to support features we had planned to do, but were too difficult to implement in the old code. Specifically, the new code:
1. completely and cleanly separates responsibilities between the HNP, orted, and tool components.

2. removes all wireup messaging during launch and shutdown.

3. maintains flow control for stdin to avoid large-scale consumption of memory by orteds when large input files are forwarded. This is done using an xon/xoff protocol.

4. enables specification of stdin recipients on the mpirun cmd line. Allowed options include rank, "all", or "none". Default is rank 0.

5. creates a new MPI_Info key "ompi_stdin_target" that supports the above options for child jobs. Default is "none".

6. adds a new tool "orte-iof" that can connect to a running mpirun and display the output. Cmd line options allow selection of any combination of stdout, stderr, and stddiag. Default is stdout.

7. adds a new mpirun and orte-iof cmd line option "tag-output" that will tag each line of output with process name and stream ident. For example, "[1,0]<stdout>this is output"

This is not intended for the 1.3 release as it is a major change requiring considerable soak time.

This commit was SVN r19767.
2008-10-18 00:00:49 +00:00

75 строки
1.4 KiB
C

#include <stdio.h>
#include <signal.h>
#include <math.h>
#include "orte/util/proc_info.h"
#include "orte/util/name_fns.h"
#include "orte/runtime/orte_globals.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/runtime/runtime.h"
#define MAX_COUNT 3
#define ORTE_IOF_BASE_MSG_MAX 2048
int
main(int argc, char *argv[]){
int count;
int msgsize;
unsigned char msg[ORTE_IOF_BASE_MSG_MAX];
int i, j, rc;
double maxpower;
unsigned char chr;
bool readstdin;
/*
* Init
*/
orte_init(ORTE_NON_TOOL);
if (argc >= 2) {
count = atoi(argv[1]);
if (count < 0) {
count = INT_MAX-1;
}
} else {
count = MAX_COUNT;
}
if (argc == 3) {
/* read from stdin */
readstdin = true;
} else {
readstdin = false;
}
if (0 == ORTE_PROC_MY_NAME->vpid && readstdin) {
while (0 != (msgsize = read(0, msg, ORTE_IOF_BASE_MSG_MAX))) {
if (msgsize > 0) {
msg[msgsize] = '\n';
write(1, msg, msgsize);
}
}
}
for (j=1; j < count+1; j++) {
#if 0
maxpower = (double)(j%7);
#endif
chr = (j % 26) + 65;
memset(msg, chr, ORTE_IOF_BASE_MSG_MAX);
msgsize = 10;
msg[msgsize-1] = '\n';
write(1, msg, msgsize);
}
orte_finalize();
return 0;
}