printf("Error : Directory %s already exists. Specify a non existing directory.\n",argv[2]);
exit(-1);
}
// check whether the input file exists. If it could not be opened (ifile = 0), it does not exist
if(ifile){
ifile.close();
}
else{
printf("The file %s does not exist, please specify a valid file name\n",infile);
exit(-1);
}
return0;
}
intmain(intargc,char*argv[])
{
intworld_size=1;
intworld_rank=0;
#ifdef __WITH_MPI
MPI_Init(NULL,NULL);
MPI_Comm_size(MPI_COMM_WORLD,&world_size);
MPI_Comm_rank(MPI_COMM_WORLD,&world_rank);
charprocessor_name[MPI_MAX_PROCESSOR_NAME];
intname_len;
MPI_Get_processor_name(processor_name,&name_len);
MPI_Barrier(MPI_COMM_WORLD);
// Print off a hello world message
#endif
intnumthreads=1;
#ifdef _OPENMP
#warning "using openmp"
#pragma omp parallel
numthreads=omp_get_num_threads();
#endif
//
printf("Hello world from processor %s, rank %d out of %d processors and %d threads per rank\n",processor_name,world_rank,world_size,numthreads);fflush(stdout);
#ifdef __WITH_MPI
MPI_Barrier(MPI_COMM_WORLD);
#endif
intverbose=(world_rank==0);
//
if(verbose)printf("Lenstool-HPC\n\n");
//
doublewallclock=myseconds();
if(world_rank==0)printf("Reading parameter file at time %f s...\n",myseconds()-wallclock);