annazan
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    # RAMP-UA questions ###### tags: `Issues` `Solved` `ToBeSolved` > Document to share issues, ideas, and possible solutions for the RAMP-UA and EcoTwins project (as of beginning of March 2021). > Please feel free to edit/suggest/delete content ## Contents [ToC] ## Assumptions > Current assumptions that underline the model | Assumption | Solvable | How | | ----------------- |:-------- |------| | No weekends | Maybe || | No seasonality | Maybe |Could use the google mobility data, there is definitely a summer holiday effect. Fewer people were at work in August 2020 than in the November lockdown| | Same mobility for all individuals during lockdown|| Jamil is keen to work on this - I think he has time-use by occupation pre-covid, and for a few points during 2020. Certainly would be good to account for key-workers which we have a flag for.| | | || | | || ## Ideas for further implementations >Once generalized the model for studying the Covid spread to a national scale, we might want to apply to further case studies - How to implement the calibration on a national scale - Improve the house-transmission modelling - Public transport not modelled for now - Speed up the peed up the population initialisation process **Final agreed folders structure** Taking into account the results of the poll and some deeper understanding of the data, we arrived to the following conclusive figure for the folders structure: ![](https://i.imgur.com/0lD4ECx.png) **Folders structure poll** Which folders structure you think is best to use for redesigning the model to run on a national scale? ![](https://i.imgur.com/ASvORn2.png) | Your name | One | Two | Three | A fourth one | | --------- | -- | --- | --- | --- | | Anna | X | X | X | | | Nick M | | | X | | | Alex | X | | | | | Hadrien | X | | | | | Fiona | X | | | | | Jesse | X | | | | > In case you choose a fourth one, please add your suggestions heareafter. > At the moment the edited version of the model runs following the diagram in figure one. ## General issues > Try to describe as detailed as possible the issue and steps undertaken to face it ### * White spaces in the path not accepted by OpenCL **Description of the problem** The issue arised when changed the path to the OpenCL kernel within `opencl/ramp/simulator.py` in the class `Simulator` (the class is called by `opencl/ramp/run.py` and eventually by the `main` through the function `run_opencl`). The original version Ramp-UA defines the path for the `kernel_dir` like this: ```javascript=67 kernel_dir = os.path.join(opencl_dir, "ramp/kernels/") # Load the OpenCL kernel programs with open(os.path.join(kernel_dir, "ramp_ua.cl")) as f: program = cl.Program(ctx, f.read()) program.build(options=[f"-I {kernel_dir}"]) ``` In AZ's version, with the need to generalise the code, the path was initially rewritten taking the full path AND missed a "/" at the end (because the name is created automatically using `os.path.join`): ```javascript=67 kernel_dir = os.path.join(Constants.Paths.PROJECT_FOLDER_ABSOLUTE_PATH, Constants.Paths.SOURCE_FOLDER, Constants.Paths.OPENCL.OPENCL_FOLDER, Constants.Paths.OPENCL.OPENCL_SOURCE_FOLDER, Constants.Paths.OPENCL.SOURCE.OPENCL_KERNELS_FOLDER) print(f"Checking the kernel_dir \t{kernel_dir}\n") # Load the OpenCL kernel programs with open(os.path.join(kernel_dir, Constants.Paths.OPENCL.SOURCE.KERNEL_FILE)) as f: program = cl.Program(ctx, f.read()) program.build(options=[f"-I {kernel_dir}"]) ``` The AZ edited model would run smoothly the opencl version without errors (even with the absolute path and a missing "/" at the end) until the files where moved to a specific folder, in order to use the Turing syncing service (ask AZ if you want details, she doesn't like white spaces in the naming!). Then the model would give error at the line 77 (AZ), so at the `build` function. The error called is similar to this: `pyopencl.RuntimeError: clBuildProgram failed: invalid build options ...` (see [Useful links](#useful_links_white_space)) where it is easy to identify the issue because `invalid build options` lists only the of the part of the path that comes after the white space. After a few investigations, noticed that this doesn't happen for the RAMP-UA original code, once moved to the same white-spaced-path folder. The issue could be easily solved by not using folders whose paths has white spaces in the name (which is anyways a good habit), but we can't control what final users have on their computers, therefore it would be better to solve the problem throuroughly so to avoid running errors. **Actions undertaken to solve the issue** Created copies of both projects (UA and AZversion) in different ad-hoc folders, with spaces, no spaces, very loong names etc. Debugged within the `pyopencl` code to understand where exactly the error was coming from. **Conclusions/Solution** Apparently the error comes from within OpenCL inner code (pyopencl works smoothly and accepts the path until the OpenCL `build` function is called). Apparently OpenCL wants the `kernel_dir` with a final '/', so we need to declare it like that (this was not creating a problem when reading the kernel file at line , because there it was added by the `os.path.join`) though OpenCL builds wants as input variable `kernel_dir` and not the kernel file). The final version of the code uses the relative path (not absolute) and a final "/". The relative path is declared within the model, where we can control the folders naming. Eventual white spaces in the user's folders naming are not entering the OpenCL core code, so they don't affect the model running. Final version (current): ```javascript=74 kernel_dir = os.path.join(Constants.Paths.SOURCE_FOLDER, Constants.Paths.OPENCL.OPENCL_FOLDER, Constants.Paths.OPENCL.OPENCL_SOURCE_FOLDER, Constants.Paths.OPENCL.SOURCE.OPENCL_KERNELS_FOLDER) kernel_dir = kernel_dir + "/" print(f"Checking kernel_dir \t{kernel_dir}\n") # Load the OpenCL kernel programs with open(os.path.join(kernel_dir, Constants.Paths.OPENCL.SOURCE.KERNEL_FILE)) as f: program = cl.Program(ctx, f.read()) program.build(options=[f"-I {kernel_dir}"]) ``` **<a id="useful_links_white_space">Useful links</a>** https://stackoverflow.com/questions/22366517/pyopencl-runtimeerror-clbuildprogram-failed-invalid-build-options **Screenshots** None ### * Another issue **Description of the problem** **Actions undertaken to solve the issue** **Conclusions/Solution** **<a id="useful_links_another_issue">Useful links</a>** **Screenshots** ** ** > Leave in-line comments... [color=#3b75c6] ## TO_DO: - [x] first task - [ ] second task - [ ] last task

    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