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 <bitset> | |
typedef unsigned int uint; | |
static uint nextPowerOfTwo(uint x) { | |
std::bitset<32> a(x); | |
std::cout << a << '\n'; | |
--x; | |
a = x; |
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 _POSIX_SOURCE | |
// If you define this macro, then the functionality from | |
// the POSIX.1 standard (IEEE Standard 1003.1) is available | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
#undef _POSIX_SOURCE | |
#include <stdio.h> |
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 <time.h> | |
#include <tchar.h> | |
#define ARRAY_MIN (1024) /* 1/4 smallest cache */ | |
#define ARRAY_MAX (4096*4096) /* 1/4 largest cache */ | |
int x[ARRAY_MAX]; /* array going to stride through */ | |
double get_seconds() { /* routine to read time in seconds */ | |
__time64_t ltime; | |
_time64(<ime); |
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 _GNU_SOURCE | |
/* | |
If you define this macro, everything is included: ISO C89, ISO C99, | |
POSIX.1, POSIX.2, BSD, SVID, X/Open, LFS, and GNU extensions. | |
*/ | |
#define _FILE_OFFSET_BITS 64 | |
/* | |
This macro determines which file system interface | |
shall be used, one replacing the other. | |
*/ |
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 <mpi.h> | |
int main (int argc, char *argv[]) | |
{ | |
int rank, comm_size; | |
MPI_Init(&argc, &argv); | |
MPI_Comm_rank(MPI_COMM_WORLD, &rank); | |
MPI_Comm_size(MPI_COMM_WORLD, &comm_size); |
NewerOlder