git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6710 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2011-08-17 21:37:24 +00:00
parent 775f182d1f
commit b416be6cbc
2 changed files with 40 additions and 0 deletions

View File

@ -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");
}