[mpich-discuss] Using MPI_Waitany for MPI_File Requests

Nils-Arne Dreier n.dreier at uni-muenster.de
Thu Sep 28 08:53:50 CDT 2017


Dear MPICH community,

I'm currently playing around with the File-IO interface of MPI. For any
reason, the following code does not running through:

#include <iostream>
#include <mpi.h>

int main(int argc, char** argv)
{
    MPI_Init(&argc, &argv);

    int rank;
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    MPI_Request recv_req;
    int int_buf;
    MPI_Irecv(&int_buf, 1, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD,
&recv_req);

    MPI_File fh;
    MPI_File_open(MPI_COMM_WORLD, "output", MPI_MODE_CREATE | MPI_MODE_RDWR,
                   MPI_INFO_NULL, &fh);
    MPI_File_set_view(fh, 2*sizeof(int)*rank, MPI_INT, MPI_INT,
"native", MPI_INFO_NULL);

    MPI_Request file_req;
    MPI_File_iwrite(fh, &rank, 1, MPI_INT, &file_req);

    MPI_Request file_req2;
    MPI_File_iwrite(fh, &rank, 1, MPI_INT, &file_req2);

    MPI_Request requests[2] = {file_req, file_req2};
    int index;
    std::cout << rank << ":\twaiting..." << std::endl;
    MPI_Waitany(2, requests, &index, MPI_STATUS_IGNORE);
    //MPI_Wait(&file_req, MPI_STATUS_IGNORE);
    std::cout << rank << ":\tdone" << std::endl;
    MPI_File_close(&fh);

    MPI_Finalize();

    return 0;
}

Neither if i exchange file_req2 with recv_req, MPI_Waitany doesn't return.

Is it possible to use MPI_Waitany with File-IO calls? Did i read
anything over in the MPI-Standard?

Thank you for your help.

Thanks,
Nils

PS: I'm running Ubuntu 16.04 LTS, gcc-4.9 (using -std=c++14) and MPICH
3.2. This is the output of mpirun --version:
HYDRA build details:
    Version:                                 3.2
    Release Date:                            Wed Nov 11 22:06:48 CST 2015
    CC:                              gcc   -Wl,-Bsymbolic-functions
-Wl,-z,relro
    CXX:                             g++   -Wl,-Bsymbolic-functions
-Wl,-z,relro
    F77:                             gfortran  -Wl,-Bsymbolic-functions
-Wl,-z,relro
    F90:                             gfortran  -Wl,-Bsymbolic-functions
-Wl,-z,relro
    Configure options:                       '--disable-option-checking'
'--prefix=/usr' '--build=x86_64-linux-gnu'
'--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
'--infodir=${prefix}/share/info' '--sysconfdir=/etc'
'--localstatedir=/var' '--disable-silent-rules'
'--libdir=${prefix}/lib/x86_64-linux-gnu'
'--libexecdir=${prefix}/lib/x86_64-linux-gnu'
'--disable-maintainer-mode' '--disable-dependency-tracking'
'--enable-shared' '--enable-fortran=all' '--disable-rpath'
'--disable-wrapper-rpath' '--sysconfdir=/etc/mpich'
'--libdir=/usr/lib/x86_64-linux-gnu' '--includedir=/usr/include/mpich'
'--docdir=/usr/share/doc/mpich' '--with-hwloc-prefix=system'
'--enable-checkpointing' '--with-hydra-ckpointlib=blcr' 'CPPFLAGS=
-Wdate-time -D_FORTIFY_SOURCE=2
-I/build/mpich-jQtQ8p/mpich-3.2/src/mpl/include
-I/build/mpich-jQtQ8p/mpich-3.2/src/mpl/include
-I/build/mpich-jQtQ8p/mpich-3.2/src/openpa/src
-I/build/mpich-jQtQ8p/mpich-3.2/src/openpa/src -D_REENTRANT
-I/build/mpich-jQtQ8p/mpich-3.2/src/mpi/romio/include' 'CFLAGS= -g -O2
-fstack-protector-strong -Wformat -Werror=format-security -O2'
'CXXFLAGS= -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -O2' 'FFLAGS= -g -O2 -fstack-protector-strong
-O2' 'FCFLAGS= -g -O2 -fstack-protector-strong -O2'
'build_alias=x86_64-linux-gnu' 'MPICHLIB_CFLAGS=-g -O2
-fstack-protector-strong -Wformat -Werror=format-security'
'MPICHLIB_CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
'MPICHLIB_CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat
-Werror=format-security' 'MPICHLIB_FFLAGS=-g -O2
-fstack-protector-strong' 'MPICHLIB_FCFLAGS=-g -O2
-fstack-protector-strong' 'LDFLAGS=-Wl,-Bsymbolic-functions
-Wl,-z,relro' 'FC=gfortran' 'F77=gfortran' 'MPILIBNAME=mpich'
'--cache-file=/dev/null' '--srcdir=.' 'CC=gcc' 'LIBS=-lpthread '
    Process Manager:                         pmi
    Launchers available:                     ssh rsh fork slurm ll lsf
sge manual persist
    Topology libraries available:            hwloc
    Resource management kernels available:   user slurm ll lsf sge pbs
cobalt
    Checkpointing libraries available:       blcr
    Demux engines available:                 poll select


-- 
Nils-Arne Dreier, M.Sc.
Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83-35147

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5390 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20170928/32daf15f/attachment.p7s>
-------------- next part --------------
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list