99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代做CSci 4061、代寫c/c++設(shè)計編程

時間:2024-03-28  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



CSci **1: Introduction to Operating Systems
Spring 2024
Project #2: Enhanced Autograder
Instructor: Jon Weissman
Due: 3/20 Midnight
Intermediate Due: 3/15 Midnight
1. Objective
In this project you will extend/enhance your autograder is a number of ways. You will use 1) pipes
(pipe) to communicate information between the autograder and its children (executables), 2) use I/O
redirection (dup2) and random I/O (*seek), 3) use message-passing queues to implement a different
style of execution (msgget, msgsnd, msgrcv, and msgctl), and use alarms to implement true timeouts to detect infinite/blocked cases (alarm, sigaction, setitimer, and sigfillset). You will
also find several string functions handy (sprintf, strchr, strrchr, strlen), as well as
several I/O functions (unlink, getline, fgets, fseek). Read up on all of these system calls.
To simplify matters, we will remove the ‘slow’ event, so only correct, incorrect, crashed, infinite, or
blocked are detected. You will also determine the value of B (batch size) at runtime by setting it to the
CPU count, which you can use /proc/cpuinfo to obtain. Specifically, count the number of times
processor occurs in the file (implement your code for this in the get_batch_size() function in src/
utils.c). This means that the new autograder will not take B as a command-line argument. Instead, it 1
will take in the directory containing the executables to be graded as the 1st argument. The new usage
will look like the following: “./autograder <testdir> <p1> <p2> … <pn>”.
We have provided quite a bit of useful code in utils.h/utils.c that you can use (or ignore). Either way,
there are a few functions that you must fill in within utils.c.
Constraint 1: please try to run your tests on a lightly-loaded machine if possible (type uptime at
the shell to get the CPU load; if it is high, wait or pick another machine).
Constraint 2: you must cleanup any infinite/blocked processes, both within your program
automatically, but also outside your program at the shell in the event of errors. You can use “ps -u
<your_x500>” and “pkill -9 <exe_name>” to kill lingering processes. The pkill function actually
allows pattern matching, so you might find the following command useful: pkill -9 “sol_*”.
Some source code, object code, and test cases will be provided as needed in a downloadable tar file
from Canvas. You may use your own P1 solution as a starting point or our solution.
2. Changing    the    way    information    is    passed
You will make several changes to your autograder solution. In P2, you will not only modify the
autograder but the template code as well.
Change 1: the current template returned the answer using a return statement. The answer was
limited to 8 bits or 0 .. 255 due to system call restrictions. This could be limiting in a “real” autograder
where the actual answer may far exceed 8 bit values that would be returned. To fix this, you will modify
the template to output its answer to STDOUT. You will also modify the autograder to redirect the
child’s STDOUT to a file named output/<executable_name>.<parameter> (e.g. output/sol.4). To
do this you will use dup2 in the autograder. Be careful to open the file with write access, and call
dup2 in the child only. Once the autograder gets an answer from each child by reading the output file
(or determines an issue with the child), it should remove the output files in the batch using: int
unlink(const char *pathname), e.g. unlink (“output/sol.4”).
 You can double check that your get_batch_size() function is working properly by comparing it to “grep processor /proc/cpuinfo | wc -l” 1
2
If you have bugs you may need to remove the output files at the shell.
We strongly recommended that an output file gets generated for each (executable,
parameter) pair in the autograder, EVEN if the event is crashed, infinite, or blocked, for
consistency. But this is up to you. The output contents will be defined for you in the
provided code.
See that Change 1 works before moving to Change 2!
Change 2: the current autograder passed a test parameter within the exec interface. You are to
create three “versions” of the template (and the corresponding) autograder. All three change the input
location only.
(i) pass each input parameter using exec as before (no new changes over Change 1 in this case.)
(ii) have the template read its parameter via STDIN; to do this you will redirect STDIN to a file via dup2
in the autograder similar to Change 1. Be careful to call dup2 in the child only. The file(s) you will
use are first created by the autograder: input/<parameter>.in for each parameter (e.g. input/
4.in, input/7.in, etc.) . The simplest way is to create the files using the autograder command-line
argv[]. You must also open the input file(s) for read access in the child before dup2.
Remove the input files when you are done using unlink. If you have bugs you may need to
remove the input files at the shell (make clean will also clear these files)
(iii) pass the input parameter using a pipe between the autograder and each child.
For all three versions, use the output mechanism of Change 1.
Create all three versions in the same source files (as real C systems programmers would do). Use #ifdef
<version>, #elif <version2, …> #endif in both template.c and autograder.c to select the <version>-
specific code. You may need to do this in several places. Please use EXEC, REDIR, and PIPE, as the version
names. (e.g. #ifdef EXEC …. #endif, #elif REDIR … , #elif PIPE … #endif).
To compile a specific version of the template and/or the autograder: you can run “make <exec|redir|pipe>”. These
targets use the -D flag to specify the version (EXEC, REDIR, or PIPE).
3. A    better    way    for    time    detection    using    Alarms
Change 3: Now detect a child process running too long by a timeout. To do this, modify autograder.c
(only) to create an alarm handler via sigaction and start the timer using setitimer (set it to expire
after TIMEOUT_SECS seconds).Remove the older code that detected running too long. When the timer
goes off, children that are still running are classified as either infinite/blocked and so you should kill
them using int kill(pid_t pid, int sig). Remember to still wait for each process. However,
since each process will eventually end, there is now no need to pass WNOHANG to waitpid. So, remove it.
Instead, you will use the information from WEXITSTATUS(status) and WTERMSIG(status) to
determine the results for each child process. One issue that might arise is that the alarm might interrupt
the call to waitpid. In that case, you should retry the call to waitpid. Hint: use the value of errno
EINTR to determine if waitpid was interrupted. You will create separate versions of the
autograder, mq_autograder.c, and the template, template_mq.c in this part.
4. Recast    the    autograder    paradigm    using    message    queues
Change 4: You will implement one more style of passing information, Linux message queues. The
method in which you distribute work will follow the master-worker model. To do this, your autograder
will write a set of “tasks” of the form [tag executable parameter] to a message queue, where tag
corresponds to a specific worker process. First, the autograder will launch all B workers and send a
message to the worker indicating how many messages it will receive so that it can initialize data
structures for storing the information. Then, the autograder should generate and insert all tasks into the
message queue. The workers will read all of the messages intended for them and send an
acknowledgement message to the autograder process. After the autograder process has received
acknowledgements from each worker, it will send a message to each worker to tell them to begin testing
3
executables. At that point, all workers will begin running their (executable, parameter) pairs in batches of
8, sending results to the autograder process after each batch, until all pairs have been tested. The process
of determining the results of each executable should be the same as in src/autograder.c. Remember to
have each child process in the worker create an output file, output/sol.4, output/sol.7, etc., for
each (executable, parameter) pair and redirect output to these files. Don’t forget to remove the
message queue when you are done.
For all versions, the final step is to create a single output file named results.txt. We have
provided a function that does just that: write_results_to_file in src/utils.c.
5. How    did    the    student    do    on    the    submission?
The final “ask” is that you implement a function called double get_score(char
*results_file, char *executable_name) that uses random I/O to return the score for a given
executable_name (student) in results.txt. The score for a given executable is the number of
parameters that result in “correct” divided by the total number of parameters tested. You must use
random I/O (*seek) to make this efficient. See the description of this function in include/utils.h for
more information and constraints.
6. Testing
For testing, observe the targets in the Makefile. There are options to compile autograder.c/template.c
for EXEC, REDIR, and PIPE, which correspond to make exec, make redir, and make pipe. The
method for making the test executables is similar to P1. A common workflow might look like the
following:
$ make exec N=20 # Recall that N sets the number of compiled template.c files
$ ./autograder solutions 1 3 5
$ make clean # This cleans up the input/output/solutions directories
For testing Change 4 (Message Queues), a common workflow might look like the following:
$ make mqueue N=20 # mq_autograder will now use the sol_X files instead of mq_sol_X
$ ./mq_autograder solutions 1 3 5
$ make clean
We will try to release more test cases as the assignment deadline approaches, but for now there is a
single test case in the Makefile, namely the target “test1_exec”. The expected output for this test
case for results.txt and scores.txt is located in the expected/ folder. It uses the EXEC mode, but the
results should be the same whether you are using EXEC, REDIR, or PIPE.
$ make test1_exec N=20
7. Intermediate    Submission
In one week you will submit a version of your code that implements get_batch_size(), Change 1, and Change 2 -
(i) and (ii) only.
8. Implementation    Notes    
• Remember to error check all system calls
• Remember to close all open files and pipes
• Remember that all template binaries must be executable (chmod -R +x test/)
9. Deliverables
4
There will be 2 submissions, one intermediate submission due 1 week after the release of the project
and a final submission due 2 weeks after the release.
Intermediate Submission :
Both intermediate and final submissions should contain the following. Please conform with the folder structure
that is provided to you. Your conformance will be graded.
One student from each group should upload a zip file containing the project folders/files detailed
above to Gradescope. When submitting, make sure to add your group members to your submission on
Gradescope. Your README.md file should contain the following information. Please avoid including
hidden files and junk files in your submission. It makes grading harder. Thank you :)
• How to compile the program
• Any assumptions outside this document
• Team id, team member names and x500’s
• Contribution by each member of the team for final submission only
10. Rubric:    Subject    to    change
• 10% README including answers to questions posed in the writeup.
• 15% Intermediate submission [Including README].
• 10% Documentation within code, coding, and style: indentations, readability of code, use of
defined constants rather than numbers. The code should be well commented (need not explain
every line). You might want to focus on the “why” part, rather than the “how”, when you add
comments.
• 65% Test cases: correctness, error handling, meeting the specifications.
You must error check ALL system calls in your autograder.
• A test folder of executables, input parameters to test, a “solution” and the templates will be
provided.
• We will use the GCC version installed on the CSELabs machines to compile your code. Make sure
your code compiles and run on CSELabs.
• Please     make     sure     that     your     program     works     on     the     CSELabs     machines     e.g., KH 4-250 (cselkh4250-xx.cselabs.umn.edu). You will be graded on one of these machines.
Project Structure Contents
include/ .h header files (utils.h)
lib/ .o library files (utils.o)
src/ .c source files (autograder.c, template.c, mq_autograder.c,
mq_template.c, utils.c)
input/ Contains the <param>.in files during runtime
output/ Contains the <exe>.<param> files during runtime
solutions/ Contains the student executables (sol_X or mq_sol_X)
expected Contains results.txt and scores.txt for specific test cases
Makefile Contains build information used for compiling/testing code
README.md Contains info outlined below
5
11. Miscellaneous
• We will provide an initial package of code, but you will be doing most of the coding.
• To run your program, type autograder <testdir> <p1>< p2> …
• Do not use the system call “system”.
• Said before: KILL all of your stray processes during debugging as needed.
• Any provided binaries are meant for the CSELAB Linux environment. No other binaries will be
distributed.
• ChatGPT or other significant “other” code reuse prohibited. The purpose of this course is to learn by doing,
and not meeting some deadline. If you are unsure about any located online code, contact us.
• On the other hand, locating code snippets that show how system calls can be used is fine.
12. SuggestedWorkplan    (preliminary    in    blue).
• Read the writeup: in parallel look at the code we have given you.
• Implement get_batch_size() to get B at runtime
• Change 1
o output file redirection
• Change 2
o Ensure that version <EXEC> runs as before
o Get (ii) working
▪ write all inputs to input files
o Get (iii) working
• Change 3
o Convert time checking to alarm timers for long-running processes
o Think about what should go in the signal handler and how you are going to
ensure infinite/stuck processes are killed.
• Change 4
o Implement mq_autograder.c and mq_template.c using the knowledge you’ve
picked up from implementing autograder.c
o Think of the message queue as another input method (EXEC, REDIR, PIPE,
MQUEUE). However you don’t need to use any # macros for it.
• Implement get_score() program

請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

掃一掃在手機打開當前頁
  • 上一篇:越南機場保關(guān)材料(機場保關(guān)有哪些服務(wù))
  • 下一篇:COMP2045代做、C++編程設(shè)計代寫
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復古美學與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                亚洲日本在线看| 国产精品动漫网站| 国产精品久久久久天堂| 风间由美中文字幕在线看视频国产欧美| 91精品婷婷国产综合久久竹菊| 亚洲成a人v欧美综合天堂| 日韩视频免费观看高清完整版| 国产一区二区h| 亚洲美女精品一区| 欧美日韩午夜精品| 国产综合一区二区| 亚洲免费观看高清完整版在线| 欧美性欧美巨大黑白大战| 另类小说一区二区三区| 国产精品色在线观看| 欧美日韩aaaaa| 成人动漫av在线| 婷婷六月综合网| 欧美国产禁国产网站cc| 精品视频1区2区| 99久久综合国产精品| 蜜桃av一区二区| 一区二区在线免费观看| 久久综合九色综合欧美亚洲| 91精彩视频在线观看| 国产一区二区看久久| 亚洲国产人成综合网站| 国产精品污污网站在线观看| 在线不卡免费av| 91蜜桃视频在线| 成人污视频在线观看| 激情综合色播五月| 亚洲无人区一区| 亚洲色图在线视频| 久久久久国产免费免费| 69堂成人精品免费视频| 91在线丨porny丨国产| 国产一区二区三区国产| 伦理电影国产精品| 日韩精品一区第一页| 亚洲一区二区在线免费看| 亚洲欧美在线另类| 国产精品欧美极品| 国产精品视频观看| 1区2区3区国产精品| 亚洲国产成人一区二区三区| www国产亚洲精品久久麻豆| 欧美二区三区的天堂| 欧美日韩一区成人| 欧美日韩二区三区| 制服.丝袜.亚洲.中文.综合| 欧美日韩国产小视频| 欧美亚洲国产bt| 欧美日韩一级视频| 制服丝袜成人动漫| 日韩一卡二卡三卡国产欧美| 日韩欧美另类在线| 亚洲精品一区二区三区香蕉| 精品国产乱码久久久久久老虎 | 26uuu色噜噜精品一区| 欧美一级精品大片| 欧美成人在线直播| 精品成人一区二区三区| 久久在线免费观看| 日韩一区在线免费观看| 综合av第一页| 亚洲午夜精品久久久久久久久| 亚洲国产日韩精品| 五月婷婷综合激情| 久久精品国产免费| 国产乱码字幕精品高清av| 国产成人高清视频| 99国产精品久久| 欧美挠脚心视频网站| 欧美一级高清大全免费观看| 欧美v日韩v国产v| 国产精品国产馆在线真实露脸 | 亚洲欧美另类久久久精品2019| 亚洲精品免费在线观看| 天堂影院一区二区| 风间由美一区二区av101| 色偷偷久久一区二区三区| 欧美高清视频一二三区| 国产亚洲欧美激情| 亚洲一二三区在线观看| 激情六月婷婷久久| 91在线你懂得| 亚洲精品一区二区三区精华液| 国产精品欧美经典| 久久精品国产亚洲aⅴ| 91亚洲男人天堂| 日韩欧美国产三级| 亚洲同性同志一二三专区| 偷拍日韩校园综合在线| 成人av资源在线观看| 91精品欧美久久久久久动漫| 国产精品无码永久免费888| 五月激情综合婷婷| 91丨九色丨黑人外教| 精品va天堂亚洲国产| 亚洲午夜精品在线| 99精品国产热久久91蜜凸| 精品少妇一区二区三区免费观看| 亚洲人成小说网站色在线 | 欧美手机在线视频| 国产精品理论在线观看| 久88久久88久久久| 在线电影欧美成精品| 亚洲欧美日韩国产综合在线 | 555www色欧美视频| 一区二区三区四区高清精品免费观看| 国产福利一区二区三区视频在线 | 黄色精品一二区| 91精品国产91综合久久蜜臀| 亚洲图片自拍偷拍| 一本久道中文字幕精品亚洲嫩 | 亚洲五月六月丁香激情| 成人精品免费网站| 久久蜜桃av一区二区天堂 | 亚洲国产岛国毛片在线| 国产在线精品一区在线观看麻豆| 制服.丝袜.亚洲.另类.中文| 天堂资源在线中文精品| 欧美午夜电影一区| 亚洲激情中文1区| 一本一道久久a久久精品综合蜜臀| 亚洲欧美在线视频| 欧美主播一区二区三区美女| 亚洲二区视频在线| 日韩视频一区二区三区| 精品中文字幕一区二区| www精品美女久久久tv| 国产在线国偷精品免费看| 精品国产sm最大网站免费看| 精品亚洲aⅴ乱码一区二区三区| 日韩午夜精品电影| 国产精品一区二区三区99| 久久久不卡影院| 成人av在线电影| 亚洲乱码中文字幕综合| 欧美综合亚洲图片综合区| 日韩经典中文字幕一区| 日韩欧美亚洲国产另类| 国产一区二区在线观看免费| 国产精品久久久久影院老司| 色综合 综合色| 男女激情视频一区| 国产精品美日韩| 欧美日韩国产成人在线91| 久久99久久99| 欧美国产禁国产网站cc| 欧美羞羞免费网站| 国内精品伊人久久久久av影院 | 自拍av一区二区三区| 欧美午夜宅男影院| 精品一区二区三区视频在线观看 | 日韩欧美中文字幕公布| 国产一区二区视频在线| 亚洲欧洲制服丝袜| 欧美大胆人体bbbb| 91日韩在线专区| 精品在线你懂的| 亚洲一二三区视频在线观看| 久久午夜电影网| 在线观看日韩电影| 国产精品996| 天堂一区二区在线免费观看| 国产精品乱码妇女bbbb| 欧美精品久久99久久在免费线| 国产一区激情在线| 日韩综合小视频| 亚洲男人的天堂在线观看| 欧美r级在线观看| 欧美亚洲国产怡红院影院| 激情五月播播久久久精品| 亚洲欧美日韩成人高清在线一区| 亚洲精品一区二区精华| 欧美日韩国产美女| 99精品国产一区二区三区不卡| 日本伊人午夜精品| 亚洲精品视频免费观看| 亚洲国产精品传媒在线观看| 欧美成人a视频| 一区二区三区四区不卡在线 | 欧美日韩国产在线观看| 在线播放一区二区三区| 精品国产亚洲在线| 欧美国产亚洲另类动漫| 中文字幕人成不卡一区| 亚洲午夜视频在线观看| 免费欧美日韩国产三级电影| 国产精品99久久久久久宅男| 成人精品电影在线观看| 91蜜桃传媒精品久久久一区二区| 欧美美女喷水视频| 久久精品这里都是精品| 亚洲美女屁股眼交| 久久99国产精品久久99果冻传媒| 国产成+人+日韩+欧美+亚洲| 99久久国产综合精品女不卡|