Changeset 472
- Timestamp:
- 05/31/11 12:52:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_card/libIGCM_card.ksh
r373 r472 195 195 tmpfile=$1_mutex_$$ 196 196 197 # Watch for possible conflics : Check for other tmpfiles. 198 unset tmpfiles 199 set +A tmpfiles -- $( ls $1_mutex_[0-9]* 2>/dev/null ) 200 typeset isleep 201 ((isleep=0)) 202 while [ ${#tmpfiles[@]} -gt 0 ] ; do 203 echo "Conflict between two processes working on " $1 "!!!" ${tmpfiles[@]} 204 sleep 1 205 ((isleep=isleep+1)) 206 if [ isleep -gt 20 ] ; then 207 echo "Too many loops waiting for other process working on " $1 ". We continue." 208 echo "You should see if one process of your run or post-treatment may have terminated suddenly." 209 echo "Afer, you should erase this(those) file(s) : " ${tmpfiles[@]} 210 # Send a mail to USER ?? 211 break ; 212 fi 213 unset tmpfiles 214 set +A tmpfiles -- $( ls $1_mutex_[0-9]* 2>/dev/null ) 215 done 197 IGCM_card_CheckConflict $1 216 198 217 199 # Do the job … … 227 209 fi 228 210 IGCM_debug_PopStack "IGCM_card_WriteOption" 211 } 212 213 function IGCM_card_CheckConflict 214 { 215 IGCM_debug_PushStack "IGCM_card_CheckConflict" $@ 216 217 typeset isleep tmpfiles 218 219 # Watch for possible conflics : Check for other tmpfiles. 220 set +A tmpfiles -- $( ls $1_mutex_[0-9]* 2>/dev/null ) 221 ((isleep=0)) 222 while [ ${#tmpfiles[@]} -gt 0 ] ; do 223 echo "Conflict between two processes working on " $1 "!!!" ${tmpfiles[@]} 224 sleep 1 225 ((isleep=isleep+1)) 226 if [ isleep -gt 20 ] ; then 227 echo "Too many loops waiting for other process working on " $1 ". We continue." 228 echo "You should see if one process of your run or post-treatment may have terminated suddenly." 229 echo "Afer, you should erase this(those) file(s) : " ${tmpfiles[@]} 230 # Send a mail to USER ?? 231 break ; 232 fi 233 unset tmpfiles 234 set +A tmpfiles -- $( ls $1_mutex_[0-9]* 2>/dev/null ) 235 done 236 237 IGCM_debug_PopStack "IGCM_card_CheckConflict" 229 238 } 230 239
Note: See TracChangeset
for help on using the changeset viewer.