git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6710 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -46,6 +46,10 @@
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
|
||||
#ifdef LMP_OPENMP
|
||||
#include "omp.h"
|
||||
#endif
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define MAXLINE 2048
|
||||
@ -1136,10 +1140,25 @@ void Input::package()
|
||||
delete [] fixarg;
|
||||
|
||||
} else if (strcmp(arg[0],"omp") == 0) {
|
||||
|
||||
#ifdef LMP_OPENMP
|
||||
if (narg != 2) error->all("Illegal package command");
|
||||
comm->nthreads = atoi(arg[1]);
|
||||
if (comm->nthreads < 1) error->all("Illegal package command");
|
||||
|
||||
omp_set_num_threads(nthr);
|
||||
if (me == 0) {
|
||||
if (screen)
|
||||
fprintf(screen," reset %d OpenMP thread(s) per MPI task\n",
|
||||
comm->nthreads);
|
||||
if (logfile)
|
||||
fprintf(logfile," reset %d OpenMP thread(s) per MPI task\n",
|
||||
comm->nthreads);
|
||||
}
|
||||
#else
|
||||
error->all("Cannot use package omp command with no OpenMP support");
|
||||
#endif
|
||||
|
||||
} else error->all("Illegal package command");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user