Skip to content

Conversation

@marksantcroos
Copy link
Contributor

This fixes #3296 which was caused by #3217.

Signed-off-by: Mark Santcroos mark.santcroos@rutgers.edu

Signed-off-by: Mark Santcroos <mark.santcroos@rutgers.edu>
@marksantcroos marksantcroos requested a review from rhc54 April 10, 2017 12:18

/* take us to the correct wdir */
if (NULL != cd->wdir) {
chdir(cd->wdir);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see this handle the case that chdir returns with error.

Copy link
Contributor Author

@marksantcroos marksantcroos Apr 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't disagree strongly, although I think your request is already covered by the call to orte_util_check_context_cwd() (https://github.com/open-mpi/ompi/blob/master/orte/util/context_fns.c#L56).

Note that my addition is mirroring the existing code in the default ODLS module (https://github.com/open-mpi/ompi/blob/master/orte/mca/odls/default/odls_default_module.c#L417).

Copy link
Contributor

@rhc54 rhc54 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda agree with @marksantcroos on this one. We cannot get to this code path unless the chdir already worked. I admit there is a race condition - could be that the directory got removed since we tested it. Since we do have a way of returning the error, it wouldn't be hard to do so if it truly is a concern.

FWIW: I'll probably go back and add it to the default one, just for aesthetics.

@marksantcroos
Copy link
Contributor Author

@rhc54 Would you like me to add the check in both places? Happy to do so.

@rhc54
Copy link
Contributor

rhc54 commented Apr 11, 2017

Oh - yes please! Much appreciated 😄

@hppritcha
Copy link
Member

I'm okay with improving possible error return from chdir with some other PR.

Signed-off-by: Mark Santcroos <mark.santcroos@rutgers.edu>
@rhc54
Copy link
Contributor

rhc54 commented Apr 11, 2017

Very nice - thanks!!!

@marksantcroos
Copy link
Contributor Author

Very nice - thanks!!!

Hold your guns! ;)

It turned out to be less straight forward than I anticipated ...

Just noticed that basename is not set in the Cray case.
Should I possibly hardcode that to "orted" anyway?

@rhc54
Copy link
Contributor

rhc54 commented Apr 11, 2017

I think that should be fine

Signed-off-by: Mark Santcroos <mark.santcroos@rutgers.edu>
@marksantcroos
Copy link
Contributor Author

Ok, thanks for the feedback. Tested on Titan and MacOS, its good to go for me.

@rhc54 rhc54 merged commit 539f71d into open-mpi:master Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 participants