This file contains 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
void device_binding () | |
{ | |
int local_rank, num_local_procs; | |
int dev_count, use_dev_count, my_dev_id; | |
char *str; | |
if ((str = getenv ("MV2_COMM_WORLD_LOCAL_RANK")) != NULL) | |
{ | |
local_rank = atoi (str); |
This file contains 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
/opt/nvidia_gpu_sdk/4.2/C/bin/linux/release/bandwidthTest --csv --mode=range --memory=pageable --htod --start=1000 --end=100000 --increment=1000 |
This file contains 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
char* str = NULL; | |
if( ( str = getenv( "MV2_USE_CUDA" ) ) != NULL) { | |
printf( "MVAPICH2-CUDA ENABLED: %s\n" ); | |
} |
This file contains 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 CHECK_ERROR( err ) \ | |
if( err != cudaSuccess ) { \ | |
std::cerr << "ERROR: " << cudaGetErrorString( err ) << std::endl; \ | |
exit( -1 ); \ | |
} | |
#define CHECK_LAST_ERROR \ | |
{ cudaError_t err = cudaGetLastError(); \ | |
if( err != cudaSuccess ) { \ | |
std::cerr << cudaGetErrorString( err ) << std::endl; \ |
This file contains 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
-D__cudart_builtin__=__device__ |
This file contains 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 <unistd.h> | |
#include <mpi.h> | |
#include <CL/cl.h> | |
int main( int argc, char** argv ) { | |
cl_int error; | |
cl_platform_id platform; | |
cl_device_id device; |
This file contains 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
class CUDAEventTimer { | |
public: | |
CUDAEventTimer() { | |
cudaEventCreate(&start_); | |
cudaEventCreate(&stop_); | |
} | |
~CUDAEventTimer() { | |
cudaEventDestroy(start_); | |
cudaEventDestroy(stop_); | |
} |
This file contains 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> | |
//#include <cstdio> - uncomment for printf in kernels | |
//#include <cuda_runtime.h> | |
//cuda is included automatically when compiling with nvcc | |
typedef double REAL_T; | |
//----------------------------------------------------------------------------- | |
class CUDAEventTimer { |
This file contains 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
int compute_blocks(int length, int threads_per_block) { | |
//integer division: | |
//if length is evenly divisable by the number of threads | |
//is equivalent to length / threads_per_block, if not | |
//it is equivalent to length / threads_per_block + 1 | |
return (length + threads_per_block - 1) / threads_per_block; | |
} | |
dim3 compute_blocks(int xsize, int ysize, int zsize, | |
int threads_per_block_x, |
This file contains 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
1) get OSXFuse: http://osxfuse.github.com | |
2) create local folder to mount remote fs into | |
3) invoke sshfs: | |
sshfs user@server:/home/user/ ~/remote -oauto_cache,reconnect,defer_permissions,negative_vncache,volname=RemoteHome | |
Look here for additional information: | |
http://www.read-write.fr/blog/blog/2012/02/26/my-guide-for-sshfs/ |