Skip to content

Commit 7294e3d

Browse files
authored
Merge pull request #2246 from rhc54/topic/iof
Cleanup some IOF attributes
2 parents 05852a7 + f9e15e6 commit 7294e3d

File tree

4 files changed

+60
-32
lines changed

4 files changed

+60
-32
lines changed

include/pmix_common.h.in

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,15 +452,6 @@ typedef uint32_t pmix_rank_t;
452452
// job - i.e., not part of the "comm_world" of the job
453453
#define PMIX_SET_SESSION_CWD "pmix.ssncwd" // (bool) set the application's current working directory to
454454
// the session working directory assigned by the RM
455-
#define PMIX_TAG_OUTPUT "pmix.tagout" // (bool) tag application output with the ID of the source
456-
#define PMIX_TIMESTAMP_OUTPUT "pmix.tsout" // (bool) timestamp output from applications
457-
#define PMIX_MERGE_STDERR_STDOUT "pmix.mergeerrout" // (bool) merge stdout and stderr streams from application procs
458-
#define PMIX_OUTPUT_TO_FILE "pmix.outfile" // (char*) direct application output into files of form
459-
// "<filename>.rank" with both stdout and stderr redirected into it
460-
#define PMIX_OUTPUT_TO_DIRECTORY "pmix.outdir" // (char*) direct application output into files of form
461-
// "<directory>/<jobid>/rank.<rank>/stdout[err]"
462-
#define PMIX_OUTPUT_NOCOPY "pmix.nocopy" // (bool) output only into designated files - do not also output
463-
// a copy to stdout/stderr
464455
#define PMIX_INDEX_ARGV "pmix.indxargv" // (bool) mark the argv with the rank of the proc
465456
#define PMIX_CPUS_PER_PROC "pmix.cpuperproc" // (uint32_t) #cpus to assign to each rank
466457
#define PMIX_NO_PROCS_ON_HEAD "pmix.nolocal" // (bool) do not place procs on the head node
@@ -878,9 +869,17 @@ typedef uint32_t pmix_rank_t;
878869
#define PMIX_IOF_PUSH_STDIN "pmix.iof.stdin" // (bool) Used by a tool to request that the PMIx library collect
879870
// the tool's stdin and forward it to the procs specified in
880871
// the PMIx_IOF_push call
881-
#define PMIX_IOF_TAG_OUTPUT "pmix.iof.tag" // (bool) Tag output with the channel it comes from
872+
#define PMIX_IOF_TAG_OUTPUT "pmix.iof.tag" // (bool) Tag output with the [nspace,rank] and channel it comes from
873+
#define PMIX_IOF_RANK_OUTPUT "pmix.iof.rank" // (bool) Tag output with the rank it came from
882874
#define PMIX_IOF_TIMESTAMP_OUTPUT "pmix.iof.ts" // (bool) Timestamp output
875+
#define PMIX_IOF_MERGE_STDERR_STDOUT "pmix.iof.mrg" // (bool) merge stdout and stderr streams from application procs
883876
#define PMIX_IOF_XML_OUTPUT "pmix.iof.xml" // (bool) Format output in XML
877+
#define PMIX_IOF_OUTPUT_TO_FILE "pmix.iof.file" // (char*) direct application output into files of form
878+
// "<filename>.rank" with both stdout and stderr redirected into it
879+
#define PMIX_IOF_OUTPUT_TO_DIRECTORY "pmix.iof.dir" // (char*) direct application output into files of form
880+
// "<directory>/<jobid>/rank.<rank>/stdout[err]"
881+
#define PMIX_IOF_FILE_ONLY "pmix.iof.fonly" // (bool) output only into designated files - do not also output
882+
// a copy to stdout/stderr
884883
#define PMIX_IOF_COPY "pmix.iof.cpy" // (bool) Requests that the host environment deliver a copy of the
885884
// specified output stream(s) to the tool, letting the stream(s)
886885
// continue to also be delivered to the default location. This

include/pmix_deprecated.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ PMIX_EXPORT pmix_status_t PMIx_tool_connect_to_server(pmix_proc_t *proc,
166166
// the event and believes termination of the application is not required
167167
#define PMIX_EVENT_WANT_TERMINATION "pmix.evterm" // (bool) ***** DEPRECATED ***** indicates that the handler has determined that the
168168
// application should be terminated
169+
#define PMIX_TAG_OUTPUT "pmix.tagout" // (bool) ***** DEPRECATED ***** tag application output with the ID of the source
170+
#define PMIX_TIMESTAMP_OUTPUT "pmix.tsout" // (bool) ***** DEPRECATED ***** timestamp output from applications
171+
#define PMIX_MERGE_STDERR_STDOUT "pmix.mergeerrout" // (bool) ***** DEPRECATED ***** merge stdout and stderr streams from application procs
172+
#define PMIX_OUTPUT_TO_FILE "pmix.outfile" // (char*) ***** DEPRECATED ***** direct application output into files of form
173+
// "<filename>.rank" with both stdout and stderr redirected into it
174+
#define PMIX_OUTPUT_TO_DIRECTORY "pmix.outdir" // (char*) ***** DEPRECATED ***** direct application output into files of form
175+
// "<directory>/<jobid>/rank.<rank>/stdout[err]"
176+
#define PMIX_OUTPUT_NOCOPY "pmix.nocopy" // (bool) ***** DEPRECATED ***** output only into designated files - do not also output
177+
// a copy to stdout/stderr
169178

170179
/* attributes for GDS */
171180
#define PMIX_GDS_MODULE "pmix.gds.mod" // (char*) ***** DEPRECATED ***** comma-delimited string of desired modules

src/common/pmix_iof.c

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -837,25 +837,34 @@ static pmix_iof_write_event_t* pmix_iof_setup(pmix_namespace_t *nptr,
837837

838838
void pmix_iof_check_flags(pmix_info_t *info, pmix_iof_flags_t *flags)
839839
{
840-
if (PMIX_CHECK_KEY(info, PMIX_IOF_TAG_OUTPUT)) {
840+
if (PMIX_CHECK_KEY(info, PMIX_IOF_TAG_OUTPUT) ||
841+
PMIX_CHECK_KEY(info, PMIX_TAG_OUTPUT)) {
841842
flags->tag = PMIX_INFO_TRUE(info);
842843
flags->set = true;
843-
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_TIMESTAMP_OUTPUT)) {
844+
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_RANK_OUTPUT)) {
845+
flags->rank = PMIX_INFO_TRUE(info);
846+
flags->set = true;
847+
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_TIMESTAMP_OUTPUT) ||
848+
PMIX_CHECK_KEY(info, PMIX_TIMESTAMP_OUTPUT)) {
844849
flags->timestamp = PMIX_INFO_TRUE(info);
845850
flags->set = true;
846851
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_XML_OUTPUT)) {
847852
flags->xml = PMIX_INFO_TRUE(info);
848853
flags->set = true;
849-
} else if (PMIX_CHECK_KEY(info, PMIX_OUTPUT_TO_FILE)) {
854+
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_OUTPUT_TO_FILE) ||
855+
PMIX_CHECK_KEY(info, PMIX_OUTPUT_TO_FILE)) {
850856
flags->file = strdup(info->value.data.string);
851857
flags->set = true;
852-
} else if (PMIX_CHECK_KEY(info, PMIX_OUTPUT_TO_DIRECTORY)) {
858+
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_OUTPUT_TO_DIRECTORY) ||
859+
PMIX_CHECK_KEY(info, PMIX_OUTPUT_TO_DIRECTORY)) {
853860
flags->directory = strdup(info->value.data.string);
854861
flags->set = true;
855-
} else if (PMIX_CHECK_KEY(info, PMIX_OUTPUT_NOCOPY)) {
862+
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_FILE_ONLY) ||
863+
PMIX_CHECK_KEY(info, PMIX_OUTPUT_NOCOPY)) {
856864
flags->nocopy = PMIX_INFO_TRUE(info);
857865
flags->set = true;
858-
} else if (PMIX_CHECK_KEY(info, PMIX_MERGE_STDERR_STDOUT)) {
866+
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_MERGE_STDERR_STDOUT) ||
867+
PMIX_CHECK_KEY(info, PMIX_MERGE_STDERR_STDOUT)) {
859868
flags->merge = PMIX_INFO_TRUE(info);
860869
flags->set = true;
861870
} else if (PMIX_CHECK_KEY(info, PMIX_IOF_LOCAL_OUTPUT)) {
@@ -1097,7 +1106,7 @@ pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_iof_channel_t
10971106
goto process;
10981107
}
10991108

1100-
if (!myflags.xml && !myflags.timestamp && !myflags.tag) {
1109+
if (!myflags.set) {
11011110
/* the data is not to be tagged - just copy it
11021111
* and move on to processing
11031112
*/
@@ -1114,17 +1123,33 @@ pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_iof_channel_t
11141123
snprintf(begintag, PMIX_IOF_BASE_TAG_MAX,
11151124
"<%s nspace=\"%s\" rank=\"%s\"", suffix,
11161125
name->nspace, PMIX_RANK_PRINT(name->rank));
1126+
} else if (myflags.rank) {
1127+
snprintf(begintag, PMIX_IOF_BASE_TAG_MAX,
1128+
"<%s rank=\"%s\"", suffix,
1129+
PMIX_RANK_PRINT(name->rank));
11171130
} else if (myflags.timestamp) {
11181131
snprintf(begintag, PMIX_IOF_BASE_TAG_MAX,
11191132
"<%s rank=\"%s\"", suffix,
11201133
PMIX_RANK_PRINT(name->rank));
11211134
} else {
11221135
snprintf(begintag, PMIX_IOF_BASE_TAG_MAX,
1123-
"<%s rank=\"%s\">", suffix,
1136+
"<%s rank=\"%s\"", suffix,
11241137
PMIX_RANK_PRINT(name->rank));
11251138
}
11261139
snprintf(endtag, PMIX_IOF_BASE_TAG_MAX,
11271140
"</%s>", suffix);
1141+
} else {
1142+
if (myflags.tag) {
1143+
snprintf(outtag, PMIX_IOF_BASE_TAG_MAX,
1144+
"[%s,%s]<%s>",
1145+
name->nspace,
1146+
PMIX_RANK_PRINT(name->rank),
1147+
suffix);
1148+
} else if (myflags.rank) {
1149+
snprintf(outtag, PMIX_IOF_BASE_TAG_MAX,
1150+
"[%s]",
1151+
PMIX_RANK_PRINT(name->rank));
1152+
}
11281153
}
11291154

11301155
/* if we are to timestamp output, start the tag with that */
@@ -1136,27 +1161,19 @@ pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_iof_channel_t
11361161
cptr = ctime(&mytime);
11371162
cptr[strlen(cptr) - 1] = '\0'; /* remove trailing newline */
11381163

1139-
if (myflags.xml && !myflags.tag) {
1164+
if (myflags.xml && !myflags.tag && !myflags.rank) {
11401165
snprintf(timestamp, PMIX_IOF_BASE_TAG_MAX,
1141-
" timestamp=\"%s\">", cptr);
1142-
} else if (myflags.xml && myflags.tag) {
1166+
" timestamp=\"%s\"", cptr);
1167+
} else if (myflags.xml && (myflags.tag || myflags.rank)) {
11431168
snprintf(timestamp, PMIX_IOF_BASE_TAG_MAX,
11441169
" timestamp=\"%s\"", cptr);
1145-
} else if (myflags.tag) {
1170+
} else if (myflags.tag || myflags.rank) {
11461171
snprintf(timestamp, PMIX_IOF_BASE_TAG_MAX, "%s", cptr);
11471172
} else {
1148-
snprintf(timestamp, PMIX_IOF_BASE_TAG_MAX, "%s<%s>", cptr, suffix);
1173+
snprintf(timestamp, PMIX_IOF_BASE_TAG_MAX, "%s<%s", cptr, suffix);
11491174
}
11501175
}
11511176

1152-
if (myflags.tag && !myflags.xml) {
1153-
snprintf(outtag, PMIX_IOF_BASE_TAG_MAX,
1154-
"[%s,%s]<%s>",
1155-
name->nspace,
1156-
PMIX_RANK_PRINT(name->rank),
1157-
suffix);
1158-
}
1159-
11601177
endtaglen = strlen(endtag);
11611178
endtagged = false;
11621179
k = 0;
@@ -1178,7 +1195,9 @@ pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_iof_channel_t
11781195
/* if xml, end the starttag with a '>' */
11791196
if (myflags.xml) {
11801197
starttag[k++] = '>';
1181-
} else {
1198+
} else if (myflags.rank) {
1199+
starttag[k++] = ' ';
1200+
} else if (myflags.tag || myflags.timestamp) {
11821201
starttag[k++] = ':';
11831202
}
11841203

src/include/pmix_globals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ typedef struct {
197197
bool xml;
198198
bool timestamp;
199199
bool tag;
200+
bool rank;
200201
char *file;
201202
char *directory;
202203
bool nocopy;

0 commit comments

Comments
 (0)