COMP2017 / COMP9017 Assignment 2Due: June 08th, 2pm AEST (Week 13 Friday)This assignment is worth 10% of your final assessmentTask DescriptionThe given data has been collected from a social media platform. supergraph2048. You are tasked withwriting program using the C programming language that will handle different queries and computethe correct result.Some queries may require simple partitioning of data for each thread to operate on, while others mayrequire strategy of dynamically partitioning data, checking the distribution of the data and synchroni-sation in order to efficiently process and eliminate redundant operations.You can ask questions on Ed using the assignments category. Please ensure that your work is yourown and you do not share any code or solutions with other students.Working on your assignmentYou can work on this assignment using your own computers or the lab machines. Students can alsotake advantage of the online code editor on Ed. You will need to navigate to the assessments orworkspaces page where you will be able to run, edit and submit your code from within your browser.However we recommend you write this code using your own computer or the lab machines.It is important that you continually back up your assignment files onto your own machine, flash drives,external hard drives and cloud storage providers. You are encouraged to submit your assignmentwhile you are in the process of completing it to receive feedback and to check for correctness of yoursolution.1COMP2017 / COMP9017Program structureThe social media platform. is composed of two types of entities:• Users• PostsEach user in the social network have a list of followers, other users they are following and posts.These collections are represented as an array of indices that relate to a user* or post* array.struct user {uint64_t user_id; //User id, is uniquesize_t* followers_idxs; //User indices within user* users graphsize_t n_followers; //Number of followerssize_t* following_idxs; //User indices within user* users graphsize_t n_following; //Number of users the user is followingsize_t* posts_idxs; //Post indices within post* posts graphsize_t n_posts; // Number of posts a user has made.};typedef struct user user;All user_id values within the users array will be unique. The lists: followers, following and postsare arranged by ascending order. In order of insertion.struct post {uint64_t pst_id; //Post id, is uniquesize_t* reposted_idxs; //Reposted indices within the graphsize_t n_reposted; // Number of reposted posts.};typedef struct post post;All pst_id values within the posts array will be unique. The posts array will not contain any cyclesas for any reposts to exist depends on the existance of an original post.For all queries you will need to return a heap allocated result structure: This structure stores allelements retrieved from the query as a heap allocated contiguous block of pointers and the number ofelements. It will be used to determine if your result is correct.struct result {void** elements;size_t n_elements;};typedef struct result resu oc_threshold• Account reputation, You will need to acknowledge the user reputation, caluclating it basedon: n_followers(n_followers+n_following) bot_net_thresholdPage 7 of 10COMP2017 / COMP9017AlgorithmsBreadth First SearchBreadth first search will check its neighbours before moving onto its neighbour’s neighbours and soon.BFS(G, v)Queue q;for all vertices u in Gu.seen = falseq.enqueue(v)while(!q.empty())u = q.dequeue()if u.seen is falseu.seen = 代做R实验作业、R编程代写、代写留学生R课程设计、R程序代做、调试R作业、R实验作业代做truefor all neighbours w of uq.enqueue(w)You may apply a Breadth First Search or any other algorithms based on what you think is appropriate.Error handlingFor all four queries, you will need to ensure that your query returns heap allocated memory. If thedata set provided is NULL or the number of elements (count) is 0, your query must return an emptyresult set ( n_elements is 0, elements is NULL).Page 8 of 10COMP2017 / COMP9017Submission DetailsYou will be provided with benchmarking code for this assessment called supergraph2048_benchand its source. It will time your query as well as load any expected results you have stored. Your pro-gram must produce no errors on Ed and will be compiled with the command:clang -O0 -std=gnu11 -march=native -lm -lpthreadYou are to submit your assessment using Ed which will check for correctness of your queries. In theevent that your program does not produce the correct output, your program will not be checked forperformance.• 4 Marks for the correctness of your program. This requires implementing all queries specifiedin the assignment and ensuring that they will return the correct result. If it does not compile, itwill receive zero.• 4 marks are assigned based on the performance of your code related to the benchmark. Thisis tested on a separate machine. Submissions that are faster or equal to the benchmark set, willreceive full marks. Submissions faster than a basic implementation will receive a minimum of2 marks.• 2 marks are assigned for a manual marking component in your tutorial. This will be based onyour submission prior to the 4thofJune20188:00amAEST. This manual marking componentwill assess your current progress of your assessment, styling (indentation and function layout)and also explaining your code to your tutor.Warning: Any attempts to deceive or disrupt the marking system will result in an immediate zero forthe entire assignment. Negative marks can be assigned if you do not follow the assignment specifica-tion or if your code is unnecessarily or deliberately obfuscated.Page 9 of 10COMP2017 / COMP9017Academic declarationBy submitting this assignment you declare the following:I declare that I have read and understood the University of Sydney Student Plagiarism: Coursework Policy andProcedure, and except where specifically acknowledged, the work contained in this assignment/project is myown work, and has not been copied from other sources or been previously submitted for award or assessment.I understand that failure to comply with the Student Plagiarism: Coursework Policy and Procedure can leadto severe penalties as outlined under Chapter 8 of the University of Sydney By-Law 1999 (as amended). Thesepenalties may be imposed in cases where any significant portion of my submitted work has been copied withoutproper acknowledgment from other sources, including published works, the Internet, existing programs, thework of other students, or work previously submitted for other awards or assessments.I realise that I may be asked to identify those portions of the work contributed by me and required to demonstratemy knowledge of the relevant material by answering oral questions or by undertaking supplementary work,either written or in the laboratory, in order to arrive at the final assessment mark.I acknowledge that the School of Information Technologies, in assessing this assignment, may reproduce itentirely, may provide a copy to another member of faculty, and/or communicate a copy of this assignmentto a plagiarism checking service or in-house computer program, and that a copy of the assignment may bemaintained by the service or the School of IT for the purpose of future plagiarism checking.Page 10 of 10& 转自:http://ass.3daixie.com/2018052758777120.html
讲解:R、R、R、R、R、R
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- By clicking to agree to this Schedule 2, which is hereby ...