Commit 4306572d authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Make the script work also in MPI mode.

parent f8fb297f
......@@ -236,8 +236,8 @@ int main(int argc, char *argv[]) {
"Executing a dry run. No i/o or time integration will be performed.");
/* Report CPU frequency. */
cpufreq = clocks_get_cpufreq();
if (myrank == 0) {
cpufreq = clocks_get_cpufreq();
message("CPU frequency used for tick conversion: %llu Hz", cpufreq);
}
......
......@@ -119,13 +119,13 @@ data = pl.loadtxt( infile )
# Recover the start and end time
full_step = data[0,:]
tic_step = int(full_step[4])
toc_step = int(full_step[5])
tic_step = int(full_step[5])
toc_step = int(full_step[6])
CPU_CLOCK = float(full_step[-1])
data = data[1:,:]
print "CPU frequency:", CPU_CLOCK / 1.e9
nranks = int(max(data[:,0])) + 1
print "Number of ranks:", nranks
nthread = int(max(data[:,1])) + 1
......@@ -150,7 +150,12 @@ if delta_t == 0:
for rank in range(nranks):
data = sdata[sdata[:,0] == rank]
start_t = min(data[:,5])
full_step = data[0,:]
tic_step = int(full_step[5])
toc_step = int(full_step[6])
data = data[1:,:]
start_t = tic_step
data[:,5] -= start_t
data[:,6] -= start_t
end_t = (toc_step - start_t) / CPU_CLOCK * 1000
......@@ -160,7 +165,7 @@ for rank in range(nranks):
for i in range(nthread):
tasks[i] = []
num_lines = pl.size(data) / 10
num_lines = pl.shape(data)[0]
for line in range(num_lines):
thread = int(data[line,1])
tasks[thread].append({})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment