root/ompi/mca/coll/base/coll_base_comm_unselect.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mca_coll_base_comm_unselect

   1 /*
   2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2017 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2012      Oak Rigde National Laboratory.
  13  *                         All rights reserved.
  14  * Copyright (c) 2013 Cisco Systems, Inc.  All rights reserved.
  15  * Copyright (c) 2014      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * Copyright (c) 2017      IBM Corporation.  All rights reserved.
  18  * Copyright (c) 2017      FUJITSU LIMITED.  All rights reserved.
  19  * $COPYRIGHT$
  20  *
  21  * Additional copyrights may follow
  22  *
  23  * $HEADER$
  24  */
  25 
  26 #include "ompi_config.h"
  27 
  28 #include <stdio.h>
  29 #include <string.h>
  30 #include <stdlib.h>
  31 
  32 #include "ompi/mca/mca.h"
  33 #include "opal/mca/base/base.h"
  34 
  35 #include "ompi/communicator/communicator.h"
  36 #include "ompi/mca/coll/base/base.h"
  37 
  38 #define CLOSE(comm, func)                                        \
  39     do {                                                         \
  40         if (NULL != comm->c_coll->coll_ ## func ## _module) {    \
  41             if (NULL != comm->c_coll->coll_ ## func ## _module->coll_module_disable) { \
  42                 comm->c_coll->coll_ ## func ## _module->coll_module_disable(           \
  43                               comm->c_coll->coll_ ## func ## _module, comm);           \
  44             }                                                    \
  45             OBJ_RELEASE(comm->c_coll->coll_ ## func ## _module); \
  46             comm->c_coll->coll_## func = NULL;                   \
  47             comm->c_coll->coll_## func ## _module = NULL;        \
  48         }                                                        \
  49     } while (0)
  50 
  51 int mca_coll_base_comm_unselect(ompi_communicator_t * comm)
  52 {
  53     CLOSE(comm, allgather);
  54     CLOSE(comm, allgatherv);
  55     CLOSE(comm, allreduce);
  56     CLOSE(comm, alltoall);
  57     CLOSE(comm, alltoallv);
  58     CLOSE(comm, alltoallw);
  59     CLOSE(comm, barrier);
  60     CLOSE(comm, bcast);
  61     CLOSE(comm, exscan);
  62     CLOSE(comm, gather);
  63     CLOSE(comm, gatherv);
  64     CLOSE(comm, reduce);
  65     CLOSE(comm, reduce_scatter_block);
  66     CLOSE(comm, reduce_scatter);
  67     CLOSE(comm, scan);
  68     CLOSE(comm, scatter);
  69     CLOSE(comm, scatterv);
  70 
  71     CLOSE(comm, iallgather);
  72     CLOSE(comm, iallgatherv);
  73     CLOSE(comm, iallreduce);
  74     CLOSE(comm, ialltoall);
  75     CLOSE(comm, ialltoallv);
  76     CLOSE(comm, ialltoallw);
  77     CLOSE(comm, ibarrier);
  78     CLOSE(comm, ibcast);
  79     CLOSE(comm, iexscan);
  80     CLOSE(comm, igather);
  81     CLOSE(comm, igatherv);
  82     CLOSE(comm, ireduce);
  83     CLOSE(comm, ireduce_scatter_block);
  84     CLOSE(comm, ireduce_scatter);
  85     CLOSE(comm, iscan);
  86     CLOSE(comm, iscatter);
  87     CLOSE(comm, iscatterv);
  88 
  89     CLOSE(comm, allgather_init);
  90     CLOSE(comm, allgatherv_init);
  91     CLOSE(comm, allreduce_init);
  92     CLOSE(comm, alltoall_init);
  93     CLOSE(comm, alltoallv_init);
  94     CLOSE(comm, alltoallw_init);
  95     CLOSE(comm, barrier_init);
  96     CLOSE(comm, bcast_init);
  97     CLOSE(comm, exscan_init);
  98     CLOSE(comm, gather_init);
  99     CLOSE(comm, gatherv_init);
 100     CLOSE(comm, reduce_init);
 101     CLOSE(comm, reduce_scatter_block_init);
 102     CLOSE(comm, reduce_scatter_init);
 103     CLOSE(comm, scan_init);
 104     CLOSE(comm, scatter_init);
 105     CLOSE(comm, scatterv_init);
 106 
 107     CLOSE(comm, neighbor_allgather);
 108     CLOSE(comm, neighbor_allgatherv);
 109     CLOSE(comm, neighbor_alltoall);
 110     CLOSE(comm, neighbor_alltoallv);
 111     CLOSE(comm, neighbor_alltoallw);
 112 
 113     CLOSE(comm, ineighbor_allgather);
 114     CLOSE(comm, ineighbor_allgatherv);
 115     CLOSE(comm, ineighbor_alltoall);
 116     CLOSE(comm, ineighbor_alltoallv);
 117     CLOSE(comm, ineighbor_alltoallw);
 118 
 119     CLOSE(comm, neighbor_allgather_init);
 120     CLOSE(comm, neighbor_allgatherv_init);
 121     CLOSE(comm, neighbor_alltoall_init);
 122     CLOSE(comm, neighbor_alltoallv_init);
 123     CLOSE(comm, neighbor_alltoallw_init);
 124 
 125     CLOSE(comm, reduce_local);
 126 
 127     free(comm->c_coll);
 128     comm->c_coll = NULL;
 129 
 130     /* All done */
 131     return OMPI_SUCCESS;
 132 }
 133 

/* [<][>][^][v][top][bottom][index][help] */