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
| Configuring the R BatchJobs package for Torque batch queues | |
| https://www.r-bloggers.com/configuring-the-r-batchjobs-package-for-torque-batch-queues/ | |
| Rstudio server: start R sessions as a job on cluster ? | |
| Unfortunately, we don't currently have a feature that does this | |
| stackoverflow mentioned the following on how to run Rstudio on a computation node of a remote linux cluster | |
| http://stackoverflow.com/questions/23639125/how-to-run-rstudio-on-a-computation-node-of-a-remote-linux-cluster | |
| What is often done is use Rstudio for development and then wrap everything in a self-contained R script to submit to the cluster with something like |
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
| /* | |
| example_chbmv.c is from http://clmathlibraries.github.io/clBLAS/example_chbmv_8c-example.html | |
| $ gcc -Wall -I/share/apps/clblas-2.10/include -L/share/apps/clblas-2.10/lib64 -o example_chbmv example_chbmv.c -lclBLAS | |
| $ ./example_chbmv | |
| Result: | |
| ( 1.00, 0.00 ) | |
| ( 2.00, 0.00 ) | |
| ( 3.00, 0.00 ) | |
| ( 4.00, 0.00 ) |
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
| /* | |
| example_chemm.cpp is from http://clmathlibraries.github.io/clBLAS/example_chemm_8cpp-example.html | |
| $ gcc -Wall -I/share/apps/clblas-2.10/include -I/share/apps/cuda-7.5/include -L/share/apps/clblas-2.10/lib64 -o example_chemm example_chemm.cpp -lclBLAS | |
| $ ./example_chemm | |
| Result: | |
| < 41430.00, 46230.00 > <-39740.00, 87400.00 > < 48960.00, 48400.00 > | |
| < 41360.00, 54760.00 > <-48340.00, 90520.00 > < 32620.00, 53220.00 > | |
| < 28830.00, 79370.00 > <-67980.00, 77040.00 > < 13400.00, 81160.00 > | |
| <-24980.00, 90100.00 > <-114700.00, -43780.00> <-67560.00, 93200.00 > |
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
| /* | |
| sgemm.c is from https://github.com/CNugteren/CLBlast/issues/51 | |
| $ g++ -std=c++11 sgemm.c -fdiagnostics-color=always -I/share/apps/clblast-0.6.0/include -I/share/apps/cuda-7.5/include -L/share/apps/clblast-0.6.0/lib -lOpenCL -lclblast -o sgemm | |
| $ ./sgemm | |
| 1 2 | |
| 3 4 | |
| 5 6 | |
| 1 2 3 | |
| 4 5 6 |
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
| /* | |
| sgemm.cpp is from https://github.com/CNugteren/CLBlast/blob/master/samples/sgemm.cpp | |
| $ g++ -std=c++11 sgemm.cpp -fdiagnostics-color=always -I/share/apps/clblast-0.6.0/include -I/share/apps/cuda-7.5/include -I/share/apps/cuda-7.5/include/CL -L/share/apps/clblast-0.6.0/lib -lOpenCL -lclblast -o sgemm | |
| $ ./sgemm | |
| Completed SGEMM in 30.277 ms with status 0 | |
| [tangc@compute-3-3 clBlast_examples]$ | |
| */ | |
| // ================================================================================================= |
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
| /* | |
| JOCLBlastSample.java is from https://forum.byte-welt.net/archive/index.php/t-18180.html | |
| $ cat output | |
| CL_DEVICE_NAME: Tesla K40m | |
| A: | |
| 11.0 12.0 13.0 14.0 15.0 | |
| 21.0 22.0 23.0 24.0 25.0 | |
| 31.0 32.0 33.0 34.0 35.0 | |
| 41.0 42.0 43.0 44.0 45.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
| command = "ls /etc | grep release"; | |
| String[] cmd = { "/bin/sh", "-c", command }; | |
| ProcessBuilder pb = new ProcessBuilder(cmd); | |
| pb.redirectOutput(Redirect.INHERIT); | |
| pb.redirectError(Redirect.INHERIT); | |
| Process p = pb.start(); | |
| p.waitFor(); |
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 | |
| # ref http://unix.stackexchange.com/questions/19008/automatically-run-commands-over-ssh-on-many-servers | |
| echo $(date) | |
| echo $@ | |
| tmp_dir_prefix=pssh-to-be-deleted-Cu8vihiWFhATbsGlSrUO | |
| rm -r /tmp/${tmp_dir_prefix}.* |
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
| NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"REST URL PATH"]]; | |
| NSData *imageData = UIImageJPEGRepresentation(image, 1.0); | |
| [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; | |
| [request setHTTPShouldHandleCookies:NO]; | |
| [request setTimeoutInterval:60]; | |
| [request setHTTPMethod:@"POST"]; | |
| NSString *boundary = @"unique-consistent-string"; |
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
| /* | |
| https://www.wiki.ed.ac.uk/display/ecdfwiki/cudaOpenMP.cu | |
| module load cuda/7.5 | |
| nvcc -Xcompiler -fopenmp -lgomp -o cudaOpenMP.out cudaOpenMP.cu | |
| ./cudaOpenMP.out | |
| */ | |
| #include <omp.h> |