[torqueusers] Problem with pbsdsh

Coyle, James J [ITACD] jjc at iastate.edu
Tue Oct 25 09:16:47 MDT 2011


Abraham,

I think   $PBS_VNODENUM  only gets a number inside a copy of
a script launched by pbsdsh.

This is similar to the value of
  n
outside of the loop
  for(n=0;n<4;n++){
}



  Try launching a script which uses
matrix_$PBS_VNODENUM.dat

internally.


E.g.

script1 is executable in $PBS_O_WORKDIR  and contains:

#!/bin/bash

./ matrix2     matrix_$PBS_VNODENUM.dat

and change the  pbsdsh command in your script to the two lines:

cd $PBS_O_WORKDIR
pbsdsh  script1


James Coyle, PhD
High Performance Computing Group
 Iowa State Univ.
web: http://jjc.public.iastate.edu/<http://www.public.iastate.edu/~jjc>





From: torqueusers-bounces at supercluster.org [mailto:torqueusers-bounces at supercluster.org] On Behalf Of Abraham Zamudio
Sent: Monday, October 24, 2011 4:14 PM
To: Torque Users Mailing List; David Beer; Ken Nielson; tbaer at utk.edu
Subject: [torqueusers] Problem with pbsdsh

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;

n=10000;
m=10000;

gsl_matrix * A = gsl_matrix_alloc(n,m);

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


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 -V
#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/20111025/cebe0f5a/attachment-0001.html 


More information about the torqueusers mailing list