当前位置: 首页 > 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

相关文章:

  • 【华为HCIP实战课程二】OSPF基础介绍和OSPF RID NBMA配置详解
  • zy89、90_C#中字符串及控制字符串的常用函数
  • vue3中动态引入组件并渲染组件
  • DC00023基于jsp+MySQL新生报到管理系统
  • 聊一聊大模型六小虎生存现状!
  • 8.代码风格调试%结课竞赛
  • 大厂面试真题:简单说下Redis的bigkey
  • Unity3D PostLateUpdate为何突然占用大量时间详解
  • CC-LINK IE Field Basic通讯设置
  • Redis --- redis事务和分布式事务锁
  • 用友U8+CRM leadconversion.php SQL注入复现
  • Linux进程的学习(持续更新)
  • C++:类中的特殊关键字,运算重载符
  • Groupby_SQL和pandas等效例子
  • 数据结构7—树(顺序存储二叉树—堆)含TOPK问题
  • Android单元测试 - 几个重要问题
  • centos安装java运行环境jdk+tomcat
  • fetch 从初识到应用
  • js中的正则表达式入门
  • nfs客户端进程变D,延伸linux的lock
  • session共享问题解决方案
  • 大数据与云计算学习:数据分析(二)
  • 动手做个聊天室,前端工程师百无聊赖的人生
  • 工作手记之html2canvas使用概述
  • 关于Flux,Vuex,Redux的思考
  • 前端相关框架总和
  • 如何邀请好友注册您的网站(模拟百度网盘)
  • 三分钟教你同步 Visual Studio Code 设置
  • 小程序 setData 学问多
  • 阿里云服务器购买完整流程
  • 正则表达式-基础知识Review
  • #VERDI# 关于如何查看FSM状态机的方法
  • #进阶:轻量级ORM框架Dapper的使用教程与原理详解
  • (10)STL算法之搜索(二) 二分查找
  • (6)STL算法之转换
  • (delphi11最新学习资料) Object Pascal 学习笔记---第13章第6节 (嵌套的Finally代码块)
  • (floyd+补集) poj 3275
  • (含react-draggable库以及相关BUG如何解决)固定在左上方某盒子内(如按钮)添加可拖动功能,使用react hook语法实现
  • (回溯) LeetCode 78. 子集
  • (理论篇)httpmoudle和httphandler一览
  • (转)GCC在C语言中内嵌汇编 asm __volatile__
  • (转)scrum常见工具列表
  • **PyTorch月学习计划 - 第一周;第6-7天: 自动梯度(Autograd)**
  • .Mobi域名介绍
  • //解决validator验证插件多个name相同只验证第一的问题
  • @Mapper作用
  • @modelattribute注解用postman测试怎么传参_接口测试之问题挖掘
  • [ C++ ] STL_list 使用及其模拟实现
  • [ Linux ] git工具的基本使用(仓库的构建,提交)
  • [.net]官方水晶报表的使用以演示下载
  • [12] 使用 CUDA 加速排序算法
  • [20171101]rman to destination.txt
  • [2669]2-2 Time类的定义
  • [AI]文心一言出圈的同时,NLP处理下的ChatGPT-4.5最新资讯
  • [AS3]URLLoader+URLRequest+JPGEncoder实现BitmapData图片数据保存