Skip to content

Conversation

steffi7574
Copy link
Member

Passing a string 'mpirun' to python interface functions 'simulate' and 'optimize'. Defaults to "mpirun -np ".

Also distributing the maximum number of cores over initial conditions first and then over Petsc cores for the remaining ones.

Passing a string 'mpirun' to python interface functions 'simulat' and
'optimize'. Defaults to "mpirun -np ".

Also distributing the number of cores over initial conditions and also
over Petsc.
@steffi7574 steffi7574 requested review from andersp and tdrwenski April 24, 2025 18:21
The standard Hamiltonian model is only needed in python if either the time step
size dT or the carrier wave frequencies are not specified by the user,
and hence need to be computed based on the system Hamiltonian.
quandary.py Outdated


def simulate(self, *, pcof0=[], pt0=[], qt0=[], maxcores=-1, datadir="./run_dir", quandary_exec="", cygwinbash="", batchargs=[]):
def simulate(self, *, pcof0=[], pt0=[], qt0=[], maxcores=-1, datadir="./run_dir", quandary_exec="", cygwinbash="", mpirun="mpirun -np ", batchargs=[]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to add to docstring, here and below

quandary.py Outdated
myrun = "mpirun -np "
runcommand = f"{myrun} {ncores} " + runcommand
myrun = mpirun
runcommand = f"{myrun}{ncores} " + runcommand
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
runcommand = f"{myrun}{ncores} " + runcommand
runcommand = f"{myrun} {ncores} " + runcommand

Maybe leave the space here so the "mpirun -np" will also work

@tdrwenski
Copy link
Collaborator

Does this make the batcharg parameter redundant? Since you can pass in yourself srun -n instead of mpirun -np?

@steffi7574 steffi7574 merged commit 95cc41f into main May 14, 2025
7 checks passed
@steffi7574 steffi7574 deleted the pythoninterface_parallelrun branch May 14, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants