[Trilinos-Users] MPI split in Epetra
Heroux, Michael A
maherou at sandia.gov
Wed Apr 8 09:35:58 MDT 2015
SungHwan,
In principle, you should be able to do this. I see a few problems in your first statement:
* You misspelled dynamic.
* The dynamic cast should return an instance of Epetra_MpiComm, which means you should use the "." instead of "->"
* Also, you should use const in the <> and in the declaration of the original_comm variable.
Warning: I have only visually inspected your code, so take these comments with some skepticism.
Mike
From: SungHwan Choi <sunghwanchoi91 at gmail.com<mailto:sunghwanchoi91 at gmail.com>>
Date: Wednesday, April 8, 2015 at 4:11 AM
To: "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: [EXTERNAL] [Trilinos-Users] MPI split in Epetra
Dear all,
I wan to do mpi split. As far as I know, there is no API to do split mpi.
in order to do so, I need MPI_Comm. but in my program only main function has comm object. in other function, it is called through Epetra_Map. Initially, I thought that bellow code work properly.
MPI_Comm original_comm = dynacic_cast<Epetra_MpiComm>(map.Comm())->GetMpiComm();
MPI_Comm_split(original_comm,id_t,id_z,&bare_comm_t);
RCP<Epetra_Comm> comm_t = rcp( new Epetra_MpiComm(bare_comm_t));
in order to run above code, the first line return error.
since Comm() function of Epetra_Map returns constant object, I can cast the type of the object to Epetra_MpiComm to call GetMpiComm. I used const_cast but it did not work bacuse Epetra_Comm is pure virtual class.
Are there good ways to split mpi?
Thanks.
Sunghwan Choi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20150408/8d1043dd/attachment.html>
More information about the Trilinos-Users
mailing list