PaCO++  0.05
paco_direct_comScheduling.cc
Go to the documentation of this file.
00001 #include "paco_direct_comScheduling.h"
00002 
00004 
00005 paco_comSchedule_direct::paco_comSchedule_direct(int rank, int max, unsigned *local_com_vector,
00006                    void** info_vector[])
00007 {
00008   _myrank=rank;
00009   _dst=new unsigned[max];
00010   _len=new unsigned[max];
00011   _inf=new void*[max];
00012   unsigned cur=0;
00013   for(int i=0;i<max; i++) {
00014     if (local_com_vector[i]>0) {
00015       _dst[cur]=i;
00016       _len[cur]=local_com_vector[i];
00017       _inf[cur]=info_vector[i];
00018       cur++;
00019     }
00020   }
00021   _nbelement=cur;
00022 }
00023 
00024 paco_comSchedule_direct::~paco_comSchedule_direct()
00025 {
00026   delete _len;
00027   delete _dst;
00028   delete _inf;
00029 }
00030 
00032 
00033 paco_comScheduling_direct::~paco_comScheduling_direct()
00034 {
00035 }
00036 
00037 paco_comSchedule* 
00038 paco_comScheduling_direct::computeScheduling(unsigned rank, 
00039                     PaCO::PacoTopology_t* srctopo, PaCO::PacoTopology_t* dsttopo,
00040                     unsigned **com_matrix, void** info_vector[])
00041 {
00042   //  cerr << __FUNCTION__ << " : rank: "<<rank<<" srvtopo: "<<dsttopo->total<<endl;
00043   return new paco_comSchedule_direct(rank, dsttopo->total, com_matrix[rank], info_vector);
00044 }