Re: amber-developers: Testing Parallel

From: Lachele Foley <lfoley.ccrc.uga.edu>
Date: Tue, 15 Apr 2008 17:16:56 -0400

> I am not entirely sure it does work as expected for argc > 2.

So far for me, it has, all the way through all the parallel tests with their varying numbers of arguments.

> I would also avoid things like sprintf(command, "%s", command).

sprintf(command,"%s %s",command,argv[a]);

... it's an easy, lazy way to ensure that there is a space between each argv. I have seen unexpected behavior when the source and destination strings are the same, but only when I had multi-dimensional arrays in twisty structures competing for space... Even then, it was usually a bug elsewhere in my memory allocation and not the sprintf command. I can write it a different way if it makes anyone nervous. I can copy character-by-character if you like... :-)

> #!/bin/sh

I tried switching to the sh shell (and ksh, bash, zsh, etc..). That didn't work. A shell script might work, though. I'll give it a shot. At the time I was frustrated with shells and figured that a C program was the least likely to do something wiggy -- that is, I was trying the thing I -knew- would work. Then, it worked, and I decided to just go with that.

:-) Lachele
--
B. Lachele Foley, PhD '92,'02
Assistant Research Scientist
Complex Carbohydrate Research Center, UGA
706-542-0263
lfoley.ccrc.uga.edu
----- Original Message -----
From: Volodymyr Babin
[mailto:vbabin.ncsu.edu]
To: amber-developers.scripps.edu
Sent: Tue, 15 Apr
2008 16:22:00 -0400
Subject: Re: amber-developers: Testing Parallel
> I am not entirely sure it does work as expected for argc > 2.
> I would also avoid things like sprintf(command, "%s", command).
> I am also not completely sure something like this is really necessary
> (cannot help though: have no clue about [t]csh). You could try
> something like:
> 
> #!/bin/sh
> 
> /opt/scali/bin/scasub -qsparams \"-W block=true -l walltime=00:10:00\"
> -mpimon -network gm0,smp -np 2 -npn 2 $*
> 
> (i.e., escape from [t]csh to, e.g., /bin/sh; this is what system()
> call does).
> 
> With best wishes,
>   Volodymyr
> 
> > My wrapper for scasub (Scali sub) with PBS:
> > =============== do_scasub_pbs_parallel.c =========================
> > // See READ ME below
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <stddef.h>
> > #include <string.h>
> > int main(int argc, char *argv[]){
> > int a=0;
> > char command[4001];
> > // *** READ ME ***
> > // Change the following command to match your situation if need be.
> > // The short walltime is usually more than sufficient and might get
> > // you into a short queue.  gm0 is for myrinet -- alter if needed
> > strcpy(command,"/opt/scali/bin/scasub -qsparams \"-W block=true -l
> > walltime=00:10:00\" -mpimon -network gm0,smp -np 2 -npn 2 ");
> > for(a=1;a<argc;a++){ sprintf(command,"%s %s",command,argv[a]); }
> > strcat(command,"\n");
> > system(command);
> > return 0;
> > }
> > ========================================
> > then:
> > gcc do_scasub_pbs_parallel.c -o do_scasub_pbs_parallel
> > setenv DO_PARALLEL '/path/to/do_scasub_pbs_parallel'
> > (etc.)
> >
> > Note, again, that this wrapper does exactly what you -think- should happen
> > with:
> >
> > setenv DO_PARALLEL '/opt/scali/bin/scasub -qsparams "-W block=true -l
> > walltime=00:10:00" -mpimon -network gm0,smp -np 2 -npn 2'
> > $DO_PARALLEL /path/to/amber10/bin/sander.MPI  -O -i mdin -c 01.ann10.xyz
> > -o noesy.out
> > (for example)
> >
> > ...but that doesn't, at least not for me.  I don't know why.
> >
> > :-) Lachele
> > --
> > B. Lachele Foley, PhD '92,'02
> > Assistant Research Scientist
> > Complex Carbohydrate Research Center, UGA
> > 706-542-0263
> > lfoley.ccrc.uga.edu
> >
> >
> > ----- Original Message -----
> > From: David A. Case
> > [mailto:case.scripps.edu]
> > To: amber-developers.scripps.edu
> > Sent: Tue, 15 Apr
> > 2008 15:12:08 -0400
> > Subject: Re: amber-developers: Testing Parallel
> >
> >
> >> On Tue, Apr 15, 2008, Lachele Foley wrote:
> >>
> >> > Ok...  I used my excessive C wrapper to get around the quote thing.
> >> Using
> >> > block=true has three advantages over the interactive method (for me --
> >> > neither is really -better-):  [1] I get nice, neat, individualized
> >> output
> >> > from the scheduler in each test directory; [2] it tests the system in
> >> a
> >> > manner very close to how the users will be running; [3] I only have to
> >> run
> >> > one set of tests (rather than test amber parallel and then test
> >> submission
> >> > to queue).
> >>
> >> Well, score one for perisitence!  Can you post the final wrapper you
> >> came up
> >> with (again)?  Maybe we can get a web page up for people with similar
> >> problems.
> >>
> >> > possible FAILURE:  check out.0.dif
> >> > /scratch2/sysadmin_test/amber10/test/softcore/complex
> >> > 77c77
> >> > < Total charge of       0.1305 removed
> >> > ---
> >> > > Total charge of ************ removed
> >> > ---------------------------------------
> >>
> >> This is actually somewhat disconcerting...looks like a problem with
> >> gfortran,
> >> but one that doesn't seem to have other bad consequences.  I'll get
> >> Thomas
> >> to look at this when he returns from Germany.
> >>
> >> ...dave
> >>
> >>
> >
> 
> 
Received on Fri Apr 18 2008 - 21:19:39 PDT
Custom Search