Jump to content
  • Announcements

    • admin

      PBS Forum Has Closed   06/12/17

      The PBS Works Support Forum is no longer active.  For PBS community-oriented questions and support, please join the discussion at http://community.pbspro.org.  Any new security advisories related to commercially-licensed products will be posted in the PBS User Area (https://secure.altair.com/UserArea/). 
Sign in to follow this  

How do I run a multinode prologue and epilogue?

Recommended Posts

If you run the standard prologue and epilogue script in PBS you might have noticed that by default this only runs on the head node (mother superior) of a multinode job. If you want an action across the other execution nodes (sisters) there is some slight adjustment that needs to be made. You could do something like the following in a prologue script to access all the nodes:

. /etc/pbs.conf
echo "This is the prologue!"

# define mother superior and sisters
nfsize=$(cat $nodesfile|wc -w)

#head node
momnode=$(head -1 $nodesfile)
echo "$momnode is the mom node."

# other execution nodes
sisternodes=$(tail -$(($nfsize-1)) $nodesfile)
echo -e "The sister nodes are \n$sisternodes"

# loop to do pdsh commands
for i in $sisternodes;do
/usr/local/bin/pdsh -w ssh:$i hostname

Depending upon the action you want to create you may also want to consider the user of the "Hooks" functionality in PBS. This is described in the Admin Guide for PBS 10 and later versions.

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now
Sign in to follow this