[mvapich-discuss] MPI_THREAD_MULTIPLE is not supported...
Jonathan Perkins
perkinjo at cse.ohio-state.edu
Tue Jun 26 08:12:14 EDT 2012
On Tue, Jun 26, 2012 at 11:12:39AM +0300, Evren Yurtesen IB wrote:
> I am having getting threaded programs to run. All I get is
> MPI_THREAD_SINGLE. The test code seems to function with mpich2...
> Also as a side question, how do I see or select which channel is
> used at runtime?
This is the default threading level returned unless affinity is
disabled. You can do this by setting MV2_ENABLE_AFFINITY to 0.
mpirun_rsh -n 2 nodeA nodeB MV2_ENABLE_AFFINITY=0 ./prog
or
mpiexec -n 2 -env MV2_ENABLE_AFFINITY 0 ./prog
There are no different channels to select at runtime when you're using
the ch3:mrail device.
>
>
> Compile options:
>
> -bash-4.1$ /export/modules/apps/mvapich2/1.8/gnu/bin/mpich2version
> MVAPICH2 Version: 1.8
> MVAPICH2 Release date: Mon Apr 30 14:50:19 EDT 2012
> MVAPICH2 Device: ch3:mrail
> MVAPICH2 configure:
> --prefix=/export/modules/apps/mvapich2/1.8/gnu
> --with-valgrind=/export/modules/tools/valgrind/3.7.0/include/valgrind
> --enable-fast=O3 --enable-shared --enable-threads=runtime
> MVAPICH2 CC: gcc -O3 -march=corei7 -mtune=corei7 -O3
> MVAPICH2 CXX: c++ -O3 -march=corei7 -mtune=corei7 -O3
> MVAPICH2 F77: gfortran -O3 -march=corei7 -mtune=corei7 -O3
> MVAPICH2 FC: gfortran -O3 -march=corei7 -mtune=corei7 -O3
> -bash-4.1$
>
> I have a test program as follows:
>
> #include <mpi.h>
> #include <stdio.h>
> #include <stdlib.h>
>
>
> int main(int argc, char *argv[]) {
>
> int node_id=-1,totalnodes=-1,provided=-1;
>
> MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
> MPI_Comm_size(MPI_COMM_WORLD, &totalnodes);
> MPI_Comm_rank(MPI_COMM_WORLD, &node_id);
>
> if(provided != MPI_THREAD_MULTIPLE) {
> fprintf(stderr, "This MPI implementation does not support MPI_THREAD_MULTIPLE.\n"
> "Use another impelmentation that supports MPI_THREAD_MULTIPLE.\n");
> fprintf(stderr, "Provided was ");
> if(provided == MPI_THREAD_SINGLE)
> fprintf(stderr, "MPI_THREAD_SINGLE");
> else if(provided == MPI_THREAD_FUNNELED)
> fprintf(stderr, "MPI_THREAD_FUNNELED");
> else if(provided == MPI_THREAD_SERIALIZED)
> fprintf(stderr, "MPI_THREAD_SERIALIZED");
> else if(provided == MPI_THREAD_MULTIPLE)
> fprintf(stderr, "MPI_THREAD_MULTIPLE");
> else
> fprintf(stderr, "Unknown");
> fprintf(stderr, "\n");
> MPI_Finalize();
> exit(-1);
> }
>
> MPI_Finalize();
> exit(0);
>
> }
--
Jonathan Perkins
http://www.cse.ohio-state.edu/~perkinjo
More information about the mvapich-discuss
mailing list