Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • M magicCut
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Computational Earth SciencesComputational Earth Sciences
  • HPC for ES Team
  • magicCut
  • Wiki
  • Home

Home · Changes

Page history
Update home authored Nov 09, 2020 by sparonuz's avatar sparonuz
Show whitespace changes
Inline Side-by-side
home.md
View page @ d6853ea9
......@@ -79,75 +79,32 @@ This script
# see which functions is first
first_routine = functions_called_once_per_step[0]
```
time_steps = time[(function_ids == first_routine) & (cpu_ids == nemo_proc[0])].shape[0]
print("Actual n_proc", nemo_proc_number, "with ", time_steps, "time steps")
# Find the index of the fastest step
time_step = np.ones([nemo_proc_number, time_steps])
ts_min_index = np.zeros(nemo_proc_number, dtype='int')
ts_max_index = np.zeros(nemo_proc_number, dtype='int')
ts_time = np.zeros([nemo_proc_number, time_steps])
start = clock_time.time()
5. For all cpu finds the shortes timestep, then look on average which one has been the fastest
``` python
for proc in nemo_proc:
index = proc - nemo_proc[0]
ts_time[index] = time[(cpu_ids == proc) & (function_ids == first_routine)]
# compute the duration of each ts
# Compute the duration of each ts
ts_duration = np.diff(ts_time[index])
# find the index of the minimum ts for each proc
# Index of the minimum ts for each proc
ts_min_index[index] = np.argmin(ts_duration)
# find the index of the maximum ts for each proc
ts_max_index[index] = np.argmax(ts_duration[1:-1]) + 1
# Evaluate the most common index for best ts
counts = np.bincount(ts_min_index)
best_ts_index = np.argmax(counts)
counts = np.bincount(ts_max_index)
worst_ts_index = np.argmax(counts)
print("for finding the index of the slowest / fastest step: ", worst_ts_index, "/", best_ts_index)
end = clock_time.time()
print(end - start)
# Find the start and the end of the best step
```
6. Once the index of the best time-step has been found find time begin/end times to pass to Extrae cutter
```python
best_ts_start = min(ts_time[:, best_ts_index])
best_ts_end = max(ts_time[:, best_ts_index + 1])
```
# Find the start and the end of the best step
worst_ts_start = min(ts_time[:, worst_ts_index])
worst_ts_end = max(ts_time[:, worst_ts_index + 1])
print("Worst / best time step's duration: ", worst_ts_end - worst_ts_start, best_ts_end - best_ts_start)
# Open the xml template
tree = ET.parse(template_path)
cutter = tree.find('cutter')
for tasks in tree.iter('tasks'):
tasks.text = str(nemo_proc_min) + "-" + str(nemo_proc_max)
for minimum_time in tree.iter('minimum_time'):
minimum_time.text = str(best_ts_start - 1000)
for maximum_time in tree.iter('maximum_time'):
maximum_time.text = str(best_ts_end + 1000)
# Create paramedir cutter file
tree.write('best_time_cutter.xml')
for minimum_time in tree.iter('minimum_time'):
minimum_time.text = str(worst_ts_start - 1000)
for maximum_time in tree.iter('maximum_time'):
maximum_time.text = str(worst_ts_end + 1000)
# Create paramedir cutter file
tree.write('worst_time_cutter.xml')
return unique_function_ids.tolist()
[... to be continued]
### Cutter template
In the template folder an extrae xml template is stored: the value obtained with the traceCutter are inserted there and the trace is cut:
```bash
echo "start paramedir cutter"
time paramedir -c best_time_cutter.xml ${trace_file} -o ${trace_base_name}.best_cut.prv
```
Clone repository
  • Home