00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <parmetislib.h>
00016
00017
00018
00019
00020
00021
00022
00023 void InitTimers(CtrlType *ctrl)
00024 {
00025 cleartimer(ctrl->TotalTmr);
00026 cleartimer(ctrl->InitPartTmr);
00027 cleartimer(ctrl->MatchTmr);
00028 cleartimer(ctrl->ContractTmr);
00029 cleartimer(ctrl->CoarsenTmr);
00030 cleartimer(ctrl->RefTmr);
00031 cleartimer(ctrl->SetupTmr);
00032 cleartimer(ctrl->ProjectTmr);
00033 cleartimer(ctrl->KWayInitTmr);
00034 cleartimer(ctrl->KWayTmr);
00035 cleartimer(ctrl->MoveTmr);
00036 cleartimer(ctrl->RemapTmr);
00037
00038 cleartimer(ctrl->AuxTmr1);
00039 cleartimer(ctrl->AuxTmr2);
00040 cleartimer(ctrl->AuxTmr3);
00041 cleartimer(ctrl->AuxTmr4);
00042 cleartimer(ctrl->AuxTmr5);
00043 cleartimer(ctrl->AuxTmr6);
00044 }
00045
00046
00047
00048
00049
00050 void PrintTimingInfo(CtrlType *ctrl)
00051 {
00052
00053 PrintTimer(ctrl, ctrl->SetupTmr, " Setup");
00054 PrintTimer(ctrl, ctrl->MatchTmr, " Matching");
00055 PrintTimer(ctrl, ctrl->ContractTmr, "Contraction");
00056 PrintTimer(ctrl, ctrl->InitPartTmr, " InitPart");
00057
00058 PrintTimer(ctrl, ctrl->ProjectTmr, " Project");
00059 PrintTimer(ctrl, ctrl->KWayInitTmr, " Initialize");
00060 PrintTimer(ctrl, ctrl->KWayTmr, " K-way");
00061 PrintTimer(ctrl, ctrl->MoveTmr, " Move");
00062 PrintTimer(ctrl, ctrl->RemapTmr, " Remap");
00063 PrintTimer(ctrl, ctrl->TotalTmr, " Total");
00064 PrintTimer(ctrl, ctrl->AuxTmr1, " Aux1");
00065 PrintTimer(ctrl, ctrl->AuxTmr2, " Aux2");
00066 PrintTimer(ctrl, ctrl->AuxTmr3, " Aux3");
00067 PrintTimer(ctrl, ctrl->AuxTmr4, " Aux4");
00068 PrintTimer(ctrl, ctrl->AuxTmr5, " Aux5");
00069 PrintTimer(ctrl, ctrl->AuxTmr6, " Aux6");
00070 }
00071
00072
00073
00074
00075
00076 void PrintTimer(CtrlType *ctrl, timer tmr, char *msg)
00077 {
00078 double sum, max, tsec;
00079
00080 tsec = gettimer(tmr);
00081 MPI_Reduce((void *)&tsec, (void *)&sum, 1, MPI_DOUBLE, MPI_SUM, 0, ctrl->comm);
00082
00083 tsec = gettimer(tmr);
00084 MPI_Reduce((void *)&tsec, (void *)&max, 1, MPI_DOUBLE, MPI_MAX, 0, ctrl->comm);
00085
00086 if (ctrl->mype == 0 && sum != 0.0)
00087 printf("%s: Max: %7.3f, Sum: %7.3f, Balance: %7.3f\n",
00088 msg, (floattype)max, (floattype)sum, (floattype)(max*ctrl->npes/sum));
00089 }
00090