Doubt about MPI_Comm_shrink

21 views
Skip to first unread message

Lucas Baptista De Moraes

unread,
Jan 21, 2020, 10:18:32 AM1/21/20
to User Level Fault Mitigation
Hello everyone, I'm getting started with MPI and ULFM studies, and I've a doubt of using MPI_Comm_shrink. If I raise a failure in some rank, like rank 0, and call MPI_Comm_shrink, my code will work, but without the output of rank 0. Is there a way of getting the output from this rank or it's impossible?

int main (int argc, char **argv)
{

MPI_Init (NULL, NULL);

int siterank;
MPI_Comm siteparent, sitemachine, sitecomm, ft_sitecomm;
MPI_Comm_get_parent (&siteparent);
siteparent = sitecomm;
sitecomm = MPI_COMM_WORLD;
MPI_Comm_rank (sitecomm, &siterank);

MPI_Comm_set_errhandler (sitecomm, MPI_ERRORS_RETURN);

if (siterank==0) raise (SIGKILL);

MPIX_Comm_shrink (sitecomm, &ft_sitecomm);

printf ("Hey there, I'm Site %d, and I'm working! :) \n\n", siterank);

MPI_Comm_spawn ("machine", MPI_ARGV_NULL, 3, MPI_INFO_NULL, 0, ft_sitecomm,
&sitemachine, MPI_ERRCODES_IGNORE);

MPI_Finalize ();
return 0;

}

George Bosilca

unread,
Jan 21, 2020, 10:42:30 AM1/21/20
to ul...@googlegroups.com
Lucas,

First: MPIX_Comm_shrink is a collective function it must therefore be called by all alive processes in sitecomm (and not only by some of them).
Second: In your code you kill your process 0 (raise(SIGKILL) is as if you were doing a "kill -9" so your process is killed by the MPI daemon). This means that process 0 will not execute anything after the kill call, so it will never get to the printf. Thus will should never see the printf from 0 (if you do that would be worrisome and definitively incorrect from ULFM perspective).

George.


--
You received this message because you are subscribed to the Google Groups "User Level Fault Mitigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ulfm+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ulfm/72f8ae90-0d81-4774-8de5-7b9fa9ca4137%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages