Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

pRF_run_analyzePRF_LISA_ephys.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #! /bin/bash
  2. # compiles & calls the compiled matlab file specified as first parameter,
  3. # passes the 2nd to 6th parameters as input
  4. # PARAMETERS ====================
  5. echo 'Matlab file name: '$1
  6. MATLAB_SCRIPT=$1
  7. echo 'Monkey name: '$2
  8. MONKEY=$2
  9. echo 'Session: '$3
  10. SESS=$3
  11. echo 'Instance: '$4
  12. INSTANCE=$4
  13. # create folder label
  14. NSTLABEL=${INSTANCE/:/-}
  15. echo 'Number of workers: '$5
  16. NWORKERS=$5
  17. echo 'Modeltype: '$6
  18. MODTYPE=$6
  19. echo 'Crossvalidation mode: '$7
  20. XVAL=$7
  21. echo 'Results folder: '$8
  22. RESFLD=$8
  23. echo 'Path to Logfile directory: '$9
  24. LOGFILE_DIR=$9
  25. echo 'Path to matlab file: '${10}
  26. MATLAB_PATH=${10}
  27. # check the number of arguments we need
  28. NARG=10
  29. if [ $# -ne $NARG ];then
  30. echo "ERROR: You must exactly provide $NARG arguments!" 1>&2
  31. exit 1
  32. fi
  33. LOC=`pwd`
  34. cd $HOME
  35. # ensure that you are in your home directory, to avoid matlab path problems
  36. # (by default, the path information is saved in the home directory, so starting
  37. # matlab from there uses the normal path of the user)
  38. HOSTNAME=`hostname`
  39. MYSELF=`whoami`
  40. DATE=`date`
  41. LOGFILE=$LOGFILE_DIR/log_job_$MONKEY_$SESS_$INSTANCE
  42. echo
  43. echo "Running job as $MYSELF on $HOSTNAME, $DATE" 2>&1
  44. echo
  45. # creating a new virtual screen using xvfb-run and calling then matlab,
  46. # including a 'mini-program' to ensure all paths are added correctly
  47. # " , \ " at end of line is necessary, because this whole little program
  48. # must be transmitted as one line to matlab.
  49. echo
  50. # go to the scratch PRF folder
  51. cd $TMPDIR/PRF
  52. # copy the matlab script that needs to be compiled from Code/BashScripts to scratch/PRF
  53. cp $HOME/PRF/Code/$MATLAB_SCRIPT* $TMPDIR/PRF
  54. # compile the matlab script (only need to do this once in theory)
  55. #module load matlab
  56. #echo "mcc -m $TMPDIR/PRF/$MATLAB_SCRIPT.m -a $TMPDIR/PRF/analyzePRF -a $TMPDIR/PRF/HRF -a $TMPDIR/PRF/NIfTI" | matlab -nodisplay
  57. #module unload matlab
  58. #wait
  59. # make it executable
  60. chmod +x $MATLAB_SCRIPT*
  61. # load the mcr module (runtime environment)
  62. module load mcr
  63. # execute the compiled function with the specified inputs
  64. ./$MATLAB_SCRIPT $MONKEY $SESS $INSTANCE $NWORKERS $MODTYPE $XVAL $RESFLD
  65. # unload the runtime environment
  66. module unload mcr
  67. # change back to the starting directory
  68. cd $LOC
  69. echo
  70. echo "Job finished with Exit code $EXIT, returning"
  71. echo "Copy results from scratch back to home " 2>&1
  72. echo
  73. #mkdir -p $HOME/PRF/Results/$MONKEY/$RESFLD
  74. #cp -r $TMPDIR/PRF/Results/$MONKEY/$RESFLD/Instance* $HOME/PRF/Results/$MONKEY/$RESFLD/
  75. mkdir -p $HOME/PRF/Results_AVG/$MONKEY/$RESFLD
  76. cp -r $TMPDIR/PRF/Results_AVG/$MONKEY/$RESFLD/Instance* $HOME/PRF/Results_AVG/$MONKEY/$RESFLD/
  77. exit $EXIT