I am trying to run a R program on cluster. In the R program,jags function is called from the package R2jags. If I don't use the cluster and simply use R, then the program works fine. However, when I try to submit a job, then I get the following error. If I don't call the function jags and use the cluster then it works just fine.
Loading required package: rjags
Loading required package: coda
Linked to JAGS 4.0.0
Loaded modules: basemod,bugs
Attaching package: ‘R2jags’
The following object is masked from ‘package:coda’:
    traceplot
 *** caught illegal operation ***
address 0x7fe566be8917, cause 'illegal operand'
Traceback:
 1: dyn.load(file)
 2: load.module(jags.module[m])
 3: jags(model.file = "myfile.txt", data = model.data,     inits = model.initial.values, parameters = model.parameters,     n.chains = 1, n.iter = 500, n.burnin = 5, n.thin = 5)
An irrecoverable exception occurred. R is aborting now ...
 line 15: 34161 Illegal instruction     (core dumped) Rscript test1.R
