⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpid_comm.c

📁 fortran并行计算包
💻 C
📖 第 1 页 / 共 2 页
字号:
         fprintf(stderr,"Invalid DCMF_ALLTOALLW option\n");   }   envopts = getenv("DCMF_ALLGATHER");   if(envopts != NULL)     {       if(strncasecmp(envopts, "M", 1) == 0) /* MPICH */         MPIDI_CollectiveProtocols.optallgather = 0;       else if(strncasecmp(envopts, "ALLR", 4) == 0) /* ALLREDUCE */         {           MPIDI_CollectiveProtocols.allgather.useallreduce  = 1;           MPIDI_CollectiveProtocols.allgather.usebcast      = 0;           MPIDI_CollectiveProtocols.allgather.usealltoallv  = 0;         }       else if(strncasecmp(envopts, "BCAST", 1) == 0) /* BCAST */         {           MPIDI_CollectiveProtocols.allgather.useallreduce  = 0;           MPIDI_CollectiveProtocols.allgather.usebcast      = 1;           MPIDI_CollectiveProtocols.allgather.usealltoallv  = 0;         }       else if(strncasecmp(envopts, "ALLT", 4) == 0) /* ALLTOALL */         {           MPIDI_CollectiveProtocols.allgather.useallreduce  = 0;           MPIDI_CollectiveProtocols.allgather.usebcast      = 0;           MPIDI_CollectiveProtocols.allgather.usealltoallv  = 1;         }       else         fprintf(stderr,"Invalid DCMF_ALLGATHER option\n");     }   envopts = getenv("DCMF_ALLGATHERV");   if(envopts != NULL)     {       if(strncasecmp(envopts, "M", 1) == 0) /* MPICH */         MPIDI_CollectiveProtocols.optallgatherv = 0;       else if(strncasecmp(envopts, "ALLR", 4) == 0) /* ALLREDUCE */         {           MPIDI_CollectiveProtocols.allgatherv.useallreduce  = 1;           MPIDI_CollectiveProtocols.allgatherv.usebcast      = 0;           MPIDI_CollectiveProtocols.allgatherv.usealltoallv  = 0;         }       else if(strncasecmp(envopts, "BCAST", 1) == 0) /* BCAST */         {           MPIDI_CollectiveProtocols.allgatherv.useallreduce  = 0;           MPIDI_CollectiveProtocols.allgatherv.usebcast      = 1;           MPIDI_CollectiveProtocols.allgatherv.usealltoallv  = 0;         }       else if(strncasecmp(envopts, "ALLT", 4) == 0) /* ALLTOALL */         {           MPIDI_CollectiveProtocols.allgatherv.useallreduce  = 0;           MPIDI_CollectiveProtocols.allgatherv.usebcast      = 0;           MPIDI_CollectiveProtocols.allgatherv.usealltoallv  = 1;         }       else         fprintf(stderr,"Invalid DCMF_ALLGATHERV option\n");     }   envopts = getenv("DCMF_ALLREDUCE");   if(envopts != NULL)   {      if(strncasecmp(envopts, "M", 1) == 0) /* MPICH */      {         MPIDI_CollectiveProtocols.allreduce.usetree = 0;         MPIDI_CollectiveProtocols.allreduce.userect = 0;         MPIDI_CollectiveProtocols.allreduce.usebinom = 0;         MPIDI_CollectiveProtocols.optallreduce = 0;      }      else if(strncasecmp(envopts, "RI", 2) == 0) /* Rectangle Ring*/      {         MPIDI_CollectiveProtocols.allreduce.userectring = 1;// defaults to off         MPIDI_CollectiveProtocols.allreduce.userect = 0;         MPIDI_CollectiveProtocols.allreduce.usetree = 0;         MPIDI_CollectiveProtocols.allreduce.usebinom = 0;      }      else if(strncasecmp(envopts, "R", 1) == 0) /* Rectangle */      {         MPIDI_CollectiveProtocols.allreduce.usetree = 0;         MPIDI_CollectiveProtocols.allreduce.usebinom = 0;      }      else if(strncasecmp(envopts, "B", 1) == 0) /* Binomial */      {         MPIDI_CollectiveProtocols.allreduce.usetree = 0;         MPIDI_CollectiveProtocols.allreduce.userect = 0;      }      else if(strncasecmp(envopts, "T", 1) == 0) /* Tree */      {         MPIDI_CollectiveProtocols.allreduce.usebinom = 0;         MPIDI_CollectiveProtocols.allreduce.userect = 0;      }      else if(strncasecmp(envopts, "C", 1) == 0) /* CCMI Tree */      {         MPIDI_CollectiveProtocols.allreduce.useccmitree = 1;// defaults to off         MPIDI_CollectiveProtocols.allreduce.usetree = 0;         MPIDI_CollectiveProtocols.allreduce.usebinom = 0;         MPIDI_CollectiveProtocols.allreduce.userect = 0;      }      else if(strncasecmp(envopts, "P", 1) == 0) /* CCMI Pipelined Tree */      {         MPIDI_CollectiveProtocols.allreduce.usepipelinedtree = 1;// defaults to off         MPIDI_CollectiveProtocols.allreduce.usetree = 0;         MPIDI_CollectiveProtocols.allreduce.usebinom = 0;         MPIDI_CollectiveProtocols.allreduce.userect = 0;      }      else         fprintf(stderr,"Invalid DCMF_ALLREDUCE option\n");   }   envopts = getenv("DCMF_ALLREDUCE_REUSE_STORAGE");   if(envopts != NULL)   {      if(strncasecmp(envopts, "N", 1) == 0) /* Do not reuse the malloc'd storage */      {         MPIDI_CollectiveProtocols.allreduce.reusestorage = 0;         fprintf(stderr, "N allreduce.reusestorage %X\n",                 MPIDI_CollectiveProtocols.allreduce.reusestorage);      }      else         if(strncasecmp(envopts, "Y", 1) == 0); /* defaults to Y */      else         fprintf(stderr,"Invalid DCMF_ALLREDUCE_REUSE_STORAGE option\n");   }   envopts = getenv("DCMF_REDUCE");   if(envopts != NULL)   {      if(strncasecmp(envopts, "M", 1) == 0) /* MPICH */      {         MPIDI_CollectiveProtocols.reduce.usetree = 0;         MPIDI_CollectiveProtocols.reduce.userect = 0;         MPIDI_CollectiveProtocols.reduce.usebinom = 0;         MPIDI_CollectiveProtocols.optreduce = 0;      }      else if(strncasecmp(envopts, "RI", 2) == 0) /* Rectangle Ring*/      {         MPIDI_CollectiveProtocols.reduce.userectring = 1;// defaults to off         MPIDI_CollectiveProtocols.reduce.userect = 0;         MPIDI_CollectiveProtocols.reduce.usetree = 0;         MPIDI_CollectiveProtocols.reduce.usebinom = 0;      }      else if(strncasecmp(envopts, "R", 1) == 0) /* Rectangle */      {         MPIDI_CollectiveProtocols.reduce.usetree = 0;         MPIDI_CollectiveProtocols.reduce.usebinom = 0;      }      else if(strncasecmp(envopts, "B", 1) == 0) /* Binomial */      {         MPIDI_CollectiveProtocols.reduce.usetree = 0;         MPIDI_CollectiveProtocols.reduce.userect = 0;      }      else if(strncasecmp(envopts, "T", 1) == 0) /* Tree */      {         MPIDI_CollectiveProtocols.reduce.usebinom = 0;         MPIDI_CollectiveProtocols.reduce.userect = 0;      }      else if(strncasecmp(envopts, "C", 1) == 0) /* CCMI Tree */      {         MPIDI_CollectiveProtocols.reduce.useccmitree = 1;// defaults to off         MPIDI_CollectiveProtocols.reduce.usetree = 0;         MPIDI_CollectiveProtocols.reduce.usebinom = 0;         MPIDI_CollectiveProtocols.reduce.userect = 0;      }      else         fprintf(stderr,"Invalid DCMF_REDUCE option\n");   }   envopts = getenv("DCMF_REDUCE_REUSE_STORAGE");   if(envopts != NULL)   {      if(strncasecmp(envopts, "N", 1) == 0) /* Do not reuse the malloc'd storage */      {         MPIDI_CollectiveProtocols.reduce.reusestorage = 0;         fprintf(stderr, "N protocol.reusestorage %X\n",                 MPIDI_CollectiveProtocols.reduce.reusestorage);      }      else         if(strncasecmp(envopts, "Y", 1) == 0); /* defaults to Y */      else         fprintf(stderr,"Invalid DCMF_REDUCE_REUSE_STORAGE option\n");   }   envopts = getenv("DCMF_BARRIER");   if(envopts != NULL)   {      if(strncasecmp(envopts, "M", 1) == 0) /* MPICH */      {         /* still need to register a barrier for DCMF collectives */         MPIDI_CollectiveProtocols.barrier.usebinom = 1;         /* MPIDI_Coll_register changes this state for us */         /* MPIDI_CollectiveProtocols.barrier.usegi = 1; */         MPIDI_CollectiveProtocols.optbarrier = 0;      }      else if(strncasecmp(envopts, "B", 1) == 0) /* Binomial */      {         MPIDI_CollectiveProtocols.barrier.usegi = 0;      }      else if(strncasecmp(envopts, "G", 1) == 0) /* GI */      {         MPIDI_CollectiveProtocols.barrier.usebinom = 0;      }      else         fprintf(stderr,"Invalid DCMF_BARRIER option\n");   }   envopts = getenv("DCMF_LOCALBARRIER");   if(envopts != NULL)   {      if(strncasecmp(envopts, "B", 1) == 0) /* Binomial */      {         MPIDI_CollectiveProtocols.localbarrier.uselockbox = 0;      }      else if(strncasecmp(envopts, "L", 1) == 0) /* Lockbox */      {         MPIDI_CollectiveProtocols.localbarrier.usebinom = 0;      }      else         fprintf(stderr,"Invalid DCMF_LOCALBARRIER option\n");   }}unsigned *MPIDI_Comm_worldranks_init(MPID_Comm *comm_ptr){  unsigned *worldranks = NULL;  int lrank, numprocs  = comm_ptr->local_size;  worldranks = comm_ptr->dcmf.worldranks;  if (worldranks == NULL)    {      worldranks = comm_ptr->dcmf.worldranks = MPIU_Malloc(numprocs * sizeof(int));      MPID_assert(worldranks != NULL);      for (lrank = 0; lrank < numprocs; lrank++)        worldranks[lrank] = comm_ptr->vcr[lrank]->lpid;    }  return worldranks;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -