for int for int dt st_n dt _end_n p-1 dt st_m dt _end_m p-1 p-1 cout d

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
for (int i = 0; i < p; i++)
{
for (int j = 0; j < p; j++)
{
dt[j].st_n = i * n/p;
dt[j]._end_n = (i == (p - 1)) ? (i * n/p + n/p + n % p-1) : (i * n/p + n/p - 1);
dt[j].st_m = j * m/p;
dt[j]._end_m = (j == (p - 1)) ? (j * m/p + m/p + m % p-1) : (j * m/p + m/p-1);
cout << "dt[i].st_n = " << dt[j].st_n << " dt[i]._end_n = "
<< dt[j]._end_n << " dt[i].st_m = " << dt[j].st_m << " dt[i]._end_m = " << dt[j]._end_m << endl;
pthread_create(&th[j], NULL, rowFunc, &dt[j]);
}
}