[torqueusers] Problem with pbsdsh

Abraham Zamudio abraham.zamudio at gmail.com
Mon Oct 24 15:13:54 MDT 2011

Hi people ,

I have a following problem . I am trying run various copies of the following
code :

#include <stdio.h>
#include <gsl/gsl_matrix.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/time.h>

int main (int argc, char **argv)
int i,j;
int n,m;


gsl_matrix * A = gsl_matrix_alloc(n,m);

struct timeval tval;
gettimeofday(&tval, 0);
long int NN = (tval.tv_sec ^ tval.tv_usec) ^ getpid() ;

for (i = 0; i < n; i++)
    for (j = 0; j < m; j++)
        gsl_matrix_set (A, i, j, rand());

FILE * f = fopen(argv[1],"wb");
gsl_matrix_fwrite (f, A);

fclose (f);
gsl_matrix_free (A);

return 0;

The compilation is with :

gcc -I/usr/include/gsl -Wall -pedantic -ggdb -std=c99 -lgsl -lgslcblas -o
matrix matrix.c

Basically what i want is to generate an output file
(matrix_$PBS_VNODENUM.dat) for each  processor .

My qsub file :

#PBS -S /bin/bash
#PBS -N matrix2
#PBS -q batch
#PBS -l nodes=quad4:ppn=4
#####    #PBS -j oe
#PBS -e matrix_$PBS_JOBID.err
#PBS -o matrix_$PBS_JOBID.out

pbsdsh -v $PBS_O_WORKDIR/matrix2 $PBS_O_WORKDIR/matrix_$PBS_VNODENUM.dat

The problem is that only stores an output file (matrix_0.dat) . I'm looking
for some advice .

Abraham Zamudio Ch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/torqueusers/attachments/20111024/cfd12275/attachment.html 

More information about the torqueusers mailing list