Unit 4 Hacks
Requirements
Work through College Board Unit 4… blog, add definitions, and pictures. Be creative, for instance make a story of Computing and Networks that is related to your PBL experiences this year.
How a Computer Works
List specification of your Computer, or Computers if working as Pair/Trio
Device name LenovoX1Win10
Processor Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2.40 GHz
Installed RAM 8.00 GB (7.87 GB usable)
Device ID EC42FC38-9DA6-4690-A71F-0B84525B66C1
Product ID 00331-10000-00001-AA619
System type 64-bit operating system, x64-based processor
Pen and touch No pen or touch input is available for this display
Edition Windows 10 Pro
Version 21H2
Installed on 8/19/2022
OS build 19044.2846
Experience Windows Feature Experience Pack 120.2212.4190.0
Define or describe usage of Computer using Computer Programs. Pictures are preferred over a lot of text. Use your experience.
- Input devices
- Output devices
- Program File
- Program Code
- Processes
- Ports
- Data File
- Inspect Running Code
- Inspect Variables
The Internet
Watch/review College Board Daily Video for 4.1.1 Complete Vocabulary Matching Activity. Incorporate this into your learnings from year. To analyze measure path and latency use traceroute and ping commands from Linux Terminal.
- Path: a sequence of directly connected computing devices that begins at the sender and ends at the receiver
- Route: the process of finding a path from the sender to the receiver
- Computer System: a group of computing devices and programs working together for a common purpose
- Computer Device: a physical artifact that can run a program. Some examples include, computers, tablets, servers, routers,a dn smart sensors
- Bandwidth: the maximum amount of data that can be sent in a fixed amount of time
- Computer Network: a group of interconnected computing devices capable of sending or receiving
Watch/review College Board Daily Video 4.1.2
- Complete True of False Questions
- open standards and protocols enable different manufacturers and developers to build hardware and software that can communicate with hardware and software on the rest of the internet
- true, because it is open
- IETF is a task force used to enforce laws to keep manufacturers out of the internet
- false , it is there to accept protocols, but is open to everyone
- routers are determined in advanced and are not flexible
- false, routers are flexible and help push things along
- a protocol is a set of agreed upon rules
- true
- UDP guarantees transfers and is faster
- false, it doesn't guarantees transfers
- The World Wide Web is the internet
- false, The internet is the infrastructure that connects computer networks together, while the World Wide Web is a system of organizing information that's accessible through the internet.
- HTTP is a protocol used by the World Wide Web
- true
- open standards and protocols enable different manufacturers and developers to build hardware and software that can communicate with hardware and software on the rest of the internet
- Go over AP videos, vocabulary, and essential knowledge. Draw a diagram showing the internet and its many levels. A preferred diagram would using your knowledge of frontend backend, deployment, etc. Picture would highlight vocabulary by illustration.
Fault Tolerance
- Watch both Daily videos for 4.2
- Complete the network activity, summarize your understanding of fault tolerance.
Systems with fault tolerance are able to finish tasks even when some connections break.System reliability is increased by fault tolerance, but if not properly balanced, it can also be very time and resource-intensive. A balanced set of eight connections is indicated in green, a non-fault-tolerant connection is indicated in black, and an excessively fault-tolerant connection is indicated in blue. Examples From the Video Example 1 The answer is C. Allowing systems to use many alternative pathways to one another, especially when additional routes are available, is the entire objective of fault tolerance. Example 2 The answer is A. As B would be another connection, the system would become fault tolerant since A is the only endpoint with a single route.draw.
Parallel and Distributed Computing
-
Review previous lecture on Parallel Computing and watch Daily vidoe 4.3. Think of ways to make something in you team project to utilize Cores more effectively. Here are some thoughts to add to your story of Computers and Networks…
-
What is naturally Distributed in Frontend/Backend archeticture?
Tasks that are related to the frontend and backend's different functions are automatically distributed between them by the frontend/backend structure. While backend tasks can be more computationally taxing and relate to the data needed by the user side, frontend tasks typically relate to user interface or relationships to the backend.The processing of frontend requests using many nodes is frequently accelerated by parallel computing in the frontend/backend topology. Image processing is frequently divided among numerous processors, which is something we already demonstrated in class. - Analyze this command in Docker: ENV GUNICORN_CMD_ARGS="--workers=1 --bind=0.0.0.0:8086". Determine if there is options are options in this command for parallel computing within the server that runs python/gunicorn. Here is an article
Setting up to present specific arguments to the gunicorn environment is the ENV GUNICORN_CMD_ARGS. The article describes how the command line option --workers=? generates workers to process HTTP requests. By forking itself initially to produce the workers and forking itself repeatedly as workers crash or fail, the master gunicorn process makes sure that the desired number of workers is maintained consistently at all times. In this instance, having one worker denotes that only one forked subprocess is in charge of handling HTTP requests. This is never advised; according to the text, the number of employees should be determined by doubling your computer's CPU and then adding one. However, this would need your computer to have a CPU of zero, which isn't exactly practical.
-
Last week we discussed parallel computing on local machine. There are many options. Here is something to get parallel computing work with a tool called Ray.
-
Review this article Can you get parallel code on images to work more effectively? I have not tried Ray. Code example from ChatGPT using squares. This might be more interesting if nums we generated to be a lot bigger.
import ray
# define a simple function that takes a number and returns its square
def square(x):
return x * x
# initialize Ray
ray.init()
# create a remote function that squares a list of numbers in parallel
@ray.remote
def square_list(nums):
return [square(num) for num in nums]
# define a list of numbers to square
nums = [1, 2, 3, 4, 5]
# split the list into two parts
split_idx = len(nums) // 2
part1, part2 = nums[:split_idx], nums[split_idx:]
# call the remote function in parallel on the two parts
part1_result = square_list.remote(part1)
part2_result = square_list.remote(part2)
# get the results and combine them
result = ray.get(part1_result) + ray.get(part2_result)
# print the result
print(result)