我有一段需要時間的MPI代碼(由其他人編寫)。代碼的基本佈局如下。概括地說,代碼的作用平行SVD兩個部分解決矩陣A
的:(1)第一分割矩陣A
均勻n
處理器之間,然後(2)執行SVD解決:如何正確計時MPI代碼
int main(){
1. Code to split A among the different processors...
2. actual parallel SVD solve
}
我只想要部分(2)代碼(在處理器之間分配A之後的SVD求解)。我嘗試以下,但我不知道,如果輸出是正確的:
int main(){
1. Code to split A among the different processors...
MPI_Barrier(MPI_COMM_WORLD);
double start = MPI_Wtime();
2. actual parallel SVD solve
MPI_Barrier(MPI_COMM_WORLD);
double end = MPI_Wtime();
if (MyPID == 0){ cout << end - start << endl;}
}
我非常新的MPI和不知道如果我正確使用MPI_Barrier命令,或者如果我真的甚至需要它。輸出時間是否會正確忽略部分(1)所需的時間?
niklasfi,有俄羅斯項目'openvampir':https://bitbucket.org/hpcc_kpi/openvampir/wiki/Home,但我沒有檢查它。另外我認爲大多數MPI具有內建跟蹤,例如MPICH有'jumpshot's:http://www.mcs.anl.gov/research/projects/perfvis/software/viewers/並且OpenMPI的FAQ說:http://www.open-mpi.org/faq/?category = perftools#view-VT TUD有從Vampir的OTF到LaTeX的免費轉換器http://tu-dresden.de/die_tu_dresden/zentrale_einrichtungen/zih/forschung/projekte/otf – osgx