当前位置: 首页 > news >正文

(undone) MIT6.824 Lab1

参考:http://nil.csail.mit.edu/6.824/2021/labs/lab-mr.html


task1: 熟悉讲义,尤其是搞明白如何运行测试程序(完成) ------------------------------------------------ start

先看 Introduction
我们的目标:构建一个MapReduce系统。
细节:实现一个工作进程,调用应用程序的Map和Reduce函数,并处理文件的读写;同时还将实现一个协调进程,负责分配任务给工作进程并应对失败的工作进程。构建的内容类似于MapReduce论文中描述的内容。(注意:实验中使用“协调者”而不是论文中的“主节点”。)
在这里插入图片描述

细节在后边
在这里插入图片描述
先根据讲义下载 LAB 代码

git clone git://g.csail.mit.edu/6.824-golabs-2021 6.824

看讲义:代码中已经有了 word-count 和 text indexer 两个应用。同时还有一个极简单的 MapReduce 实现(在一个进程中,一次只运行一个 map 和 一个reduce)。
我们电脑上没 go ,先安装,安装步骤如下 (WSL2 ubuntu20.04)

wget -qO- https://golang.org/dl/go1.15.8.linux-amd64.tar.gz | sudo tar xz -C /usr/local
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go

安装完毕,我们试着按照讲义运行 word count 这个应用

cd ~/6.824
cd src/main
go build -race -buildmode=plugin ../mrapps/wc.go
go run -race mrsequential.go wc.so pg*.txt
more mr-out-0

出现了单词统计结果:
在这里插入图片描述
看来顺利运行了

看看后边的内容
这一段概述了要做的事情(作业目标)
在这里插入图片描述

下面内容介绍了一些代码大致位置:
1.main函数,包括对 协调者 和 工作者 的调动,在 main/mrcoordinator.go 里(不应修改)
2.我们的实现应该放在 mr/coordinator.go, mr/worker.go 和 mr/rpc.go 里
更多内容看后边
在这里插入图片描述
仔细阅读了后边的内容,总结了运行测试程序的方式:
1.修改 mr/coordinator.go Done 函数中的 返回值,把 return false 改成 return true
2.在 main 文件夹下,运行 bash test-mr.sh
看到输出如下:

*** Starting wc test.
2024/09/29 10:39:19 rpc.Register: method "Done" has 1 input parameters; needs exactly three
sort: cannot read: 'mr-out*': No such file or directory
cmp: EOF on mr-wc-all which is empty
--- wc output is not the same as mr-correct-wc.txt
--- wc test: FAIL
*** Starting indexer test.
2024/09/29 10:39:21 rpc.Register: method "Done" has 1 input parameters; needs exactly three
sort: cannot read: 'mr-out*': No such file or directory
cmp: EOF on mr-indexer-all which is empty
--- indexer output is not the same as mr-correct-indexer.txt
--- indexer test: FAIL
*** Starting map parallelism test.
2024/09/29 10:39:22 rpc.Register: method "Done" has 1 input parameters; needs exactly three
cat: 'mr-out*': No such file or directory
--- saw 0 workers rather than 2
--- map parallelism test: FAIL
cat: 'mr-out*': No such file or directory
--- map workers did not run in parallel
--- map parallelism test: FAIL
*** Starting job count test.
2024/09/29 10:39:24 rpc.Register: method "Done" has 1 input parameters; needs exactly three
cat: 'mr-out*': No such file or directory
test-mr.sh: line 170: [: : integer expression expected
--- job count test: PASS
*** Starting early exit test.
2024/09/29 10:39:25 rpc.Register: method "Done" has 1 input parameters; needs exactly three
sort: cannot read: 'mr-out*': No such file or directory
sort: cannot read: 'mr-out*': No such file or directory
--- early exit test: PASS
*** Starting crash test.
2024/09/29 10:39:26 rpc.Register: method "Done" has 1 input parameters; needs exactly three
sort: cannot read: 'mr-out*': No such file or directory
cmp: EOF on mr-crash-all which is empty
--- crash output is not the same as mr-correct-crash.txt
--- crash test: FAIL
*** FAILED SOME TESTS

本 task 完成

task1: 熟悉讲义,尤其是搞明白如何运行测试程序(完成) ------------------------------------------------ end

task2: 该明白测试程序的原理,尤其是如何测试代码是并行运行的 ------------------------------------------------ start

TODO:here

task2: 该明白测试程序的原理,尤其是如何测试代码是并行运行的 ------------------------------------------------ end

TODO: 看看 word count 和 MapReduce 的联动

TODO: here

http://www.lryc.cn/news/451461.html

相关文章:

  • SpringMVC——REST
  • 【牛客网刷题记录】【java】二叉树
  • 一文讲透大语言模型构建流程
  • VR视频怎样进行加密和一机一码的使用?--加密(一)
  • Ubuntu启动后第一次需要很久才能启动GTK应用问题
  • 栏目二:Echart绘制动态折线图+柱状图
  • Gromacs——使用过程中暴露问题分析及学习
  • Webpack模式-Resolve-本地服务器
  • 【LLM论文日更】| 通过指令调整进行零样本稠密检索的无监督文本表示学习
  • 02.01、移除重复节点
  • 旅游推荐|旅游推荐系统|基于Springboot+VUE的旅游推荐系统设计与实现(源码+数据库+文档)
  • github项目--crawl4ai
  • 仅有N卡独显的情况下安装ubuntu是遇到的黑屏,加载卡顿等问题
  • Vite:为什么选 Vite
  • 个人项目简单https服务配置
  • Rust 函数
  • 微信小程序中的 `<block>` 元素:高效渲染与结构清晰的利器
  • 选读算法导论5.2 指示器随机变量
  • 大数据-154 Apache Druid 架构与原理详解 基础架构、架构演进
  • centos9 nginx 版本
  • https访问报错:net::ERR_CERT_DATE_INVALLD
  • cat用来查看文件内容、合并文件,或者将文件内容输出到终端
  • 基于ssm大学生自主学习网站的设计与实现
  • C++基础补充(01)C++11基于范围的for循环
  • qt6 使用QPSQL
  • 【PostgreSQL】提高篇——公用表表达式(CTE)和窗口函数
  • 【min25筛】【CF2020F】Count Leaves
  • 【d57】【sql】1661. 每台机器的进程平均运行时间
  • ArcGIS共享数据的最佳方法(不丢可视化、标注等各类显示信息一样带)
  • 小程序this.getOpenerEventChannel()当前页面与navigateTo页面之间数据通信