@@ -837,25 +837,34 @@ static pmix_iof_write_event_t* pmix_iof_setup(pmix_namespace_t *nptr,
837
837
838
838
void pmix_iof_check_flags (pmix_info_t * info , pmix_iof_flags_t * flags )
839
839
{
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 )) {
841
842
flags -> tag = PMIX_INFO_TRUE (info );
842
843
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 )) {
844
849
flags -> timestamp = PMIX_INFO_TRUE (info );
845
850
flags -> set = true;
846
851
} else if (PMIX_CHECK_KEY (info , PMIX_IOF_XML_OUTPUT )) {
847
852
flags -> xml = PMIX_INFO_TRUE (info );
848
853
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 )) {
850
856
flags -> file = strdup (info -> value .data .string );
851
857
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 )) {
853
860
flags -> directory = strdup (info -> value .data .string );
854
861
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 )) {
856
864
flags -> nocopy = PMIX_INFO_TRUE (info );
857
865
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 )) {
859
868
flags -> merge = PMIX_INFO_TRUE (info );
860
869
flags -> set = true;
861
870
} 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
1097
1106
goto process ;
1098
1107
}
1099
1108
1100
- if (!myflags .xml && ! myflags . timestamp && ! myflags . tag ) {
1109
+ if (!myflags .set ) {
1101
1110
/* the data is not to be tagged - just copy it
1102
1111
* and move on to processing
1103
1112
*/
@@ -1114,17 +1123,33 @@ pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_iof_channel_t
1114
1123
snprintf (begintag , PMIX_IOF_BASE_TAG_MAX ,
1115
1124
"<%s nspace=\"%s\" rank=\"%s\"" , suffix ,
1116
1125
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 ));
1117
1130
} else if (myflags .timestamp ) {
1118
1131
snprintf (begintag , PMIX_IOF_BASE_TAG_MAX ,
1119
1132
"<%s rank=\"%s\"" , suffix ,
1120
1133
PMIX_RANK_PRINT (name -> rank ));
1121
1134
} else {
1122
1135
snprintf (begintag , PMIX_IOF_BASE_TAG_MAX ,
1123
- "<%s rank=\"%s\"> " , suffix ,
1136
+ "<%s rank=\"%s\"" , suffix ,
1124
1137
PMIX_RANK_PRINT (name -> rank ));
1125
1138
}
1126
1139
snprintf (endtag , PMIX_IOF_BASE_TAG_MAX ,
1127
1140
"</%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
+ }
1128
1153
}
1129
1154
1130
1155
/* 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
1136
1161
cptr = ctime (& mytime );
1137
1162
cptr [strlen (cptr ) - 1 ] = '\0' ; /* remove trailing newline */
1138
1163
1139
- if (myflags .xml && !myflags .tag ) {
1164
+ if (myflags .xml && !myflags .tag && ! myflags . rank ) {
1140
1165
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 ) ) {
1143
1168
snprintf (timestamp , PMIX_IOF_BASE_TAG_MAX ,
1144
1169
" timestamp=\"%s\"" , cptr );
1145
- } else if (myflags .tag ) {
1170
+ } else if (myflags .tag || myflags . rank ) {
1146
1171
snprintf (timestamp , PMIX_IOF_BASE_TAG_MAX , "%s" , cptr );
1147
1172
} 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 );
1149
1174
}
1150
1175
}
1151
1176
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
-
1160
1177
endtaglen = strlen (endtag );
1161
1178
endtagged = false;
1162
1179
k = 0 ;
@@ -1178,7 +1195,9 @@ pmix_status_t pmix_iof_write_output(const pmix_proc_t *name, pmix_iof_channel_t
1178
1195
/* if xml, end the starttag with a '>' */
1179
1196
if (myflags .xml ) {
1180
1197
starttag [k ++ ] = '>' ;
1181
- } else {
1198
+ } else if (myflags .rank ) {
1199
+ starttag [k ++ ] = ' ' ;
1200
+ } else if (myflags .tag || myflags .timestamp ) {
1182
1201
starttag [k ++ ] = ':' ;
1183
1202
}
1184
1203
0 commit comments