This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from mpi4py import MPI | |
| comm = MPI.COMM_WORLD | |
| # each thread will have different rank, we treat 0 as master, others as slave | |
| rank = comm.Get_rank() | |
| # total number of threads | |
| size = comm.Get_size() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #SBATCH --nodes=1 | |
| #SBATCH --ntasks=4 | |
| #SBATCH --ntasks-per-node=4 # 4 tasks per node | |
| #SBATCH --gres=gpu:4 # 4 GPUs per node | |
| #SBATCH --exclusive | |
| #SBATCH --partition=batch | |
| #SBATCH -J p1-weak | |
| #SBATCH -o /scratch/P100-Exps/Weak/logs/p1.out | |
| #SBATCH -e /scratch/P100-Exps/Weak/errs/p1.err |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include "mpi.h" | |
| #define nstrings 5 | |
| const char *const strings[nstrings] = {"Hello","world!","Bonjour","le","monde!"}; | |
| int main(int argc, char **argv) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cstring> | |
| #include <iostream> | |
| #include <queue> | |
| using namespace std; | |
| // This is a test about double free error | |
| // You need to add a copy constructor for class Test | |
| class Test{ | |
| int *myArray; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define CONCAT_2_EXPAND(A, B) A ## B | |
| #define CONCAT_2(A, B) CONCAT_2_EXPAND(A, B) | |
| #define CONCAT_3_EXPAND(A, B, C) A ## B ## C | |
| #define CONCAT_3(A, B, C) CONCAT_3_EXPAND(A, B, C) | |
| #define Vector_(NAME) CONCAT_3(Num, Vector_, NAME) | |
| #define Vector CONCAT_2(Num, Vector) | |
| #define num float | |
| #define Num Float |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| #define IndexType int | |
| void merge_local_vectors(vector<IndexType> &first, vector<IndexType> &second, int pair_size1, int pair_size2, int key1, int key2) { | |
| int ssz1 = first.size(), ssz2 = second.size(); | |
| int i = 0, j = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| typedef struct { | |
| int a, b, c; | |
| }Int3; | |
| int comp (const void * elem1, const void * elem2) { | |
| Int3 f = *((Int3*)elem1); | |
| Int3 s = *((Int3*)elem2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sys/time.h> | |
| #include <sys/types.h> | |
| #include <sys/stat.h> | |
| #include <sys/mman.h> | |
| #include <fcntl.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| #define BUFFER_SIZE (1 * 1024 * 1024) | |
| #define ITERATIONS (10 * 1024) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| ) | |
| const PORT = "7777" | |
| func main() { | |
| fmt.Println("Start listening on port " + PORT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Black 0;30 Dark Gray 1;30 | |
| # Red 0;31 Light Red 1;31 | |
| # Green 0;32 Light Green 1;32 | |
| # Brown/Orange 0;33 Yellow 1;33 | |
| # Blue 0;34 Light Blue 1;34 | |
| # Purple 0;35 Light Purple 1;35 | |
| # Cyan 0;36 Light Cyan 1;36 | |
| # Light Gray 0;37 White 1;37 | |
| RED='\033[0;31m' |
OlderNewer