UPPMAX
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- # Using Python in an HPC environment **Welcome!** Link to this document: <https://hackmd.io/@bclaremar/HPC-python> Link to first part of Q/A: https://hackmd.io/IoseeprATrWH0ZI7z6wJ-w?view **Lecture Zoom link**: https://umu.zoom.us/j/68897489502?pwd=TXlraXI5UkFvNWxIV0xGcWZ4M1lQdz09 **Separate UPPMAX session Zoom**: https://uu-se.zoom.us/j/68160935750 Password: 298853 **Separate HPC2N session Zoom**: https://umu.zoom.us/j/64721465122?pwd=NGtZM2h0bmJBTU4xNThjT0t5eFZndz09 **Course material**: <https://uppmax.github.io/HPC-python/index.html> --- ## MPI session - Q: Do you have an example for C/C++ interface also? - A: pybind11 is great for this: https://github.com/pybind/pybind11. This cookiecutter https://github.com/scikit-hep/cookie is a really good place to get started writing C/C++ bindings. - Participant comment: `ctypes` is a low-level good start to interface already existing C code without automatic "intent" guessing, also `#include <Python.h>` is a slightly harder way to write a python module in C. I have written some examples for my students [here](https://danielk.developer.irf.se/software_contribution_guide/mixed_coding_arts.html) - :+1: :::info - we have a reservation on UPPMAX: - add ``--reservation=snic2022-22-641_1`` as slurm flag in bash script or in command line for ``sbatch`` or ``interactive`` - this is only for today until 4PM ::: - Q: Why keeps this hackmd deleting what I write? Should I setup something? - A: Appologies for the annoyance. It happens sometime if several people edit at the same time. Please re-type if it happens. - Q: Cores vs. processes vs. threads, what is the difference? - A: **Core**: part of a multicore CPU, processor. Hardware. Think of it like a small CPU, I guess, inside the CPU. Usually cores share memory with other cores in the same socket on the CPU. **Process**: it's a task or instance of a program that is active. **Thread**: software. A process can do stuff concurrently by having several threads. Shares memory - A: so with MPI - a copy of the program (**process**) is copied to several instances (**tasks**) they work independently from each-other but has to communicate to exchange data and to wait for some calculations to be finished before continuing. - A: https://davescomputertips.com/cpu-cores-versus-threads-explained/ - A: https://www.geeksforgeeks.org/difference-between-process-and-thread/ - A: https://smileipic.github.io/Smilei/parallelization.html - A: something that really improved my low-level optimization skills was understanding of CPU/GPU memory cache levels and how to chunk memory between communication and calculations (this seems to explain levels pretty OK: https://www.makeuseof.com/tag/what-is-cpu-cache/ ) - A: A node is the physical box containing a computer. An hpc cluster usually has several nodes. - Each motherboard in each node might have several sockets and can have a cpu chip in each socket. - Each cpu has multiple cores. - Depending on your configuration each core can run multiple threads to have several processes running at once (our cluster has multi threading turned off so 1core=1thread). - A: At UPPMAX our clusters has multi threading turned off so 1core=1thread. The same at HPC2N. - Q: In the GPU example you login to snowy with `interactive` but in the snowy user guide they write that you must use `salloc`. So can I use `interactive` for snowy? - A: well it worked for me, put please follow instructions on UPPMAX web! - A: `interactive` is a wrapper around `salloc`, it works for Snowy too. ## Machine Learning session - Q: In order to run the "example-tf.sh" on Uppmax I had to change to **#SBATCH --gres=gpu:0** Does this mean that no gpus are available? Followup question: is everyone allowed to use Snowy? It seems not to work with -A SNIC2022-22-641 - A: There are GPUs on Snowy but not on Rackham ## UPPMAX session - Conda and Bianca - Q: Once I got an error "the environment is inconsistent, please check the package plan carefully" when I used conda before. How to solve it? - A: Was it in a clean enviroment or just when adding more packages? - A2: In general environment inconsistencies can show up due to a multitude of reasons e.g. using both `conda install` and `pip install` for the same environment. Many answers seem to suggest that `conda update --all` could solve the issue. - Q: - A: - Q: - A: ## HPC2N session: Machine learning (continued) - Q: Why are we now using **python -m pip install package** instead of the **pip install --no-cache-dir --no-build-isolation package**? Is python needed? Will this still avoid other environments/be isolated? - A: the second option is the recommended one, I will update this information ## Q/A on demand - Storage basics UPPMAX and similar to HPC2N - All nodes can access: Your home directory Your project directories Its own local scratch disk (2-3 TB) - If you’re reading/writing a file once, use a directory on Crex or Castor - If you’re reading/writing a file many times: - Copy the file to ”scratch”, the node local disk: - cp myFile ``$SNIC_TMP`` ## Exercise help Please write the number of the breakout room here if you need help: :::warning Archive Q&A from the earlier sessions: https://hackmd.io/@dianai/HPC-Python-2022 :::

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully