国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

代做CSci 4061、代寫c/c++設計編程

時間:2024-03-28  來源:合肥網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 

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

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产欧美精品在线| 国产精品一区二区久久精品| 欧美国产视频一区| 91国产一区在线| 欧美成人免费va影院高清| 日韩中文字幕在线视频观看| 国产啪精品视频| 国产精品裸体一区二区三区| 午夜精品区一区二区三| 欧美精品亚州精品| 欧美交换配乱吟粗大25p| 国产成人精品免费久久久久 | 国产精品视频资源| 任我爽在线视频精品一| 久久国产亚洲精品无码| 色噜噜狠狠色综合网| 91久久偷偷做嫩草影院| 亚洲午夜精品久久| 国产精品午夜视频| 在线观看亚洲视频啊啊啊啊 | 国产黄页在线观看| 亚洲巨乳在线观看| 91av在线不卡| 午夜精品一区二区三区av| 国产精品一区二区三区在线观| 久久久黄色av| 亚洲a一级视频| 欧美日韩性生活片| 久久人人爽人人爽爽久久| 日本久久久网站| 国产精品97在线| 亚洲日本精品国产第一区| 国产日韩精品久久| 国产精品久久久久久久app| 日本高清视频精品| 国产伦一区二区三区色一情| 国产精品旅馆在线| 欧美 国产 精品| 91免费精品视频| 欧美激情视频网站| 黄色片久久久久| 国产精品视频免费一区| 欧美亚洲另类在线| 日韩在线观看高清| 欧美在线精品免播放器视频| 国产精品无码人妻一区二区在线 | 精品免费日产一区一区三区免费 | 在线观看污视频| 国产男女无遮挡| 美女扒开尿口让男人操亚洲视频网站| 国内精品视频一区二区三区| 国产精品免费久久久| 欧美精品免费观看二区| 久久精品影视伊人网| 欧美日韩国产综合在线| 日韩中文字幕视频在线观看| 日本久久精品视频| 日韩在线免费av| 今天免费高清在线观看国语| 国产精品免费视频一区二区| 黄色污污在线观看| 国产精品视频一区二区三区经| 欧美黄色直播| 久久av中文字幕| 国产精品中文字幕在线| 亚洲影院污污.| 久久久久成人精品免费播放动漫| 日本免费黄视频| 久久久www成人免费精品| 精品午夜一区二区| 欧美日本精品在线| 91精品国产成人| 欧美日韩不卡在线视频| 久久亚洲影音av资源网| 成人精品网站在线观看| 日本精品久久中文字幕佐佐木| 久久久久久久免费| 黄色网址在线免费看| 一女被多男玩喷潮视频| 成人欧美一区二区三区黑人免费| 亚洲乱码一区二区三区| 久久久久高清| 欧美日韩一区二区三区在线视频| 久久99久久亚洲国产| 国产成人一区二区三区别| 国内精品视频在线播放| 三级网在线观看| 国产精品成人观看视频免费| 91九色国产ts另类人妖| 欧美精品中文字幕一区二区| 最新av网址在线观看| 成人欧美一区二区三区黑人| 亚洲综合国产精品| zzjj国产精品一区二区| 99亚洲精品视频| 欧美 日韩 国产在线观看| 亚洲a∨日韩av高清在线观看| 久久99精品久久久久久久久久| 国产日韩欧美夫妻视频在线观看| 日本高清+成人网在线观看| 美女福利视频一区| 精品国内产的精品视频在线观看| 国产精品一区二区三区免费视频| 日韩av播放器| 欧美激情亚洲另类| 久久久精品免费视频| 国产在线一区二区三区四区| 伊人精品久久久久7777| 久久免费一级片| 国产精品一区二区三区免费| 欧美精品成人网| 视频一区国产精品| 中文字幕无码精品亚洲35 | 国产福利精品视频| 成人免费aaa| 蜜臀av.com| 日韩欧美一区二区三区四区五区| 久久久久久国产精品| 国产精品视频在线播放| 国产成人艳妇aa视频在线| 国产伦精品一区二区三区视频孕妇| 欧美亚洲午夜视频在线观看| 午夜精品一区二区三区av | 欧美 日韩 国产精品| 日本一本a高清免费不卡| 久久久久久国产精品三级玉女聊斋| 久久精品亚洲94久久精品| 91九色国产视频| 国产女女做受ⅹxx高潮| 日韩免费不卡av| 午夜精品一区二区三区av| 中文字幕中文字幕在线中心一区| 国产精品久久久久久久乖乖| 精品国产一区二区三区久久狼5月 精品国产一区二区三区久久久狼 精品国产一区二区三区久久久 | 日本一区免费看| 亚洲综合av影视| 国产a∨精品一区二区三区不卡| 精品久久国产精品| 日韩在线中文字| 国产mv久久久| 国产av人人夜夜澡人人爽麻豆| 久久久午夜视频| 国产经品一区二区| 不卡一卡2卡3卡4卡精品在| 狠狠色噜噜狠狠狠狠色吗综合| 日本一本a高清免费不卡| 婷婷精品国产一区二区三区日韩| 亚洲一二区在线| 一区二区免费在线视频| 欧美成人精品在线| 国产精品大陆在线观看| 欧美成人免费va影院高清| 国产精品久久网| 国产精品吹潮在线观看| 久久伊人精品一区二区三区| 北条麻妃久久精品| 视频直播国产精品| 日韩中文字在线| 国产国语videosex另类| 91久久精品国产91久久| www.av中文字幕| 国产精品96久久久久久又黄又硬| 久久久久国产精品熟女影院| 久久久久亚洲精品| 日韩在线精品视频| 国产精品久久久久久免费观看 | 色噜噜狠狠狠综合曰曰曰88av | 奇米精品一区二区三区| 欧美午夜精品久久久久久蜜| 黄黄视频在线观看| 国产欧美丝袜| 97久久久免费福利网址| 久久精品中文字幕一区二区三区| 久久久久久伊人| 国产精品视频播放| 欧美猛交ⅹxxx乱大交视频| 欧美日韩国产成人在线观看| 亚洲在线视频观看| 日韩精品久久一区| 欧美v在线观看| 国产欧美亚洲精品| 国产精品.com| 久久久www成人免费精品| 欧美激情视频在线观看| 午夜啪啪福利视频| 日韩久久久久久久久久久久| 国产欧美丝袜| 国产成人一区二区三区免费看| 久久久精品欧美| 一区二区三区不卡在线| 欧美有码在线视频| 国产日韩精品一区观看| 国产极品美女高潮无套久久久| 国产精品无码专区av在线播放| 久久伊人精品天天| 亚洲精品9999| 欧美极品日韩| 国产精品97在线| 国产精品视频久久| 懂色av粉嫩av蜜臀av|