|
14 | 14 | * Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved. |
15 | 15 | * Copyright (c) 2007-2017 Los Alamos National Security, LLC. All rights |
16 | 16 | * reserved. |
17 | | - * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. |
| 17 | + * Copyright (c) 2013-2018 Intel, Inc. All rights reserved. |
18 | 18 | * Copyright (c) 2015-2017 Research Organization for Information Science |
19 | 19 | * and Technology (RIST). All rights reserved. |
20 | 20 | * Copyright (c) 2017 IBM Corporation. All rights reserved. |
@@ -813,7 +813,19 @@ int orte_submit_job(char *argv[], int *index, |
813 | 813 | } |
814 | 814 | /* if we were asked to output to files, pass it along */ |
815 | 815 | if (NULL != orte_cmd_options.output_filename) { |
816 | | - orte_set_attribute(&jdata->attributes, ORTE_JOB_OUTPUT_TO_FILE, ORTE_ATTR_GLOBAL, orte_cmd_options.output_filename, OPAL_STRING); |
| 816 | + /* if the given filename isn't an absolute path, then |
| 817 | + * convert it to one so the name will be relative to |
| 818 | + * the directory where prun was given as that is what |
| 819 | + * the user will have seen */ |
| 820 | + if (!opal_path_is_absolute(orte_cmd_options.output_filename)) { |
| 821 | + char cwd[OPAL_PATH_MAX], path; |
| 822 | + getcwd(cwd, sizeof(cwd)); |
| 823 | + path = opal_os_path(false, cwd, orte_cmd_options.output_filename, NULL); |
| 824 | + orte_set_attribute(&jdata->attributes, ORTE_JOB_OUTPUT_TO_FILE, ORTE_ATTR_GLOBAL, path, OPAL_STRING); |
| 825 | + free(path); |
| 826 | + } else { |
| 827 | + orte_set_attribute(&jdata->attributes, ORTE_JOB_OUTPUT_TO_FILE, ORTE_ATTR_GLOBAL, orte_cmd_options.output_filename, OPAL_STRING); |
| 828 | + } |
817 | 829 | } |
818 | 830 | /* if we were asked to merge stderr to stdout, mark it so */ |
819 | 831 | if (orte_cmd_options.merge) { |
|
0 commit comments