Skip to content

Instantly share code, notes, and snippets.

View clickCA's full-sized avatar
:dependabot:
computing

Chanakorn Aramsak clickCA

:dependabot:
computing
View GitHub Profile

To run the command:

  1. Change directory to the folder that contains the input file sort-rand-199999999.txt: cd /path/to/folder
  2. Optionally, replace sort-rand-199999999.txt with another input file. Make sure that the file is located in the current directory.
  3. Run the command: time docker run -v $PWD:/input -v $PWD:/output clickads/terasort:latest ./prog /input/sort-rand-199999999.txt /output/out.txt

This command runs a Docker container that uses the clickads/terasort image and sorts the specified input file from the /input directory to the /output/out.txt file. The time command is used to measure the execution time of the command.

// A program to simulates page faults and calculates page fault rate.
// Input: a list of page references (a series of page numbers, separated by a space).
// Output: page fault rate
// Option: -v --> verbose mode: print the result of every page reference,
// whether a page fault occurs, the involved page table entry, page number, and frame number.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define FRAME_SIZE 256
#define FRAME_ENTRIES 128
#define PAGE_SIZE 256
#define PAGE_ENTRIES 16
#define OUTER_PAGE_ENTRIES 16
@clickCA
clickCA / test.c
Last active February 20, 2023 16:37
#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include <time.h>
int main(void)
{
int a[100000];
double start_time, end_time;
size_t i;