|
466 | 466 | { |
467 | 467 | "cell_type": "markdown", |
468 | 468 | "metadata": {}, |
469 | | - "source": [] |
| 469 | + "source": [ |
| 470 | + "### Large array processing with Score-P\n", |
| 471 | + "This example illustrates the steps involved in the marshalling process when a cell instrumented with Score-P is executed with a large data payload as input.\n" |
| 472 | + ] |
| 473 | + }, |
| 474 | + { |
| 475 | + "cell_type": "code", |
| 476 | + "execution_count": null, |
| 477 | + "metadata": {}, |
| 478 | + "outputs": [], |
| 479 | + "source": [ |
| 480 | + "import time\n", |
| 481 | + "import numpy as np\n", |
| 482 | + "\n", |
| 483 | + "def generate_array_with_size(size_mb, dtype=np.float32):\n", |
| 484 | + " size_bytes = size_mb * 1024 * 1024\n", |
| 485 | + " element_size = np.dtype(dtype).itemsize\n", |
| 486 | + " num_elements = size_bytes // element_size\n", |
| 487 | + " array = np.zeros(num_elements, dtype=dtype)\n", |
| 488 | + " return array\n", |
| 489 | + "\n", |
| 490 | + "big_array = generate_array_with_size(size_mb=1000)" |
| 491 | + ] |
| 492 | + }, |
| 493 | + { |
| 494 | + "cell_type": "markdown", |
| 495 | + "metadata": {}, |
| 496 | + "source": [ |
| 497 | + "Enable marshalling detailed report for each step." |
| 498 | + ] |
| 499 | + }, |
| 500 | + { |
| 501 | + "cell_type": "code", |
| 502 | + "execution_count": null, |
| 503 | + "metadata": {}, |
| 504 | + "outputs": [], |
| 505 | + "source": [ |
| 506 | + "%env JUMPER_MARSHALLING_DETAILED_REPORT=1" |
| 507 | + ] |
| 508 | + }, |
| 509 | + { |
| 510 | + "cell_type": "markdown", |
| 511 | + "metadata": {}, |
| 512 | + "source": [ |
| 513 | + "Run cell with Score-P" |
| 514 | + ] |
| 515 | + }, |
| 516 | + { |
| 517 | + "cell_type": "code", |
| 518 | + "execution_count": null, |
| 519 | + "metadata": {}, |
| 520 | + "outputs": [], |
| 521 | + "source": [ |
| 522 | + "%%execute_with_scorep\n", |
| 523 | + "big_array\n", |
| 524 | + "time.sleep(4)" |
| 525 | + ] |
470 | 526 | } |
471 | 527 | ], |
472 | 528 | "metadata": { |
473 | 529 | "kernelspec": { |
474 | | - "display_name": "scorep-python", |
| 530 | + "display_name": "JUmPER", |
475 | 531 | "language": "python", |
476 | | - "name": "scorep-python" |
| 532 | + "name": "jumper" |
477 | 533 | }, |
478 | 534 | "language_info": { |
479 | 535 | "file_extension": ".py", |
480 | 536 | "mimetype": "text/plain", |
481 | | - "name": "Any text" |
| 537 | + "name": "python" |
482 | 538 | } |
483 | 539 | }, |
484 | 540 | "nbformat": 4, |
|
0 commit comments