Bureaucrats, cc_docs_admin, cc_staff, rsnt_translations
2,837
edits
No edit summary |
|||
Line 204: | Line 204: | ||
int MPI_Comm_size(MPI_Comm comm, int *nproc); | int MPI_Comm_size(MPI_Comm comm, int *nproc); | ||
int MPI_Comm_rank(MPI_Comm comm, int *myrank); | int MPI_Comm_rank(MPI_Comm comm, int *myrank); | ||
</source> | |||
</tab> | |||
<tab name="Boost C++"> | |||
<source lang="cpp"> | |||
int mpi::communicator::size(); | |||
int mpi::communicator::rank(); | |||
</source> | </source> | ||
</tab> | </tab> | ||
Line 245: | Line 251: | ||
return(0); | return(0); | ||
} | } | ||
}} | |||
</tab> | |||
<tab name="Boost C++"> | |||
{{File | |||
|name=phello1.cpp | |||
|lang="cpp" | |||
|contents= | |||
#include <iostream> | |||
#include <boost/mpi.hpp> | |||
using namespace std; | |||
using namespace boost; | |||
int main(int argc, char *argv[]) | |||
{ | |||
mpi::environment env(argc, argv); | |||
mpi::communicator world; | |||
cout << "Hello, world! from process " << world.rank() << " of " << world.size() << endl; | |||
return 0; | |||
} | |||
}} | }} | ||
</tab> | </tab> |