Blame test/mpi/errors/group/group_union_nullarg.c

Packit Service c5cf8c
#include <mpi.h>
Packit Service c5cf8c
#include <stdio.h>
Packit Service c5cf8c
#include "mpitest.h"
Packit Service c5cf8c
Packit Service c5cf8c
int main(int argc, char **argv)
Packit Service c5cf8c
{
Packit Service c5cf8c
    MPI_Group basegroup;
Packit Service c5cf8c
    MPI_Group g1, g2;
Packit Service c5cf8c
    MPI_Comm comm, newcomm, dupcomm;
Packit Service c5cf8c
    int errs = 0, mpi_errno, rank, size;
Packit Service c5cf8c
    int errclass, worldrank;
Packit Service c5cf8c
Packit Service c5cf8c
    MTest_Init(&argc, &argv);
Packit Service c5cf8c
    MPI_Comm_rank(MPI_COMM_WORLD, &worldrank);
Packit Service c5cf8c
    comm = MPI_COMM_WORLD;
Packit Service c5cf8c
    MPI_Comm_group(comm, &basegroup);
Packit Service c5cf8c
    MPI_Comm_rank(comm, &rank;;
Packit Service c5cf8c
    MPI_Comm_size(comm, &size);
Packit Service c5cf8c
    MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
Packit Service c5cf8c
Packit Service c5cf8c
    MPI_Comm_split(comm, 0, size - rank, &newcomm);
Packit Service c5cf8c
    MPI_Comm_group(newcomm, &g1;;
Packit Service c5cf8c
    MPI_Comm_dup(comm, &dupcomm);
Packit Service c5cf8c
    MPI_Comm_group(dupcomm, &g2;;
Packit Service c5cf8c
Packit Service c5cf8c
    /* checking group_union for NULL variable */
Packit Service c5cf8c
    mpi_errno = MPI_Group_union(g1, g2, NULL);
Packit Service c5cf8c
    MPI_Error_class(mpi_errno, &errclass);
Packit Service c5cf8c
    if (errclass != MPI_ERR_ARG)
Packit Service c5cf8c
        ++errs;
Packit Service c5cf8c
Packit Service c5cf8c
    MPI_Comm_free(&comm);
Packit Service c5cf8c
    MPI_Comm_free(&newcomm);
Packit Service c5cf8c
    MPI_Comm_free(&dupcomm);
Packit Service c5cf8c
    MPI_Group_free(&basegroup);
Packit Service c5cf8c
    MPI_Group_free(&g1;;
Packit Service c5cf8c
    MPI_Group_free(&g2;;
Packit Service c5cf8c
    MTest_Finalize(errs);
Packit Service c5cf8c
    return 0;
Packit Service c5cf8c
}