GitHub PullRequestReviewCommentEvent at 2014-10-15 21:23:16
Repository: smartdispatch
Actor: mgermain
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/comments/18923886","id":18923886,"diff_hunk":"@@ -0,0 +1,159 @@\n+import os\n+import re\n+\n+regex_walltime = re.compile(\"(\\d+:){1,4}\")\n+regex_resource_nodes = re.compile(\"[a-zA-Z0-9]+(:ppn=\\d+)?(:gpus=\\d+)?(:[a-zA-Z0-9]+)*\")\n+regex_resource_pmem = re.compile(\"[0-9]+(b|kb|mb|gb|tb)?\")\n+\n+\n+def write_pbs_to_files(pbs_list, pbs_dir=\"./\"):\n+    pbs_filenames = []\n+    for i, pbs in enumerate(pbs_list):\n+        pbs_filename = os.path.join(pbs_dir, 'job_commands_' + str(i) + '.sh')\n+        pbs.write(pbs_filename)\n+        pbs_filenames.append(pbs_filename)\n+\n+    return pbs_filenames\n+\n+\n+class PBS:\n+    \"\"\" Offers functionalities to generate PBS files.\n+\n+    For more information about the PBS file format see:\n+    `http://docs.adaptivecomputing.com/suite/8-0/basic/help.htm#topics/torque/2-jobs/requestingRes.htm?TocPath=TORQUE Resource Manager|Submitting and managing jobs|Job submission|_____3`\n+\n+    Parameters\n+    ----------\n+    queue_name : str\n+        name of the queue on which commands will be executed\n+    walltime : str\n+        maximum time allocated to execute every commands (DD:HH:MM:SS)\n+    \"\"\"\n+    def __init__(self, queue_name, walltime):\n+        if queue_name is None or len(queue_name) == 0:\n+            raise ValueError(\"Queue's name must be provided.\")\n+\n+        self.queue_name = queue_name\n+        self.modules = []\n+        self.commands = []\n+\n+        self.resources = {}\n+        self.add_resources(walltime=walltime)\n+\n+        self.options = {}\n+        self.add_options(q=queue_name)\n+\n+        # Declares that all environment variables in the qsub command's\n+        #  environment are to be exported to the batch job.\n+        self.add_options(V=\"\")\n+\n+    def add_options(self, **options):\n+        \"\"\" Adds options to this PBS file.\n+\n+        Parameters\n+        ----------\n+        **options : dict\n+            each key is the name of a PBS option (see `Options`)\n+\n+        Options\n+        -------\n+        *A* : account_string\n+            Defines the account string associated with the job.\n+        *N* : name (up to 15 characters)","path":"smartdispatch/pbs.py","position":62,"original_position":62,"commit_id":"f476603ab68e6ce2f3d5e665fa9918966ed62962","original_commit_id":"f476603ab68e6ce2f3d5e665fa9918966ed62962","user":{"login":"mgermain","id":1077147,"avatar_url":"https://avatars.githubusercontent.com/u/1077147?v=2","gravatar_id":"","url":"https://api.github.com/users/mgermain","html_url":"https://github.com/mgermain","followers_url":"https://api.github.com/users/mgermain/followers","following_url":"https://api.github.com/users/mgermain/following{/other_user}","gists_url":"https://api.github.com/users/mgermain/gists{/gist_id}","starred_url":"https://api.github.com/users/mgermain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgermain/subscriptions","organizations_url":"https://api.github.com/users/mgermain/orgs","repos_url":"https://api.github.com/users/mgermain/repos","events_url":"https://api.github.com/users/mgermain/events{/privacy}","received_events_url":"https://api.github.com/users/mgermain/received_events","type":"User","site_admin":false},"body":"I don't think there is such a limit.","created_at":"2014-10-15T21:23:16Z","updated_at":"2014-10-15T21:23:16Z","html_url":"https://github.com/SMART-Lab/smartdispatch/pull/39#discussion_r18923886","pull_request_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/comments/18923886"},"html":{"href":"https://github.com/SMART-Lab/smartdispatch/pull/39#discussion_r18923886"},"pull_request":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39","id":22022209,"html_url":"https://github.com/SMART-Lab/smartdispatch/pull/39","diff_url":"https://github.com/SMART-Lab/smartdispatch/pull/39.diff","patch_url":"https://github.com/SMART-Lab/smartdispatch/pull/39.patch","issue_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues/39","number":39,"state":"open","locked":false,"title":"WIP: Support gpu and other queues","user":{"login":"MarcCote","id":660004,"avatar_url":"https://avatars.githubusercontent.com/u/660004?v=2","gravatar_id":"","url":"https://api.github.com/users/MarcCote","html_url":"https://github.com/MarcCote","followers_url":"https://api.github.com/users/MarcCote/followers","following_url":"https://api.github.com/users/MarcCote/following{/other_user}","gists_url":"https://api.github.com/users/MarcCote/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcCote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcCote/subscriptions","organizations_url":"https://api.github.com/users/MarcCote/orgs","repos_url":"https://api.github.com/users/MarcCote/repos","events_url":"https://api.github.com/users/MarcCote/events{/privacy}","received_events_url":"https://api.github.com/users/MarcCote/received_events","type":"User","site_admin":false},"body":"This PR is not finished yet :p. We need to discuss about the pbs_generator class.\r\n\r\nFixed #34","created_at":"2014-09-30T17:49:58Z","updated_at":"2014-10-15T21:23:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9620ac030f652cc2d6e4837cbb3f48312a9b4fd1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39/commits","review_comments_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39/comments","review_comment_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/comments/{number}","comments_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues/39/comments","statuses_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/statuses/f476603ab68e6ce2f3d5e665fa9918966ed62962","head":{"label":"MarcCote:support_gpu","ref":"support_gpu","sha":"f476603ab68e6ce2f3d5e665fa9918966ed62962","user":{"login":"MarcCote","id":660004,"avatar_url":"https://avatars.githubusercontent.com/u/660004?v=2","gravatar_id":"","url":"https://api.github.com/users/MarcCote","html_url":"https://github.com/MarcCote","followers_url":"https://api.github.com/users/MarcCote/followers","following_url":"https://api.github.com/users/MarcCote/following{/other_user}","gists_url":"https://api.github.com/users/MarcCote/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcCote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcCote/subscriptions","organizations_url":"https://api.github.com/users/MarcCote/orgs","repos_url":"https://api.github.com/users/MarcCote/repos","events_url":"https://api.github.com/users/MarcCote/events{/privacy}","received_events_url":"https://api.github.com/users/MarcCote/received_events","type":"User","site_admin":false},"repo":{"id":16565530,"name":"smartdispatch","full_name":"MarcCote/smartdispatch","owner":{"login":"MarcCote","id":660004,"avatar_url":"https://avatars.githubusercontent.com/u/660004?v=2","gravatar_id":"","url":"https://api.github.com/users/MarcCote","html_url":"https://github.com/MarcCote","followers_url":"https://api.github.com/users/MarcCote/followers","following_url":"https://api.github.com/users/MarcCote/following{/other_user}","gists_url":"https://api.github.com/users/MarcCote/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcCote/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcCote/subscriptions","organizations_url":"https://api.github.com/users/MarcCote/orgs","repos_url":"https://api.github.com/users/MarcCote/repos","events_url":"https://api.github.com/users/MarcCote/events{/privacy}","received_events_url":"https://api.github.com/users/MarcCote/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MarcCote/smartdispatch","description":"Development of a command that launch job on the super computer Mammuth ","fork":true,"url":"https://api.github.com/repos/MarcCote/smartdispatch","forks_url":"https://api.github.com/repos/MarcCote/smartdispatch/forks","keys_url":"https://api.github.com/repos/MarcCote/smartdispatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MarcCote/smartdispatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MarcCote/smartdispatch/teams","hooks_url":"https://api.github.com/repos/MarcCote/smartdispatch/hooks","issue_events_url":"https://api.github.com/repos/MarcCote/smartdispatch/issues/events{/number}","events_url":"https://api.github.com/repos/MarcCote/smartdispatch/events","assignees_url":"https://api.github.com/repos/MarcCote/smartdispatch/assignees{/user}","branches_url":"https://api.github.com/repos/MarcCote/smartdispatch/branches{/branch}","tags_url":"https://api.github.com/repos/MarcCote/smartdispatch/tags","blobs_url":"https://api.github.com/repos/MarcCote/smartdispatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MarcCote/smartdispatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MarcCote/smartdispatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/MarcCote/smartdispatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MarcCote/smartdispatch/statuses/{sha}","languages_url":"https://api.github.com/repos/MarcCote/smartdispatch/languages","stargazers_url":"https://api.github.com/repos/MarcCote/smartdispatch/stargazers","contributors_url":"https://api.github.com/repos/MarcCote/smartdispatch/contributors","subscribers_url":"https://api.github.com/repos/MarcCote/smartdispatch/subscribers","subscription_url":"https://api.github.com/repos/MarcCote/smartdispatch/subscription","commits_url":"https://api.github.com/repos/MarcCote/smartdispatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/MarcCote/smartdispatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/MarcCote/smartdispatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/MarcCote/smartdispatch/issues/comments/{number}","contents_url":"https://api.github.com/repos/MarcCote/smartdispatch/contents/{+path}","compare_url":"https://api.github.com/repos/MarcCote/smartdispatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MarcCote/smartdispatch/merges","archive_url":"https://api.github.com/repos/MarcCote/smartdispatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MarcCote/smartdispatch/downloads","issues_url":"https://api.github.com/repos/MarcCote/smartdispatch/issues{/number}","pulls_url":"https://api.github.com/repos/MarcCote/smartdispatch/pulls{/number}","milestones_url":"https://api.github.com/repos/MarcCote/smartdispatch/milestones{/number}","notifications_url":"https://api.github.com/repos/MarcCote/smartdispatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MarcCote/smartdispatch/labels{/name}","releases_url":"https://api.github.com/repos/MarcCote/smartdispatch/releases{/id}","created_at":"2014-02-06T01:52:15Z","updated_at":"2014-09-10T18:30:46Z","pushed_at":"2014-10-15T17:27:51Z","git_url":"git://github.com/MarcCote/smartdispatch.git","ssh_url":"git@github.com:MarcCote/smartdispatch.git","clone_url":"https://github.com/MarcCote/smartdispatch.git","svn_url":"https://github.com/MarcCote/smartdispatch","homepage":null,"size":716,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SMART-Lab:master","ref":"master","sha":"12e0232796a18269b642f8de55382d504d42536a","user":{"login":"SMART-Lab","id":5042629,"avatar_url":"https://avatars.githubusercontent.com/u/5042629?v=2","gravatar_id":"","url":"https://api.github.com/users/SMART-Lab","html_url":"https://github.com/SMART-Lab","followers_url":"https://api.github.com/users/SMART-Lab/followers","following_url":"https://api.github.com/users/SMART-Lab/following{/other_user}","gists_url":"https://api.github.com/users/SMART-Lab/gists{/gist_id}","starred_url":"https://api.github.com/users/SMART-Lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SMART-Lab/subscriptions","organizations_url":"https://api.github.com/users/SMART-Lab/orgs","repos_url":"https://api.github.com/users/SMART-Lab/repos","events_url":"https://api.github.com/users/SMART-Lab/events{/privacy}","received_events_url":"https://api.github.com/users/SMART-Lab/received_events","type":"Organization","site_admin":false},"repo":{"id":16428294,"name":"smartdispatch","full_name":"SMART-Lab/smartdispatch","owner":{"login":"SMART-Lab","id":5042629,"avatar_url":"https://avatars.githubusercontent.com/u/5042629?v=2","gravatar_id":"","url":"https://api.github.com/users/SMART-Lab","html_url":"https://github.com/SMART-Lab","followers_url":"https://api.github.com/users/SMART-Lab/followers","following_url":"https://api.github.com/users/SMART-Lab/following{/other_user}","gists_url":"https://api.github.com/users/SMART-Lab/gists{/gist_id}","starred_url":"https://api.github.com/users/SMART-Lab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SMART-Lab/subscriptions","organizations_url":"https://api.github.com/users/SMART-Lab/orgs","repos_url":"https://api.github.com/users/SMART-Lab/repos","events_url":"https://api.github.com/users/SMART-Lab/events{/privacy}","received_events_url":"https://api.github.com/users/SMART-Lab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SMART-Lab/smartdispatch","description":"Batch job launcher for the Mammouth supercomputer.","fork":false,"url":"https://api.github.com/repos/SMART-Lab/smartdispatch","forks_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/forks","keys_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/teams","hooks_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/hooks","issue_events_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues/events{/number}","events_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/events","assignees_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/assignees{/user}","branches_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/branches{/branch}","tags_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/tags","blobs_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/statuses/{sha}","languages_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/languages","stargazers_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/stargazers","contributors_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/contributors","subscribers_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/subscribers","subscription_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/subscription","commits_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues/comments/{number}","contents_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/contents/{+path}","compare_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/merges","archive_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/downloads","issues_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues{/number}","pulls_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls{/number}","milestones_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/milestones{/number}","notifications_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/labels{/name}","releases_url":"https://api.github.com/repos/SMART-Lab/smartdispatch/releases{/id}","created_at":"2014-02-01T04:30:56Z","updated_at":"2014-09-10T18:30:46Z","pushed_at":"2014-10-01T00:28:03Z","git_url":"git://github.com/SMART-Lab/smartdispatch.git","ssh_url":"git@github.com:SMART-Lab/smartdispatch.git","clone_url":"https://github.com/SMART-Lab/smartdispatch.git","svn_url":"https://github.com/SMART-Lab/smartdispatch","homepage":"","size":912,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":15,"forks":4,"open_issues":15,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39"},"html":{"href":"https://github.com/SMART-Lab/smartdispatch/pull/39"},"issue":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues/39"},"comments":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/SMART-Lab/smartdispatch/statuses/f476603ab68e6ce2f3d5e665fa9918966ed62962"}}}}