LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Troy Telford (ttelford_at_[hidden])
Date: 2006-03-20 19:36:44


I have a slightly modified version of the code:
***
         sprintf( filename, "node_%d_of_%d", myRank, numProcs );
+ system( "umask" );
         FILE *tempfile = fopen( filename, "w" );
***
When rsh is used (rather than 'tm') the return value for 'umask' is '022'
When the 'tm' module is used, the return for the 'umask' on each node is
'077'

(ie. exactly what is happening)

More importantly, I believe I have found something that may be the cause.
(And I'll have to ask that the LAM dev's supply info about unintended
consequences):

Throughout the LAM source code, I've found the following snippet(s):
***
/* Be safe; blanket coverage */
umask(077);

or

/* Be safe; blanket coverage */
original_umask = umask(077);
***

running "find -name '*.[ch]' | xargs grep umask" from the LAM-MPI source
folder should give you a list of the files I'm speaking of)

So (shooting from the hip) what would the consequences be of commenting
out areas where 'umask(077)' is called?

-- 
Troy Telford
On Mon, 20 Mar 2006 09:27:46 -0700, Scott Campbell <scc_at_[hidden]> wrote:
> I am seeing that permissions on files created by MPI programs change
> depending on which boot module I have selected.
>
> I am using LAM 7.1.1 configured with this command:
>
> ./configure --with-tm=/usr/pbs --prefix=/opt/share/lam-7.1.1
> --without-fc --without-mpi2cpp
>
> (I know it probably doesn't matter, but LAM was compiled with gcc
> version 3.3.5, not the Intel compilers that were the subject of my last
> question)
>
>
> My umask is set to 0022.
>
>
> Test code:
>
> #include <mpi.h>
> #include <stdio.h>
>
> int main( int argc, char *argv[] )
> {
>         char filename[2048];
>         int myRank = -1, numProcs = -1;
>         MPI_Init( &argc, &argv );
>
>         MPI_Comm_rank( MPI_COMM_WORLD, &myRank );
>         MPI_Comm_size( MPI_COMM_WORLD, &numProcs );
>         sprintf( filename, "node_%d_of_%d", myRank, numProcs );
>         FILE *tempfile = fopen( filename, "w" );
>         if( NULL != tempfile )
>                 fclose( tempfile );
>         return 0;
> }
>
> PBS script:
>
> #!/bin/bash
> echo `date`
>
> lamboot -v -ssi boot rsh $PBS_NODEFILE
> mpirun -np 2 /tmp/a.out
>
>
> Resulting files:
>
> -rw-r--r--   1 user1 g1           0 2006-03-20 12:16 node_1_of_2
> -rw-r--r--   1 user1 g1           0 2006-03-20 12:16 node_0_of_2
>
>
>
> 49-1356
> If I change the script to this:
>
> #!/bin/bash
> echo `date`
>
> lamboot -v -ssi boot tm $PBS_NODEFILE
> mpirun -np 2 /tmp/a.out
>
>
> Resulting files:
>
> -rw-------   1 user1 g1           0 2006-03-20 12:15 node_1_of_2
> -rw-------   1 user1 g1           0 2006-03-20 12:15 node_0_of_2
> Is this by design?  I need the files created when using the tm boot
> module to have the -rw-r--r-- permissions.  Can this be configured?  If
> not, any pointers on where in the source code I need to tweak?