- 博客(14)
- 资源 (3)
- 收藏
- 关注
原创 #pragma omp threadprivate(alpha)
#include <omp.h>int alpha[10],beta[10],i;#pragma omp threadprivate(alpha)main(){/* first parallel region */#pragma omp parallel private(i,beta){ int id ; id = omp_get_thread_num(); for(i=
2016-12-30 09:54:43 777
原创 模幂运算
//一开始写错了是因为模幂运算溢出#include <iostream>#include<cmath>#define mistakeP 0.0001using namespace std;bool Btest(int a,int n){int s=0; int t=n-1; do{ s++; t=t/2; }while(t % 2!=1); //int x=((int)pow
2016-12-27 19:45:01 597
原创 已经有科学了?还需要自然辩证法吗?
已经有科学了?还需要自然辩证法吗?摘要:人类对自然的探索,从人刚开始进化就已经开始,经历了一个漫长的发展过程。从火的发现到用火冶炼金属,从夜观天象到地动仪的发明,从电的产生到第二次工业革命。看似每一个不可思议的发明发现,皆是历年的科学技术的一次由量变到质变的过程。时间发展到现代,自然科学技术已经涉及到方方面面,知识体量的爆炸在历史的每一个时间是不曾出现过的。然而随着时间的推移,这种问题会越来越突出,
2016-12-25 18:33:03 1515
原创 LV 八皇后
#include <iostream>#include <vector>#include <stack>#include<cstdlib>#define queenCount 16#define maxTryCount 1000000#define intMaxValue 2147483647#define exeCount 1000//每个stepVegas执行exeCount
2016-12-25 16:14:14 375
原创 malloc
int ** p=(int **)malloc(sizeof(int *)*len);for(int i=0;i<len;i++) {p[i]=(int *)malloc(sizeof(int)*len); }int (*a)[len]=(int *)malloc(sizeof(int)*len);a指向一个指针数组
2016-12-21 16:23:20 431
原创 fox 算法 mpi 实现
#include <stdio.h>#include <stdlib.h>#include <time.h>#include<math.h>#include <string.h>#include "mpi.h"#define matrixLength 8#define matrixMaxValue 50void initialMatrix(int matrixA[matrixLeng
2016-12-20 21:46:01 1259 1
原创 memset
void * memset ( void * ptr, int value, size_t num );/*Fill block of memorySets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char).*//
2016-12-20 10:50:36 584
原创 mpi错误
int nproc;MPI_Comm_size( MPI_COMM_WORLD, &nproc);MPI_Comm_rank( MPI_COMM_WORLD, &rank);int allName[nproc];int num=rank+1; MPI_Gather(&num, 1, MPI_INT, allName,nproc, MPI_INT, 0,MPI_COMM_WORLD); i
2016-12-17 17:01:25 1148
原创 mpi 通信域划分不完整版
#include "mpi.h"#include <stdio.h>#include <unistd.h>#define nodeNameLength 20int main(int argc, char *argv[]){ int rank,nproc; MPI_Init( &argc, &argv ); MPI_Comm_size( MPI_COMM_WOR
2016-12-17 11:39:15 1021
原创 mpi comm 划分
Maybe it can‘t be run ,but it just provides a thinking way and mpi api overview.#include "mpi.h"#include <stdio.h>#include <unistd.h>#define nodeNameLength 20int main(int argc, char *argv[]){
2016-12-17 09:56:01 1635
原创 愚蠢的傲慢
// GetKernel32FuncAddr.cpp : #include <stdio.h>#include <stdlib.h>unsigned long GetKernel32FuncAddr(){ unsigned long pBaseOfKernel32, pNameOfModule; unsigned long pAddressOfFunctions, pAddr
2016-12-15 16:58:47 366
转载 scp 跨机远程拷贝
转载:http://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/scp.html scp 跨机远程拷贝scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的。当你服务器硬盘变为只读 read only system时,用scp可以帮你把文
2016-12-08 09:58:27 310
原创 mpi_allgather实现
#include "mpi.h"#include <stdio.h>#define dataLength 32void mpi_allgatherSelfImpl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datat
2016-12-08 09:48:11 2080
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人