- Timestamp:
- Dec 1, 2011, 3:23:57 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/civ.m
r313 r314 924 924 end 925 925 set(hlist,'UserData',rootroot) 926 if count<10 926 if count<10||(nbfiles-count)<10 927 927 pause(.5)% wait 0.5 seconds for next check 928 928 else … … 1486 1486 cmd=['!qsub -p ' pvalue ' -q civ.q -e ' flname '.errors -o ' flname '.log' ' ' batch_file_list{p}]; 1487 1487 display(cmd);eval(cmd); 1488 end 1489 1488 end 1490 1489 case 'oar_old' 1491 1490 for p=1:length(batch_file_list) … … 1494 1493 '-l "/core=1+{type = ''smalljob''}/licence=1,walltime=00:60:00" ' batch_file_list{p}]; 1495 1494 display(oar_command);eval(oar_command); 1496 end 1497 case 'oar' %oar-dispatch.pl 1498 1499 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1500 fid=fopen(filename_joblist,'w'); 1501 walltime_onejob=600;%seconds 1502 for p=1:length(batch_file_list) 1503 oar_command=['oarsub -n CIVX '... 1504 '-E ' regexprep(batch_file_list{p},'\.bat\>','.errors') ' -O ' regexprep(batch_file_list{p},'\.bat\>','.log ')... 1505 '-l "/core=1,walltime=' datestr(walltime_onejob/86400,13) '" ' batch_file_list{p}]; 1495 end 1496 case 'oar' 1497 1498 oar_modes={'oar-dispatch','mpilauncher'}; 1499 text={'Batch processing on servcalcul3 LEGI';... 1500 'Please choose one of the followint modes';... 1501 '* oar-dispatch : jobs in a container';... 1502 '* mpilauncher : one single job using several cores';... 1503 '**********************************'... 1504 }; 1505 [S,v]=listdlg('PromptString',text,'ListString',oar_modes,... 1506 'SelectionMode','single','ListSize',[400 100],'Name','LEGI job mode'); 1507 switch oar_modes{S} 1508 1509 case 'oar-dispatch' %oar-dispatch.pl 1510 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1511 fid=fopen(filename_joblist,'w'); 1512 walltime_onejob=600;%seconds 1513 for p=1:length(batch_file_list) 1514 oar_command=['oarsub -n CIVX '... 1515 '-E ' regexprep(batch_file_list{p},'\.bat\>','.errors') ' -O ' regexprep(batch_file_list{p},'\.bat\>','.log ')... 1516 '-l "/core=1,walltime=' datestr(walltime_onejob/86400,13) '" ' batch_file_list{p}]; 1517 fprintf(fid,[oar_command '\n']); 1518 end 1519 fclose(fid); 1520 ncores=36; 1521 oar_command=['oarsub -t container -n civx-container '... 1522 '-l /core=' num2str(ncores)... 1523 ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13)... 1524 ' "oar-dispatch -f ' filename_joblist '"']; 1525 filename_oarcommand=fullfile(Rootbat,'oar_command'); 1526 fid=fopen(filename_oarcommand,'w'); 1506 1527 fprintf(fid,[oar_command '\n']); 1507 end 1508 fclose(fid); 1509 ncores=36; 1510 oar_command=['oarsub -t container -n civx-container '... 1511 '-l /core=' num2str(ncores)... 1512 ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13)... 1513 ' "oar-dispatch -f ' filename_joblist '"']; 1514 filename_oarcommand=fullfile(Rootbat,'oar_command'); 1515 fid=fopen(filename_oarcommand,'w'); 1516 fprintf(fid,[oar_command '\n']); 1517 fclose(fid); 1518 display(oar_command); 1519 eval(['! . ' filename_oarcommand]) 1520 1521 case 'oar_mpi' 1522 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1523 fid=fopen(filename_joblist,'w'); 1524 1525 for p=1:length(batch_file_list) 1526 fprintf(fid,[batch_file_list{p} '\n']); 1527 end 1528 fclose(fid) 1529 text_oarscript=[... 1530 '#!/bin/bash \n'... 1531 '#OAR -n Mylauncher \n'... 1532 '#OAR -l node=4/core=5,walltime=0:15:00 \n'... 1533 '#OAR -E stderrfile.log \n'... 1534 '#OAR -O stdoutfile.log \n'... 1535 '# ========================================================= \n'... 1536 '# This simple program launch a multinode parallel OpenMPI mpilauncher \n'... 1537 '# application for coriolis PIV post-processing. \n'... 1538 '# OAR uses oarshmost wrapper to propagate the user environement. \n'... 1539 '# This wrapper assert that the user has the same environment on all the \n'... 1540 '# allocated nodes (basic behavior needed by most MPI applications). \n'... 1541 '# \n'... 1542 '# REQUIREMENT: \n'... 1543 '# the oarshmost wrapper should be installed in $HOME/bin directory. \n'... 1544 '# If a different location is used, change the line following the comment "Bidouille" \n'... 1545 '# ========================================================= \n'... 1546 '# USER should only modify these 2 lines \n'... 1547 'WORKDIR=/home/users/gostiaux/tmp/begou \n'... 1548 'COMMANDE="/home/users/gostiaux/tmp/begou/mpilauncher -f ' filename_joblist '" \n'... 1549 '# ========================================================= \n'... 1550 '# DO NOT MODIFY the FOLOWING LINES. (or be carefull) \n'... 1551 'echo "job starting on: "`hostname` \n'... 1552 'MPINODES="-host `tr [\\\\\\n] [,] <$OAR_NODEFILE |sed -e "s/,$/ /"`" \n'... 1553 'NCPUS=`cat $OAR_NODEFILE |wc -l` \n'... 1554 '#========== Bidouille ============== \n'... 1555 'export OMPI_MCA_plm_rsh_agent=$HOME/tmp/begou/oarshmost \n'... 1556 'cd $WORKDIR \n'... 1557 'CMD="mpirun -np $NCPUS -wdir $WORKDIR $MPINODES $COMMANDE" \n'... 1558 'echo "I run: $CMD" \n'... 1559 '$CMD \n'... 1560 'echo "job ending" \n'... 1561 ]; 1562 % oarsub -S ./oar.sub 1563 filename_oarscript=fullfile(Rootbat,'oar_command'); 1564 fid=fopen(filename_oarscript,'w'); 1565 fprintf(fid,[text_oarscript]); 1566 fclose(fid); 1567 eval(['!chmod +x ' filename_oarscript]); 1568 eval(['!oarsub -S ' filename_oarscript]); 1569 1570 case 'oar_new' % to be develloped with Patrick Begou 1571 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1572 fid=fopen(filename_superbat,'w'); 1573 if fid==-1 1574 msgbox_uvmat('ERROR',['cannot create the command file ' filename_superbat]) 1575 return 1576 end 1577 for p=1:length(batch_file_list) 1578 fprintf(fid,[batch_file_list{p} '\n']); 1579 end 1580 fclose(fid); 1581 walltime=datestr(length(super_cmd)*10/24/60,13); 1582 eval( ['!oarsub -n CIVX -q nicejob -l "/core=1+{type = ''smalljob''}/licence=1,walltime=' walltime '" ' filename_superbat]); 1583 oar_modes={'oar-dispatch','mpilauncher'}; 1584 text={'Batch processing on servcalcul3 LEGI';... 1585 'Please choose one of the followint modes';... 1586 '* oar-dispatch : jobs in a container';... 1587 '* mpilauncher : one single job using several cores';... 1588 '**********************************'... 1589 }; 1590 [S,v]=listdlg('PromptString',text,'ListString',oar_modes,... 1591 'SelectionMode','single','ListSize',[400 100],'Name','LEGI job mode'); 1592 switch oar_modes{S} 1593 1594 case 'oar-dispatch' %oar-dispatch.pl 1595 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1596 fid=fopen(filename_joblist,'w'); 1597 walltime_onejob=600;%seconds 1598 for p=1:length(batch_file_list) 1599 oar_command=['oarsub -n CIVX '... 1600 '-E ' regexprep(batch_file_list{p},'\.bat\>','.errors') ' -O ' regexprep(batch_file_list{p},'\.bat\>','.log ')... 1601 '-l "/core=1,walltime=' datestr(walltime_onejob/86400,13) '" ' batch_file_list{p}]; 1602 fprintf(fid,[oar_command '\n']); 1603 end 1604 fclose(fid); 1605 ncores=36; 1606 oar_command=['oarsub -t container -n civx-container '... 1607 '-l /core=' num2str(ncores)... 1608 ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13)... 1609 ' "oar-dispatch -f ' filename_joblist '"']; 1610 filename_oarcommand=fullfile(Rootbat,'oar_command'); 1611 fid=fopen(filename_oarcommand,'w'); 1612 fprintf(fid,[oar_command '\n']); 1613 fclose(fid); 1614 display(oar_command); 1615 eval(['! . ' filename_oarcommand]) 1616 case 'mpilauncher' 1617 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1618 fid=fopen(filename_joblist,'w'); 1619 1620 for p=1:length(batch_file_list) 1621 fprintf(fid,[batch_file_list{p} '\n']); 1622 end 1623 fclose(fid) 1624 text_oarscript=[... 1625 '#!/bin/bash \n'... 1626 '#OAR -n Mylauncher \n'... 1627 '#OAR -l node=4/core=5,walltime=0:15:00 \n'... 1628 '#OAR -E stderrfile.log \n'... 1629 '#OAR -O stdoutfile.log \n'... 1630 '# ========================================================= \n'... 1631 '# This simple program launch a multinode parallel OpenMPI mpilauncher \n'... 1632 '# application for coriolis PIV post-processing. \n'... 1633 '# OAR uses oarshmost wrapper to propagate the user environement. \n'... 1634 '# This wrapper assert that the user has the same environment on all the \n'... 1635 '# allocated nodes (basic behavior needed by most MPI applications). \n'... 1636 '# \n'... 1637 '# REQUIREMENT: \n'... 1638 '# the oarshmost wrapper should be installed in $HOME/bin directory. \n'... 1639 '# If a different location is used, change the line following the comment "Bidouille" \n'... 1640 '# ========================================================= \n'... 1641 '# USER should only modify these 2 lines \n'... 1642 'WORKDIR=' pwd ' \n'... 1643 'COMMANDE="mpilauncher -f ' filename_joblist '" \n'... 1644 '# ========================================================= \n'... 1645 '# DO NOT MODIFY the FOLOWING LINES. (or be carefull) \n'... 1646 'echo "job starting on: "`hostname` \n'... 1647 'MPINODES="-host `tr [\\\\\\n] [,] <$OAR_NODEFILE |sed -e "s/,$/ /"`" \n'... 1648 'NCPUS=`cat $OAR_NODEFILE |wc -l` \n'... 1649 '#========== Bidouille ============== \n'... 1650 'export OMPI_MCA_plm_rsh_agent=oar-envsh \n'...% 'cd $WORKDIR \n'... 1651 'CMD="mpirun -np $NCPUS -wdir $WORKDIR $MPINODES $COMMANDE" \n'... 1652 'echo "I run: $CMD" \n'... 1653 '$CMD \n'... 1654 'echo "job ending" \n'... 1655 ]; 1656 % oarsub -S ./oar.sub 1657 filename_oarscript=fullfile(Rootbat,'oar_command'); 1658 fid=fopen(filename_oarscript,'w'); 1659 fprintf(fid,[text_oarscript]); 1660 fclose(fid); 1661 eval(['!chmod +x ' filename_oarscript]); 1662 eval(['!oarsub -S ' filename_oarscript]); 1663 end 1528 fclose(fid); 1529 display(oar_command); 1530 eval(['! . ' filename_oarcommand]) 1531 case 'mpilauncher' 1532 filename_joblist=fullfile(Rootbat,'job_list.txt'); 1533 fid=fopen(filename_joblist,'w'); 1534 1535 for p=1:length(batch_file_list) 1536 fprintf(fid,[batch_file_list{p} '\n']); 1537 end 1538 fclose(fid) 1539 text_oarscript=[... 1540 '#!/bin/bash \n'... 1541 '#OAR -n Mylauncher \n'... 1542 '#OAR -l node=4/core=5,walltime=0:15:00 \n'... 1543 '#OAR -E stderrfile.log \n'... 1544 '#OAR -O stdoutfile.log \n'... 1545 '# ========================================================= \n'... 1546 '# This simple program launch a multinode parallel OpenMPI mpilauncher \n'... 1547 '# application for coriolis PIV post-processing. \n'... 1548 '# OAR uses oarshmost wrapper to propagate the user environement. \n'... 1549 '# This wrapper assert that the user has the same environment on all the \n'... 1550 '# allocated nodes (basic behavior needed by most MPI applications). \n'... 1551 '# \n'... 1552 '# REQUIREMENT: \n'... 1553 '# the oarshmost wrapper should be installed in $HOME/bin directory. \n'... 1554 '# If a different location is used, change the line following the comment "Bidouille" \n'... 1555 '# ========================================================= \n'... 1556 '# USER should only modify these 2 lines \n'... 1557 'WORKDIR=' pwd ' \n'... 1558 'COMMANDE="mpilauncher -f ' filename_joblist '" \n'... 1559 '# ========================================================= \n'... 1560 '# DO NOT MODIFY the FOLOWING LINES. (or be carefull) \n'... 1561 'echo "job starting on: "`hostname` \n'... 1562 'MPINODES="-host `tr [\\\\\\n] [,] <$OAR_NODEFILE |sed -e "s/,$/ /"`" \n'... 1563 'NCPUS=`cat $OAR_NODEFILE |wc -l` \n'... 1564 '#========== Bidouille ============== \n'... 1565 'export OMPI_MCA_plm_rsh_agent=oar-envsh \n'...% 'cd $WORKDIR \n'... 1566 'CMD="mpirun -np $NCPUS -wdir $WORKDIR $MPINODES $COMMANDE" \n'... 1567 'echo "I run: $CMD" \n'... 1568 '$CMD \n'... 1569 'echo "job ending" \n'... 1570 ]; 1571 % oarsub -S ./oar.sub 1572 filename_oarscript=fullfile(Rootbat,'oar_command'); 1573 fid=fopen(filename_oarscript,'w'); 1574 fprintf(fid,[text_oarscript]); 1575 fclose(fid); 1576 eval(['!chmod +x ' filename_oarscript]); 1577 eval(['!oarsub -S ' filename_oarscript]); 1578 end 1664 1579 end 1665 1580 else
Note: See TracChangeset
for help on using the changeset viewer.