Believe %!s(int64=4) %!d(string=hai) anos
pai
achega
f5f82f2ae2
Modificáronse 2 ficheiros con 8 adicións e 2 borrados
  1. 4 1
      wtdbg.c
  2. 4 1
      wtdbg.h

+ 4 - 1
wtdbg.c

@@ -490,6 +490,7 @@ int main(int argc, char **argv){
 	rpar->aln_var = 0.25;
 	opt_flags = 0;
 
+	// 初始化mpi分布式通讯  ningwenmo@outlook.com
 	MPI_Init(&argc, &argv);
 	MPI_Comm_rank(MPI_COMM_WORLD, &g_mpi_comm_rank);
 	MPI_Comm_size(MPI_COMM_WORLD, &g_mpi_comm_size);
@@ -952,7 +953,7 @@ int main(int argc, char **argv){
 	{
 		g->rpar = realign? rpar : NULL;
 		g->genome_size = genome_size;
-		g->num_index = (g_mpi_comm_size >= 2) ? (g_mpi_comm_size - 1) : num_index;
+		g->num_index = (g_mpi_comm_size >= 2) ? (g_mpi_comm_size - 1) : num_index; // 除第一个mpi进程外,其他进程将参与分布计算  ningwenmo@outlook.com
 		//g->corr_mode = (corr_mode > 0 && genome_size > 0)? 1 : 0;
 		//g->corr_gcov = corr_mode;
 		//g->corr_min = corr_min;
@@ -993,6 +994,7 @@ int main(int argc, char **argv){
 	}
 	g->par = par;
 
+	// master节点将等待每个分布计算节点完成,并同步加载各节点alignments  ningwenmo@outlook.com
 	if (g_mpi_comm_size >= 2 && g_mpi_comm_rank == 0){
 		int i ;
 		for (i= 1; i < g_mpi_comm_size; i++){
@@ -1048,6 +1050,7 @@ int main(int argc, char **argv){
 		fprintf(KBM_LOGF, "[%s] Done, %llu nodes\n", date(), (unsigned long long)g->nodes->size);
 	}
 
+	// 各计算节点在分布计算完成后,通知master节点并立刻退出  ningwenmo@outlook.com
 	if (g_mpi_comm_size >= 2 && g_mpi_comm_rank != 0){
 		int message = 0;
 		MPI_Send(&message, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);

+ 4 - 1
wtdbg.h

@@ -1364,7 +1364,7 @@ static inline u8i load_alignments_core(Graph *g, FileReader *pws, int raw, rdreg
 			}
 	}
 	fprintf(KBM_LOGF, "\r%llu lines, %llu hits\n", pws->n_line, nhit);
-	print_proc_stat_info(g_mpi_comm_rank);
+	print_proc_stat_info(g_mpi_comm_rank); //每个分布节点比对完成后消耗时间 ningwenmo@outlook.com
 
 	free_kbmmapv(hits);
 	if(g->chainning_hits) free_bitsvec(cigars);
@@ -1410,6 +1410,7 @@ static inline u8i proc_alignments_core(Graph *g, int ncpu, int raw, rdregv *regs
 	}
 	// alno = open_file_for_write(prefix, ".alignments.gz", 1);
 
+	// 每个分布节点输出相应计算的alignments ningwenmo@outlook.com
 	char* alignments_file_name[64];
 	sprintf(alignments_file_name, ".%u_%u.alignments", g_mpi_comm_rank, g_mpi_comm_size);
 	alno = open_file_for_write(prefix, alignments_file_name, 1);
@@ -1447,6 +1448,7 @@ static inline u8i proc_alignments_core(Graph *g, int ncpu, int raw, rdregv *regs
 		qe = ie ? g->kbm->bins->buffer[ie - 1].ridx : 0;
 		nbp = ((u8i)(ie - ib)) * KBM_BIN_SIZE;
 
+		//每个分布节点计算分别计算相应数据 ningwenmo@outlook.com
 		if (g_mpi_comm_size >= 2 && ii != (g_mpi_comm_rank - 1))
 			continue;
 
@@ -1675,6 +1677,7 @@ static inline void build_nodes_graph(Graph *g, u8i maxbp, int ncpu, FileReader *
 		nhit = proc_alignments_core(g, ncpu, raw, regs, maps, prefix, dump_kbm);
 	}
 
+	// 每个节点分布计算完成后返回  ningwenmo@outlook.com
 	if (g_mpi_comm_size >= 2 && g_mpi_comm_rank != 0){
 		// int message = 0;
 		// MPI_Send(&message, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);